diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/Makefile.am | 8 | ||||
-rw-r--r-- | example/Makefile.in | 17 | ||||
-rw-r--r-- | example/simple-client-test-icon.png | bin | 0 -> 3310 bytes | |||
-rw-r--r-- | example/simple-client.c | 20 |
4 files changed, 36 insertions, 9 deletions
diff --git a/example/Makefile.am b/example/Makefile.am index f4f2ab2..e23e08d 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -10,10 +10,14 @@ simple_client_SOURCES = \ simple-client.c simple_client_CFLAGS = \ - $(INDICATOR_CFLAGS) \ + $(LIBRARY_CFLAGS) \ + -DLOCAL_ICON="\"$(abs_srcdir)/simple-client-test-icon.png\"" \ -Wall -Werror \ -I$(top_srcdir)/src simple_client_LDADD = \ - $(INDICATOR_LIBS) \ + $(LIBRARY_LIBS) \ $(top_builddir)/src/libappindicator.la + +EXTRA_DIST = \ + simple-client-test-icon.png diff --git a/example/Makefile.in b/example/Makefile.in index 4496bac..0337245 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -108,7 +108,6 @@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSC = @CSC@ CYGPATH_W = @CYGPATH_W@ -DBUSSERVICEDIR = @DBUSSERVICEDIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ @@ -135,10 +134,6 @@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTK_SHARP_CFLAGS = @GTK_SHARP_CFLAGS@ GTK_SHARP_LIBS = @GTK_SHARP_LIBS@ HTML_DIR = @HTML_DIR@ -INDICATORDIR = @INDICATORDIR@ -INDICATORICONSDIR = @INDICATORICONSDIR@ -INDICATOR_CFLAGS = @INDICATOR_CFLAGS@ -INDICATOR_LIBS = @INDICATOR_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -155,6 +150,8 @@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBRARY_CFLAGS = @LIBRARY_CFLAGS@ +LIBRARY_LIBS = @LIBRARY_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ @@ -200,6 +197,8 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TESTDEPS_CFLAGS = @TESTDEPS_CFLAGS@ +TESTDEPS_LIBS = @TESTDEPS_LIBS@ VALA_API_GEN = @VALA_API_GEN@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ @@ -265,14 +264,18 @@ simple_client_SOURCES = \ simple-client.c simple_client_CFLAGS = \ - $(INDICATOR_CFLAGS) \ + $(LIBRARY_CFLAGS) \ + -DLOCAL_ICON="\"$(abs_srcdir)/simple-client-test-icon.png\"" \ -Wall -Werror \ -I$(top_srcdir)/src simple_client_LDADD = \ - $(INDICATOR_LIBS) \ + $(LIBRARY_LIBS) \ $(top_builddir)/src/libappindicator.la +EXTRA_DIST = \ + simple-client-test-icon.png + all: all-am .SUFFIXES: diff --git a/example/simple-client-test-icon.png b/example/simple-client-test-icon.png Binary files differnew file mode 100644 index 0000000..30dbb9d --- /dev/null +++ b/example/simple-client-test-icon.png diff --git a/example/simple-client.c b/example/simple-client.c index f2fac6f..734aff6 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -60,6 +60,20 @@ activate_clicked_cb (GtkWidget *widget, gpointer data) } static void +local_icon_toggle_cb (GtkWidget *widget, gpointer data) +{ + AppIndicator * ci = APP_INDICATOR(data); + + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + app_indicator_set_icon(ci, LOCAL_ICON); + } else { + app_indicator_set_icon(ci, "indicator-messages"); + } + + return; +} + +static void item_clicked_cb (GtkWidget *widget, gpointer data) { const gchar *text = (const gchar *)data; @@ -192,6 +206,12 @@ main (int argc, char ** argv) gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show(item); + item = gtk_check_menu_item_new_with_label ("Set Local Icon"); + g_signal_connect (item, "activate", + G_CALLBACK (local_icon_toggle_cb), ci); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_widget_show(item); + app_indicator_set_menu (ci, GTK_MENU (menu)); mainloop = g_main_loop_new(NULL, FALSE); |