From 1f822bf64b8891dab03937060dd47b8003bb8ab5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Oct 2009 15:28:41 -0400 Subject: Building a base object. --- libindicator/indicator-object.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 libindicator/indicator-object.h (limited to 'libindicator/indicator-object.h') diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h new file mode 100644 index 0000000..9c6c103 --- /dev/null +++ b/libindicator/indicator-object.h @@ -0,0 +1,33 @@ +#ifndef __INDICATOR_OBJECT_H__ +#define __INDICATOR_OBJECT_H__ + +#include +#include + +G_BEGIN_DECLS + +#define INDICATOR_OBJECT_TYPE (indicator_object_get_type ()) +#define INDICATOR_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_OBJECT_TYPE, IndicatorObject)) +#define INDICATOR_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) +#define IS_INDICATOR_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_OBJECT_TYPE)) +#define IS_INDICATOR_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE)) +#define INDICATOR_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) + +typedef struct _IndicatorObject IndicatorObject; +typedef struct _IndicatorObjectClass IndicatorObjectClass; + +struct _IndicatorObjectClass { + GObjectClass parent_class; + +}; + +struct _IndicatorObject { + GObject parent; + +}; + +GType indicator_object_get_type (void); + +G_END_DECLS + +#endif -- cgit v1.2.3 From b4d20eb0049cc36dbdd03754f820bd46df6e60ec Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 17:09:21 -0400 Subject: Adding a function to create an object from a file --- libindicator/indicator-object.c | 6 ++++++ libindicator/indicator-object.h | 1 + 2 files changed, 7 insertions(+) (limited to 'libindicator/indicator-object.h') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index bb154fc..00ede90 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -54,3 +54,9 @@ indicator_object_finalize (GObject *object) G_OBJECT_CLASS (indicator_object_parent_class)->finalize (object); return; } + +IndicatorObject * +indicator_object_new_from_file (const gchar * file) +{ + return NULL; +} diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index 9c6c103..fd7f470 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -27,6 +27,7 @@ struct _IndicatorObject { }; GType indicator_object_get_type (void); +IndicatorObject * indicator_object_new_from_file (const gchar * file); G_END_DECLS -- cgit v1.2.3 From 5144944dbe90e1eaf65bfeedbd6057b858880abc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 20:47:19 -0400 Subject: Adding some accessor functions for the various GTK objects. --- libindicator/indicator-object.c | 24 ++++++++++++++++++++++++ libindicator/indicator-object.h | 4 ++++ 2 files changed, 28 insertions(+) (limited to 'libindicator/indicator-object.h') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 71e72d8..38847dd 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -175,3 +175,27 @@ unrefandout: g_object_unref(object); return NULL; } + +GtkLabel * +indicator_object_get_label (IndicatorObject * io) +{ + g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); + return priv->label; +} + +GtkImage * +indicator_object_get_icon (IndicatorObject * io) +{ + g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); + return priv->icon; +} + +GtkMenu * +indicator_object_get_menu (IndicatorObject * io) +{ + g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); + return priv->menu; +} diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index fd7f470..d06355b 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -29,6 +29,10 @@ struct _IndicatorObject { GType indicator_object_get_type (void); IndicatorObject * indicator_object_new_from_file (const gchar * file); +GtkLabel * indicator_object_get_label (IndicatorObject * io); +GtkImage * indicator_object_get_icon (IndicatorObject * io); +GtkMenu * indicator_object_get_menu (IndicatorObject * io); + G_END_DECLS #endif -- cgit v1.2.3 From 755adf0afbb0b0478f6c9f3534f04f21bcdea910 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Oct 2009 16:41:34 -0500 Subject: Oh, legal headers. Fun, fun. --- libindicator/indicator-object.c | 21 +++++++++++++++++++++ libindicator/indicator-object.h | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) (limited to 'libindicator/indicator-object.h') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index e80c1d5..5921ce5 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -1,3 +1,24 @@ +/* +An interface for indicators to link to for creation. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 3.0 as published by the Free Software Foundation. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License version 3.0 for more details. + +You should have received a copy of the GNU General Public +License along with this library. If not, see +. +*/ #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index d06355b..cb01b85 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -1,3 +1,25 @@ +/* +An interface for indicators to link to for creation. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +version 3.0 as published by the Free Software Foundation. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License version 3.0 for more details. + +You should have received a copy of the GNU General Public +License along with this library. If not, see +. +*/ + #ifndef __INDICATOR_OBJECT_H__ #define __INDICATOR_OBJECT_H__ -- cgit v1.2.3 From b8db81899bc6903c7c1a21b434caaa862c29ea32 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 09:33:21 -0500 Subject: Making 'INDICATOR' the prefix for the objects. --- libindicator/indicator-object.c | 6 +++--- libindicator/indicator-object.h | 4 ++-- libindicator/indicator-service-manager.h | 4 ++-- libindicator/indicator-service.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'libindicator/indicator-object.h') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 5921ce5..ed9214c 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -246,7 +246,7 @@ unrefandout: GtkLabel * indicator_object_get_label (IndicatorObject * io) { - g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + g_return_val_if_fail(INDICATOR_IS_OBJECT(io), NULL); IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); return priv->label; } @@ -264,7 +264,7 @@ indicator_object_get_label (IndicatorObject * io) GtkImage * indicator_object_get_icon (IndicatorObject * io) { - g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + g_return_val_if_fail(INDICATOR_IS_OBJECT(io), NULL); IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); return priv->icon; } @@ -282,7 +282,7 @@ indicator_object_get_icon (IndicatorObject * io) GtkMenu * indicator_object_get_menu (IndicatorObject * io) { - g_return_val_if_fail(IS_INDICATOR_OBJECT(io), NULL); + g_return_val_if_fail(INDICATOR_IS_OBJECT(io), NULL); IndicatorObjectPrivate * priv = INDICATOR_OBJECT_GET_PRIVATE(io); return priv->menu; } diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index cb01b85..ea3f52e 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -31,8 +31,8 @@ G_BEGIN_DECLS #define INDICATOR_OBJECT_TYPE (indicator_object_get_type ()) #define INDICATOR_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_OBJECT_TYPE, IndicatorObject)) #define INDICATOR_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) -#define IS_INDICATOR_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_OBJECT_TYPE)) -#define IS_INDICATOR_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE)) +#define INDICATOR_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_OBJECT_TYPE)) +#define INDICATOR_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_OBJECT_TYPE)) #define INDICATOR_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_OBJECT_TYPE, IndicatorObjectClass)) typedef struct _IndicatorObject IndicatorObject; diff --git a/libindicator/indicator-service-manager.h b/libindicator/indicator-service-manager.h index 61c6e64..f2e4d75 100644 --- a/libindicator/indicator-service-manager.h +++ b/libindicator/indicator-service-manager.h @@ -9,8 +9,8 @@ G_BEGIN_DECLS #define INDICATOR_SERVICE_MANAGER_TYPE (indicator_service_manager_get_type ()) #define INDICATOR_SERVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManager)) #define INDICATOR_SERVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManagerClass)) -#define IS_INDICATOR_SERVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_MANAGER_TYPE)) -#define IS_INDICATOR_SERVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_MANAGER_TYPE)) +#define INDICATOR_IS_SERVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_MANAGER_TYPE)) +#define INDICATOR_IS_SERVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_MANAGER_TYPE)) #define INDICATOR_SERVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManagerClass)) typedef struct _IndicatorServiceManager IndicatorServiceManager; diff --git a/libindicator/indicator-service.h b/libindicator/indicator-service.h index 0cec28c..48f1d81 100644 --- a/libindicator/indicator-service.h +++ b/libindicator/indicator-service.h @@ -9,8 +9,8 @@ G_BEGIN_DECLS #define INDICATOR_SERVICE_TYPE (indicator_service_get_type ()) #define INDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SERVICE_TYPE, IndicatorService)) #define INDICATOR_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_SERVICE_TYPE, IndicatorServiceClass)) -#define IS_INDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_TYPE)) -#define IS_INDICATOR_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_TYPE)) +#define INDICATOR_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_TYPE)) +#define INDICATOR_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_TYPE)) #define INDICATOR_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_SERVICE_TYPE, IndicatorServiceClass)) typedef struct _IndicatorService IndicatorService; -- cgit v1.2.3