diff options
-rw-r--r-- | bindings/mono/Makefile.am | 6 | ||||
-rw-r--r-- | bindings/mono/app-indicator.sources.xml | 12 | ||||
-rw-r--r-- | bindings/mono/app-indicator.sources.xml.in | 12 | ||||
-rw-r--r-- | bindings/python/Makefile.am | 9 | ||||
-rw-r--r-- | bindings/python/appindicator.override.in (renamed from bindings/python/appindicator.override) | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/app-indicator.c | 90 |
7 files changed, 70 insertions, 65 deletions
diff --git a/bindings/mono/Makefile.am b/bindings/mono/Makefile.am index f4a59a8..6f8e8a9 100644 --- a/bindings/mono/Makefile.am +++ b/bindings/mono/Makefile.am @@ -66,7 +66,7 @@ EXTRA_DIST = \ $(METADATA) \ appindicator-sharp-0.1.pc.in \ appindicator-sharp.dll.config.in \ - app-indicator.sources.xml \ + app-indicator.sources.xml.in \ $(ASSEMBLY_NAME).snk \ $(POLICY).config.in \ $(POLICY1).config.in \ @@ -85,13 +85,13 @@ test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) $(MONO_NUNIT_LIBS) -r:$(ASSEMB endif $(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING) - $(GAPI_PARSER) $(srcdir)/app-indicator.sources.xml + $(GAPI_PARSER) app-indicator.sources.xml $(WRAPPER_FREE_BINDING): $(WRAPPER_FREE_BINDING_SRC) sed '/signals\[X_NEW_LABEL\] /,+6d' $(WRAPPER_FREE_BINDING_SRC) > $(WRAPPER_FREE_BINDING) $(MIDDLE_API): $(METADATA) $(RAW_API) - cp $(srcdir)/$(RAW_API) $(MIDDLE_API) + cp $(RAW_API) $(MIDDLE_API) chmod u+w $(MIDDLE_API) @if test -n '$(METADATA)'; then \ echo "$(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA)"; \ diff --git a/bindings/mono/app-indicator.sources.xml b/bindings/mono/app-indicator.sources.xml deleted file mode 100644 index 6cf28e9..0000000 --- a/bindings/mono/app-indicator.sources.xml +++ /dev/null @@ -1,12 +0,0 @@ -<gapi-parser-input> - <api filename="libappindicator-api.raw"> - <library name="appindicator.dll"> - <namespace name="AppIndicator"> - <file>app-indicator.c</file> - <file>../../src/app-indicator-enum-types.c</file> - <file>../../src/app-indicator-enum-types.h</file> - <file>../../src/app-indicator.h</file> - </namespace> - </library> - </api> -</gapi-parser-input> diff --git a/bindings/mono/app-indicator.sources.xml.in b/bindings/mono/app-indicator.sources.xml.in new file mode 100644 index 0000000..7f8e869 --- /dev/null +++ b/bindings/mono/app-indicator.sources.xml.in @@ -0,0 +1,12 @@ +<gapi-parser-input> + <api filename="libappindicator-api.raw"> + <library name="appindicator.dll"> + <namespace name="AppIndicator"> + <file>@top_builddir@/bindings/mono/app-indicator.c</file> + <file>@top_builddir@/src/app-indicator-enum-types.c</file> + <file>@top_builddir@/src/app-indicator-enum-types.h</file> + <file>@top_srcdir@/src/app-indicator.h</file> + </namespace> + </library> + </api> +</gapi-parser-input> diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index 7febc11..fe95c02 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -25,16 +25,15 @@ _appindicator_la_SOURCES = appindicatormodule.c nodist__appindicator_la_SOURCES = appindicator.c CLEANFILES = appindicator.c -EXTRA_DIST = appindicator.override appindicator-arg-types.py $(defs_DATA) +EXTRA_DIST = appindicator.override.in appindicator-arg-types.py $(defs_DATA) appindicator.c: $(defs_DATA) appindicator.override %.c: %.defs - (cd $(srcdir) \ - && $(PYGTK_CODEGEN) \ + ($(PYGTK_CODEGEN) \ --register $(PYGTK_DEFSDIR)/gtk-types.defs \ --register $(PYGTK_DEFSDIR)/gdk-types.defs \ - --load-types appindicator-arg-types.py \ + --load-types $(srcdir)/appindicator-arg-types.py \ --override $*.override \ - --prefix py$* $*.defs) > gen-$*.c \ + --prefix py$* $(srcdir)/$*.defs) > gen-$*.c \ && cp gen-$*.c $*.c \ && rm -f gen-$*.c diff --git a/bindings/python/appindicator.override b/bindings/python/appindicator.override.in index b252994..84d3159 100644 --- a/bindings/python/appindicator.override +++ b/bindings/python/appindicator.override.in @@ -28,8 +28,8 @@ License version 3 and version 2.1 along with this program. If not, see %% headers #include <Python.h> -#include "../src/app-indicator.h" -#include "../src/app-indicator-enum-types.h" +#include "@top_srcdir@/src/app-indicator.h" +#include "@top_builddir@/src/app-indicator-enum-types.h" #include <glib.h> #include "pygobject.h" #include "pyglib.h" diff --git a/configure.ac b/configure.ac index 127307e..7c067e9 100644 --- a/configure.ac +++ b/configure.ac @@ -228,9 +228,11 @@ bindings/Makefile bindings/mono/Makefile bindings/mono/appindicator-sharp.dll.config bindings/mono/appindicator-sharp-0.1.pc +bindings/mono/app-indicator.sources.xml bindings/mono/examples/Makefile bindings/mono/examples/indicator-example bindings/python/Makefile +bindings/python/appindicator.override bindings/vala/Makefile bindings/vala/examples/Makefile tests/Makefile diff --git a/src/app-indicator.c b/src/app-indicator.c index f3d0b65..d7b3d18 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -899,7 +899,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu } if (priv->status_icon != NULL) { - gtk_status_icon_set_title(priv->status_icon, priv->title ? priv->title : ""); + gtk_status_icon_set_title(priv->status_icon, priv->title ? priv->title : ""); } break; } @@ -1590,60 +1590,58 @@ static void status_icon_changes (AppIndicator * self, gpointer data) { GtkStatusIcon * icon = GTK_STATUS_ICON(data); - gchar *longname = NULL; - - /* add the icon_theme_path once if needed */ - GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); - if (self->priv->icon_theme_path != NULL) - { - gchar **path; - gint n_elements, i; - gboolean found=FALSE; - gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); - for (i=0; i< n_elements || path[i] == NULL; i++) - { - if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) - { - found=TRUE; - break; - } - } - if(!found) - gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); - g_strfreev (path); - } + /* add the icon_theme_path once if needed */ + GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); + if (self->priv->icon_theme_path != NULL) { + gchar **path; + gint n_elements, i; + gboolean found=FALSE; + gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); + for (i=0; i< n_elements || path[i] == NULL; i++) { + if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) { + found=TRUE; + break; + } + } + if(!found) { + gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); + } + g_strfreev (path); + } + + const gchar * icon_name = NULL; switch (app_indicator_get_status(self)) { case APP_INDICATOR_STATUS_PASSIVE: - /* hide first to avoid that the change is visible to the user */ - gtk_status_icon_set_visible(icon, FALSE); - longname = append_panel_icon_suffix(app_indicator_get_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + /* hide first to avoid that the change is visible to the user */ + gtk_status_icon_set_visible(icon, FALSE); + icon_name = app_indicator_get_icon(self); break; case APP_INDICATOR_STATUS_ACTIVE: - longname = append_panel_icon_suffix(app_indicator_get_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + icon_name = app_indicator_get_icon(self); gtk_status_icon_set_visible(icon, TRUE); break; case APP_INDICATOR_STATUS_ATTENTION: - /* get the _attention_ icon here */ - longname = append_panel_icon_suffix(app_indicator_get_attention_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + /* get the _attention_ icon here */ + icon_name = app_indicator_get_attention_icon(self); gtk_status_icon_set_visible(icon, TRUE); break; }; - if (longname) { - g_free(longname); + if (icon_name != NULL) { + if (g_file_test(icon_name, G_FILE_TEST_EXISTS)) { + gtk_status_icon_set_from_file(icon, icon_name); + } else { + gchar *longname = append_panel_icon_suffix(icon_name); + + if (longname != NULL && gtk_icon_theme_has_icon (icon_theme, longname)) { + gtk_status_icon_set_from_icon_name(icon, longname); + } else { + gtk_status_icon_set_from_icon_name(icon, icon_name); + } + + g_free(longname); + } } return; @@ -2209,6 +2207,9 @@ app_indicator_set_secondary_activate_target (AppIndicator *self, GtkWidget *menu * the title as the first part of the line for the menu items. * * Setting @title to %NULL removes the title. + * + * Since: 0.5 + * */ void app_indicator_set_title (AppIndicator *self, const gchar * title) @@ -2358,6 +2359,9 @@ app_indicator_get_attention_icon_desc (AppIndicator *self) * app_indicator_set_title() for information on the title. * * Return value: The current title. + * + * Since: 0.5 + * */ const gchar * app_indicator_get_title (AppIndicator *self) |