aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-03 18:00:36 -0800
committerTed Gould <ted@gould.cx>2010-02-03 18:00:36 -0800
commit9b7020779b1b334d696e6d165d1d61f95c12fc0a (patch)
treebf956e15e448d85be480a8e5a8af8566300c0816 /libdbusmenu-glib
parent0a22ccfb87ec1c1f7bc1f543f8af3ef333c22b2c (diff)
downloadlibdbusmenu-9b7020779b1b334d696e6d165d1d61f95c12fc0a.tar.gz
libdbusmenu-9b7020779b1b334d696e6d165d1d61f95c12fc0a.tar.bz2
libdbusmenu-9b7020779b1b334d696e6d165d1d61f95c12fc0a.zip
Adding in the client menuitem subclass
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/Makefile.am2
-rw-r--r--libdbusmenu-glib/client-menuitem.c67
-rw-r--r--libdbusmenu-glib/client-menuitem.h34
3 files changed, 103 insertions, 0 deletions
diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am
index fc37019..998af50 100644
--- a/libdbusmenu-glib/Makefile.am
+++ b/libdbusmenu-glib/Makefile.am
@@ -27,6 +27,8 @@ libdbusmenu_glib_la_SOURCES = \
server.c \
server-marshal.h \
server-marshal.c \
+ client-menuitem.h \
+ client-menuitem.c \
client.h \
client.c
diff --git a/libdbusmenu-glib/client-menuitem.c b/libdbusmenu-glib/client-menuitem.c
new file mode 100644
index 0000000..e77461d
--- /dev/null
+++ b/libdbusmenu-glib/client-menuitem.c
@@ -0,0 +1,67 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "client-menuitem.h"
+
+typedef struct _DbusmenuClientMenuitemPrivate DbusmenuClientMenuitemPrivate;
+
+struct _DbusmenuClientMenuitemPrivate
+{
+ DbusmenuClient * client;
+};
+
+#define DBUSMENU_CLIENT_MENUITEM_GET_PRIVATE(o) \
+(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_CLIENT_MENUITEM_TYPE, DbusmenuClientMenuitemPrivate))
+
+static void dbusmenu_client_menuitem_class_init (DbusmenuClientMenuitemClass *klass);
+static void dbusmenu_client_menuitem_init (DbusmenuClientMenuitem *self);
+static void dbusmenu_client_menuitem_dispose (GObject *object);
+static void dbusmenu_client_menuitem_finalize (GObject *object);
+
+G_DEFINE_TYPE (DbusmenuClientMenuitem, dbusmenu_client_menuitem, DBUSMENU_TYPE_MENUITEM);
+
+static void
+dbusmenu_client_menuitem_class_init (DbusmenuClientMenuitemClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (DbusmenuClientMenuitemPrivate));
+
+ object_class->dispose = dbusmenu_client_menuitem_dispose;
+ object_class->finalize = dbusmenu_client_menuitem_finalize;
+
+ return;
+}
+
+static void
+dbusmenu_client_menuitem_init (DbusmenuClientMenuitem *self)
+{
+
+ return;
+}
+
+static void
+dbusmenu_client_menuitem_dispose (GObject *object)
+{
+
+ G_OBJECT_CLASS (dbusmenu_client_menuitem_parent_class)->dispose (object);
+ return;
+}
+
+static void
+dbusmenu_client_menuitem_finalize (GObject *object)
+{
+
+ G_OBJECT_CLASS (dbusmenu_client_menuitem_parent_class)->finalize (object);
+ return;
+}
+
+DbusmenuClientMenuitem *
+dbusmenu_client_menuitem_new (gint id, DbusmenuClient * client)
+{
+ DbusmenuClientMenuitem * mi = g_object_new(DBUSMENU_CLIENT_MENUITEM_TYPE, "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
new file mode 100644
index 0000000..a25d209
--- /dev/null
+++ b/libdbusmenu-glib/client-menuitem.h
@@ -0,0 +1,34 @@
+#ifndef __DBUSMENU_CLIENT_MENUITEM_H__
+#define __DBUSMENU_CLIENT_MENUITEM_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include "menuitem.h"
+#include "client.h"
+
+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))
+
+typedef struct _DbusmenuClientMenuitem DbusmenuClientMenuitem;
+typedef struct _DbusmenuClientMenuitemClass DbusmenuClientMenuitemClass;
+
+struct _DbusmenuClientMenuitemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _DbusmenuClientMenuitem {
+ DbusmenuMenuitem parent;
+};
+
+GType dbusmenu_client_menuitem_get_type (void);
+DbusmenuClientMenuitem * dbusmenu_client_menuitem_new (gint id, DbusmenuClient * client);
+
+G_END_DECLS
+
+#endif