From f022d796081febf634787868ddd93d5e19431786 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 17 Aug 2009 17:20:45 -0500 Subject: Getting more of a basis for Telepathy stuff --- src/Makefile.am | 2 + src/status-provider-telepathy.c | 113 ++++++++++++++++++++++++++++++++++++++++ src/status-provider-telepathy.h | 56 ++++++++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 src/status-provider-telepathy.c create mode 100644 src/status-provider-telepathy.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index a014128..dbe6d0f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,6 +31,8 @@ indicator_status_service_SOURCES = \ status-provider-pidgin.c \ status-provider-pidgin-marshal.h \ status-provider-pidgin-marshal.c \ + status-provider-telepathy.h \ + status-provider-telepathy.c \ status-provider-telepathy-marshal.h \ status-provider-telepathy-marshal.c indicator_status_service_CFLAGS = $(STATUSSERVICE_CFLAGS) -Wall -Werror diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c new file mode 100644 index 0000000..339ede3 --- /dev/null +++ b/src/status-provider-telepathy.c @@ -0,0 +1,113 @@ +/* +A small wrapper utility to load indicators and put them as menu items +into the gnome-panel using it's applet interface. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "status-provider.h" +#include "status-provider-telepathy.h" +#include "status-provider-telepathy-marshal.h" + +#include + + +typedef struct _StatusProviderTelepathyPrivate StatusProviderTelepathyPrivate; +struct _StatusProviderTelepathyPrivate { + DBusGProxy * proxy; +}; + +#define STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(o) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((o), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyPrivate)) + +/* Prototypes */ +/* GObject stuff */ +static void status_provider_telepathy_class_init (StatusProviderTelepathyClass *klass); +static void status_provider_telepathy_init (StatusProviderTelepathy *self); +static void status_provider_telepathy_dispose (GObject *object); +static void status_provider_telepathy_finalize (GObject *object); + +G_DEFINE_TYPE (StatusProviderTelepathy, status_provider_telepathy, STATUS_PROVIDER_TYPE); + +static void +status_provider_telepathy_class_init (StatusProviderTelepathyClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (StatusProviderTelepathyPrivate)); + + object_class->dispose = status_provider_telepathy_dispose; + object_class->finalize = status_provider_telepathy_finalize; + + //StatusProviderClass * spclass = STATUS_PROVIDER_CLASS(klass); + + //spclass->set_status = set_status; + //spclass->get_status = get_status; + + return; +} + + +static void +status_provider_telepathy_init (StatusProviderTelepathy *self) +{ + //StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); + + return; +} + +static void +status_provider_telepathy_dispose (GObject *object) +{ + StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(object); + + if (priv->proxy != NULL) { + g_object_unref(priv->proxy); + priv->proxy = NULL; + } + + G_OBJECT_CLASS (status_provider_telepathy_parent_class)->dispose (object); + return; +} + +static void +status_provider_telepathy_finalize (GObject *object) +{ + + G_OBJECT_CLASS (status_provider_telepathy_parent_class)->finalize (object); + return; +} + +/** + status_provider_telepathy_new: + + Creates a new #StatusProviderTelepathy object. No parameters or anything + like that. Just a convience function. + + Return value: A new instance of #StatusProviderTelepathy +*/ +StatusProvider * +status_provider_telepathy_new (void) +{ + return STATUS_PROVIDER(g_object_new(STATUS_PROVIDER_TELEPATHY_TYPE, NULL)); +} + diff --git a/src/status-provider-telepathy.h b/src/status-provider-telepathy.h new file mode 100644 index 0000000..a67ee40 --- /dev/null +++ b/src/status-provider-telepathy.h @@ -0,0 +1,56 @@ +/* +A small wrapper utility to load indicators and put them as menu items +into the gnome-panel using it's applet interface. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + +#ifndef __STATUS_PROVIDER_TELEPATHY_H__ +#define __STATUS_PROVIDER_TELEPATHY_H__ + +#include +#include + +#include "status-provider.h" + +G_BEGIN_DECLS + +#define STATUS_PROVIDER_TELEPATHY_TYPE (status_provider_telepathy_get_type ()) +#define STATUS_PROVIDER_TELEPATHY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathy)) +#define STATUS_PROVIDER_TELEPATHY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyClass)) +#define IS_STATUS_PROVIDER_TELEPATHY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STATUS_PROVIDER_TELEPATHY_TYPE)) +#define IS_STATUS_PROVIDER_TELEPATHY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STATUS_PROVIDER_TELEPATHY_TYPE)) +#define STATUS_PROVIDER_TELEPATHY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STATUS_PROVIDER_TELEPATHY_TYPE, StatusProviderTelepathyClass)) + + +typedef struct _StatusProviderTelepathyClass StatusProviderTelepathyClass; +struct _StatusProviderTelepathyClass { + StatusProviderClass parent_class; +}; + +typedef struct _StatusProviderTelepathy StatusProviderTelepathy; +struct _StatusProviderTelepathy { + StatusProvider parent; +}; + +GType status_provider_telepathy_get_type (void); +StatusProvider * status_provider_telepathy_new (void); + +G_END_DECLS + +#endif -- cgit v1.2.3