From 0575b91145b07ecc7fc861bcb8648296fbd74bb4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 3 Nov 2009 13:19:25 -0600 Subject: Redefining the interface. Now this object should get subclassed by folks. --- libindicator/indicator-object.h | 71 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 7 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h index fa6373d..6637f05 100644 --- a/libindicator/indicator-object.h +++ b/libindicator/indicator-object.h @@ -36,25 +36,82 @@ G_BEGIN_DECLS #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; - +typedef struct _IndicatorObject IndicatorObject; +typedef struct _IndicatorObjectClass IndicatorObjectClass; +typedef struct _IndicatorObjectPrivate IndicatorObjectPrivate; +typedef struct _IndicatorObjectEntry IndicatorObjectEntry; + +/** + IndicatorObjectClass: + @parent_class: #GObjectClass + @get_label: Gets the label for this object. Should be set + to #NULL if @get_entries is set. Should NOT ref the + object. + @get_image: Gets the image for this object. Should be set + to #NULL if @get_entries is set. Should NOT ref the + object. + @get_menu: Gets the image for this object. Should be set + to #NULL if @get_entries is set. Should NOT ref the + object. + @get_entires: Gets all of the entires for this object returning + a #GList of #IndicatorObjectEntries. The list should be + under the ownership of the caller but the entires will + not be. + @entry_added: Slot for #IndicatorObject::entry-added + @entry_removed: Slot for #IndicatorObject::entry-removed + @indicator_object_reserved_1: Reserved for future use + @indicator_object_reserved_2: Reserved for future use + @indicator_object_reserved_3: Reserved for future use + @indicator_object_reserved_4: Reserved for future use +*/ struct _IndicatorObjectClass { GObjectClass parent_class; - + + /* Virtual Functions */ + GtkLabel * get_label (IndicatorObject * io); + GtkImage * get_image (IndicatorObject * io); + GtkMenu * get_menu (IndicatorObject * io); + + GList * get_entries (IndicatorObject * io); + + /* Signals */ + void entry_added (IndicatorObject * io, IndicatorEntry * entry, gpointer user_data); + void entry_removed (IndicatorObject * io, IndicatorEntry * entry, gpointer user_data); + + /* Reserved */ + void (* indicator_object_reserved_1) (void); + void (* indicator_object_reserved_2) (void); + void (* indicator_object_reserved_3) (void); + void (* indicator_object_reserved_4) (void); }; +/** + IndicatorObject: + @parent: #GObject + @priv: A cached reference to the private data for the + instance. +*/ struct _IndicatorObject { GObject parent; + IndicatorObjectPrivate * priv; +}; +/** + IndicatorObjectEntry: + @label: The label to be shown on the panel + @image: The image to be shown on the panel + @menu: The menu to be added to the menubar +*/ +struct _IndicatorObjectEntry { + GtkLabel * label; + GtkImage * image; + GtkMenu * menu; }; 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); +GList * indicator_object_get_entries (IndicatorObject * io); G_END_DECLS -- cgit v1.2.3