aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-11-05 09:30:16 -0600
committerTed Gould <ted@canonical.com>2009-11-05 09:30:16 -0600
commit3d9e5a769865912765db035874b7791d7a32651a (patch)
treef7a28503271d53bee0b74325dca6e2a459821e35
parent4c401b08ceb4cf0659bfc4e4edc9659f6fc50fc3 (diff)
parent6886b23eaf8010a6361d15d9ac64df62a1680e82 (diff)
downloadayatana-indicator-messages-3d9e5a769865912765db035874b7791d7a32651a.tar.gz
ayatana-indicator-messages-3d9e5a769865912765db035874b7791d7a32651a.tar.bz2
ayatana-indicator-messages-3d9e5a769865912765db035874b7791d7a32651a.zip
* Porting to libindicator 0.3.0
* debian/control: Increasing libindicator-dev dependency to 0.3.0~dev
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog8
-rw-r--r--debian/control2
-rw-r--r--src/indicator-messages.c92
4 files changed, 87 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 4b36234..3edcc3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ GTK_REQUIRED_VERSION=2.12
GIO_UNIX_REQUIRED_VERSION=2.18
PANEL_REQUIRED_VERSION=2.0.0
INDICATE_REQUIRED_VERSION=0.2.0
-INDICATOR_REQUIRED_VERSION=0.2.0
+INDICATOR_REQUIRED_VERSION=0.3.0
DBUSMENUGTK_REQUIRED_VERSION=0.1.1
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
diff --git a/debian/changelog b/debian/changelog
index 7bf474f..84be776 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+indicator-messages (0.3.0~dev-0ubuntu1~ppa1) UNRELEASED; urgency=low
+
+ * Porting to libindicator 0.3.0
+ * debian/control: Increasing libindicator-dev dependency to
+ 0.3.0~dev
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 05 Nov 2009 09:29:47 -0600
+
indicator-messages (0.2.6-0ubuntu2~ppa1) karmic; urgency=low
* Adding translator comments from hours and minutes strings.
diff --git a/debian/control b/debian/control
index 08f19e3..ab92d8b 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 5.0),
intltool,
libindicate-dev (>= 0.2.0),
libindicate-gtk-dev (>= 0.2.0),
- libindicator-dev (>= 0.2.0~bzr301),
+ libindicator-dev (>= 0.3.0~dev),
libdbusmenu-gtk-dev (>= 0.1.1),
libdbusmenu-glib-dev (>= 0.1.1)
Standards-Version: 3.8.0
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index e7d6207..54e67c9 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -22,6 +22,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <string.h>
#include <glib.h>
+#include <glib-object.h>
#include <gtk/gtk.h>
#include <libdbusmenu-gtk/menu.h>
#include <libdbusmenu-gtk/menuitem.h>
@@ -29,21 +30,88 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <dbus/dbus-glib-bindings.h>
#include <libindicator/indicator.h>
-INDICATOR_SET_VERSION
-INDICATOR_SET_NAME("messages")
+#include <libindicator/indicator-object.h>
#include "dbus-data.h"
#include "messages-service-client.h"
-static GtkWidget * main_image = NULL;
+#define INDICATOR_MESSAGES_TYPE (indicator_messages_get_type ())
+#define INDICATOR_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_MESSAGES_TYPE, IndicatorMessages))
+#define INDICATOR_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_MESSAGES_TYPE, IndicatorMessagesClass))
+#define IS_INDICATOR_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_MESSAGES_TYPE))
+#define IS_INDICATOR_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_MESSAGES_TYPE))
+#define INDICATOR_MESSAGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_MESSAGES_TYPE, IndicatorMessagesClass))
+
+typedef struct _IndicatorMessages IndicatorMessages;
+typedef struct _IndicatorMessagesClass IndicatorMessagesClass;
+struct _IndicatorMessagesClass {
+ IndicatorObjectClass parent_class;
+};
+
+struct _IndicatorMessages {
+ IndicatorObject parent;
+};
+
+GType indicator_messages_get_type (void);
+
+/* Indicator Module Config */
+INDICATOR_SET_VERSION
+INDICATOR_SET_TYPE(INDICATOR_MESSAGES_TYPE)
+
+/* Globals */
+static GtkWidget * main_image = NULL;
#define DESIGN_TEAM_SIZE design_team_size
static GtkIconSize design_team_size;
-
static DBusGProxy * icon_proxy = NULL;
-
static GtkSizeGroup * indicator_right_group = NULL;
+/* Prototypes */
+static void indicator_messages_class_init (IndicatorMessagesClass *klass);
+static void indicator_messages_init (IndicatorMessages *self);
+static void indicator_messages_dispose (GObject *object);
+static void indicator_messages_finalize (GObject *object);
+static GtkImage * get_icon (IndicatorObject * io);
+static GtkMenu * get_menu (IndicatorObject * io);
+
+G_DEFINE_TYPE (IndicatorMessages, indicator_messages, INDICATOR_OBJECT_TYPE);
+
+static void
+indicator_messages_class_init (IndicatorMessagesClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->dispose = indicator_messages_dispose;
+ object_class->finalize = indicator_messages_finalize;
+
+ IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass);
+
+ io_class->get_image = get_icon;
+ io_class->get_menu = get_menu;
+
+ return;
+}
+
+static void
+indicator_messages_init (IndicatorMessages *self)
+{
+}
+
+static void
+indicator_messages_dispose (GObject *object)
+{
+G_OBJECT_CLASS (indicator_messages_parent_class)->dispose (object);
+}
+
+static void
+indicator_messages_finalize (GObject *object)
+{
+G_OBJECT_CLASS (indicator_messages_parent_class)->finalize (object);
+}
+
+
+
+/* Functions */
static void
attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata)
{
@@ -303,14 +371,8 @@ new_launcher_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusme
return TRUE;
}
-GtkLabel *
-get_label (void)
-{
- return NULL;
-}
-
-GtkImage *
-get_icon (void)
+static GtkImage *
+get_icon (IndicatorObject * io)
{
design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
@@ -320,8 +382,8 @@ get_icon (void)
return GTK_IMAGE(main_image);
}
-GtkMenu *
-get_menu (void)
+static GtkMenu *
+get_menu (IndicatorObject * io)
{
guint returnval = 0;
GError * error = NULL;