Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / sysui / desktop / macosx / list_icons.pl
blob046c979b039f6e536a5a93d18e4dead82495b4bb
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
6 # This file is part of the LibreOffice project.
8 # This Source Code Form is subject to the terms of the Mozilla Public
9 # License, v. 2.0. If a copy of the MPL was not distributed with this
10 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 # This file incorporates work covered by the following license notice:
14 # Licensed to the Apache Software Foundation (ASF) under one or more
15 # contributor license agreements. See the NOTICE file distributed
16 # with this work for additional information regarding copyright
17 # ownership. The ASF licenses this file to you under the Apache
18 # License, Version 2.0 (the "License"); you may not use this file
19 # except in compliance with the License. You may obtain a copy of
20 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 use warnings;
24 use strict 'vars';
26 # package all .icns if XML::Parser module is not installed
27 eval 'use XML::Parser;'; if ( $@ ) { print '*.icns'; exit 0; };
29 my $valuetype = "none";
30 my $key = "none";
33 # XML handlers
36 sub start_handler {
37 my ($parser,$element,%attributes) = @_;
38 $valuetype = "$element";
41 sub char_handler {
42 my ($parser,$string) = @_;
43 if ( $key eq "CFBundleTypeIconFile" || $key eq "CFBundleIconFile" ) {
44 $string =~ s/^\s+//;
45 $string =~ s/\s+$//;
46 print "$string " if length($string) > 0;
48 $key = "$string" if $valuetype eq "key";
51 sub default_handler {
52 my ($parser,$string) = @_;
55 sub end_handler {
56 my ($parser,$element) = @_;
58 $key = "none" if $valuetype ne "key";
59 $valuetype = "none";
63 # main
66 my $parser = new XML::Parser(ErrorContext => 2,
67 Namespaces => 1);
69 $parser->setHandlers( Start => \&start_handler,
70 End => \&end_handler,
71 Char => \&char_handler,
72 Default => \&default_handler);
73 $parser->parse(STDIN);
75 print "\n";