From 0e0780f55ad2814ca7d96446fa0489e259b87e13 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 15 Feb 2009 21:40:46 -0600 Subject: Adding a check for NULL string in the icon parsing code. This will stop a bunch of warnings coming from everything else. --- libindicate/listener.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libindicate/listener.c b/libindicate/listener.c index 3cc9111..d8926f1 100644 --- a/libindicate/listener.c +++ b/libindicate/listener.c @@ -688,6 +688,11 @@ get_property_cb (DBusGProxy *proxy, char * OUT_value, GError *error, gpointer us case PROPERTY_TYPE_ICON: { indicate_listener_get_property_icon_cb cb = (indicate_listener_get_property_icon_cb)get_property_data->cb; + /* There is no icon */ + if (OUT_value == NULL || OUT_value[0] == '\0') { + break; + } + gsize length = 0; guchar * icondata = g_base64_decode(OUT_value, &length); -- cgit v1.2.3 From 3a3a6e58cfddaa0f72f71e7a01d76ac24f5e854d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 15 Feb 2009 21:53:55 -0600 Subject: Adding a new signal in that handles the ID of zero, or null, comming back from a listener and uses that to show the server. Or atleast signal it to figure out how to do that. Also cleaning up the signals a little to use defines. --- libindicate/server.c | 31 ++++++++++++++++++++++++++----- libindicate/server.h | 12 ++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/libindicate/server.c b/libindicate/server.c index ee20321..8a35906 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -52,6 +52,7 @@ enum { INDICATOR_MODIFIED, SERVER_SHOW, SERVER_HIDE, + SERVER_DISPLAY, LAST_SIGNAL }; @@ -116,41 +117,48 @@ indicate_server_class_init (IndicateServerClass * class) gobj->set_property = set_property; gobj->get_property = get_property; - signals[INDICATOR_ADDED] = g_signal_new("indicator-added", + signals[INDICATOR_ADDED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_ADDED, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (IndicateServerClass, indicator_added), NULL, NULL, g_cclosure_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - signals[INDICATOR_REMOVED] = g_signal_new("indicator-removed", + signals[INDICATOR_REMOVED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (IndicateServerClass, indicator_removed), NULL, NULL, g_cclosure_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - signals[INDICATOR_MODIFIED] = g_signal_new("indicator-modified", + signals[INDICATOR_MODIFIED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (IndicateServerClass, indicator_modified), NULL, NULL, g_cclosure_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - signals[SERVER_SHOW] = g_signal_new("server-show", + signals[SERVER_SHOW] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_SHOW, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (IndicateServerClass, server_show), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_STRING); - signals[SERVER_HIDE] = g_signal_new("server-hide", + signals[SERVER_HIDE] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_HIDE, G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (IndicateServerClass, server_hide), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_STRING); + signals[SERVER_DISPLAY] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_DISPLAY, + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicateServerClass, server_display), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); g_object_class_install_property (gobj, PROP_DESKTOP, g_param_spec_string("desktop", "Desktop File", @@ -661,6 +669,11 @@ get_indicator_properties (IndicateServer * server, guint id, gchar *** propertie static gboolean show_indicator_to_user (IndicateServer * server, guint id, GError ** error) { + if (id == INDICATE_SERVER_INDICATOR_NULL) { + g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE); + return TRUE; + } + IndicateIndicator * indicator = get_indicator(server, id, error); if (indicator == NULL) { return FALSE; @@ -879,3 +892,11 @@ indicate_server_emit_indicator_modified (IndicateServer *server, guint id, const g_signal_emit(server, signals[INDICATOR_MODIFIED], 0, id, property); } + +void +indicate_server_emit_server_display (IndicateServer *server) +{ + g_return_if_fail (INDICATE_IS_SERVER (server)); + + g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE); +} diff --git a/libindicate/server.h b/libindicate/server.h index 4e3c931..8aa0cf1 100644 --- a/libindicate/server.h +++ b/libindicate/server.h @@ -45,6 +45,16 @@ G_BEGIN_DECLS #define INDICATE_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_SERVER)) #define INDICATE_SERVER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_SERVER, IndicateServerClass)) +#define INDICATE_SERVER_INDICATOR_NULL (0) + +#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED "indicator-added" +#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED "indicator-removed" +#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED "indicator-modified" +#define INDICATE_SERVER_SIGNAL_SERVER_SHOW "server-show" +#define INDICATE_SERVER_SIGNAL_SERVER_HIDE "server-hide" +#define INDICATE_SERVER_SIGNAL_SERVER_DISPLAY "server-display" + + typedef struct _IndicateServer IndicateServer; struct _IndicateServer { GObject parent; @@ -60,6 +70,7 @@ struct _IndicateServerClass { void (* indicator_modified) (IndicateServer * server, guint id, gchar * property); void (* server_show) (IndicateServer * server, gchar * type); void (* server_hide) (IndicateServer * server, gchar * type); + void (* server_display) (IndicateServer * server); /* Virtual Functions */ gboolean (*get_indicator_count) (IndicateServer * server, guint * count, GError **error); @@ -115,6 +126,7 @@ gboolean indicate_server_show_indicator_to_user (IndicateServer * server, guint void indicate_server_emit_indicator_added (IndicateServer *server, guint id, const gchar *type); void indicate_server_emit_indicator_removed (IndicateServer *server, guint id, const gchar *type); void indicate_server_emit_indicator_modified (IndicateServer *server, guint id, const gchar *property); +void indicate_server_emit_server_display (IndicateServer *server); G_END_DECLS -- cgit v1.2.3 From 524e5b9804537a2a170e5d9a5c2090a3a7f49afb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 15 Feb 2009 21:58:08 -0600 Subject: Adding a handler for the new server display signal, and then make the messages more clear between the two. --- docs/reference/libindicate-decl.txt | 34 ++++++++++++++++++++++++++++++++++ tests/im-client.c | 9 ++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/docs/reference/libindicate-decl.txt b/docs/reference/libindicate-decl.txt index e3280bd..e7890c0 100644 --- a/docs/reference/libindicate-decl.txt +++ b/docs/reference/libindicate-decl.txt @@ -315,6 +315,34 @@ IndicateListener * listener,IndicateListenerServer * server,indicate_listener_ge INDICATE_SERVER_GET_CLASS #define INDICATE_SERVER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_SERVER, IndicateServerClass)) + +INDICATE_SERVER_INDICATOR_NULL +#define INDICATE_SERVER_INDICATOR_NULL (0) + + +INDICATE_SERVER_SIGNAL_INDICATOR_ADDED +#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED "indicator-added" + + +INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED +#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED "indicator-removed" + + +INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED +#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED "indicator-modified" + + +INDICATE_SERVER_SIGNAL_SERVER_SHOW +#define INDICATE_SERVER_SIGNAL_SERVER_SHOW "server-show" + + +INDICATE_SERVER_SIGNAL_SERVER_HIDE +#define INDICATE_SERVER_SIGNAL_SERVER_HIDE "server-hide" + + +INDICATE_SERVER_SIGNAL_SERVER_DISPLAY +#define INDICATE_SERVER_SIGNAL_SERVER_DISPLAY "server-display" + IndicateServer @@ -339,6 +367,7 @@ struct _IndicateServerClass { void (* indicator_modified) (IndicateServer * server, guint id, gchar * property); void (* server_show) (IndicateServer * server, gchar * type); void (* server_hide) (IndicateServer * server, gchar * type); + void (* server_display) (IndicateServer * server); /* Virtual Functions */ gboolean (*get_indicator_count) (IndicateServer * server, guint * count, GError **error); @@ -468,6 +497,11 @@ IndicateServer *server, guint id, const gchar *type void IndicateServer *server, guint id, const gchar *property + +indicate_server_emit_server_display +void +IndicateServer *server + INDICATE_TYPE_INDICATOR_MESSAGE #define INDICATE_TYPE_INDICATOR_MESSAGE (indicate_indicator_message_get_type ()) diff --git a/tests/im-client.c b/tests/im-client.c index 3419a9d..1b5a86b 100644 --- a/tests/im-client.c +++ b/tests/im-client.c @@ -56,7 +56,13 @@ timeout_cb (gpointer data) static void display (IndicateIndicator * indicator, gpointer data) { - g_debug("Ah, I've been displayed"); + g_debug("Ah, my indicator has been displayed"); +} + +static void +server_display (IndicateServer * server, gpointer data) +{ + g_debug("Ah, my server has been displayed"); } int @@ -67,6 +73,7 @@ main (int argc, char ** argv) IndicateServer * server = indicate_server_ref_default(); indicate_server_set_type(server, "message.im"); indicate_server_set_desktop_file(server, "/usr/share/applications/empathy.desktop"); + g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_SERVER_DISPLAY, G_CALLBACK(server_display), NULL); IndicateIndicatorMessage * indicator; -- cgit v1.2.3 From 975000d7ab53c8f58468f0f648f991892e092833 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 15 Feb 2009 21:58:56 -0600 Subject: Removing the debian directory. Going to start using this as my upstream branch and the other as the packaging branch. --- debian/changelog | 222 ---------------------------------------- debian/control | 43 -------- debian/copyright | 22 ---- debian/indicator-applet.install | 3 - debian/libindicate-dev.install | 4 - debian/libindicate0.install | 1 - debian/rules | 8 -- 7 files changed, 303 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100644 debian/indicator-applet.install delete mode 100644 debian/libindicate-dev.install delete mode 100644 debian/libindicate0.install delete mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 91ceaac..0000000 --- a/debian/changelog +++ /dev/null @@ -1,222 +0,0 @@ -indicator-applet (0.1~ppa36) intrepid; urgency=low - - * Better handling of the properties with convience functions - and working on both sides of the connection. - * Cleaning up the listener code to make it more robust. - * Adding a ref_default for listeners. - * Correcting all of the license information. - - -- Ted Gould Wed, 11 Feb 2009 20:34:14 -0600 - -indicator-applet (0.1~ppa35) intrepid; urgency=low - - * Better use of type and sending it with signals. - * Making it so that the server hide function works better. - * Only sending property updates if the indicator is - visible. - - -- Ted Gould Mon, 09 Feb 2009 11:01:11 -0600 - -indicator-applet (0.1~ppa34) intrepid; urgency=low - - * Ah, listener fixes too. Make everything get together and - use the new APIs. - - -- Ted Gould Fri, 06 Feb 2009 15:02:57 +0100 - -indicator-applet (0.1~ppa33) intrepid; urgency=low - - * Version bump, autogen.sh - - -- Ted Gould Fri, 06 Feb 2009 14:35:38 +0100 - -indicator-applet (0.1~ppa32) intrepid; urgency=low - - * Adding back in the package config data - - -- Ted Gould Fri, 06 Feb 2009 14:14:33 +0100 - -indicator-applet (0.1~ppa31) intrepid; urgency=low - - * Ah, silly packaging stuff. I hate packaging. - - -- Ted Gould Fri, 06 Feb 2009 11:39:04 +0100 - -indicator-applet (0.1~ppa30) intrepid; urgency=low - - * Removing GObject introspection, so that it will build in - the PPA. Will put back later. - - -- Ted Gould Fri, 06 Feb 2009 10:39:59 +0100 - -indicator-applet (0.1~ppa29) intrepid; urgency=low - - * Bumping for PPA as forgot to run autogen.sh - - -- Ted Gould Fri, 06 Feb 2009 00:29:11 +0100 - -indicator-applet (0.1~ppa28) intrepid; urgency=low - - * Updating the server interface to have signals for show and hide - on the server and having properties for the desktop and type - of the server. - - -- Ted Gould Thu, 05 Feb 2009 18:22:19 +0100 - -indicator-applet (0.1~ppa27) intrepid; urgency=low - - * Adding an API function for pixbufs - - -- Ted Gould Thu, 05 Feb 2009 14:46:44 +0100 - -indicator-applet (0.1~ppa26) intrepid; urgency=low - - * Removing the icons - * Adding in the docs - * Printing the icons dir - - -- Ted Gould Wed, 04 Feb 2009 18:58:32 +0100 - -indicator-applet (0.1~ppa25) intrepid; urgency=low - - * Set the widget name on the applet rather than the menubar, to make sure - it's picked up globally. - - -- Neil J. Patel Wed, 04 Feb 2009 14:53:41 +0100 - -indicator-applet (0.1~ppa24) intrepid; urgency=low - - * Adding a conflicts and a replaces to get rid of errors. - - -- Ted Gould Wed, 04 Feb 2009 14:14:25 +0100 - -indicator-applet (0.1~ppa23) intrepid; urgency=low - - * Removing border - - -- Ted Gould Wed, 04 Feb 2009 13:57:23 +0100 - -indicator-applet (0.1~ppa22) intrepid; urgency=low - - * Add support for a transparent panel applet - - -- Neil J. Patel Wed, 04 Feb 2009 12:44:56 +0100 - -indicator-applet (0.1~ppa21) intrepid; urgency=low - - * Adding in package fixes from seb128 - * Removing scrollkeeper - * Changing libindicate to libindicate0 - * Removing .la file - * Removing targets for files in libindcate-dev.install - * Removing pkg-create-dbgsym - - -- Ted Gould Tue, 03 Feb 2009 11:34:02 +0100 - -indicator-applet (0.1~ppa20) intrepid; urgency=low - - * Adding a build depend on pkg-create-dbgsym - - -- Ted Gould Mon, 02 Feb 2009 13:38:05 +0100 - -indicator-applet (0.1~ppa19) intrepid; urgency=low - - * Bump for PPA - - -- Ted Gould Mon, 02 Feb 2009 10:43:32 +0100 - -indicator-applet (0.1~ppa18) intrepid; urgency=low - - * Adding interface for listener sending back a display - request. - - -- Ted Gould Fri, 30 Jan 2009 15:06:47 -0600 - -indicator-applet (0.1~ppa17) intrepid; urgency=low - - * Fixing the handling of named DBus connections - * Moving most of the data in the objects to private sections - * Making the signal names defines for easier usage - * Having property changes actually work now. - - -- Ted Gould Thu, 29 Jan 2009 13:38:16 -0600 - -indicator-applet (0.1~ppa16) intrepid; urgency=low - - * Forgot to run autogen.sh before last package :( - - -- Ted Gould Thu, 22 Jan 2009 15:39:19 -0600 - -indicator-applet (0.1~ppa15) intrepid; urgency=low - - * Update API slightly and some fixes. - - -- Ted Gould Wed, 21 Jan 2009 19:43:11 -0600 - -indicator-applet (0.1~ppa14) intrepid; urgency=low - - * Adding in listener_get_property - - -- Ted Gould Wed, 21 Jan 2009 15:13:19 -0600 - -indicator-applet (0.1~ppa13) intrepid; urgency=low - - * Wrong indicate include directory in package config files - - -- Ted Gould Mon, 19 Jan 2009 12:21:45 -0600 - -indicator-applet (0.1~ppa12) intrepid; urgency=low - - * Removing the gir file from the applet so that it's only - with the library so that we can install all of them. - - -- Ted Gould Fri, 16 Jan 2009 17:11:43 -0600 - -indicator-applet (0.1~ppa11) intrepid; urgency=low - - * Adding the GObject Introspection files into the build and the - packaging. - - -- Ted Gould Fri, 16 Jan 2009 16:23:14 -0600 - -indicator-applet (0.1~ppa10) intrepid; urgency=low - - * Adding in libtool to build deps - - -- Ted Gould Fri, 16 Jan 2009 13:31:57 -0600 - -indicator-applet (0.1~ppa9) intrepid; urgency=low - - * Adding in the libindicate lib. - - -- Ted Gould Fri, 16 Jan 2009 12:41:32 -0600 - -indicator-applet (0.1~ppa8) intrepid; urgency=low - - * Moving the indicator directory cross-packages. - - -- Ted Gould Thu, 04 Dec 2008 22:56:40 -0800 - -indicator-applet (0.1~ppa7) intrepid; urgency=low - - * Put in the kickarse loader code. Happy, happy. - - -- Ted Gould Thu, 04 Dec 2008 22:39:41 -0800 - -indicator-applet (0.1~ppa6) intrepid; urgency=low - - * Making the applet very light. - - -- Ted Gould Wed, 03 Dec 2008 23:23:15 -0800 - -indicator-applet (0.1~ppa2) intrepid; urgency=low - - * Adding a depend for dbus-glib - - -- Ted Gould Tue, 18 Nov 2008 14:30:35 -0600 - -indicator-applet (0.1~ppa1) intrepid; urgency=low - - * Initial release. - - -- Ted Gould Tue, 18 Nov 2008 13:54:43 -0600 diff --git a/debian/control b/debian/control deleted file mode 100644 index 7cacf57..0000000 --- a/debian/control +++ /dev/null @@ -1,43 +0,0 @@ -Source: indicator-applet -Section: gnome -Priority: optional -Maintainer: Ubuntu Core Developers -Build-Depends: debhelper (>= 5.0), - cdbs (>= 0.4.41), - libgtk2.0-dev (>= 2.12.0), - libpanel-applet2-dev (>= 2.0.0), - libdbus-glib-1-dev, - gnome-doc-utils, - libtool, - intltool, - gobject-introspection (>= 0.6), - gobject-introspection-glib-2.0 (>= 0.6), - libgirepository-dev (>= 0.6) -Standards-Version: 3.8.0 - -Package: indicator-applet -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - gnome-panel -Description: Applet for the GNOME panel providing various indicators for - display to users. - -Package: libindicate0 -Section: libs -Conflicts: libindicate -Replaces: libindicate -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: A library used to indicate. - -Package: libindicate-dev -Section: libdevel -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - libindicate0 (= ${binary:Version}), - libdbus-glib-1-dev (>= 0.76), - libgtk2.0-dev (>= 2.12.0) -Description: Development files. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 56f5316..0000000 --- a/debian/copyright +++ /dev/null @@ -1,22 +0,0 @@ -This package was debianized by Ted Gould on -Wed, 11 Feb 2009 15:41:06 -0600. - -It was downloaded from - -Upstream Author(s): - - Ted Gould - -Copyright: - - - -License: - - Licensed under the GPL v3 - - libindicate/ - Licensed under the LGPL v2.1 and/or v3 - -The Debian packaging is (C) 2009, Canonical Ltd. and -is licensed under the GPLv3, see `/usr/share/common-licenses/GPL-3'. diff --git a/debian/indicator-applet.install b/debian/indicator-applet.install deleted file mode 100644 index 428774c..0000000 --- a/debian/indicator-applet.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/tmp/etc -debian/tmp/usr/lib/bonobo -debian/tmp/usr/lib/indicator-applet diff --git a/debian/libindicate-dev.install b/debian/libindicate-dev.install deleted file mode 100644 index 4623919..0000000 --- a/debian/libindicate-dev.install +++ /dev/null @@ -1,4 +0,0 @@ -debian/tmp/usr/include/ -debian/tmp/usr/lib/pkgconfig -debian/tmp/usr/lib/libindicate.a -debian/tmp/usr/lib/libindicate.so diff --git a/debian/libindicate0.install b/debian/libindicate0.install deleted file mode 100644 index 0618a58..0000000 --- a/debian/libindicate0.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libindicate.so.* diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 1c64b91..0000000 --- a/debian/rules +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/gnome.mk - -DEB_CONFIGURE_EXTRA_FLAGS += --disable-scrollkeeper -LDFLAGS += -Wl,-z,defs -Wl,--as-needed - -- cgit v1.2.3