diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-12-08 04:27:50 -0500 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-12-08 04:27:50 -0500 |
commit | be69a42947c59dc9a047e3cb304e858db669bb95 (patch) | |
tree | c3b66304300acb67f41ed8dd931df52a80c05560 /src | |
parent | 853fe81d0bab3ba0011a6759026223e96013a762 (diff) | |
parent | c05b64af5fc28789f404629d64a1ade4d6c6da34 (diff) | |
download | libayatana-appindicator-be69a42947c59dc9a047e3cb304e858db669bb95.tar.gz libayatana-appindicator-be69a42947c59dc9a047e3cb304e858db669bb95.tar.bz2 libayatana-appindicator-be69a42947c59dc9a047e3cb304e858db669bb95.zip |
* New upstream release.
* A race fix on the dbus name (LP: #526499)
* Fixing the Watcher Interface
* Fixes to build with GTK 2/3
* Fixes to build with valac-0.12
* debian/control
- Changed the valac build depends to valac-0.12
* debian/python-appindicator.install
- Make sure python2.6 and python2.7 files get included
* debian/rules
- Fix builds for multiple python versions
- disable parallel builds, it breaks the mono binding generation
Diffstat (limited to 'src')
-rw-r--r-- | src/AppIndicator-0.1.metadata | 1 | ||||
-rw-r--r-- | src/Makefile.am | 65 | ||||
-rw-r--r-- | src/Makefile.in | 158 | ||||
-rw-r--r-- | src/app-indicator.c | 44 | ||||
-rw-r--r-- | src/appindicator3-0.1.pc.in | 14 | ||||
-rw-r--r-- | src/application-service-appstore.c | 18 | ||||
-rw-r--r-- | src/application-service-appstore.h | 1 | ||||
-rw-r--r-- | src/application-service-watcher.c | 123 | ||||
-rw-r--r-- | src/application-service-watcher.h | 7 | ||||
-rw-r--r-- | src/indicator-application.c | 7 | ||||
-rw-r--r-- | src/notification-watcher.xml | 23 |
11 files changed, 349 insertions, 112 deletions
diff --git a/src/AppIndicator-0.1.metadata b/src/AppIndicator-0.1.metadata new file mode 100644 index 0000000..e4d068e --- /dev/null +++ b/src/AppIndicator-0.1.metadata @@ -0,0 +1 @@ +AppIndicator name="AppIndicator" diff --git a/src/Makefile.am b/src/Makefile.am index 1c4e7ae..9e58943 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,22 @@ +if USE_GTK3 +VER=3 +lib_LTLIBRARIES = libappindicator3.la +GTKGIR = Gtk-3.0 +GTKVAPI = gtk+-3.0 +else +VER= +lib_LTLIBRARIES = libappindicator.la +GTKGIR = Gtk-2.0 +GTKVAPI = gtk+-2.0 +endif + CLEANFILES = DISTCLEANFILES = BUILT_SOURCES = -EXTRA_DIST = appindicator-0.1.pc.in +EXTRA_DIST = \ + appindicator-0.1.pc.in \ + appindicator3-0.1.pc.in \ + AppIndicator-0.1.metadata include $(top_srcdir)/Makefile.am.enum include $(top_srcdir)/Makefile.am.marshal @@ -60,7 +75,7 @@ indicator_application_service_CFLAGS = \ indicator_application_service_LDADD = \ $(INDICATOR_LIBS) \ - libappindicator.la + libappindicator$(VER).la glib_marshal_list = application-service-marshal.list glib_marshal_prefix = _application_service_marshal @@ -69,7 +84,7 @@ glib_marshal_prefix = _application_service_marshal # Library ################################## -pkgconfig_DATA = appindicator-0.1.pc +pkgconfig_DATA = appindicator$(VER)-0.1.pc pkgconfigdir = $(libdir)/pkgconfig glib_enum_h = app-indicator-enum-types.h @@ -78,10 +93,7 @@ glib_enum_headers = $(addprefix $(srcdir)/, $(libappindicator_headers)) DISTCLEANFILES += app-indicator-enum-types.c -lib_LTLIBRARIES = \ - libappindicator.la - -libappindicatorincludedir=$(includedir)/libappindicator-0.1/libappindicator +libappindicatorincludedir=$(includedir)/libappindicator$(VER)-0.1/libappindicator libappindicator_headers = \ app-indicator.h @@ -115,6 +127,17 @@ libappindicator_la_CFLAGS = \ libappindicator_la_LIBADD = \ $(INDICATOR_LIBS) +# We duplicate these here because Automake won't let us use $(VER) on the left hand side. +# Since we carefully use $(VER) in the right hand side above, we can assign the same values. +# Only one version of the library is every compiled at the same time, so it is safe to reuse +# the right hand sides like this. +libappindicator3includedir = $(libappindicatorincludedir) +libappindicator3include_HEADERS = $(libappindicatorinclude_HEADERS) +libappindicator3_la_SOURCES = $(libappindicator_la_SOURCES) +libappindicator3_la_LDFLAGS = $(libappindicator_la_LDFLAGS) +libappindicator3_la_CFLAGS = $(libappindicator_la_CFLAGS) +libappindicator3_la_LIBADD = $(libappindicator_la_LIBADD) + ################################## # DBus Specs ################################## @@ -156,24 +179,30 @@ EXTRA_DIST += $(DBUS_SPECS) INTROSPECTION_GIRS = INTROSPECTION_SCANNER_ARGS = \ --add-include-path=$(srcdir) \ - $(addprefix --c-include=libappindicator/, $(introspection_sources)) + $(addprefix --c-include=src/, $(introspection_sources)) \ + --symbol-prefix=app \ + --identifier-prefix=App INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) if HAVE_INTROSPECTION introspection_sources = \ - $(addprefix $(srcdir)/,$(libappindicator_headers)) \ - $(addprefix $(top_builddir)/src/, $(glib_enum_h)) + $(addprefix $(srcdir)/,$(libappindicator_headers)) -AppIndicator-0.1.gir: libappindicator.la $(glib_enum_h) +AppIndicator$(VER)-0.1.gir: libappindicator$(VER).la AppIndicator_0_1_gir_INCLUDES = \ GObject-2.0 \ - Gtk-2.0 + $(GTKGIR) AppIndicator_0_1_gir_CFLAGS = $(INDICATOR_CFLAGS) -I$(srcdir) -I$(top_builddir)/src -AppIndicator_0_1_gir_LIBS = libappindicator.la +AppIndicator_0_1_gir_LIBS = libappindicator$(VER).la AppIndicator_0_1_gir_FILES = $(introspection_sources) -INTROSPECTION_GIRS += AppIndicator-0.1.gir +AppIndicator3_0_1_gir_INCLUDES = $(AppIndicator_0_1_gir_INCLUDES) +AppIndicator3_0_1_gir_CFLAGS = $(AppIndicator_0_1_gir_CFLAGS) +AppIndicator3_0_1_gir_LIBS = $(AppIndicator_0_1_gir_LIBS) +AppIndicator3_0_1_gir_FILES = $(AppIndicator_0_1_gir_FILES) + +INTROSPECTION_GIRS += AppIndicator$(VER)-0.1.gir girdir = $(datadir)/gir-1.0 gir_DATA = $(INTROSPECTION_GIRS) @@ -192,11 +221,11 @@ endif if HAVE_INTROSPECTION vapidir = $(datadir)/vala/vapi -vapi_DATA = AppIndicator-0.1.vapi +vapi_DATA = AppIndicator$(VER)-0.1.vapi -AppIndicator-0.1.vapi: AppIndicator-0.1.gir Makefile.am - $(VALA_API_GEN) --library=AppIndicator-0.1 \ - --pkg gtk+-2.0 \ +AppIndicator$(VER)-0.1.vapi: AppIndicator$(VER)-0.1.gir Makefile.am + $(VALA_API_GEN) --library=AppIndicator$(VER)-0.1 \ + --pkg $(GTKVAPI) \ --vapidir=$(top_builddir)/src \ $< diff --git a/src/Makefile.in b/src/Makefile.in index b0ceb16..3e55704 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -70,12 +70,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(libappindicatorinclude_HEADERS) $(srcdir)/Makefile.am \ +DIST_COMMON = $(libappindicator3include_HEADERS) \ + $(libappindicatorinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/appindicator-0.1.pc.in \ + $(srcdir)/appindicator3-0.1.pc.in \ $(top_srcdir)/Makefile.am.enum \ $(top_srcdir)/Makefile.am.marshal libexec_PROGRAMS = indicator-application-service$(EXEEXT) -@HAVE_INTROSPECTION_TRUE@am__append_1 = AppIndicator-0.1.gir +@HAVE_INTROSPECTION_TRUE@am__append_1 = AppIndicator$(VER)-0.1.gir @HAVE_INTROSPECTION_TRUE@am__append_2 = $(gir_DATA) $(typelib_DATA) \ @HAVE_INTROSPECTION_TRUE@ $(vapi_DATA) subdir = src @@ -89,7 +91,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = appindicator-0.1.pc +CONFIG_CLEAN_FILES = appindicator-0.1.pc appindicator3-0.1.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -116,6 +118,7 @@ am__installdirs = "$(DESTDIR)$(applicationlibdir)" \ "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \ "$(DESTDIR)$(girdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(vapidir)" \ + "$(DESTDIR)$(libappindicator3includedir)" \ "$(DESTDIR)$(libappindicatorincludedir)" LTLIBRARIES = $(applicationlib_LTLIBRARIES) $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @@ -134,6 +137,21 @@ libappindicator_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libappindicator_la_CFLAGS) $(CFLAGS) \ $(libappindicator_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_GTK3_FALSE@am_libappindicator_la_rpath = -rpath $(libdir) +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +libappindicator3_la_DEPENDENCIES = $(am__DEPENDENCIES_2) +am__objects_2 = $(am__objects_1) \ + libappindicator3_la-app-indicator-enum-types.lo \ + libappindicator3_la-app-indicator.lo \ + libappindicator3_la-application-service-marshal.lo \ + libappindicator3_la-generate-id.lo +am_libappindicator3_la_OBJECTS = $(am__objects_2) +libappindicator3_la_OBJECTS = $(am_libappindicator3_la_OBJECTS) +libappindicator3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(libappindicator3_la_CFLAGS) $(CFLAGS) \ + $(libappindicator3_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_GTK3_TRUE@am_libappindicator3_la_rpath = -rpath $(libdir) libapplication_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libapplication_la_OBJECTS = \ libapplication_la-application-service-marshal.lo \ @@ -154,7 +172,7 @@ am_indicator_application_service_OBJECTS = \ indicator_application_service_OBJECTS = \ $(am_indicator_application_service_OBJECTS) indicator_application_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - libappindicator.la + libappindicator$(VER).la indicator_application_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(indicator_application_service_CFLAGS) $(CFLAGS) \ @@ -185,13 +203,15 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libappindicator_la_SOURCES) $(libapplication_la_SOURCES) \ +SOURCES = $(libappindicator_la_SOURCES) $(libappindicator3_la_SOURCES) \ + $(libapplication_la_SOURCES) \ $(indicator_application_service_SOURCES) DIST_SOURCES = $(libappindicator_la_SOURCES) \ - $(libapplication_la_SOURCES) \ + $(libappindicator3_la_SOURCES) $(libapplication_la_SOURCES) \ $(indicator_application_service_SOURCES) DATA = $(gir_DATA) $(pkgconfig_DATA) $(typelib_DATA) $(vapi_DATA) -HEADERS = $(libappindicatorinclude_HEADERS) +HEADERS = $(libappindicator3include_HEADERS) \ + $(libappindicatorinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -363,6 +383,14 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +@USE_GTK3_FALSE@VER = +@USE_GTK3_TRUE@VER = 3 +@USE_GTK3_FALSE@lib_LTLIBRARIES = libappindicator.la +@USE_GTK3_TRUE@lib_LTLIBRARIES = libappindicator3.la +@USE_GTK3_FALSE@GTKGIR = Gtk-2.0 +@USE_GTK3_TRUE@GTKGIR = Gtk-3.0 +@USE_GTK3_FALSE@GTKVAPI = gtk+-2.0 +@USE_GTK3_TRUE@GTKVAPI = gtk+-3.0 CLEANFILES = stamp-enum-types stamp-marshal $(BUILT_SOURCES) \ $(am__append_2) DISTCLEANFILES = $(glib_enum_h) $(glib_enum_c) $(marshal_h) \ @@ -374,7 +402,8 @@ BUILT_SOURCES = $(glib_enum_h) $(glib_enum_c) $(marshal_h) \ notification-watcher-server.h notification-watcher-client.h \ notification-item-server.h $(DBUS_SPECS:.xml=-client.h) \ $(DBUS_SPECS:.xml=-server.h) -EXTRA_DIST = appindicator-0.1.pc.in $(enum_tmpl_h) $(enum_tmpl_c) \ +EXTRA_DIST = appindicator-0.1.pc.in appindicator3-0.1.pc.in \ + AppIndicator-0.1.metadata $(enum_tmpl_h) $(enum_tmpl_c) \ $(glib_marshal_list) $(DBUS_SPECS) enum_tmpl_h = $(glib_enum_h:.h=.h.in) enum_tmpl_c = $(glib_enum_c:.c=.c.in) @@ -421,7 +450,7 @@ indicator_application_service_CFLAGS = \ indicator_application_service_LDADD = \ $(INDICATOR_LIBS) \ - libappindicator.la + libappindicator$(VER).la glib_marshal_list = application-service-marshal.list glib_marshal_prefix = _application_service_marshal @@ -429,15 +458,12 @@ glib_marshal_prefix = _application_service_marshal ################################## # Library ################################## -pkgconfig_DATA = appindicator-0.1.pc +pkgconfig_DATA = appindicator$(VER)-0.1.pc pkgconfigdir = $(libdir)/pkgconfig glib_enum_h = app-indicator-enum-types.h glib_enum_c = app-indicator-enum-types.c glib_enum_headers = $(addprefix $(srcdir)/, $(libappindicator_headers)) -lib_LTLIBRARIES = \ - libappindicator.la - -libappindicatorincludedir = $(includedir)/libappindicator-0.1/libappindicator +libappindicatorincludedir = $(includedir)/libappindicator$(VER)-0.1/libappindicator libappindicator_headers = \ app-indicator.h @@ -467,6 +493,17 @@ libappindicator_la_LIBADD = \ $(INDICATOR_LIBS) +# We duplicate these here because Automake won't let us use $(VER) on the left hand side. +# Since we carefully use $(VER) in the right hand side above, we can assign the same values. +# Only one version of the library is every compiled at the same time, so it is safe to reuse +# the right hand sides like this. +libappindicator3includedir = $(libappindicatorincludedir) +libappindicator3include_HEADERS = $(libappindicatorinclude_HEADERS) +libappindicator3_la_SOURCES = $(libappindicator_la_SOURCES) +libappindicator3_la_LDFLAGS = $(libappindicator_la_LDFLAGS) +libappindicator3_la_CFLAGS = $(libappindicator_la_CFLAGS) +libappindicator3_la_LIBADD = $(libappindicator_la_LIBADD) + ################################## # DBus Specs ################################## @@ -480,20 +517,25 @@ DBUS_SPECS = \ INTROSPECTION_GIRS = $(am__append_1) INTROSPECTION_SCANNER_ARGS = \ --add-include-path=$(srcdir) \ - $(addprefix --c-include=libappindicator/, $(introspection_sources)) + $(addprefix --c-include=src/, $(introspection_sources)) \ + --symbol-prefix=app \ + --identifier-prefix=App INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) @HAVE_INTROSPECTION_TRUE@introspection_sources = \ -@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/,$(libappindicator_headers)) \ -@HAVE_INTROSPECTION_TRUE@ $(addprefix $(top_builddir)/src/, $(glib_enum_h)) +@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/,$(libappindicator_headers)) @HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_INCLUDES = \ @HAVE_INTROSPECTION_TRUE@ GObject-2.0 \ -@HAVE_INTROSPECTION_TRUE@ Gtk-2.0 +@HAVE_INTROSPECTION_TRUE@ $(GTKGIR) @HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_CFLAGS = $(INDICATOR_CFLAGS) -I$(srcdir) -I$(top_builddir)/src -@HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_LIBS = libappindicator.la +@HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_LIBS = libappindicator$(VER).la @HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_FILES = $(introspection_sources) +@HAVE_INTROSPECTION_TRUE@AppIndicator3_0_1_gir_INCLUDES = $(AppIndicator_0_1_gir_INCLUDES) +@HAVE_INTROSPECTION_TRUE@AppIndicator3_0_1_gir_CFLAGS = $(AppIndicator_0_1_gir_CFLAGS) +@HAVE_INTROSPECTION_TRUE@AppIndicator3_0_1_gir_LIBS = $(AppIndicator_0_1_gir_LIBS) +@HAVE_INTROSPECTION_TRUE@AppIndicator3_0_1_gir_FILES = $(AppIndicator_0_1_gir_FILES) @HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 @HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS) @HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0 @@ -503,7 +545,7 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) # VAPI Files ######################### @HAVE_INTROSPECTION_TRUE@vapidir = $(datadir)/vala/vapi -@HAVE_INTROSPECTION_TRUE@vapi_DATA = AppIndicator-0.1.vapi +@HAVE_INTROSPECTION_TRUE@vapi_DATA = AppIndicator$(VER)-0.1.vapi all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -541,6 +583,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): appindicator-0.1.pc: $(top_builddir)/config.status $(srcdir)/appindicator-0.1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +appindicator3-0.1.pc: $(top_builddir)/config.status $(srcdir)/appindicator3-0.1.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-applicationlibLTLIBRARIES: $(applicationlib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(applicationlibdir)" || $(MKDIR_P) "$(DESTDIR)$(applicationlibdir)" @@ -604,7 +648,9 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libappindicator.la: $(libappindicator_la_OBJECTS) $(libappindicator_la_DEPENDENCIES) - $(AM_V_CCLD)$(libappindicator_la_LINK) -rpath $(libdir) $(libappindicator_la_OBJECTS) $(libappindicator_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libappindicator_la_LINK) $(am_libappindicator_la_rpath) $(libappindicator_la_OBJECTS) $(libappindicator_la_LIBADD) $(LIBS) +libappindicator3.la: $(libappindicator3_la_OBJECTS) $(libappindicator3_la_DEPENDENCIES) + $(AM_V_CCLD)$(libappindicator3_la_LINK) $(am_libappindicator3_la_rpath) $(libappindicator3_la_OBJECTS) $(libappindicator3_la_LIBADD) $(LIBS) libapplication.la: $(libapplication_la_OBJECTS) $(libapplication_la_DEPENDENCIES) $(AM_V_CCLD)$(libapplication_la_LINK) -rpath $(applicationlibdir) $(libapplication_la_OBJECTS) $(libapplication_la_LIBADD) $(LIBS) install-libexecPROGRAMS: $(libexec_PROGRAMS) @@ -666,6 +712,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_application_service-application-service-watcher.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_application_service-application-service.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_application_service-generate-id.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator3_la-app-indicator-enum-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator3_la-app-indicator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator3_la-application-service-marshal.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator3_la-generate-id.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator_la-app-indicator-enum-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator_la-app-indicator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libappindicator_la-application-service-marshal.Plo@am__quote@ @@ -729,6 +779,38 @@ libappindicator_la-generate-id.lo: generate-id.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator_la_CFLAGS) $(CFLAGS) -c -o libappindicator_la-generate-id.lo `test -f 'generate-id.c' || echo '$(srcdir)/'`generate-id.c +libappindicator3_la-app-indicator-enum-types.lo: app-indicator-enum-types.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -MT libappindicator3_la-app-indicator-enum-types.lo -MD -MP -MF $(DEPDIR)/libappindicator3_la-app-indicator-enum-types.Tpo -c -o libappindicator3_la-app-indicator-enum-types.lo `test -f 'app-indicator-enum-types.c' || echo '$(srcdir)/'`app-indicator-enum-types.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libappindicator3_la-app-indicator-enum-types.Tpo $(DEPDIR)/libappindicator3_la-app-indicator-enum-types.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='app-indicator-enum-types.c' object='libappindicator3_la-app-indicator-enum-types.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -c -o libappindicator3_la-app-indicator-enum-types.lo `test -f 'app-indicator-enum-types.c' || echo '$(srcdir)/'`app-indicator-enum-types.c + +libappindicator3_la-app-indicator.lo: app-indicator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -MT libappindicator3_la-app-indicator.lo -MD -MP -MF $(DEPDIR)/libappindicator3_la-app-indicator.Tpo -c -o libappindicator3_la-app-indicator.lo `test -f 'app-indicator.c' || echo '$(srcdir)/'`app-indicator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libappindicator3_la-app-indicator.Tpo $(DEPDIR)/libappindicator3_la-app-indicator.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='app-indicator.c' object='libappindicator3_la-app-indicator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -c -o libappindicator3_la-app-indicator.lo `test -f 'app-indicator.c' || echo '$(srcdir)/'`app-indicator.c + +libappindicator3_la-application-service-marshal.lo: application-service-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -MT libappindicator3_la-application-service-marshal.lo -MD -MP -MF $(DEPDIR)/libappindicator3_la-application-service-marshal.Tpo -c -o libappindicator3_la-application-service-marshal.lo `test -f 'application-service-marshal.c' || echo '$(srcdir)/'`application-service-marshal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libappindicator3_la-application-service-marshal.Tpo $(DEPDIR)/libappindicator3_la-application-service-marshal.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='application-service-marshal.c' object='libappindicator3_la-application-service-marshal.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -c -o libappindicator3_la-application-service-marshal.lo `test -f 'application-service-marshal.c' || echo '$(srcdir)/'`application-service-marshal.c + +libappindicator3_la-generate-id.lo: generate-id.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -MT libappindicator3_la-generate-id.lo -MD -MP -MF $(DEPDIR)/libappindicator3_la-generate-id.Tpo -c -o libappindicator3_la-generate-id.lo `test -f 'generate-id.c' || echo '$(srcdir)/'`generate-id.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libappindicator3_la-generate-id.Tpo $(DEPDIR)/libappindicator3_la-generate-id.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-id.c' object='libappindicator3_la-generate-id.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libappindicator3_la_CFLAGS) $(CFLAGS) -c -o libappindicator3_la-generate-id.lo `test -f 'generate-id.c' || echo '$(srcdir)/'`generate-id.c + libapplication_la-application-service-marshal.lo: application-service-marshal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libapplication_la_CFLAGS) $(CFLAGS) -MT libapplication_la-application-service-marshal.lo -MD -MP -MF $(DEPDIR)/libapplication_la-application-service-marshal.Tpo -c -o libapplication_la-application-service-marshal.lo `test -f 'application-service-marshal.c' || echo '$(srcdir)/'`application-service-marshal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libapplication_la-application-service-marshal.Tpo $(DEPDIR)/libapplication_la-application-service-marshal.Plo @@ -926,6 +1008,26 @@ uninstall-vapiDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(vapidir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(vapidir)" && rm -f $$files +install-libappindicator3includeHEADERS: $(libappindicator3include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(libappindicator3includedir)" || $(MKDIR_P) "$(DESTDIR)$(libappindicator3includedir)" + @list='$(libappindicator3include_HEADERS)'; test -n "$(libappindicator3includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libappindicator3includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(libappindicator3includedir)" || exit $$?; \ + done + +uninstall-libappindicator3includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(libappindicator3include_HEADERS)'; test -n "$(libappindicator3includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libappindicator3includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libappindicator3includedir)" && rm -f $$files install-libappindicatorincludeHEADERS: $(libappindicatorinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(libappindicatorincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libappindicatorincludedir)" @@ -1034,7 +1136,7 @@ check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(applicationlibdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(libappindicatorincludedir)"; do \ + for dir in "$(DESTDIR)$(applicationlibdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibdir)" "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(libappindicator3includedir)" "$(DESTDIR)$(libappindicatorincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -1091,6 +1193,7 @@ info: info-am info-am: install-data-am: install-applicationlibLTLIBRARIES install-girDATA \ + install-libappindicator3includeHEADERS \ install-libappindicatorincludeHEADERS install-pkgconfigDATA \ install-typelibDATA install-vapiDATA @@ -1140,6 +1243,7 @@ ps-am: uninstall-am: uninstall-applicationlibLTLIBRARIES uninstall-girDATA \ uninstall-libLTLIBRARIES \ + uninstall-libappindicator3includeHEADERS \ uninstall-libappindicatorincludeHEADERS \ uninstall-libexecPROGRAMS uninstall-pkgconfigDATA \ uninstall-typelibDATA uninstall-vapiDATA @@ -1156,6 +1260,7 @@ uninstall-am: uninstall-applicationlibLTLIBRARIES uninstall-girDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-girDATA install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ + install-libappindicator3includeHEADERS \ install-libappindicatorincludeHEADERS install-libexecPROGRAMS \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip install-typelibDATA \ @@ -1165,6 +1270,7 @@ uninstall-am: uninstall-applicationlibLTLIBRARIES uninstall-girDATA \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-applicationlibLTLIBRARIES uninstall-girDATA \ uninstall-libLTLIBRARIES \ + uninstall-libappindicator3includeHEADERS \ uninstall-libappindicatorincludeHEADERS \ uninstall-libexecPROGRAMS uninstall-pkgconfigDATA \ uninstall-typelibDATA uninstall-vapiDATA @@ -1231,11 +1337,11 @@ $(marshal_c): $(marshal_h) -include $(INTROSPECTION_MAKEFILE) -@HAVE_INTROSPECTION_TRUE@AppIndicator-0.1.gir: libappindicator.la $(glib_enum_h) +@HAVE_INTROSPECTION_TRUE@AppIndicator$(VER)-0.1.gir: libappindicator$(VER).la -@HAVE_INTROSPECTION_TRUE@AppIndicator-0.1.vapi: AppIndicator-0.1.gir Makefile.am -@HAVE_INTROSPECTION_TRUE@ $(VALA_API_GEN) --library=AppIndicator-0.1 \ -@HAVE_INTROSPECTION_TRUE@ --pkg gtk+-2.0 \ +@HAVE_INTROSPECTION_TRUE@AppIndicator$(VER)-0.1.vapi: AppIndicator$(VER)-0.1.gir Makefile.am +@HAVE_INTROSPECTION_TRUE@ $(VALA_API_GEN) --library=AppIndicator$(VER)-0.1 \ +@HAVE_INTROSPECTION_TRUE@ --pkg $(GTKVAPI) \ @HAVE_INTROSPECTION_TRUE@ --vapidir=$(top_builddir)/src \ @HAVE_INTROSPECTION_TRUE@ $< diff --git a/src/app-indicator.c b/src/app-indicator.c index 6511589..98663c1 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -32,8 +32,14 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include <dbus/dbus-glib.h> +#include <dbus/dbus-glib-bindings.h> + #include <libdbusmenu-glib/server.h> +#ifdef HAVE_GTK3 +#include <libdbusmenu-gtk3/client.h> +#else #include <libdbusmenu-gtk/client.h> +#endif #include "app-indicator.h" #include "app-indicator-enum-types.h" @@ -1052,6 +1058,23 @@ dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, c return; } +/* Checking to see if someone already has the name we're looking for */ +static void +check_owner_cb (DBusGProxy *proxy, gboolean exists, GError *error, gpointer userdata) +{ + if (error != NULL) { + g_warning("Unable to check for '" NOTIFICATION_WATCHER_DBUS_ADDR "' on DBus. No worries, but concerning."); + return; + } + + if (exists) { + g_debug("Woah, we actually has a race condition with dbus"); + dbus_owner_change(proxy, NOTIFICATION_WATCHER_DBUS_ADDR, NULL, "Non NULL", userdata); + } + + return; +} + /* This is an idle function to create the proxy. This is mostly because start_fallback_timer can get called in the distruction of a proxy and thus the proxy manager gets confused when creating @@ -1074,6 +1097,11 @@ setup_name_owner_proxy (gpointer data) G_TYPE_INVALID); dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", G_CALLBACK(dbus_owner_change), data, NULL); + + /* Check to see if anyone has the name we're looking for + just incase we missed it changing. */ + + org_freedesktop_DBus_name_has_owner_async(priv->dbus_proxy, NOTIFICATION_WATCHER_DBUS_ADDR, check_owner_cb, data); } return FALSE; @@ -1525,13 +1553,17 @@ static void update_icon_name (DbusmenuMenuitem *menuitem, GtkImage *image) { + const gchar *icon_name = NULL; + if (gtk_image_get_storage_type (image) != GTK_IMAGE_ICON_NAME) return; + gtk_image_get_icon_name (image, &icon_name, NULL); + if (should_show_image (image)) dbusmenu_menuitem_property_set (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, - image->data.name.icon_name); + icon_name); else dbusmenu_menuitem_property_remove (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME); @@ -1543,16 +1575,18 @@ update_stock_item (DbusmenuMenuitem *menuitem, GtkImage *image) { GtkStockItem stock; + gchar *stock_id = NULL; if (gtk_image_get_storage_type (image) != GTK_IMAGE_STOCK) return FALSE; - gtk_stock_lookup (image->data.stock.stock_id, &stock); + gtk_image_get_stock (image, &stock_id, NULL); + gtk_stock_lookup (stock_id, &stock); if (should_show_image (image)) dbusmenu_menuitem_property_set (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME, - image->data.stock.stock_id); + stock_id); else dbusmenu_menuitem_property_remove (menuitem, DBUSMENU_MENUITEM_PROP_ICON_NAME); @@ -1601,7 +1635,7 @@ widget_notify_cb (GtkWidget *widget, { dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_ENABLED, - GTK_WIDGET_IS_SENSITIVE (widget)); + gtk_widget_is_sensitive (widget)); } else if (pspec->name == g_intern_static_string ("label")) { @@ -1753,7 +1787,7 @@ container_iterate (GtkWidget *widget, dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_ENABLED, - GTK_WIDGET_IS_SENSITIVE (widget)); + gtk_widget_is_sensitive (widget)); dbusmenu_menuitem_property_set_bool (child, DBUSMENU_MENUITEM_PROP_VISIBLE, gtk_widget_get_visible (widget)); diff --git a/src/appindicator3-0.1.pc.in b/src/appindicator3-0.1.pc.in new file mode 100644 index 0000000..a485910 --- /dev/null +++ b/src/appindicator3-0.1.pc.in @@ -0,0 +1,14 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +bindir=@bindir@ +includedir=@includedir@ + +Cflags: -I${includedir}/libappindicator3-0.1 +Requires: dbusmenu-glib gtk+-3.0 +Libs: -L${libdir} -lappindicator3 + +Name: appindicator3-0.1 +Description: Application indicators +Version: @VERSION@ + diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 46118bb..e3befff 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -1022,6 +1022,24 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap return; } +gchar** +application_service_appstore_application_get_list (ApplicationServiceAppstore * appstore) +{ + ApplicationServiceAppstorePrivate * priv = appstore->priv; + gchar ** out; + gchar ** outpntr; + GList * listpntr; + + out = g_new(gchar*, g_list_length(priv->applications) + 1); + + for (listpntr = priv->applications, outpntr = out; listpntr != NULL; listpntr = g_list_next(listpntr), ++outpntr) { + Application * app = (Application *)listpntr->data; + *outpntr = g_strdup_printf("%s%s", app->dbus_name, app->dbus_object); + } + *outpntr = 0; + return out; +} + /* Creates a basic appstore object and attaches the LRU file object to it. */ ApplicationServiceAppstore * diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index 73f6a9d..aa2824b 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -66,6 +66,7 @@ void application_service_appstore_application_remove (ApplicationServiceApp void application_service_appstore_approver_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object); +gchar** application_service_appstore_application_get_list (ApplicationServiceAppstore * appstore); G_END_DECLS diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 5b77620..50b0be9 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -30,12 +30,25 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "application-service-watcher.h" #include "dbus-shared.h" +/* Enum for the properties so that they can be quickly + found and looked up. */ +enum { + PROP_0, + PROP_PROTOCOL_VERSION, + PROP_IS_STATUS_NOTIFIER_HOST_REGISTERED, + PROP_REGISTERED_STATUS_NOTIFIER_ITEMS +}; + +/* The strings so that they can be slowly looked up. */ +#define PROP_PROTOCOL_VERSION_S "protocol-version" +#define PROP_IS_STATUS_NOTIFIER_HOST_REGISTERED_S "is-status-notifier-host-registered" +#define PROP_REGISTERED_STATUS_NOTIFIER_ITEMS_S "registered-status-notifier-items" + +#define CURRENT_PROTOCOL_VERSION 0 + static gboolean _notification_watcher_server_register_status_notifier_item (ApplicationServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method); -static gboolean _notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps); -static gboolean _notification_watcher_server_protocol_version (ApplicationServiceWatcher * appwatcher, char ** version); -static gboolean _notification_watcher_server_register_notification_host (ApplicationServiceWatcher * appwatcher, const gchar * host); +static gboolean _notification_watcher_server_register_status_notifier_host (ApplicationServiceWatcher * appwatcher, const gchar * host); static gboolean _notification_watcher_server_x_ayatana_register_notification_approver (ApplicationServiceWatcher * appwatcher, const gchar * path, const GArray * categories, DBusGMethodInvocation * method); -static gboolean _notification_watcher_server_is_notification_host_registered (ApplicationServiceWatcher * appwatcher, gboolean * haveHost); static void get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data); #include "notification-watcher-server.h" @@ -52,10 +65,9 @@ struct _ApplicationServiceWatcherPrivate { /* Signals Stuff */ enum { - SERVICE_REGISTERED, - SERVICE_UNREGISTERED, - NOTIFICATION_HOST_REGISTERED, - NOTIFICATION_HOST_UNREGISTERED, + STATUS_NOTIFIER_ITEM_REGISTERED, + STATUS_NOTIFIER_ITEM_UNREGISTERED, + STATUS_NOTIFIER_HOST_REGISTERED, LAST_SIGNAL }; @@ -66,6 +78,8 @@ static void application_service_watcher_class_init (ApplicationServiceWatcherCla static void application_service_watcher_init (ApplicationServiceWatcher *self); static void application_service_watcher_dispose (GObject *object); static void application_service_watcher_finalize (GObject *object); +static void application_service_watcher_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); +static void application_service_watcher_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); G_DEFINE_TYPE (ApplicationServiceWatcher, application_service_watcher, G_TYPE_OBJECT); @@ -79,31 +93,52 @@ application_service_watcher_class_init (ApplicationServiceWatcherClass *klass) object_class->dispose = application_service_watcher_dispose; object_class->finalize = application_service_watcher_finalize; - signals[SERVICE_REGISTERED] = g_signal_new ("service-registered", + /* Property funcs */ + object_class->set_property = application_service_watcher_set_property; + object_class->get_property = application_service_watcher_get_property; + + /* Properties */ + g_object_class_install_property (object_class, + PROP_PROTOCOL_VERSION, + g_param_spec_int(PROP_PROTOCOL_VERSION_S, + "Protocol Version", + "Which version of the StatusNotifierProtocol this watcher implements", + 0, G_MAXINT, + CURRENT_PROTOCOL_VERSION, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, + PROP_IS_STATUS_NOTIFIER_HOST_REGISTERED, + g_param_spec_boolean(PROP_IS_STATUS_NOTIFIER_HOST_REGISTERED_S, + "Is StatusNotifierHost Registered", + "True if there is at least one StatusNotifierHost registered", + FALSE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property (object_class, + PROP_REGISTERED_STATUS_NOTIFIER_ITEMS, + g_param_spec_boxed(PROP_REGISTERED_STATUS_NOTIFIER_ITEMS_S, + "Registered StatusNotifierItems", + "The list of StatusNotifierItems registered to this watcher", + G_TYPE_STRV, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /* Signals */ + signals[STATUS_NOTIFIER_ITEM_REGISTERED] = g_signal_new ("status-notifier-item-registered", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceWatcherClass, service_registered), + G_STRUCT_OFFSET (ApplicationServiceWatcherClass, status_notifier_item_registered), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING, G_TYPE_NONE); - signals[SERVICE_UNREGISTERED] = g_signal_new ("service-unregistered", + signals[STATUS_NOTIFIER_ITEM_UNREGISTERED] = g_signal_new ("status-notifier-item-unregistered", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceWatcherClass, service_unregistered), + G_STRUCT_OFFSET (ApplicationServiceWatcherClass, status_notifier_item_unregistered), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING, G_TYPE_NONE); - signals[NOTIFICATION_HOST_REGISTERED] = g_signal_new ("notification-host-registered", - G_TYPE_FROM_CLASS(klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceWatcherClass, notification_host_registered), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0, G_TYPE_NONE); - signals[NOTIFICATION_HOST_UNREGISTERED] = g_signal_new ("notification-host-unregistered", + signals[STATUS_NOTIFIER_HOST_REGISTERED] = g_signal_new ("status-notifier-host-registered", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ApplicationServiceWatcherClass, notification_host_unregistered), + G_STRUCT_OFFSET (ApplicationServiceWatcherClass, status_notifier_host_registered), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE); @@ -175,6 +210,29 @@ application_service_watcher_finalize (GObject *object) return; } +static void +application_service_watcher_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) +{ + /* There are no writable properties for now */ +} + +static void +application_service_watcher_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) +{ + ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(object); + switch (prop_id) { + case PROP_PROTOCOL_VERSION: + g_value_set_int (value, CURRENT_PROTOCOL_VERSION); + break; + case PROP_IS_STATUS_NOTIFIER_HOST_REGISTERED: + g_value_set_boolean (value, TRUE); + break; + case PROP_REGISTERED_STATUS_NOTIFIER_ITEMS: + g_value_set_boxed (value, application_service_appstore_application_get_list(priv->appstore)); + break; + } +} + ApplicationServiceWatcher * application_service_watcher_new (ApplicationServiceAppstore * appstore) { @@ -205,33 +263,12 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa } static gboolean -_notification_watcher_server_registered_status_notifier_items (ApplicationServiceWatcher * appwatcher, GArray ** apps) -{ - - return FALSE; -} - -static gboolean -_notification_watcher_server_protocol_version (ApplicationServiceWatcher * appwatcher, char ** version) -{ - *version = g_strdup("Ayatana Version 1"); - return TRUE; -} - -static gboolean -_notification_watcher_server_register_notification_host (ApplicationServiceWatcher * appwatcher, const gchar * host) +_notification_watcher_server_register_status_notifier_host (ApplicationServiceWatcher * appwatcher, const gchar * host) { return FALSE; } -static gboolean -_notification_watcher_server_is_notification_host_registered (ApplicationServiceWatcher * appwatcher, gboolean * haveHost) -{ - *haveHost = TRUE; - return TRUE; -} - /* Function to handle the return of the get name. There isn't a whole lot that can be done, but we're atleast going to tell people. */ static void diff --git a/src/application-service-watcher.h b/src/application-service-watcher.h index ee6a723..6c430db 100644 --- a/src/application-service-watcher.h +++ b/src/application-service-watcher.h @@ -44,10 +44,9 @@ struct _ApplicationServiceWatcherClass { GObjectClass parent_class; /* Signals */ - void (*service_registered) (ApplicationServiceWatcher * watcher, gchar * object, gpointer data); - void (*service_unregistered) (ApplicationServiceWatcher * watcher, gchar * object, gpointer data); - void (*notification_host_registered) (ApplicationServiceWatcher * watcher, gpointer data); - void (*notification_host_unregistered) (ApplicationServiceWatcher * watcher, gpointer data); + void (*status_notifier_item_registered) (ApplicationServiceWatcher * watcher, gchar * object, gpointer data); + void (*status_notifier_item_unregistered) (ApplicationServiceWatcher * watcher, gchar * object, gpointer data); + void (*status_notifier_host_registered) (ApplicationServiceWatcher * watcher, gpointer data); }; struct _ApplicationServiceWatcher { diff --git a/src/indicator-application.c b/src/indicator-application.c index 36e1446..ecf19e8 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -21,6 +21,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* G Stuff */ #include <glib.h> @@ -29,7 +32,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. /* DBus Stuff */ #include <dbus/dbus-glib.h> +#ifdef HAVE_GTK3 +#include <libdbusmenu-gtk3/menu.h> +#else #include <libdbusmenu-gtk/menu.h> +#endif /* Indicator Stuff */ #include <libindicator/indicator.h> diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index 5f19dd2..b03c5e3 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -3,25 +3,18 @@ <interface name="org.kde.StatusNotifierWatcher"> <!-- Properties --> - <!-- None currently --> + <property name="ProtocolVersion" type="i" access="read" /> + <property name="IsStatusNotifierHostRegistered" type="b" access="read" /> + <property name="RegisteredStatusNotifierItems" type="as" access="read" /> <!-- Methods --> <method name="RegisterStatusNotifierItem"> <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> <arg type="s" name="service" direction="in" /> </method> - <method name="RegisteredStatusNotifierItems"> - <arg type="as" name="services" direction="out" /> - </method> - <method name="ProtocolVersion"> - <arg type="s" name="version" direction="out" /> - </method> - <method name="RegisterNotificationHost"> + <method name="RegisterStatusNotifierHost"> <arg type="s" name="service" direction="in" /> </method> - <method name="IsNotificationHostRegistered"> - <arg type="b" name="hasHost" direction="out" /> - </method> <method name="XAyatanaRegisterNotificationApprover"> <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> <!-- The path where to find the approver interface --> @@ -31,15 +24,13 @@ </method> <!-- Signals --> - <signal name="ServiceRegistered"> + <signal name="StatusNotifierItemRegistered"> <arg type="s" name="service" direction="out" /> </signal> - <signal name="ServiceUnregistered"> + <signal name="StatusNotifierItemUnregistered"> <arg type="s" name="service" direction="out" /> </signal> - <signal name="NotificationHostRegistered"> - </signal> - <signal name="NotificationHostUnregistered"> + <signal name="StatusNotifierHostRegistered"> </signal> </interface> |