diff options
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/client.h | 17 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem-proxy.c | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem-proxy.h | 18 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.h | 24 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 7 | ||||
-rw-r--r-- | libdbusmenu-glib/server.h | 26 |
8 files changed, 81 insertions, 29 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 52cb24f..dae1dd7 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -66,7 +66,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; struct _DbusmenuClientPrivate { DbusmenuMenuitem * root; @@ -117,8 +116,7 @@ struct _event_data_t { }; -#define DBUSMENU_CLIENT_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate)) +#define DBUSMENU_CLIENT_GET_PRIVATE(o) (DBUSMENU_CLIENT(o)->priv) /* GObject Stuff */ static void dbusmenu_client_class_init (DbusmenuClientClass *klass); @@ -258,6 +256,8 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass) static void dbusmenu_client_init (DbusmenuClient *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate); + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(self); priv->root = NULL; diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 5d4b5c3..32813d9 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -56,6 +56,8 @@ G_BEGIN_DECLS #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" #define DBUSMENU_CLIENT_TYPES_IMAGE "standard" +typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; + /** DbusmenuClientClass: @parent_class: #GObjectClass @@ -65,6 +67,10 @@ G_BEGIN_DECLS @event_result: Slot for #DbusmenuClient::event-error. @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. A simple class that takes all of the information from a #DbusmenuServer over DBus and makes the same set of @@ -80,11 +86,13 @@ struct _DbusmenuClientClass { void (*item_activate) (DbusmenuMenuitem * item, guint timestamp); void (*event_result) (DbusmenuMenuitem * item, gchar * event, GValue * data, guint timestamp, GError * error); - /* Reserved for future use */ + /*< Private >*/ void (*reserved1) (void); void (*reserved2) (void); - /* void (*reserved3) (void); */ - /* void (*reserved4) (void); */ + void (*reserved3) (void); + void (*reserved4) (void); + void (*reserved5) (void); + void (*reserved6) (void); }; /** @@ -97,6 +105,9 @@ struct _DbusmenuClientClass { typedef struct _DbusmenuClient DbusmenuClient; struct _DbusmenuClient { GObject parent; + + /*< Private >*/ + DbusmenuClientPrivate * priv; }; typedef gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); diff --git a/libdbusmenu-glib/menuitem-proxy.c b/libdbusmenu-glib/menuitem-proxy.c index 2dd5ada..7acb541 100644 --- a/libdbusmenu-glib/menuitem-proxy.c +++ b/libdbusmenu-glib/menuitem-proxy.c @@ -32,7 +32,6 @@ License version 3 and version 2.1 along with this program. If not, see #include "menuitem-proxy.h" -typedef struct _DbusmenuMenuitemProxyPrivate DbusmenuMenuitemProxyPrivate; struct _DbusmenuMenuitemProxyPrivate { DbusmenuMenuitem * mi; gulong sig_property_changed; @@ -49,8 +48,7 @@ enum { #define PROP_MENU_ITEM_S "menu-item" -#define DBUSMENU_MENUITEM_PROXY_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_MENUITEM_PROXY, DbusmenuMenuitemProxyPrivate)) +#define DBUSMENU_MENUITEM_PROXY_GET_PRIVATE(o) (DBUSMENU_MENUITEM_PROXY(o)->priv) static void dbusmenu_menuitem_proxy_class_init (DbusmenuMenuitemProxyClass *klass); static void dbusmenu_menuitem_proxy_init (DbusmenuMenuitemProxy *self); @@ -92,6 +90,8 @@ dbusmenu_menuitem_proxy_class_init (DbusmenuMenuitemProxyClass *klass) static void dbusmenu_menuitem_proxy_init (DbusmenuMenuitemProxy *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), DBUSMENU_TYPE_MENUITEM_PROXY, DbusmenuMenuitemProxyPrivate); + DbusmenuMenuitemProxyPrivate * priv = DBUSMENU_MENUITEM_PROXY_GET_PRIVATE(self); priv->mi = NULL; diff --git a/libdbusmenu-glib/menuitem-proxy.h b/libdbusmenu-glib/menuitem-proxy.h index 56c4941..2a22efe 100644 --- a/libdbusmenu-glib/menuitem-proxy.h +++ b/libdbusmenu-glib/menuitem-proxy.h @@ -42,17 +42,28 @@ G_BEGIN_DECLS #define DBUSMENU_IS_MENUITEM_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_MENUITEM_PROXY)) #define DBUSMENU_MENUITEM_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_MENUITEM_PROXY, DbusmenuMenuitemProxyClass)) -typedef struct _DbusmenuMenuitemProxy DbusmenuMenuitemProxy; -typedef struct _DbusmenuMenuitemProxyClass DbusmenuMenuitemProxyClass; +typedef struct _DbusmenuMenuitemProxy DbusmenuMenuitemProxy; +typedef struct _DbusmenuMenuitemProxyClass DbusmenuMenuitemProxyClass; +typedef struct _DbusmenuMenuitemProxyPrivate DbusmenuMenuitemProxyPrivate; /** DbusmenuMenuitemProxyClass: @parent_class: The Class of #DbusmeneMenuitem + @reserved1: Reserved for future use. + @reserved2: Reserved for future use. + @reserved3: Reserved for future use. + @reserved4: Reserved for future use. Functions and signal slots for #DbusmenuMenuitemProxy. */ struct _DbusmenuMenuitemProxyClass { DbusmenuMenuitemClass parent_class; + + /*< Private >*/ + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); }; /** @@ -63,6 +74,9 @@ struct _DbusmenuMenuitemProxyClass { */ struct _DbusmenuMenuitemProxy { DbusmenuMenuitem parent; + + /*< Private >*/ + DbusmenuMenuitemProxyPrivate * priv; }; GType dbusmenu_menuitem_proxy_get_type (void); diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index ef037d1..73b765b 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -52,7 +52,6 @@ License version 3 and version 2.1 along with this program. If not, see out of data that we have. They can still be gotten using accessor functions, but are protected appropriately. */ -typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate; struct _DbusmenuMenuitemPrivate { gint id; @@ -84,8 +83,7 @@ enum { #define PROP_ID_S "id" -#define DBUSMENU_MENUITEM_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemPrivate)) +#define DBUSMENU_MENUITEM_GET_PRIVATE(o) (DBUSMENU_MENUITEM(o)->priv) /* Prototypes */ static void dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass); @@ -290,6 +288,8 @@ _g_value_free (gpointer data) static void dbusmenu_menuitem_init (DbusmenuMenuitem *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemPrivate); + DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(self); priv->id = -1; diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index d7cf586..ff8d713 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -78,6 +78,8 @@ G_BEGIN_DECLS #define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU "submenu" +typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate; + /** * DbusmenuMenuitem: * @@ -92,6 +94,9 @@ typedef struct _DbusmenuMenuitem DbusmenuMenuitem; struct _DbusmenuMenuitem { GObject parent; + + /*< Private >*/ + DbusmenuMenuitemPrivate * priv; }; /** @@ -126,6 +131,13 @@ typedef void (*dbusmenu_menuitem_buildxml_slot_t) (DbusmenuMenuitem * mi, GPtrAr * @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. */ typedef struct _DbusmenuMenuitemClass DbusmenuMenuitemClass; struct _DbusmenuMenuitemClass @@ -146,10 +158,14 @@ struct _DbusmenuMenuitemClass void (*send_about_to_show) (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data); void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data); - /* void (*reserved1) (void); */ - /* void (*reserved2) (void); */ - /* void (*reserved3) (void); */ - /* void (*reserved4) (void); -- realized, realloc when bumping lib version */ + + /*< Private >*/ + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); + void (*reserved5) (void); + void (*reserved6) (void); }; GType dbusmenu_menuitem_get_type (void); diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 68afb92..c5cf2fe 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -53,8 +53,6 @@ static void layout_update_signal (DbusmenuServer * server); #define DBUSMENU_VERSION_NUMBER 2 /* Privates, I'll show you mine... */ -typedef struct _DbusmenuServerPrivate DbusmenuServerPrivate; - struct _DbusmenuServerPrivate { DbusmenuMenuitem * root; @@ -63,8 +61,7 @@ struct _DbusmenuServerPrivate guint layout_idle; }; -#define DBUSMENU_SERVER_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_SERVER, DbusmenuServerPrivate)) +#define DBUSMENU_SERVER_GET_PRIVATE(o) (DBUSMENU_SERVER(o)->priv) /* Signals */ enum { @@ -214,6 +211,8 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) static void dbusmenu_server_init (DbusmenuServer *self) { + self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), DBUSMENU_TYPE_SERVER, DbusmenuServerPrivate); + DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(self); priv->root = NULL; diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index a9bf213..5668258 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -53,6 +53,8 @@ G_BEGIN_DECLS #define DBUSMENU_SERVER_PROP_ROOT_NODE "root-node" #define DBUSMENU_SERVER_PROP_VERSION "version" +typedef struct _DbusmenuServerPrivate DbusmenuServerPrivate; + /** DbusmenuServerClass: @parent_class: #GObjectClass @@ -60,9 +62,13 @@ G_BEGIN_DECLS @id_update: Slot for #DbusmenuServer::id-update. @layout_updated: Slot for #DbusmenuServer::layout-update. @item_activation_requested: Slot for #DbusmenuServer::item-activation-requested. - @dbusmenu_server_reserved1: Reserved for future use. - @dbusmenu_server_reserved2: Reserved for future use. - @dbusmenu_server_reserved3: Reserved for future use. + + @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. The class implementing the virtual functions for #DbusmenuServer. */ @@ -76,10 +82,13 @@ struct _DbusmenuServerClass { void (*layout_updated)(gint revision); void (*item_activation)(gint id, guint timestamp); - /* Reserved */ - void (*dbusmenu_server_reserved1)(void); - void (*dbusmenu_server_reserved2)(void); - void (*dbusmenu_server_reserved3)(void); + /*< Private >*/ + void (*reserved1) (void); + void (*reserved2) (void); + void (*reserved3) (void); + void (*reserved4) (void); + void (*reserved5) (void); + void (*reserved6) (void); }; /** @@ -92,6 +101,9 @@ struct _DbusmenuServerClass { typedef struct _DbusmenuServer DbusmenuServer; struct _DbusmenuServer { GObject parent; + + /*< Private >*/ + DbusmenuServerPrivate * priv; }; GType dbusmenu_server_get_type (void); |