From e0e63649dc830cd63ae4e7a958e224ef3b2a1375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 30 Sep 2010 05:19:31 +0200 Subject: Redesign the library and related components. This step is needed, since the current design is quite chaotic and it would not be possible to finish the application. There's still a lot to be done. After this step, it's time to implement the rest of LdLua. --- src/ld-symbol-category.h | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'src/ld-symbol-category.h') diff --git a/src/ld-symbol-category.h b/src/ld-symbol-category.h index 42ad8ac..21286c9 100644 --- a/src/ld-symbol-category.h +++ b/src/ld-symbol-category.h @@ -27,33 +27,24 @@ G_BEGIN_DECLS ((obj), LD_SYMBOL_CATEGORY, LdSymbolCategoryClass)) typedef struct _LdSymbolCategory LdSymbolCategory; +typedef struct _LdSymbolCategoryPrivate LdSymbolCategoryPrivate; typedef struct _LdSymbolCategoryClass LdSymbolCategoryClass; /** * LdSymbolCategory: - * @parent: The parent object, may be #LdLibrary - * or another #LdSymbolCategory. - * @name: The name of the category. - * @image_path: Path to the image for this category. - * @children: Children of this category. - */ -/* TODO: Make the public fields private and set them as properties - * + implement setters and getters. On change the category - * shall emit a "changed" signal in the Library. */ struct _LdSymbolCategory { /*< private >*/ GObject parent_instance; - -/*< public >*/ - gpointer parent; - gchar *name; - gchar *image_path; - GHashTable *children; + LdSymbolCategoryPrivate *priv; }; +/* TODO: If required sometime, categories (and maybe symbols) should implement + * a "changed" signal. This can be somewhat tricky. The library might be + * a good candidate for what they call a proxy. See GtkUIManager. + */ struct _LdSymbolCategoryClass { GObjectClass parent_class; @@ -62,13 +53,20 @@ struct _LdSymbolCategoryClass GType ld_symbol_category_get_type (void) G_GNUC_CONST; -LdSymbolCategory * -ld_symbol_category_new (LdLibrary *parent); - -/* TODO: Methods for inserting and removing children. */ -/* TODO: Create a separate ld-symbol-private.h, include it in this ld-s-c.c - * and then assign and ref the parent category here. - */ +LdSymbolCategory *ld_symbol_category_new (const gchar *name); + +/* TODO: Create properties for "name" and "image_path". */ +void ld_symbol_category_set_name (LdSymbolCategory *self, const gchar *name); +const gchar *ld_symbol_category_get_name (LdSymbolCategory *self); +void ld_symbol_category_set_image_path (LdSymbolCategory *self, + const gchar *image_path); +const gchar *ld_symbol_category_get_image_path (LdSymbolCategory *self); +/* TODO: Implement. */ +void ld_symbol_category_insert_child (LdSymbolCategory *self, + GObject *child, gint pos); +void ld_symbol_category_remove_child (LdSymbolCategory *self, + GObject *child); +GSList *ld_symbol_category_get_children (LdSymbolCategory *self); G_END_DECLS -- cgit v1.2.3