diff -Nru libgtk2-appindicator-perl-0.12.precise/AppIndicator.xs libgtk2-appindicator-perl-0.13.precise/AppIndicator.xs --- libgtk2-appindicator-perl-0.12.precise/AppIndicator.xs 2012-07-18 14:42:09.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/AppIndicator.xs 2012-07-19 23:00:05.000000000 +0000 @@ -4,17 +4,25 @@ #include #include +#include #include MODULE = Gtk2::AppIndicator PACKAGE = Gtk2::AppIndicator -GObject *appindicator_new(name,iconname) +GObject *appindicator_new(name,iconname,type) char *name char *iconname + int type CODE: AppIndicator *theApp; - theApp=app_indicator_new (name,iconname,APP_INDICATOR_CATEGORY_APPLICATION_STATUS); + int tp; + if (type==1) { tp=APP_INDICATOR_CATEGORY_APPLICATION_STATUS; } + else if (type==2) { tp=APP_INDICATOR_CATEGORY_COMMUNICATIONS; } + else if (type==3) { tp=APP_INDICATOR_CATEGORY_SYSTEM_SERVICES; } + else if (type==4) { tp=APP_INDICATOR_CATEGORY_HARDWARE; } + else { tp=APP_INDICATOR_CATEGORY_OTHER; } + theApp=app_indicator_new (name,iconname,tp); RETVAL=(GObject *) theApp; OUTPUT: RETVAL @@ -41,6 +49,12 @@ app_indicator_set_attention_icon_full((AppIndicator *) self, name , text); +void appindicator_set_passive(self) + GObject *self + CODE: + app_indicator_set_status ((AppIndicator *) self, APP_INDICATOR_STATUS_PASSIVE); + + void appindicator_set_active(self) GObject *self CODE: @@ -56,6 +70,114 @@ GObject *menu CODE: app_indicator_set_menu((AppIndicator *) self,(GtkMenu *) menu); + +void appindicator_set_label(self,label,guide) + GObject *self + char *label + char *guide + CODE: + app_indicator_set_label((AppIndicator *) self,label,guide); + +void appindicator_set_secondary_activate_target(self,widget) + GObject *self + GObject *widget + CODE: + app_indicator_set_secondary_activate_target((AppIndicator *) self,GTK_WIDGET(widget)); + + +void appindicator_set_title(self,title) + GObject *self + char *title + CODE: + app_indicator_set_title((AppIndicator *) self,title); + +const gchar *appindicator_get_id(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_id((AppIndicator *) self); + OUTPUT: + RETVAL +const char *appindicator_get_category(self) + GObject *self; + CODE: + int cat=app_indicator_get_category((AppIndicator *) self); + if (cat==APP_INDICATOR_CATEGORY_APPLICATION_STATUS) { RETVAL="application-status"; } + else if (cat==APP_INDICATOR_CATEGORY_COMMUNICATIONS) { RETVAL="communications"; } + else if (cat==APP_INDICATOR_CATEGORY_SYSTEM_SERVICES) { RETVAL="system-services"; } + else if (cat==APP_INDICATOR_CATEGORY_HARDWARE) { RETVAL="hardware"; } + else { RETVAL="other"; } + OUTPUT: + RETVAL +const char *appindicator_get_status(self) + GObject *self; + CODE: + int s=app_indicator_get_category((AppIndicator *) self); + if (s==APP_INDICATOR_STATUS_PASSIVE) { RETVAL="passive"; } + else if (s==APP_INDICATOR_STATUS_ACTIVE) { RETVAL="active"; } + else if (s==APP_INDICATOR_STATUS_ATTENTION) { RETVAL="attention"; } + else { RETVAL=""; } + OUTPUT: + RETVAL + +const char *appindicator_get_icon(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_icon((AppIndicator *)self); + OUTPUT: + RETVAL + +const char *appindicator_get_icon_desc(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_icon_desc((AppIndicator *)self); + OUTPUT: + RETVAL + + +const char *appindicator_get_icon_theme_path(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_icon_theme_path((AppIndicator *)self); + OUTPUT: + RETVAL + + +const char *appindicator_get_attention_icon(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_attention_icon((AppIndicator *)self); + OUTPUT: + RETVAL + +const char *appindicator_get_attention_icon_desc(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_attention_icon_desc((AppIndicator *)self); + OUTPUT: + RETVAL + +const char *appindicator_get_label(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_label((AppIndicator *)self); + OUTPUT: + RETVAL + +const char *appindicator_get_label_guide(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_label_guide((AppIndicator *)self); + OUTPUT: + RETVAL + +const char *appindicator_get_title(self) + GObject *self; + CODE: + RETVAL=app_indicator_get_title((AppIndicator *)self); + OUTPUT: + RETVAL + + diff -Nru libgtk2-appindicator-perl-0.12.precise/Changes libgtk2-appindicator-perl-0.13.precise/Changes --- libgtk2-appindicator-perl-0.12.precise/Changes 2012-07-19 21:23:44.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/Changes 2012-07-19 23:17:57.000000000 +0000 @@ -1,3 +1,4 @@ +0.13 Made the API interface complete for AppIndicator 0.12 Wrong email address in distribution 0.11 dh-make-perl somehow doesn't work on a directory, so I changed it (back) to --cpan 0.09 Removed dependency on perl 5.012003, perl 5.006 is more then enough diff -Nru libgtk2-appindicator-perl-0.12.precise/debian/changelog libgtk2-appindicator-perl-0.13.precise/debian/changelog --- libgtk2-appindicator-perl-0.12.precise/debian/changelog 2012-07-20 13:57:56.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/debian/changelog 2012-07-22 06:47:55.000000000 +0000 @@ -1,5 +1,5 @@ -libgtk2-appindicator-perl (0.12.precise-1) precise; urgency=low +libgtk2-appindicator-perl (0.13.precise-1) precise; urgency=low * Initial Release. - -- Hans Oesterholt (Lives in the Netherlands) Fri, 20 Jul 2012 15:57:56 +0200 + -- Hans Oesterholt (Lives in the Netherlands) Sun, 22 Jul 2012 08:47:53 +0200 diff -Nru libgtk2-appindicator-perl-0.12.precise/lib/Gtk2/AppIndicator.pm libgtk2-appindicator-perl-0.13.precise/lib/Gtk2/AppIndicator.pm --- libgtk2-appindicator-perl-0.12.precise/lib/Gtk2/AppIndicator.pm 2012-07-19 21:24:10.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/lib/Gtk2/AppIndicator.pm 2012-07-19 23:19:19.000000000 +0000 @@ -26,7 +26,7 @@ our @EXPORT = qw( ); -our $VERSION = '0.12'; +our $VERSION = '0.13'; #sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() @@ -60,21 +60,42 @@ sub new { my $class=shift; - my $appname=shift or die "Gtk2::AppIndicator->new needs an application name"; + my $application_id=shift or die "Gtk2::AppIndicator->new needs an application id"; my $iconname=shift or die "Gtk2::AppIndicator->new needs an icon name"; + my $type=shift; + if (not(defined($type))) { $type="application-status"; } + + my $tp=-1; + if ($type eq "application-status") { $tp=1; } + elsif ($type eq "communications") { $tp=2; } + elsif ($type eq "system-services") { $tp=3; } + elsif ($type eq "hardware") { $tp=4; } + elsif ($type eq "other") { $tp=5; } + + if ($tp==-1) { die "Gtk2::AppIndicator->new -> category of indicator must be one of 'application-status','communications','system-services','hardware','other'}"; } my $obj={}; bless $obj,$class; - $obj->{ind}=appindicator_new($appname,$iconname); + $obj->{ind}=appindicator_new($application_id,$iconname,$tp); return $obj; } +sub get_category { + my $self=shift; + return appindicator_get_category($self->{ind}); +} + sub set_icon_theme_path { my $self=shift; my $path=shift; appindicator_set_icon_theme_path($self->{ind},$path); } +sub get_icon_theme_path { + my $self=shift; + return appindicator_get_icon_theme_path($self->{ind}); +} + sub set_icon_name_active { my $self=shift; my $name=shift; @@ -83,6 +104,23 @@ appindicator_set_icon_name_active($self->{ind},$name,$text); } +sub get_icon_name_active { + my $self=shift; + return appindicator_get_icon($self->{ind}); +} + +sub get_icon_desc_active { + my $self=shift; + return appindicator_get_icon_desc($self->{ind}); +} + +sub get_id { + my $self=shift; + return appindicator_get_id($self->{ind}); +} + + + sub set_icon_name_attention { my $self=shift; my $name=shift; @@ -91,6 +129,17 @@ appindicator_set_icon_name_attention($self->{ind},$name,$text); } +sub get_icon_name_attention { + my $self=shift; + return appindicator_get_attention_icon($self->{ind}); +} + +sub get_icon_desc_attention { + my $self=shift; + return appindicator_get_attention_icon_desc($self->{ind}); +} + + sub set_active { my $self=shift; appindicator_set_active($self->{ind}); @@ -101,13 +150,81 @@ appindicator_set_attention($self->{ind}); } +sub set_passive { + my $self=shift; + appindicator_set_passive($self->{ind}); +} + +sub set_status { + my $self=shift; + my $status=shift; + if ($status eq "passive") { $self->set_passive(); } + elsif ($status eq "active") { $self->set_active(); } + elsif ($status eq "attention") { $self->set_attention(); } + else { die "usage: set_status <'passive'|'active'|'attention'>"; } +} + +sub get_status { + my $self=shift; + return appindicator_get_status($self->{ind}); +} + sub set_menu { my $self=shift; my $menu=shift; + $self->{menu}=$menu; appindicator_set_menu($self->{ind},$menu); } +sub get_menu { + my $self=shift; + return $self->{menu}; +} + +sub set_secondary_active_target { + my $self=shift; + my $widget=shift; + $self->{secondary}=$widget; + appindicator_set_secondary_active_target($self->{ind},$widget); +} + +sub get_secondary_active_target { + my $self=shift; + return $self->{secondary}; +} + +sub set_title { + my $self=shift; + my $title=shift; + appindicator_set_title($self->{ind},$title); +} + +sub get_title { + my $self=shift; + return appindicator_get_title($self->{ind}); +} + +sub set_label { + my $self=shift; + my $label=shift or die "usage: set_label(label,guide)"; + my $guide=shift or die "usage: set_label(label,guide)"; + appindicator_set_label($self->{ind},$label,$guide); +} + +sub get_label { + my $self=shift; + return appindicator_get_label($self->{ind}); +} + +sub get_guide { + my $self=shift; + return appindicator_get_label_guide($self->{ind}); +} + + + + 1; __END__ @@ -142,22 +259,44 @@ =head1 FUNCTIONS - $ind=Gtk2::AppIndicator->new($application_name,$active_icon_name) + $ind=Gtk2::AppIndicator->new($application_id,$active_icon_name [,$category]) -Creates a new application indicator object with given name and icon name for the active icon. +Creates a new application indicator object with given name (id) and icon name for the active icon. +Category must be one of { 'application-status','communications','system-services','hardware','other' } +if set. if not set, it defaults to 'application-status'. $ind->set_icon_theme_path($path) Set the icon theme path to 'path'. This is where icons should be found with names like .png. + $ind->get_icon_theme_path() + +Returns the (previously written) icon theme path, or undefined if not set. + + $ind->get_category() + +Returns the previously set category with the new function. + + $ind->get_id() + +Returns the application id given to the new function. + $ind->set_icon_name_active($name) Sets the icon name for the active icon. + $ind->get_icon_name_active() + +Returns the name of the icon for active state. + $ind->set_icon_name_attention($name) Sets the icon name for the attention icon + $ind->get_icon_name_attention() + +Returns the name of the icon for attention state. + $ind->set_active() Makes the application indicator active. @@ -166,10 +305,34 @@ Makes the application indicator show the attention icon. + $ind->set_passive() + +Makes the application indicator enter passive state, not showing any icon + + $ind->set_state($state) + +Sets application indicator in the given state, one of {'active','passive','attention'}. + + $ind->get_state() + +Returns the current state of the application indicator. + $ind->set_menu($menu) Sets the popup menu for the indicator icon. + $ind->get_menu() + +Returns the current menu (not from the C code, but as stored in the perl object) + + $ind->set_secondary_activate_target($widget) + +Sets the secondary active target (under the middle mouse button) to $widget + + $ind->get_secondary_activate_target() + +Returns the current secondary active target (not from the C code, but as stored in the perl object) + =head1 AUTHOR Hans Oesterholt, Eoesterhol@cpan.orgE diff -Nru libgtk2-appindicator-perl-0.12.precise/Makefile.PL libgtk2-appindicator-perl-0.13.precise/Makefile.PL --- libgtk2-appindicator-perl-0.12.precise/Makefile.PL 2012-07-19 21:22:44.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/Makefile.PL 2012-07-19 22:58:12.000000000 +0000 @@ -3,12 +3,12 @@ # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. -open my $fh,"pkg-config --cflags appindicator-0.1 |"; +open my $fh,"pkg-config --cflags appindicator-0.1 gtk+-2.0 |"; my $inc=<$fh>; chomp $inc; close $fh; -open $fh,"pkg-config --libs appindicator-0.1 |"; +open $fh,"pkg-config --libs appindicator-0.1 gtk+-2.0 |"; my $lib=<$fh>; chomp $lib; close $fh; diff -Nru libgtk2-appindicator-perl-0.12.precise/META.yml libgtk2-appindicator-perl-0.13.precise/META.yml --- libgtk2-appindicator-perl-0.12.precise/META.yml 2012-07-19 21:24:15.000000000 +0000 +++ libgtk2-appindicator-perl-0.13.precise/META.yml 2012-07-19 23:19:36.000000000 +0000 @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Gtk2-AppIndicator -version: 0.12 +version: 0.13 abstract: Perl extension for libappindicator author: - Hans Oesterholt