From df0a25db8fe93989c3175b4c05e1febc14da5baa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Feb 2011 14:13:29 -0600 Subject: Use the documented API here --- libdbusmenu-gtk/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c index c2720ac..0b31069 100644 --- a/libdbusmenu-gtk/menu.c +++ b/libdbusmenu-gtk/menu.c @@ -103,7 +103,7 @@ menu_focus_cb(DbusmenuGtkMenu * menu, gpointer userdata) if (priv->client != NULL) { /* TODO: We should stop the display of the menu until the about to show call returns. */ - dbusmenu_client_send_about_to_show(DBUSMENU_CLIENT(priv->client), 0, NULL, NULL); + dbusmenu_menuitem_send_about_to_show(priv->root, NULL, NULL); } return; } -- cgit v1.2.3 From 00149bf958d0e4d05710eb261a22461905f651fc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Feb 2011 14:19:51 -0600 Subject: Ensuring we don't have an GenericMenuItem in the docs --- libdbusmenu-gtk/genericmenuitem.c | 2 +- libdbusmenu-gtk/genericmenuitem.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 2fd6fba..3652ceb 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -32,7 +32,7 @@ License version 3 and version 2.1 along with this program. If not, see #include "genericmenuitem.h" -/** +/* GenericmenuitemPrivate: @check_type: What type of check we have, or none at all. @state: What the state of our check is. diff --git a/libdbusmenu-gtk/genericmenuitem.h b/libdbusmenu-gtk/genericmenuitem.h index 3c4af0c..5e3c640 100644 --- a/libdbusmenu-gtk/genericmenuitem.h +++ b/libdbusmenu-gtk/genericmenuitem.h @@ -48,7 +48,7 @@ typedef struct _GenericmenuitemPrivate GenericmenuitemPrivate; typedef enum _GenericmenuitemCheckType GenericmenuitemCheckType; typedef enum _GenericmenuitemState GenericmenuitemState; -/** +/* GenericmenuitemClass: @parent_class: Our parent #GtkCheckMenuItemClass */ @@ -56,7 +56,7 @@ struct _GenericmenuitemClass { GtkCheckMenuItemClass parent_class; }; -/** +/* Genericmenuitem: @parent: Our parent #GtkCheckMenuItem */ -- cgit v1.2.3 From ed667bade52f8f4f4e388931eaa6b41a11cf7692 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Feb 2011 14:36:22 -0600 Subject: Fixing up the client documentation --- libdbusmenu-gtk/client.h | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/client.h b/libdbusmenu-gtk/client.h index c986a5d..75b59a0 100644 --- a/libdbusmenu-gtk/client.h +++ b/libdbusmenu-gtk/client.h @@ -41,20 +41,28 @@ G_BEGIN_DECLS #define DBUSMENU_IS_GTKCLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_GTKCLIENT_TYPE)) #define DBUSMENU_GTKCLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_GTKCLIENT_TYPE, DbusmenuGtkClientClass)) +/** + * DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED: + * + * String to attach to signal #DbusmenuClient::root-changed + */ #define DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED typedef struct _DbusmenuGtkClientPrivate DbusmenuGtkClientPrivate; /** - DbusmenuGtkClientClass: - @parent_class: #GtkMenuClass - @reserved1: Reserved for future use. - @reserved2: Reserved for future use. - @reserved3: Reserved for future use. - @reserved4: Reserved for future use. - @reserved5: Reserved for future use. - @reserved6: Reserved for future use. -*/ + * DbusmenuGtkClientClass: + * @parent_class: #GtkMenuClass + * @root_changed: Slot for signal #DbusmenuGtkClient::root-changed + * @reserved1: Reserved for future use. + * @reserved2: Reserved for future use. + * @reserved3: Reserved for future use. + * @reserved4: Reserved for future use. + * @reserved5: Reserved for future use. + * @reserved6: Reserved for future use. + * + * Functions and signal slots for using a #DbusmenuGtkClient + */ typedef struct _DbusmenuGtkClientClass DbusmenuGtkClientClass; struct _DbusmenuGtkClientClass { DbusmenuClientClass parent_class; @@ -72,9 +80,11 @@ struct _DbusmenuGtkClientClass { }; /** - DbusmenuGtkClient: - @parent: #GtkMenu -*/ + * DbusmenuGtkClient: + * + * A subclass of #DbusmenuClient to add functionality with regarding + * building GTK items out of the abstract tree. + */ typedef struct _DbusmenuGtkClient DbusmenuGtkClient; struct _DbusmenuGtkClient { DbusmenuClient parent; @@ -94,10 +104,10 @@ GtkAccelGroup * dbusmenu_gtkclient_get_accel_group (DbusmenuGtkClient * client); void dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * item, GtkMenuItem * gmi, DbusmenuMenuitem * parent); /** - SECTION:gtkmenu - @short_description: A GTK Menu Object that syncronizes over DBus + SECTION:client + @short_description: A subclass of #DbusmenuClient adding GTK level features @stability: Unstable - @include: libdbusmenu-gtk/menu.h + @include: libdbusmenu-gtk/client.h In general, this is just a #GtkMenu, why else would you care? Oh, because this menu is created by someone else on a server that exists @@ -115,8 +125,6 @@ void dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuit number of entries change, the menus change, if they change thier properties change, they update in the items. All of this should be handled transparently to the user of this object. - - TODO: Document properties. */ G_END_DECLS -- cgit v1.2.3 From f946dbac76e5f4fd1cc9a4a9ed8b4712aaf3e935 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Feb 2011 14:40:44 -0600 Subject: Fixing the dbusmenu gtk menu docs --- libdbusmenu-gtk/menu.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/menu.h b/libdbusmenu-gtk/menu.h index 896e466..c413ab8 100644 --- a/libdbusmenu-gtk/menu.h +++ b/libdbusmenu-gtk/menu.h @@ -45,15 +45,18 @@ G_BEGIN_DECLS typedef struct _DbusmenuGtkMenuPrivate DbusmenuGtkMenuPrivate; /** - DbusmenuGtkMenuClass: - @parent_class: #GtkMenuClass - @reserved1: Reserved for future use. - @reserved2: Reserved for future use. - @reserved3: Reserved for future use. - @reserved4: Reserved for future use. - @reserved5: Reserved for future use. - @reserved6: Reserved for future use. -*/ + * DbusmenuGtkMenuClass: + * @parent_class: #GtkMenuClass + * @reserved1: Reserved for future use. + * @reserved2: Reserved for future use. + * @reserved3: Reserved for future use. + * @reserved4: Reserved for future use. + * @reserved5: Reserved for future use. + * @reserved6: Reserved for future use. + * + * All of the subclassable functions and signal slots for a + * #DbusmenuGtkMenu. + */ typedef struct _DbusmenuGtkMenuClass DbusmenuGtkMenuClass; struct _DbusmenuGtkMenuClass { GtkMenuClass parent_class; @@ -68,9 +71,11 @@ struct _DbusmenuGtkMenuClass { }; /** - DbusmenuGtkMenu: - @parent: #GtkMenu -*/ + * DbusmenuGtkMenu: + * + * A #GtkMenu that is built using an abstract tree built from + * a #DbusmenuGtkClient. + */ typedef struct _DbusmenuGtkMenu DbusmenuGtkMenu; struct _DbusmenuGtkMenu { GtkMenu parent; @@ -84,7 +89,7 @@ DbusmenuGtkMenu * dbusmenu_gtkmenu_new (gchar * dbus_name, gchar * dbus_object); DbusmenuGtkClient * dbusmenu_gtkmenu_get_client (DbusmenuGtkMenu * menu); /** - SECTION:gtkmenu + SECTION:menu @short_description: A GTK Menu Object that syncronizes over DBus @stability: Unstable @include: libdbusmenu-gtk/menu.h @@ -105,8 +110,6 @@ DbusmenuGtkClient * dbusmenu_gtkmenu_get_client (DbusmenuGtkMenu * menu); number of entries change, the menus change, if they change thier properties change, they update in the items. All of this should be handled transparently to the user of this object. - - TODO: Document properties. */ G_END_DECLS -- cgit v1.2.3 From 33fa8790605ea379ccfad8fa940f92af6810feb3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 21 Feb 2011 14:52:13 -0600 Subject: Adding sections and a little bit of docs to get everything up-to-date. --- libdbusmenu-gtk/menuitem.h | 11 +++++++++++ libdbusmenu-gtk/parser.h | 14 ++++++++++++++ libdbusmenu-gtk/serializablemenuitem.h | 18 ++++++++++++++++++ 3 files changed, 43 insertions(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/menuitem.h b/libdbusmenu-gtk/menuitem.h index 6f009df..41f2187 100644 --- a/libdbusmenu-gtk/menuitem.h +++ b/libdbusmenu-gtk/menuitem.h @@ -45,6 +45,17 @@ gboolean dbusmenu_menuitem_property_set_shortcut_string (DbusmenuMenuitem * menu gboolean dbusmenu_menuitem_property_set_shortcut_menuitem (DbusmenuMenuitem * menuitem, const GtkMenuItem * gmi); void dbusmenu_menuitem_property_get_shortcut (DbusmenuMenuitem * menuitem, guint * key, GdkModifierType * modifier); +/** + SECTION:menuitem + @short_description: Helpers for #DbusmenuMenuitem properties that require a GTK dependency + @stability: Unstable + @include: libdbusmenu-gtk/menuitem.h + + Some property helpers can't be done without picking up a GTK+ + dependency. So those sit in libdbusmenu-gtk but have very similar + prototypes to the code in libdbusmenu-glib so your code will + look consistent, just with the extra depedency. +*/ G_END_DECLS #endif diff --git a/libdbusmenu-gtk/parser.h b/libdbusmenu-gtk/parser.h index a40d709..8187a8e 100644 --- a/libdbusmenu-gtk/parser.h +++ b/libdbusmenu-gtk/parser.h @@ -32,6 +32,20 @@ License version 3 and version 2.1 along with this program. If not, see #include #include +G_BEGIN_DECLS + DbusmenuMenuitem * dbusmenu_gtk_parse_menu_structure (GtkWidget * widget); +/** + SECTION:parser + @short_description: A parser of in-memory GTK menu trees + @stability: Unstable + @include: libdbusmenu-gtk/parser.h + + The parser will take a GTK menu tree and attach it to a Dbusmenu menu + tree. Along with setting up all the signals for updates and destruction. + The returned item would be the root item of the given tree. +*/ +G_END_DECLS + #endif /* DBUSMENU_GTK_PARSER_H__ */ diff --git a/libdbusmenu-gtk/serializablemenuitem.h b/libdbusmenu-gtk/serializablemenuitem.h index db28a24..9bea89f 100644 --- a/libdbusmenu-gtk/serializablemenuitem.h +++ b/libdbusmenu-gtk/serializablemenuitem.h @@ -44,6 +44,11 @@ G_BEGIN_DECLS #define DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_GTK_SERIALIZABLE_MENU_ITEM)) #define DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_GTK_SERIALIZABLE_MENU_ITEM, DbusmenuGtkSerializableMenuItemClass)) +/** + * DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM: + * + * String to access property #DbusmenuGtkSerializableMenuItem:dbusmenu-menuitem + */ #define DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM "dbusmenu-menuitem" typedef struct _DbusmenuGtkSerializableMenuItem DbusmenuGtkSerializableMenuItem; @@ -62,6 +67,8 @@ typedef struct _DbusmenuGtkSerializableMenuItemPrivate DbusmenuGtkSerializableMe @_dbusmenu_gtk_serializable_menu_item_reserved4: Reserved for future use. @_dbusmenu_gtk_serializable_menu_item_reserved5: Reserved for future use. @_dbusmenu_gtk_serializable_menu_item_reserved6: Reserved for future use. + + Signals and functions for #DbusmenuGtkSerializableMenuItem. */ struct _DbusmenuGtkSerializableMenuItemClass { GtkMenuItemClass parent_class; @@ -110,6 +117,17 @@ DbusmenuMenuitem * dbusmenu_gtk_serializable_menu_item_build_menuitem (Dbusmenu void dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, GType item_type); void dbusmenu_gtk_serializable_menu_item_set_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi); +/** + SECTION:serializablemenuitem + @short_description: A way to build #GtkMenuItems that can be sent over Dbusmenu + @stability: Unstable + @include: libdbusmenu-gtk/serializablemenuitem.h + + Menuitems can subclass from this instead of #GtkMenuItem and + by providing the appropriate functions Dbusmenu will be able + to parse them and send them over the bus. +*/ + G_END_DECLS #endif -- cgit v1.2.3