Icon-Theme-Helper

 view release on metacpan or  search on metacpan

lib/Icon/Theme/Helper.pm  view on Meta::CPAN

			$self->{error}=3;
			$self->{perror}=1;
			$self->{errorString}='The specified directory, "'.$self->{dir}.'", does not exist';
			warn($self->{module}.' '.$method.':'.$self->{error}.': '.$self->{errorString});
			return $self;
	}

	if (! -f $self->{dir}.'/'.$self->{theme}.'/index.theme' ) {
			$self->{error}=4;
			$self->{perror}=1;
			$self->{errorString}='The specified theme, "'.$self->{theme}.'", is not a Freedesktop.org compliant icon theme';
			warn($self->{module}.' '.$method.':'.$self->{error}.': '.$self->{errorString});
			return $self;
	}

	#holds the required themes
	$self->{themes}={};

	#read the default theme
	$self->{themes}{$self->{theme}}=Icon::Theme::Index::Parse->new_from_file($self->{dir}.'/'.$self->{theme}.'/index.theme');
	if ($self->{themes}{$self->{theme}}->{error}) {

lib/Icon/Theme/Helper.pm  view on Meta::CPAN


	return $self;
}

=head2 getIcon

This returns the icon file.

The first arguement is the context and the second is the icon name.

    my $iconFile=$iconhelper->getIcon('Places', 'desktop');

=cut

sub getIcon{
	my $self=$_[0];
	my $context=$_[1];
	my $name=$_[2];
	my $method='getIcon';

	#blanks any previous errors

lib/Icon/Theme/Helper.pm  view on Meta::CPAN

=head2 2

The specified directory does not exist.

=head2 3

The specified theme does not exist.

=head2 4

The theme is not a Freedesktop.org compliant theme.

=head2 5

Parsing the index for the specified config failed.

=head2 6

No context specified.

=head2 7



( run in 0.438 second using v1.01-cache-2.11-cpan-299005ec8e3 )