merged tag ooo/OOO330_m14
[LibreOffice.git] / sysui / desktop / macosx / list_icons.pl
blobbaf155c03d1d38a60e735ecadf6e83c529cf929e
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
5 #*************************************************************************
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 # Copyright 2000, 2010 Oracle and/or its affiliates.
11 # OpenOffice.org - a multi-platform office productivity suite
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 use warnings;
33 use strict 'vars';
35 # package all .icns if XML::Parser module is not installed
36 eval 'use XML::Parser;'; if ( $@ ) { print '*.icns'; exit 0; };
38 my $valuetype = "none";
39 my $key = "none";
42 # XML handlers
45 sub start_handler {
46 my ($parser,$element,%attributes) = @_;
47 $valuetype = "$element";
50 sub char_handler {
51 my ($parser,$string) = @_;
52 if ( $key eq "CFBundleTypeIconFile" || $key eq "CFBundleIconFile" ) {
53 $string =~ s/^\s+//;
54 $string =~ s/\s+$//;
55 print "$string " if length($string) > 0;
57 $key = "$string" if $valuetype eq "key";
60 sub default_handler {
61 my ($parser,$string) = @_;
64 sub end_handler {
65 my ($parser,$element) = @_;
67 $key = "none" if $valuetype ne "key";
68 $valuetype = "none";
72 # main
75 my $parser = new XML::Parser(ErrorContext => 2,
76 Namespaces => 1);
78 $parser->setHandlers( Start => \&start_handler,
79 End => \&end_handler,
80 Char => \&char_handler,
81 Default => \&default_handler);
82 $parser->parse(STDIN);
84 print "\n";