summaryrefslogtreecommitdiff
path: root/libmissioncontrol
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-02-18 14:32:22 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-02-18 14:32:22 +0000
commit7880b97d1c330c6651d6e820fd442251d5bd4ced (patch)
tree860134b93a0f9c6572096efb98404ed3ad0053aa /libmissioncontrol
parenta7a591133887897bf6eb4e8afa18e3e421008c64 (diff)
* libmissioncontrol.pc.in: require newer libtelepathy, telepathy-glib
* libmissioncontrol/dbus-api.[ch], libmissioncontrol/mission-control.h: move MissionControl D-Bus interface constants into a new shared header, and auto-generate GTypes and enums from XML (in theory - currently there are none) * libmissioncontrol/cli-nmc4.[ch]: add McCliNMC4, a TpProxy subclass representing the MC 4.x D-Bus API * libmissioncontrol/svc-nmc4.[ch]: add McSvcNMC4, a GInterface representing the MC 4.x D-Bus API * libmissioncontrol/Makefile.am: auto-generate stuff for McCliNMC4, McSvcNMC4 and dbus-api.h * xml/, doc/Makefile.am: move mcd-dbus-services.xml to nmc4.xml, add all.xml (this is to fit in better with telepathy-glib code-gen) * configure.ac: check for mkdir -p * doc/reference/libmissioncontrol/Makefile.am: fix out-of-tree build against generated headers * doc/reference/libmissioncontrol-server/libmissioncontrol-server.types: reconstruct missing file which broke distcheck * Makefile.am: use --enable-gtk-doc when running distcheck git-svn-id: https://mission-control.svn.sourceforge.net/svnroot/mission-control/trunk@287 d91c8aed-3f2b-0410-a83d-924a1c20a0ba
Diffstat (limited to 'libmissioncontrol')
-rw-r--r--libmissioncontrol/Makefile.am118
-rw-r--r--libmissioncontrol/cli-nmc4.c111
-rw-r--r--libmissioncontrol/cli-nmc4.h58
-rw-r--r--libmissioncontrol/dbus-api.c26
-rw-r--r--libmissioncontrol/dbus-api.h35
-rw-r--r--libmissioncontrol/mission-control.h15
-rw-r--r--libmissioncontrol/svc-nmc4.h28
7 files changed, 379 insertions, 12 deletions
diff --git a/libmissioncontrol/Makefile.am b/libmissioncontrol/Makefile.am
index 3f108275..5e6ee104 100644
--- a/libmissioncontrol/Makefile.am
+++ b/libmissioncontrol/Makefile.am
@@ -1,15 +1,23 @@
-INCLUDES = $(DBUS_CFLAGS) $(TELEPATHY_CFLAGS) -I$(top_srcdir) \
+INCLUDES = \
+ $(DBUS_CFLAGS) \
+ $(TELEPATHY_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
-DMC_DISABLE_DEPRECATED \
-DLIBDIR="@libdir@" -DLIBVERSION="0"
BUILT_SOURCES = \
+ _gen/all.xml \
+ _gen/nmc4.xml \
mission-control-signals-marshal.c \
mission-control-signals-marshal.h \
mc-enum-types.c \
mc-enum-types.h \
mc-signals-marshal.c \
mc-signals-marshal.h \
- mc-client-lib-gen.h
+ mc-client-lib-gen.h \
+ $(nodist_libmissioncontrol_client_la_SOURCES) \
+ $(nodist_geninclude_HEADERS)
CLEANFILES = $(BUILT_SOURCES) stamp-mc-enum-types.h
@@ -17,6 +25,8 @@ lib_LTLIBRARIES = libmissioncontrol-client.la
libmissioncontrol_client_la_CFLAGS = $(GLIB_CFLAGS) $(GCONF_CFLAGS)
libmissioncontrol_client_la_SOURCES = \
+ cli-nmc4.c \
+ dbus-api.c \
mc.c\
mc-manager.c \
mc-manager-priv.h \
@@ -33,7 +43,9 @@ libmissioncontrol_client_la_SOURCES = \
mission-control.c
libmissioncontrol_client_includedir = $(includedir)/libmissioncontrol
-libmissioncontrol_client_include_DATA = \
+libmissioncontrol_client_include_HEADERS = \
+ cli-nmc4.h \
+ dbus-api.h \
mc.h \
mc-account.h \
mc-account-monitor.h \
@@ -43,7 +55,26 @@ libmissioncontrol_client_include_DATA = \
mc-manager.h \
mc-signals-marshal.h \
mission-control-signals-marshal.h \
- mission-control.h
+ mission-control.h \
+ svc-nmc4.h
+
+genincludedir = $(libmissioncontrol_client_includedir)/_gen
+nodist_geninclude_HEADERS = \
+ _gen/cli-nmc4.h \
+ _gen/enums.h \
+ _gen/interfaces.h \
+ _gen/gtypes.h \
+ _gen/svc-nmc4.h
+
+nodist_libmissioncontrol_client_la_SOURCES = \
+ _gen/cli-nmc4-body.h \
+ _gen/gtypes-body.h \
+ _gen/interfaces-body.h \
+ _gen/register-dbus-glib-marshallers-body.h \
+ _gen/signals-marshal.c \
+ _gen/signals-marshal.h \
+ _gen/signals-marshal.list \
+ _gen/svc-nmc4.c
libmissioncontrol_client_la_LIBADD = $(GCONF_LIBS) $(GLIB_LIBS) $(DBUS_LIBS) $(TELEPATHY_LIBS)
@@ -101,3 +132,82 @@ EXTRA_DIST = \
mission-control-signals-marshal.list \
mc-signals-marshal.list
+# ---- telepathy-glib-style code generation ----
+
+tools_dir = $(top_srcdir)/tools
+
+_gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml)
+ $(mkdir_p) _gen
+ $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+ $< > $@
+
+# Generated files which can be done for all "classes" at once
+
+_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \
+ $(top_srcdir)/tools/glib-gtypes-generator.py
+ $(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
+ $< _gen/gtypes mc
+
+_gen/signals-marshal.list: _gen/all.xml \
+ $(tools_dir)/glib-signals-marshal-gen.py
+ $(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@
+
+_gen/signals-marshal.h: _gen/signals-marshal.list
+ $(GLIB_GENMARSHAL) --header --prefix=_mc_ext_marshal $< > $@
+
+_gen/signals-marshal.c: _gen/signals-marshal.list
+ $(GLIB_GENMARSHAL) --body --prefix=_mc_ext_marshal $< > $@
+
+_gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \
+ $(tools_dir)/glib-client-marshaller-gen.py
+ $(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \
+ _mc_ext > $@
+
+_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-generator.xsl
+ $(XSLTPROC) $(XSLTPROCFLAGS) \
+ --stringparam mixed-case-prefix mc \
+ $(tools_dir)/c-constants-generator.xsl \
+ $< > $@
+
+_gen/interfaces.h: _gen/all.xml \
+ $(tools_dir)/glib-interfaces-generator.xsl \
+ $(tools_dir)/c-interfaces-generator.xsl
+ $(XSLTPROC) $(XSLTPROCFLAGS) \
+ --stringparam mixed-case-prefix mc \
+ $(tools_dir)/glib-interfaces-generator.xsl \
+ $< > $@
+
+_gen/interfaces-body.h: _gen/all.xml \
+ $(tools_dir)/glib-interfaces-body-generator.xsl \
+ $(tools_dir)/c-interfaces-generator.xsl
+ $(XSLTPROC) $(XSLTPROCFLAGS) \
+ --stringparam mixed-case-prefix mc \
+ $(tools_dir)/glib-interfaces-body-generator.xsl \
+ $< > $@
+
+
+# Generated files which must be generated per "class".
+# (Currently the only "class" is nmc4, but the new API will need "classes"
+# like account, account-manager, ...)
+
+_gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml)
+ $(mkdir_p) _gen
+ $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+ $< > $@
+
+_gen/cli-%-body.h _gen/cli-%.h: _gen/%.xml \
+ $(tools_dir)/glib-client-gen.py Makefile.am
+ $(PYTHON) $(tools_dir)/glib-client-gen.py \
+ --group=`echo $* | tr x- x_` \
+ --iface-quark-prefix=MC_IFACE_QUARK \
+ $< Mc_Cli _gen/cli-$*
+
+_gen/svc-%.c _gen/svc-%.h: _gen/%.xml \
+ $(tools_dir)/glib-ginterface-gen.py Makefile.am
+ $(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
+ --filename=_gen/svc-$* \
+ --signal-marshal-prefix=_mc_ext \
+ --include='<telepathy-glib/dbus.h>' \
+ --include='"_gen/signals-marshal.h"' \
+ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \
+ $< Mc_Svc_
diff --git a/libmissioncontrol/cli-nmc4.c b/libmissioncontrol/cli-nmc4.c
new file mode 100644
index 00000000..12f777c4
--- /dev/null
+++ b/libmissioncontrol/cli-nmc4.c
@@ -0,0 +1,111 @@
+/*
+ * cli-nmc4.c - the Nokia Mission Control 4.x D-Bus interface (client side)
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libmissioncontrol/cli-nmc4.h"
+
+#include <telepathy-glib/proxy-subclass.h>
+
+#include "libmissioncontrol/mission-control.h"
+
+#include "libmissioncontrol/_gen/cli-nmc4-body.h"
+
+/**
+ * SECTION:cli-nmc4
+ * @title: McCliNMC4
+ * @short_description: proxy object for the Nokia Mission Control 4.x D-Bus API
+ *
+ * This module provides a client-side proxy object for the NMC 4.x D-Bus API,
+ * for use until the modular D-Bus API becomes available.
+ *
+ * Since: FIXME
+ */
+
+/**
+ * McCliNMC4Class:
+ *
+ * The class of a #McCliNMC4.
+ *
+ * Since: FIXME
+ */
+struct _McCliNMC4Class {
+ TpProxyClass parent_class;
+ /*<private>*/
+ gpointer priv;
+};
+
+/**
+ * McCliNMC4:
+ *
+ * A proxy object for the Nokia Mission Control 4.x D-Bus API. This is a
+ * subclass of #TpProxy.
+ *
+ * Since: FIXME
+ */
+struct _McCliNMC4 {
+ TpProxy parent;
+ /*<private>*/
+ gpointer priv;
+};
+
+G_DEFINE_TYPE (McCliNMC4,
+ mc_cli_nmc4,
+ TP_TYPE_PROXY);
+
+static void
+mc_cli_nmc4_init (McCliNMC4 *self)
+{
+}
+
+static void
+mc_cli_nmc4_class_init (McCliNMC4Class *klass)
+{
+ GType type = MC_TYPE_CLI_NMC4;
+ TpProxyClass *proxy_class = (TpProxyClass *) klass;
+
+ /* the API is stateless, so we can keep the same proxy across restarts */
+ proxy_class->must_have_unique_name = FALSE;
+
+ proxy_class->interface = MC_IFACE_QUARK_NMC4;
+ tp_proxy_or_subclass_hook_on_interface_add (type, mc_cli_nmc4_add_signals);
+
+ tp_proxy_subclass_add_error_mapping (type, TP_ERROR_PREFIX, TP_ERRORS,
+ TP_TYPE_ERROR);
+}
+
+/**
+ * mc_cli_nmc4_new:
+ * @dbus: a D-Bus daemon; may not be %NULL
+ *
+ * <!-- -->
+ *
+ * Returns: a new NMC 4.x proxy
+ *
+ * Since: FIXME
+ */
+McCliNMC4 *
+mc_cli_nmc4_new (TpDBusDaemon *dbus)
+{
+ return MC_CLI_NMC4 (g_object_new (MC_TYPE_CLI_NMC4,
+ "dbus-daemon", dbus,
+ "bus-name", MISSION_CONTROL_SERVICE,
+ "object-path", MISSION_CONTROL_PATH,
+ NULL));
+}
diff --git a/libmissioncontrol/cli-nmc4.h b/libmissioncontrol/cli-nmc4.h
new file mode 100644
index 00000000..bbfa3b63
--- /dev/null
+++ b/libmissioncontrol/cli-nmc4.h
@@ -0,0 +1,58 @@
+/*
+ * cli-nmc4.h - the Nokia Mission Control 4.x D-Bus interface (client side)
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBMISSIONCONTROL_CLI_NMC4_H__
+#define __LIBMISSIONCONTROL_CLI_NMC4_H__
+
+#include <telepathy-glib/proxy.h>
+
+G_BEGIN_DECLS
+
+typedef struct _McCliNMC4 McCliNMC4;
+typedef struct _McCliNMC4Class McCliNMC4Class;
+typedef struct _McCliNMC4Private McCliNMC4Private;
+
+GType mc_cli_nmc4_get_type (void);
+
+#define MC_TYPE_CLI_NMC4 \
+ (mc_cli_nmc4_get_type ())
+#define MC_CLI_NMC4(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MC_TYPE_CLI_NMC4, \
+ McCliNMC4))
+#define MC_CLI_NMC4_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), MC_TYPE_CLI_NMC4, \
+ McCliNMC4Class))
+#define MC_IS_CLI_NMC4(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MC_TYPE_CLI_NMC4))
+#define MC_IS_CLI_NMC4_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), MC_TYPE_CLI_NMC4))
+#define MC_CLI_NMC4_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), MC_TYPE_CLI_NMC4, \
+ McCliNokiaMC4Class))
+
+McCliNMC4 *mc_cli_nmc4_new (TpDBusDaemon *dbus);
+
+G_END_DECLS
+
+/* auto-generated stubs */
+#include <libmissioncontrol/_gen/cli-nmc4.h>
+
+#endif
diff --git a/libmissioncontrol/dbus-api.c b/libmissioncontrol/dbus-api.c
new file mode 100644
index 00000000..f8409160
--- /dev/null
+++ b/libmissioncontrol/dbus-api.c
@@ -0,0 +1,26 @@
+/*
+ * dbus-api.c - Mission Control D-Bus API strings, enums etc.
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <libmissioncontrol/dbus-api.h>
+
+/* auto-generated stubs */
+#include "_gen/gtypes-body.h"
+#include "_gen/interfaces-body.h"
diff --git a/libmissioncontrol/dbus-api.h b/libmissioncontrol/dbus-api.h
new file mode 100644
index 00000000..24a4812f
--- /dev/null
+++ b/libmissioncontrol/dbus-api.h
@@ -0,0 +1,35 @@
+/*
+ * dbus-api.h - Mission Control D-Bus API strings, enums etc.
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBMISSIONCONTROL_DBUS_API_H__
+#define __LIBMISSIONCONTROL_DBUS_API_H__
+
+#include <glib/gquark.h>
+
+#define MISSION_CONTROL_SERVICE "org.freedesktop.Telepathy.MissionControl"
+#define MISSION_CONTROL_IFACE "org.freedesktop.Telepathy.MissionControl"
+#define MISSION_CONTROL_PATH "/org/freedesktop/Telepathy/MissionControl"
+
+#include <libmissioncontrol/_gen/enums.h>
+#include <libmissioncontrol/_gen/gtypes.h>
+#include <libmissioncontrol/_gen/interfaces.h>
+
+#endif
diff --git a/libmissioncontrol/mission-control.h b/libmissioncontrol/mission-control.h
index 9ac97168..5a6a9d61 100644
--- a/libmissioncontrol/mission-control.h
+++ b/libmissioncontrol/mission-control.h
@@ -29,18 +29,17 @@
#define DBUS_API_SUBJECT_TO_CHANGE
#endif
-#include "dbus/dbus-glib.h"
-#include "dbus/dbus-glib-lowlevel.h"
-#include "dbus/dbus.h"
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus.h>
#include <libtelepathy/tp-constants.h>
#include <libtelepathy/tp-conn.h>
#include <libtelepathy/tp-chan.h>
-#include <sys/types.h>
-#include <unistd.h>
-#define MISSION_CONTROL_SERVICE "org.freedesktop.Telepathy.MissionControl"
-#define MISSION_CONTROL_IFACE "org.freedesktop.Telepathy.MissionControl"
-#define MISSION_CONTROL_PATH "/org/freedesktop/Telepathy/MissionControl"
+#include <libmissioncontrol/dbus-api.h>
#define MISSIONCONTROL_TYPE (mission_control_get_type ())
diff --git a/libmissioncontrol/svc-nmc4.h b/libmissioncontrol/svc-nmc4.h
new file mode 100644
index 00000000..1d7ed940
--- /dev/null
+++ b/libmissioncontrol/svc-nmc4.h
@@ -0,0 +1,28 @@
+/*
+ * svc-nmc4.h - the Nokia Mission Control 4.x D-Bus interface (service side)
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __LIBMISSIONCONTROL_SVC_NMC4_H__
+#define __LIBMISSIONCONTROL_SVC_NMC4_H__
+
+/* auto-generated stubs */
+#include <libmissioncontrol/_gen/svc-nmc4.h>
+
+#endif