aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-13 16:23:09 -0500
committerTed Gould <ted@canonical.com>2009-04-13 16:23:09 -0500
commit53b477561da7b49fcf208cf615a42e3b0820c0b8 (patch)
tree3da0050d550ec59a6f1a78301fc649c57cfbe800
parent7fde4447bc484c9ff2752740e8bb375d3f2df87a (diff)
downloadlibdbusmenu-53b477561da7b49fcf208cf615a42e3b0820c0b8.tar.gz
libdbusmenu-53b477561da7b49fcf208cf615a42e3b0820c0b8.tar.bz2
libdbusmenu-53b477561da7b49fcf208cf615a42e3b0820c0b8.zip
Putting in more gobject based examples and getting all the libraries tied in to make them work.
-rw-r--r--.bzrignore1
-rw-r--r--configure.ac15
-rw-r--r--libdbusmenu-glib/Makefile.am8
-rw-r--r--libdbusmenu-glib/menuitem.c48
-rw-r--r--libdbusmenu-glib/menuitem.h33
-rw-r--r--libdbusmenu-glib/test.c4
-rw-r--r--libdbusmenu-glib/test.h2
7 files changed, 101 insertions, 10 deletions
diff --git a/.bzrignore b/.bzrignore
index 76220ec..cd6e8f9 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -15,3 +15,4 @@ libdbusmenu-qt/.libs
libdbusmenu-qt/dbusmenu-qt.pc
libdbusmenu-qt/libdbusmenu-qt.la
libdbusmenu-qt/libdbusmenu_qt_la-test.lo
+libdbusmenu-glib/libdbusmenu_glib_la-menuitem.lo
diff --git a/configure.ac b/configure.ac
index 9a4ecbe..47f750a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,21 @@ AC_SUBST(VERSION)
AC_CONFIG_MACRO_DIR([m4])
###########################
+# Dependencies - GLib
+###########################
+
+GLIB_REQUIRED_VERSION=2.18
+DBUS_REQUIRED_VERSION=0.76
+XML_REQUIRED_VERSION=2.6
+
+PKG_CHECK_MODULES(DBUSMENUGLIB, glib-2.0 >= $GLIB_REQUIRED_VERSION
+ dbus-glib-1 >= $DBUS_REQUIRED_VERSION
+ libxml-2.0 >= $XML_REQUIRED_VERSION)
+
+AC_SUBST(DBUSMENUGLIB_CFLAGS)
+AC_SUBST(DBUSMENUGLIB_LIBS)
+
+###########################
# Lib versioning
###########################
diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am
index c94231b..758de05 100644
--- a/libdbusmenu-glib/Makefile.am
+++ b/libdbusmenu-glib/Makefile.am
@@ -8,10 +8,10 @@ lib_LTLIBRARIES = \
libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-0.1/libdbusmenu-glib/
libdbusmenu_glibinclude_HEADERS = \
- test.h
+ menuitem.h
libdbusmenu_glib_la_SOURCES = \
- test.c
+ menuitem.c
libdbusmenu_glib_la_LDFLAGS = \
-version-info $(LIBDBUSMENU_CURRENT):$(LIBDBUSMENU_REVISION):$(LIBDBUSMENU_AGE) \
@@ -19,10 +19,10 @@ libdbusmenu_glib_la_LDFLAGS = \
-export-symbols-regex "^[^_].*"
libdbusmenu_glib_la_CFLAGS = \
- $(LIBDBUSMENU_GLIB_CFLAGS)
+ $(DBUSMENUGLIB_CFLAGS)
libdbusmenu_glib_la_LIBADD = \
- $(LIBDBUSMENU_GLIB_LIBS)
+ $(DBUSMENUGLIB_LIBS)
pkgconfig_DATA = dbusmenu-glib.pc
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
new file mode 100644
index 0000000..080372a
--- /dev/null
+++ b/libdbusmenu-glib/menuitem.c
@@ -0,0 +1,48 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "menuitem.h"
+
+typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate;
+
+struct _DbusmenuMenuitemPrivate
+{
+};
+
+#define DBUSMENU_MENUITEM_GET_PRIVATE(o) \
+(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_MENUITEM_TYPE, DbusmenuMenuitemPrivate))
+
+static void dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass);
+static void dbusmenu_menuitem_init (DbusmenuMenuitem *self);
+static void dbusmenu_menuitem_dispose (GObject *object);
+static void dbusmenu_menuitem_finalize (GObject *object);
+
+G_DEFINE_TYPE (DbusmenuMenuitem, dbusmenu_menuitem, G_TYPE_OBJECT);
+
+static void
+dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass)
+{
+GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+g_type_class_add_private (klass, sizeof (DbusmenuMenuitemPrivate));
+
+object_class->dispose = dbusmenu_menuitem_dispose;
+object_class->finalize = dbusmenu_menuitem_finalize;
+}
+
+static void
+dbusmenu_menuitem_init (DbusmenuMenuitem *self)
+{
+}
+
+static void
+dbusmenu_menuitem_dispose (GObject *object)
+{
+G_OBJECT_CLASS (dbusmenu_menuitem_parent_class)->dispose (object);
+}
+
+static void
+dbusmenu_menuitem_finalize (GObject *object)
+{
+G_OBJECT_CLASS (dbusmenu_menuitem_parent_class)->finalize (object);
+}
diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h
new file mode 100644
index 0000000..4e87ba5
--- /dev/null
+++ b/libdbusmenu-glib/menuitem.h
@@ -0,0 +1,33 @@
+#ifndef __DBUSMENU_MENUITEM_H__
+#define __DBUSMENU_MENUITEM_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define DBUSMENU_MENUITEM_TYPE (dbusmenu_menuitem_get_type ())
+#define DBUSMENU_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUSMENU_MENUITEM_TYPE, DbusmenuMenuitem))
+#define DBUSMENU_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUSMENU_MENUITEM_TYPE, DbusmenuMenuitemClass))
+#define DBUSMENU_IS_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUSMENU_MENUITEM_TYPE))
+#define DBUSMENU_IS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_MENUITEM_TYPE))
+#define DBUSMENU_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_MENUITEM_TYPE, DbusmenuMenuitemClass))
+
+typedef struct _DbusmenuMenuitem DbusmenuMenuitem;
+typedef struct _DbusmenuMenuitemClass DbusmenuMenuitemClass;
+
+struct _DbusmenuMenuitemClass
+{
+GObjectClass parent_class;
+};
+
+struct _DbusmenuMenuitem
+{
+GObject parent;
+};
+
+GType dbusmenu_menuitem_get_type (void);
+
+G_END_DECLS
+
+#endif
diff --git a/libdbusmenu-glib/test.c b/libdbusmenu-glib/test.c
deleted file mode 100644
index 8ebb3f7..0000000
--- a/libdbusmenu-glib/test.c
+++ /dev/null
@@ -1,4 +0,0 @@
-
-void mysymbol (void) {
- return;
-}
diff --git a/libdbusmenu-glib/test.h b/libdbusmenu-glib/test.h
deleted file mode 100644
index ad000af..0000000
--- a/libdbusmenu-glib/test.h
+++ /dev/null
@@ -1,2 +0,0 @@
-
-void mysymbol (void);