diff options
author | Ted Gould <ted@gould.cx> | 2011-02-24 08:18:59 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-24 08:18:59 -0600 |
commit | 7f25511b0a3182b27a42f1ffb1858b94615575ca (patch) | |
tree | 28f02ed5092ac0c18d5d82f9a6ff27bc23be6384 | |
parent | 59469d1643fdc81563544da189bf773fe1b80367 (diff) | |
parent | c1506b101d22d01dad63da90683e9a13a4e2dac0 (diff) | |
download | libdbusmenu-7f25511b0a3182b27a42f1ffb1858b94615575ca.tar.gz libdbusmenu-7f25511b0a3182b27a42f1ffb1858b94615575ca.tar.bz2 libdbusmenu-7f25511b0a3182b27a42f1ffb1858b94615575ca.zip |
Fix up documentation and make it part of make check
24 files changed, 592 insertions, 98 deletions
diff --git a/docs/libdbusmenu-glib/reference/Makefile.am b/docs/libdbusmenu-glib/reference/Makefile.am index e8a3610..1c8dfa8 100644 --- a/docs/libdbusmenu-glib/reference/Makefile.am +++ b/docs/libdbusmenu-glib/reference/Makefile.am @@ -48,11 +48,12 @@ CFILE_GLOB=$(top_srcdir)/libdbusmenu-glib/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= \ + dbus-menu-clean.xml.h \ + client-menuitem.h \ + client-private.h \ menuitem-marshal.h \ server-marshal.h \ - menuitem-private.h \ - dbusmenu-client.h \ - dbusmenu-server.h + menuitem-private.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png @@ -88,5 +89,13 @@ EXTRA_DIST += version.xml.in #DISTCLEANFILES += # Comment this out if you want your docs-status tested during 'make check' -#TESTS = $(GTKDOC_CHECK) +TESTS = gtkdoc-in-srcdir + +gtkdoc-in-srcdir: Makefile.am + @echo "#!/bin/sh" > $@ + @echo "cd \"$(srcdir)\"" >> $@ + @echo "$(GTKDOC_CHECK)" >> $@ + @chmod +x $@ + +DISTCLEANFILES = gtkdoc-in-srcdir diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml index ecc25a3..16ed624 100644 --- a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml +++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-docs.sgml @@ -28,6 +28,10 @@ <title>API Index</title> <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> </index> + <index id="api-index-deprecated"> + <title>Deprecated API Index</title> + <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> + </index> <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> </book> diff --git a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt index 0186049..b6a6902 100644 --- a/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt +++ b/docs/libdbusmenu-glib/reference/libdbusmenu-glib-sections.txt @@ -4,6 +4,8 @@ DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM +DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT +DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE DBUSMENU_CLIENT_PROP_DBUS_NAME DBUSMENU_CLIENT_PROP_DBUS_OBJECT DBUSMENU_CLIENT_TYPES_DEFAULT @@ -12,19 +14,21 @@ DBUSMENU_CLIENT_TYPES_IMAGE DbusmenuClient DbusmenuClientClass DbusmenuClientTypeHandler +DbusmenuClientTypeDestroyHandler dbusmenu_client_new dbusmenu_client_get_root dbusmenu_client_add_type_handler -dbusmenu_client_send_event -dbusmenu_client_send_about_to_show +dbusmenu_client_add_type_handler_full <SUBSECTION Standard> DBUSMENU_CLIENT DBUSMENU_IS_CLIENT DBUSMENU_TYPE_CLIENT -dbusmenu_client_get_type DBUSMENU_CLIENT_CLASS DBUSMENU_IS_CLIENT_CLASS DBUSMENU_CLIENT_GET_CLASS +<SUBSECTION Private> +DbusmenuClientPrivate +dbusmenu_client_get_type </SECTION> <SECTION> @@ -37,6 +41,8 @@ DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED DBUSMENU_MENUITEM_SIGNAL_REALIZED DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID +DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW +DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER DBUSMENU_MENUITEM_PROP_TYPE DBUSMENU_MENUITEM_PROP_VISIBLE DBUSMENU_MENUITEM_PROP_ENABLED @@ -46,6 +52,7 @@ DBUSMENU_MENUITEM_PROP_ICON_DATA DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE DBUSMENU_MENUITEM_PROP_TOGGLE_STATE DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY +DBUSMENU_MENUITEM_PROP_SHORTCUT DBUSMENU_MENUITEM_TOGGLE_CHECK DBUSMENU_MENUITEM_TOGGLE_RADIO DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED @@ -53,9 +60,13 @@ DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN DBUSMENU_MENUITEM_ICON_NAME_BLANK DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU +DBUSMENU_MENUITEM_SHORTCUT_ALT +DBUSMENU_MENUITEM_SHORTCUT_CONTROL +DBUSMENU_MENUITEM_SHORTCUT_SHIFT +DBUSMENU_MENUITEM_SHORTCUT_SUPER DbusmenuMenuitem dbusmenu_menuitem_about_to_show_cb -dbusmenu_menuitem_buildxml_slot_t +dbusmenu_menuitem_buildvariant_slot_t DbusmenuMenuitemClass dbusmenu_menuitem_new dbusmenu_menuitem_new_with_id @@ -72,13 +83,13 @@ dbusmenu_menuitem_child_reorder dbusmenu_menuitem_child_find dbusmenu_menuitem_find_id dbusmenu_menuitem_property_set -dbusmenu_menuitem_property_set_value dbusmenu_menuitem_property_set_bool dbusmenu_menuitem_property_set_int +dbusmenu_menuitem_property_set_variant dbusmenu_menuitem_property_get -dbusmenu_menuitem_property_get_value dbusmenu_menuitem_property_get_bool dbusmenu_menuitem_property_get_int +dbusmenu_menuitem_property_get_variant dbusmenu_menuitem_property_exist dbusmenu_menuitem_properties_list dbusmenu_menuitem_properties_copy @@ -88,14 +99,17 @@ dbusmenu_menuitem_get_root dbusmenu_menuitem_foreach dbusmenu_menuitem_handle_event dbusmenu_menuitem_send_about_to_show +dbusmenu_menuitem_show_to_user <SUBSECTION Standard> DBUSMENU_MENUITEM DBUSMENU_IS_MENUITEM DBUSMENU_TYPE_MENUITEM -dbusmenu_menuitem_get_type DBUSMENU_MENUITEM_CLASS DBUSMENU_IS_MENUITEM_CLASS DBUSMENU_MENUITEM_GET_CLASS +<SUBSECTION Private> +DbusmenuMenuitemPrivate +dbusmenu_menuitem_get_type </SECTION> <SECTION> @@ -105,6 +119,7 @@ DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE DBUSMENU_SERVER_SIGNAL_ID_UPDATE DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE +DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION DBUSMENU_SERVER_PROP_DBUS_OBJECT DBUSMENU_SERVER_PROP_ROOT_NODE DBUSMENU_SERVER_PROP_VERSION @@ -116,26 +131,12 @@ dbusmenu_server_set_root DBUSMENU_SERVER DBUSMENU_IS_SERVER DBUSMENU_TYPE_SERVER -dbusmenu_server_get_type DBUSMENU_SERVER_CLASS DBUSMENU_IS_SERVER_CLASS DBUSMENU_SERVER_GET_CLASS -</SECTION> - -<SECTION> -<FILE>client-menuitem</FILE> -<TITLE>DbusmenuClientMenuitem</TITLE> -DBUSMENU_CLIENT_MENUITEM_TYPE -DbusmenuClientMenuitem -DbusmenuClientMenuitemClass -dbusmenu_client_menuitem_new -<SUBSECTION Standard> -DBUSMENU_CLIENT_MENUITEM -DBUSMENU_IS_CLIENT_MENUITEM -dbusmenu_client_menuitem_get_type -DBUSMENU_CLIENT_MENUITEM_CLASS -DBUSMENU_IS_CLIENT_MENUITEM_CLASS -DBUSMENU_CLIENT_MENUITEM_GET_CLASS +<SUBSECTION Private> +DbusmenuServerPrivate +dbusmenu_server_get_type </SECTION> <SECTION> @@ -149,9 +150,11 @@ dbusmenu_menuitem_proxy_get_wrapped DBUSMENU_MENUITEM_PROXY DBUSMENU_IS_MENUITEM_PROXY DBUSMENU_TYPE_MENUITEM_PROXY -dbusmenu_menuitem_proxy_get_type DBUSMENU_MENUITEM_PROXY_CLASS DBUSMENU_IS_MENUITEM_PROXY_CLASS DBUSMENU_MENUITEM_PROXY_GET_CLASS +<SUBSECTION Private> +DbusmenuMenuitemProxyPrivate +dbusmenu_menuitem_proxy_get_type </SECTION> diff --git a/docs/libdbusmenu-gtk/reference/Makefile.am b/docs/libdbusmenu-gtk/reference/Makefile.am index 191d68e..06d0009 100644 --- a/docs/libdbusmenu-gtk/reference/Makefile.am +++ b/docs/libdbusmenu-gtk/reference/Makefile.am @@ -16,7 +16,7 @@ AUTOMAKE_OPTIONS = 1.6 # of using the various options. # The name of the module, e.g. 'glib'. -DOC_MODULE=libdbusmenu-gtk$(VER) +DOC_MODULE=libdbusmenu-gtk # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml @@ -90,5 +90,12 @@ EXTRA_DIST += version.xml.in #DISTCLEANFILES += # Comment this out if you want your docs-status tested during 'make check' -#TESTS = $(GTKDOC_CHECK) +TESTS = gtkdoc-in-srcdir +gtkdoc-in-srcdir: Makefile.am + @echo "#!/bin/sh" > $@ + @echo "cd \"$(srcdir)\"" >> $@ + @echo "$(GTKDOC_CHECK)" >> $@ + @chmod +x $@ + +DISTCLEANFILES = gtkdoc-in-srcdir diff --git a/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml index ec6b82f..e9020de 100644 --- a/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml +++ b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-docs.sgml @@ -11,9 +11,10 @@ <chapter> <title>API</title> - <xi:include href="xml/menu.xml"/> - <xi:include href="xml/client.xml"/> + <xi:include href="xml/menu.xml"/> <xi:include href="xml/menuitem.xml"/> + <xi:include href="xml/client.xml"/> + <xi:include href="xml/parser.xml"/> <xi:include href="xml/serializablemenuitem.xml"/> </chapter> @@ -25,6 +26,10 @@ <title>API Index</title> <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> </index> + <index id="api-index-deprecated"> + <title>Deprecated API Index</title> + <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> + </index> <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> </book> diff --git a/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-sections.txt b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-sections.txt new file mode 100644 index 0000000..77101f7 --- /dev/null +++ b/docs/libdbusmenu-gtk/reference/libdbusmenu-gtk-sections.txt @@ -0,0 +1,77 @@ +<SECTION> +<FILE>client</FILE> +<TITLE>DbusmenuGtkClient</TITLE> +DBUSMENU_GTKCLIENT_SIGNAL_ROOT_CHANGED +DbusmenuGtkClient +DbusmenuGtkClientClass +dbusmenu_gtkclient_new +dbusmenu_gtkclient_menuitem_get +dbusmenu_gtkclient_menuitem_get_submenu +dbusmenu_gtkclient_set_accel_group +dbusmenu_gtkclient_get_accel_group +dbusmenu_gtkclient_newitem_base +<SUBSECTION Standard> +DBUSMENU_GTKCLIENT +DBUSMENU_IS_GTKCLIENT +DBUSMENU_GTKCLIENT_CLASS +DBUSMENU_IS_GTKCLIENT_CLASS +DBUSMENU_GTKCLIENT_GET_CLASS +<SUBSECTION Private> +DBUSMENU_GTKCLIENT_TYPE +dbusmenu_gtkclient_get_type +DbusmenuGtkClientPrivate +</SECTION> + +<SECTION> +<FILE>serializablemenuitem</FILE> +<TITLE>DbusmenuGtkSerializableMenuItem</TITLE> +DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_PROP_MENUITEM +DbusmenuGtkSerializableMenuItemClass +dbusmenu_gtk_serializable_menu_item_build_menuitem +dbusmenu_gtk_serializable_menu_item_register_to_client +dbusmenu_gtk_serializable_menu_item_set_menuitem +<SUBSECTION Standard> +DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM +DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM +DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_CLASS +DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM_CLASS +DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM_GET_CLASS +<SUBSECTION Private> +DBUSMENU_TYPE_GTK_SERIALIZABLE_MENU_ITEM +dbusmenu_gtk_serializable_menu_item_get_type +DbusmenuGtkSerializableMenuItemPrivate +</SECTION> + +<SECTION> +<FILE>menu</FILE> +<TITLE>DbusmenuGtkMenu</TITLE> +DbusmenuGtkMenuClass +dbusmenu_gtkmenu_new +dbusmenu_gtkmenu_get_client +<SUBSECTION Standard> +DBUSMENU_GTKMENU +DBUSMENU_IS_GTKMENU +DBUSMENU_GTKMENU_CLASS +DBUSMENU_IS_GTKMENU_CLASS +DBUSMENU_GTKMENU_GET_CLASS +<SUBSECTION Private> +dbusmenu_gtkmenu_get_type +DBUSMENU_GTKMENU_TYPE +DbusmenuGtkMenuPrivate +</SECTION> + +<SECTION> +<FILE>menuitem</FILE> +dbusmenu_menuitem_property_set_image +dbusmenu_menuitem_property_get_image +dbusmenu_menuitem_property_set_shortcut +dbusmenu_menuitem_property_set_shortcut_string +dbusmenu_menuitem_property_set_shortcut_menuitem +dbusmenu_menuitem_property_get_shortcut +</SECTION> + +<SECTION> +<FILE>parser</FILE> +dbusmenu_gtk_parse_menu_structure +</SECTION> + diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 5ddbeb8..dd4c354 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -41,6 +41,7 @@ libdbusmenu_glib_la_SOURCES = \ client-marshal.c \ client-menuitem.h \ client-menuitem.c \ + client-private.h \ client.h \ client.c diff --git a/libdbusmenu-glib/client-menuitem.c b/libdbusmenu-glib/client-menuitem.c index 0f14b85..60f8637 100644 --- a/libdbusmenu-glib/client-menuitem.c +++ b/libdbusmenu-glib/client-menuitem.c @@ -30,6 +30,7 @@ License version 3 and version 2.1 along with this program. If not, see #endif #include "client-menuitem.h" +#include "client-private.h" typedef struct _DbusmenuClientMenuitemPrivate DbusmenuClientMenuitemPrivate; @@ -39,7 +40,7 @@ struct _DbusmenuClientMenuitemPrivate }; #define DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_CLIENT_MENUITEM_TYPE, DbusmenuClientMenuitemPrivate)) +(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT_MENUITEM, DbusmenuClientMenuitemPrivate)) static void dbusmenu_client_menuitem_class_init (DbusmenuClientMenuitemClass *klass); static void dbusmenu_client_menuitem_init (DbusmenuClientMenuitem *self); @@ -94,7 +95,7 @@ dbusmenu_client_menuitem_finalize (GObject *object) DbusmenuClientMenuitem * dbusmenu_client_menuitem_new (gint id, DbusmenuClient * client) { - DbusmenuClientMenuitem * mi = g_object_new(DBUSMENU_CLIENT_MENUITEM_TYPE, "id", id, NULL); + DbusmenuClientMenuitem * mi = g_object_new(DBUSMENU_TYPE_CLIENT_MENUITEM, "id", id, NULL); DbusmenuClientMenuitemPrivate * priv = DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(mi); priv->client = client; return mi; diff --git a/libdbusmenu-glib/client-menuitem.h b/libdbusmenu-glib/client-menuitem.h index ef61213..a89cb11 100644 --- a/libdbusmenu-glib/client-menuitem.h +++ b/libdbusmenu-glib/client-menuitem.h @@ -35,12 +35,12 @@ License version 3 and version 2.1 along with this program. If not, see G_BEGIN_DECLS -#define DBUSMENU_CLIENT_MENUITEM_TYPE (dbusmenu_client_menuitem_get_type ()) -#define DBUSMENU_CLIENT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUSMENU_CLIENT_MENUITEM_TYPE, DbusmenuClientMenuitem)) -#define DBUSMENU_CLIENT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUSMENU_CLIENT_MENUITEM_TYPE, DbusmenuClientMenuitemClass)) -#define DBUSMENU_IS_CLIENT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUSMENU_CLIENT_MENUITEM_TYPE)) -#define DBUSMENU_IS_CLIENT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_CLIENT_MENUITEM_TYPE)) -#define DBUSMENU_CLIENT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_CLIENT_MENUITEM_TYPE, DbusmenuClientMenuitemClass)) +#define DBUSMENU_TYPE_CLIENT_MENUITEM (dbusmenu_client_menuitem_get_type ()) +#define DBUSMENU_CLIENT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUSMENU_TYPE_CLIENT_MENUITEM, DbusmenuClientMenuitem)) +#define DBUSMENU_CLIENT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUSMENU_TYPE_CLIENT_MENUITEM, DbusmenuClientMenuitemClass)) +#define DBUSMENU_IS_CLIENT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUSMENU_TYPE_CLIENT_MENUITEM)) +#define DBUSMENU_IS_CLIENT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_CLIENT_MENUITEM)) +#define DBUSMENU_CLIENT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_CLIENT_MENUITEM, DbusmenuClientMenuitemClass)) typedef struct _DbusmenuClientMenuitem DbusmenuClientMenuitem; typedef struct _DbusmenuClientMenuitemClass DbusmenuClientMenuitemClass; diff --git a/libdbusmenu-glib/client-private.h b/libdbusmenu-glib/client-private.h new file mode 100644 index 0000000..f6df372 --- /dev/null +++ b/libdbusmenu-glib/client-private.h @@ -0,0 +1,48 @@ +/* +A library to communicate a menu object set accross DBus and +track updates and maintain consistency. + +Copyright 2011 Canonical Ltd. + +Authors: + Ted Gould <ted@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of either or both of the following licenses: + +1) the GNU Lesser General Public License version 3, as published by the +Free Software Foundation; and/or +2) the GNU Lesser General Public License version 2.1, 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 applicable version of the GNU Lesser General Public +License for more details. + +You should have received a copy of both the GNU Lesser General Public +License version 3 and version 2.1 along with this program. If not, see +<http://www.gnu.org/licenses/> +*/ + +#ifndef __DBUSMENU_CLIENT_PRIVATE_H__ +#define __DBUSMENU_CLIENT_PRIVATE_H__ + +#include "client.h" + +G_BEGIN_DECLS + +void dbusmenu_client_send_event (DbusmenuClient * client, + gint id, + const gchar * name, + GVariant * variant, + guint timestamp); +void dbusmenu_client_send_about_to_show(DbusmenuClient * client, + gint id, + void (*cb) (gpointer user_data), + gpointer cb_data); + +G_END_DECLS + +#endif diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 0848294..ee1186b 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -33,6 +33,7 @@ License version 3 and version 2.1 along with this program. If not, see #include <gio/gio.h> #include "client.h" +#include "client-private.h" #include "menuitem.h" #include "menuitem-private.h" #include "client-menuitem.h" diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 79c0ee2..7bb0e6a 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -43,17 +43,71 @@ G_BEGIN_DECLS #define DBUSMENU_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_CLIENT)) #define DBUSMENU_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_CLIENT, DbusmenuClientClass)) +/** + * DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED: + * + * String to attach to signal #DbusmenuClient::layout-updated + */ #define DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED "layout-updated" +/** + * DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED: + * + * String to attach to signal #DbusmenuClient::root-changed + */ #define DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED "root-changed" +/** + * DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM: + * + * String to attach to signal #DbusmenuClient::new-menuitem + */ #define DBUSMENU_CLIENT_SIGNAL_NEW_MENUITEM "new-menuitem" +/** + * DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE: + * + * String to attach to signal #DbusmenuClient::item-activate + */ #define DBUSMENU_CLIENT_SIGNAL_ITEM_ACTIVATE "item-activate" +/** + * DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT: + * + * String to attach to signal #DbusmenuClient::event-result + */ #define DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT "event-result" +/** + * DBUSMENU_CLIENT_PROP_DBUS_NAME: + * + * String to access property #DbusmenuClient:dbus-name + */ #define DBUSMENU_CLIENT_PROP_DBUS_NAME "dbus-name" +/** + * DBUSMENU_CLIENT_PROP_DBUS_OBJECT: + * + * String to access property #DbusmenuClient:dbus-object + */ #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object" +/** + * DBUSMENU_CLIENT_TYPES_DEFAULT: + * + * Used to set the 'type' property on a menu item to create + * a standard menu item. + */ #define DBUSMENU_CLIENT_TYPES_DEFAULT "standard" +/** + * DBUSMENU_CLIENT_TYPES_SEPARATOR: + * + * Used to set the 'type' property on a menu item to create + * a separator menu item. + */ #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" +/** + * DBUSMENU_CLIENT_TYPES_IMAGE: + * + * Used to set the 'type' property on a menu item to create + * an image menu item. Deprecated as standard menu items now + * support images as well. + */ #define DBUSMENU_CLIENT_TYPES_IMAGE "standard" typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; @@ -62,6 +116,7 @@ typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; DbusmenuClientClass: @parent_class: #GObjectClass @layout_updated: Slot for #DbusmenuClient::layout-updated. + @root_changed: Slot for #DbusmenuClient::root-changed. @new_menuitem: Slot for #DbusmenuClient::new-menuitem. @item_activate: Slot for #DbusmenuClient::item-activate. @event_result: Slot for #DbusmenuClient::event-error. @@ -97,7 +152,6 @@ struct _DbusmenuClientClass { /** DbusmenuClient: - @parent: #GObject. The client for a #DbusmenuServer creating a shared object set of #DbusmenuMenuitem objects. @@ -119,6 +173,9 @@ struct _DbusmenuClient { The type handler is called when a dbusmenu item is created with a matching type as setup in #dbusmenu_client_add_type_handler + + Return value: #TRUE if the type has been handled. #FALSE if this + function was somehow unable to handle it. */ typedef gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client, gpointer user_data); @@ -146,15 +203,6 @@ gboolean dbusmenu_client_add_type_handler_full (DbusmenuClient * cli DbusmenuClientTypeHandler newfunc, gpointer user_data, DbusmenuClientTypeDestroyHandler destroy_func); -void dbusmenu_client_send_event (DbusmenuClient * client, - gint id, - const gchar * name, - GVariant * variant, - guint timestamp); -void dbusmenu_client_send_about_to_show(DbusmenuClient * client, - gint id, - void (*cb) (gpointer user_data), - gpointer cb_data); /** SECTION:client diff --git a/libdbusmenu-glib/menuitem-proxy.h b/libdbusmenu-glib/menuitem-proxy.h index 2a22efe..ee988d8 100644 --- a/libdbusmenu-glib/menuitem-proxy.h +++ b/libdbusmenu-glib/menuitem-proxy.h @@ -67,8 +67,7 @@ struct _DbusmenuMenuitemProxyClass { }; /** - DbusmeneMenuitemProxy: - @parent: The instance of #DbusmenuMenuitem + DbusmenuMenuitemProxy: Public instance data for a #DbusmenuMenuitemProxy. */ @@ -83,6 +82,17 @@ GType dbusmenu_menuitem_proxy_get_type (void); DbusmenuMenuitemProxy * dbusmenu_menuitem_proxy_new (DbusmenuMenuitem * mi); DbusmenuMenuitem * dbusmenu_menuitem_proxy_get_wrapped (DbusmenuMenuitemProxy * pmi); +/** + * SECTION:menuitem-proxy + * @short_description: A menuitem that proxies from another menuitem + * @stability: Unstable + * @include: libdbusmenu-glib/menuitem-proxy.h + * + * This small object allows for proxying all the properties from a remote + * menuitem to a new object that can be moved around appropriately within + * the new menu structure. + */ + G_END_DECLS #endif diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index f7e4716..26dad62 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1213,7 +1213,7 @@ dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * propert /** - * dbusmenu_menuitem_property_exit: + * dbusmenu_menuitem_property_exist: * @mi: The #DbusmenuMenuitem to look for the property on. * @property: The property to look for. * diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index afd6084..4a1c156 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -42,47 +42,231 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemClass)) +/** + * DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED: + * + * String to attach to signal #DbusmenuServer::property-changed + */ #define DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED "property-changed" +/** + * DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED: + * + * String to attach to signal #DbusmenuServer::item-activated + */ #define DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED "item-activated" +/** + * DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED: + * + * String to attach to signal #DbusmenuServer::child-added + */ #define DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED "child-added" +/** + * DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED: + * + * String to attach to signal #DbusmenuServer::child-removed + */ #define DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED "child-removed" +/** + * DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED: + * + * String to attach to signal #DbusmenuServer::child-moved + */ #define DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED "child-moved" +/** + * DBUSMENU_MENUITEM_SIGNAL_REALIZED: + * + * String to attach to signal #DbusmenuServer::realized + */ #define DBUSMENU_MENUITEM_SIGNAL_REALIZED "realized" +/** + * DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID: + * + * ID to attach to signal #DbusmenuServer::realized + */ #define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM)) +/** + * DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER: + * + * String to attach to signal #DbusmenuServer::show-to-user + */ #define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user" +/** + * DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW: + * + * String to attach to signal #DbusmenuServer::about-to-show + */ #define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW "about-to-show" +/** + * DBUSMENU_MENUITEM_PROP_TYPE: + * + * #DbusmenuMenuitem property used to represent what type of menuitem + * this object represents. Type: #G_VARIANT_TYPE_STRING. + */ #define DBUSMENU_MENUITEM_PROP_TYPE "type" +/** + * DBUSMENU_MENUITEM_PROP_VISIBLE: + * + * #DbusmenuMenuitem property used to represent whether the menuitem + * should be shown or not. Type: #G_VARIANT_TYPE_BOOLEAN. + */ #define DBUSMENU_MENUITEM_PROP_VISIBLE "visible" +/** + * DBUSMENU_MENUITEM_PROP_ENABLED: + * + * #DbusmenuMenuitem property used to represent whether the menuitem + * is clickable or not. Type: #G_VARIANT_TYPE_BOOLEAN. + */ #define DBUSMENU_MENUITEM_PROP_ENABLED "enabled" +/** + * DBUSMENU_MENUITEM_PROP_LABEL: + * + * #DbusmenuMenuitem property used for the text on the menu item. + * Type: #G_VARIANT_TYPE_STRING + */ #define DBUSMENU_MENUITEM_PROP_LABEL "label" +/** + * DBUSMENU_MENUITEM_PROP_ICON_NAME: + * + * #DbusmenuMenuitem property that is the name of the icon under the + * Freedesktop.org icon naming spec. Type: #G_VARIANT_TYPE_STRING + */ #define DBUSMENU_MENUITEM_PROP_ICON_NAME "icon-name" +/** + * DBUSMENU_MENUITEM_PROP_ICON_DATA: + * + * #DbusmenuMenuitem property that is the raw data of a custom icon + * used in the application. Type: #G_VARIANT_TYPE_VARIANT + * + * It is recommended that this is not set directly but instead the + * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_image() + */ #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data" +/** + * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE: + * + * #DbusmenuMenuitem property that says what type of toggle entry should + * be shown in the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_CHECK + * or #DBUSMENU_MENUITEM_TOGGLE_RADIO. Type: #G_VARIANT_TYPE_STRING + */ #define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE "toggle-type" +/** + * DBUSMENU_MENUITEM_PROP_TOGGLE_STATE: + * + * #DbusmenuMenuitem property that says what state a toggle entry should + * be shown as the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED + * #DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED or #DBUSMENU_MENUITEM_TOGGLE_STATUE_UNKNOWN. + * Type: #G_VARIANT_TYPE_INT32 + */ #define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE "toggle-state" +/** + * DBUSMENU_MENUITEM_PROP_SHORTCUT: + * + * #DbusmenuMenuitem property that is the entries that represent a shortcut + * to activate the menuitem. It is an array of arrays of strings. + * Type: #G_VARIANT_TYPE_ARRAY + * + * It is recommended that this is not set directly but instead the + * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_shortcut() + */ #define DBUSMENU_MENUITEM_PROP_SHORTCUT "shortcut" +/** + * DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY: + * + * #DbusmenuMenuitem property that tells how the children of this menuitem + * should be displayed. Most likely this will be unset or of the value + * #DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU. Type: #G_VARIANT_TYPE_STRING + */ #define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY "children-display" +/** + * DBUSMENU_MENUITEM_TOGGLE_CHECK: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard + * check mark item. + */ #define DBUSMENU_MENUITEM_TOGGLE_CHECK "checkmark" +/** + * DBUSMENU_MENUITEM_TOGGLE_RADIO: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard + * radio item. + */ #define DBUSMENU_MENUITEM_TOGGLE_RADIO "radio" +/** + * DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's + * toggle item is empty. + */ #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED 0 +/** + * DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's + * toggle item is filled. + */ #define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED 1 +/** + * DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's + * toggle item is undecided. + */ #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN -1 +/** + * DBUSMENU_MENUITEM_ICON_NAME_BLANK: + * + * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's + * toggle item is undecided. + */ #define DBUSMENU_MENUITEM_ICON_NAME_BLANK "blank-icon" +/** + * DBUSMENU_MENUITEM_SHORTCUT_CONTROL: + * + * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the + * control key. + */ #define DBUSMENU_MENUITEM_SHORTCUT_CONTROL "Control" +/** + * DBUSMENU_MENUITEM_SHORTCUT_ALT: + * + * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the + * alternate key. + */ #define DBUSMENU_MENUITEM_SHORTCUT_ALT "Alt" +/** + * DBUSMENU_MENUITEM_SHORTCUT_SHIFT: + * + * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the + * shift key. + */ #define DBUSMENU_MENUITEM_SHORTCUT_SHIFT "Shift" +/** + * DBUSMENU_MENUITEM_SHORTCUT_SUPER: + * + * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the + * super key. + */ #define DBUSMENU_MENUITEM_SHORTCUT_SUPER "Super" +/** + * DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU: + * + * Used in #DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY to have the + * subitems displayed as a submenu. + */ #define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU "submenu" typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate; /** * DbusmenuMenuitem: + * @parent: Parent object + * @priv: Private data * * This is the #GObject based object that represents a menu * item. It gets created the same on both the client and @@ -113,16 +297,18 @@ typedef void (*dbusmenu_menuitem_about_to_show_cb) (DbusmenuMenuitem * mi, gpoin /** * dbusmenu_menuitem_buildvariant_slot_t: * @mi: (in): Menu item that should be built from + * @properties: (allow-none): A list of properties that should be the only ones in the resulting variant structure * * This is the function that is called to represent this menu item * as a variant. Should call it's own children. * - * Return value: (transfer full) A variant representing this item and it's children + * Return value: (transfer full): A variant representing this item and it's children */ typedef GVariant * (*dbusmenu_menuitem_buildvariant_slot_t) (DbusmenuMenuitem * mi, gchar ** properties); /** * DbusmenuMenuitemClass: + * @parent_class: Functions and signals from our parent * @property_changed: Slot for #DbusmenuMenuitem::property-changed. * @item_activated: Slot for #DbusmenuMenuitem::item-activated. * @child_added: Slot for #DbusmenuMenuitem::child-added. @@ -130,17 +316,19 @@ typedef GVariant * (*dbusmenu_menuitem_buildvariant_slot_t) (DbusmenuMenuitem * * @child_moved: Slot for #DbusmenuMenuitem::child-moved. * @realized: Slot for #DbusmenuMenuitem::realized. * @about_to_show: Slot for #DbusmenuMenuitem::about-to-show. - * @buildxml: Virtual function that appends the strings required to represent this menu item in the menu XML file. + * @buildvariant: Virtual function that appends the strings required to represent this menu item in the menu variant. * @handle_event: This function is to override how events are handled by subclasses. Look at #dbusmenu_menuitem_handle_event for lots of good information. * @send_about_to_show: Virtual function that notifies server that the client is about to show a menu. * @show_to_user: Slot for #DbusmenuMenuitem::show-to-user. - * * @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 signals that every menuitem should know something + * about. */ typedef struct _DbusmenuMenuitemClass DbusmenuMenuitemClass; struct _DbusmenuMenuitemClass diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index 5668258..11ce085 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -43,14 +43,54 @@ G_BEGIN_DECLS #define DBUSMENU_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_SERVER)) #define DBUSMENU_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_SERVER, DbusmenuServerClass)) +/** + * DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE: + * + * String to attach to signal #DbusmenuServer::item-property-updated + */ #define DBUSMENU_SERVER_SIGNAL_ID_PROP_UPDATE "item-property-updated" +/** + * DBUSMENU_SERVER_SIGNAL_ID_UPDATE: + * + * String to attach to signal #DbusmenuServer::item-updated + */ #define DBUSMENU_SERVER_SIGNAL_ID_UPDATE "item-updated" +/** + * DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED: + * + * String to attach to signal #DbusmenuServer::layout-updated + */ #define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED "layout-updated" +/** + * DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION: + * + * String to attach to signal #DbusmenuServer::item-activation-requested + */ #define DBUSMENU_SERVER_SIGNAL_ITEM_ACTIVATION "item-activation-requested" +/** + * DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE: + * + * String to attach to signal #DbusmenuServer::layout-updated + */ #define DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATE DBUSMENU_SERVER_SIGNAL_LAYOUT_UPDATED +/** + * DBUSMENU_SERVER_PROP_DBUS_OBJECT: + * + * String to access property #DbusmenuServer:dbus-object + */ #define DBUSMENU_SERVER_PROP_DBUS_OBJECT "dbus-object" +/** + * DBUSMENU_SERVER_PROP_ROOT_NODE: + * + * String to access property #DbusmenuServer:root-node + */ #define DBUSMENU_SERVER_PROP_ROOT_NODE "root-node" +/** + * DBUSMENU_SERVER_PROP_VERSION: + * + * String to access property #DbusmenuServer:version + */ #define DBUSMENU_SERVER_PROP_VERSION "version" typedef struct _DbusmenuServerPrivate DbusmenuServerPrivate; @@ -61,8 +101,7 @@ typedef struct _DbusmenuServerPrivate DbusmenuServerPrivate; @id_prop_update: Slot for #DbusmenuServer::id-prop-update. @id_update: Slot for #DbusmenuServer::id-update. @layout_updated: Slot for #DbusmenuServer::layout-update. - @item_activation_requested: Slot for #DbusmenuServer::item-activation-requested. - + @item_activation: Slot for #DbusmenuServer::item-activation-requested. @reserved1: Reserved for future use. @reserved2: Reserved for future use. @reserved3: Reserved for future use. @@ -93,7 +132,6 @@ struct _DbusmenuServerClass { /** DbusmenuServer: - @parent: #GObject A server which represents a sharing of a set of #DbusmenuMenuitems across DBus to a #DbusmenuClient. @@ -108,10 +146,10 @@ struct _DbusmenuServer { GType dbusmenu_server_get_type (void); DbusmenuServer * dbusmenu_server_new (const gchar * object); -void dbusmenu_server_set_root (DbusmenuServer * server, DbusmenuMenuitem * root); +void dbusmenu_server_set_root (DbusmenuServer * self, DbusmenuMenuitem * root); /** - SECIONT:server + SECTION:server @short_description: The server signals changed and updates on a tree of #DbusmenuMenuitem objecs. @stability: Unstable 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 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 */ 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; } 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 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 <libdbusmenu-glib/menuitem.h> #include <gtk/gtk.h> +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 |