[Telepathy-commits] [telepathy-mission-control/master] Some include headers cleanups

Alberto Mardegan alberto.mardegan at nokia.com
Mon Feb 23 23:32:58 PST 2009


dbus.api.h should not have been installed in the first place. Deprecate it.
Add mc-types.h, mc-interfaces.h, mc-enums.h and mc-svc-client.h
---
 libmcclient/Makefile.am             |    6 ++++-
 libmcclient/dbus-api.c              |    2 +
 libmcclient/dbus-api.h              |   13 +++++++---
 libmcclient/mc-account-avatar.c     |    2 +
 libmcclient/mc-account-compat.c     |    2 +
 libmcclient/mc-account-conditions.c |    2 +
 libmcclient/mc-account-manager.c    |    2 +
 libmcclient/mc-account-manager.h    |    7 ++++++
 libmcclient/mc-account-request.c    |    2 +
 libmcclient/mc-account-stats.c      |    2 +
 libmcclient/mc-account.c            |    4 +++
 libmcclient/mc-account.h            |    9 +++++++
 libmcclient/mc-dispatch-operation.c |    5 ++++
 libmcclient/mc-enums.h              |    6 +++++
 libmcclient/mc-gtypes.h             |   32 +++++++++++++++++++++++++++
 libmcclient/mc-interfaces.h         |   12 ++++++++++
 libmcclient/mc-profile.c            |    2 +
 libmcclient/mc-svc-client.h         |   41 +++++++++++++++++++++++++++++++++++
 18 files changed, 146 insertions(+), 5 deletions(-)
 create mode 100644 libmcclient/mc-enums.h
 create mode 100644 libmcclient/mc-gtypes.h
 create mode 100644 libmcclient/mc-interfaces.h
 create mode 100644 libmcclient/mc-svc-client.h

diff --git a/libmcclient/Makefile.am b/libmcclient/Makefile.am
index e7992dd..8196a59 100644
--- a/libmcclient/Makefile.am
+++ b/libmcclient/Makefile.am
@@ -36,11 +36,15 @@ libmcclient_includedir = $(includedir)/libmcclient
 libmcclient_include_HEADERS = \
 	dbus-api.h \
 	mc-account.h \
+	mc-enums.h \
 	mc-errors.h \
+	mc-gtypes.h \
+	mc-interfaces.h \
 	mc-profile.h \
 	mc-account-manager.h \
 	mc-dispatch-operation.h \
-	mc-signals-marshal.h
+	mc-signals-marshal.h \
+	mc-svc-client.h
 
 noinst_HEADERS = \
 	mc-account-priv.h
diff --git a/libmcclient/dbus-api.c b/libmcclient/dbus-api.c
index 3e282c8..f9a9a8c 100644
--- a/libmcclient/dbus-api.c
+++ b/libmcclient/dbus-api.c
@@ -21,7 +21,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
 #include "dbus-api.h"
+#include "mc-gtypes.h"
 #include <string.h>
 
 #include <dbus/dbus-protocol.h>
diff --git a/libmcclient/dbus-api.h b/libmcclient/dbus-api.h
index 104c0bc..93a27d2 100644
--- a/libmcclient/dbus-api.h
+++ b/libmcclient/dbus-api.h
@@ -33,6 +33,9 @@
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/proxy.h>
 
+#ifndef MC_INTERNAL
+#warning This header is deprecated in favor of mc-account.h, mc-account-manager.h, mc-client.h
+
 #define MC_ACCOUNT_MANAGER_DBUS_SERVICE "org.freedesktop.Telepathy.AccountManager"
 #define MC_ACCOUNT_MANAGER_DBUS_OBJECT "/org/freedesktop/Telepathy/AccountManager"
 #define MC_ACCOUNT_DBUS_OBJECT_BASE "/org/freedesktop/Telepathy/Account/"
@@ -47,13 +50,15 @@
 #define MC_CLIENT_DBUS_SERVICE_BASE_LEN \
     (sizeof (MC_CLIENT_DBUS_SERVICE_BASE) - 1)
 
+#include <libmcclient/mc-enums.h>
+#include <libmcclient/mc-gtypes.h>
+#include <libmcclient/mc-interfaces.h>
+
+#endif /* MC_INTERNAL */
+
 /* FIXME: MC should register a separate service for the ChannelDispatcher */
 #define MC_CHANNEL_DISPATCHER_DBUS_SERVICE MC_ACCOUNT_MANAGER_DBUS_SERVICE
 
-#include <libmcclient/_gen/enums.h>
-#include <libmcclient/_gen/gtypes.h>
-#include <libmcclient/_gen/interfaces.h>
-
 void _mc_ext_register_dbus_glib_marshallers (void);
 
 inline void _mc_gvalue_stolen (GValue *value);
diff --git a/libmcclient/mc-account-avatar.c b/libmcclient/mc-account-avatar.c
index ab3f687..2c5e24d 100644
--- a/libmcclient/mc-account-avatar.c
+++ b/libmcclient/mc-account-avatar.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
diff --git a/libmcclient/mc-account-compat.c b/libmcclient/mc-account-compat.c
index 755ae9d..e81d917 100644
--- a/libmcclient/mc-account-compat.c
+++ b/libmcclient/mc-account-compat.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
diff --git a/libmcclient/mc-account-conditions.c b/libmcclient/mc-account-conditions.c
index 73be67a..8c841aa 100644
--- a/libmcclient/mc-account-conditions.c
+++ b/libmcclient/mc-account-conditions.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
diff --git a/libmcclient/mc-account-manager.c b/libmcclient/mc-account-manager.c
index bec0c58..183f120 100644
--- a/libmcclient/mc-account-manager.c
+++ b/libmcclient/mc-account-manager.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <string.h>
 #include "mc-account-manager.h"
 #include "dbus-api.h"
diff --git a/libmcclient/mc-account-manager.h b/libmcclient/mc-account-manager.h
index ee15684..29dc8ea 100644
--- a/libmcclient/mc-account-manager.h
+++ b/libmcclient/mc-account-manager.h
@@ -35,6 +35,13 @@ typedef struct _McAccountManagerPrivate McAccountManagerPrivate;
 
 #include <libmcclient/mc-account.h>
 
+#ifndef MC_ACCOUNT_MANAGER_DBUS_SERVICE
+#define MC_ACCOUNT_MANAGER_DBUS_SERVICE \
+    "org.freedesktop.Telepathy.AccountManager"
+#define MC_ACCOUNT_MANAGER_DBUS_OBJECT \
+    "/org/freedesktop/Telepathy/AccountManager"
+#endif
+
 GType mc_account_manager_get_type (void);
 
 #define MC_TYPE_ACCOUNT_MANAGER \
diff --git a/libmcclient/mc-account-request.c b/libmcclient/mc-account-request.c
index 3a3cdd2..1c75065 100644
--- a/libmcclient/mc-account-request.c
+++ b/libmcclient/mc-account-request.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
diff --git a/libmcclient/mc-account-stats.c b/libmcclient/mc-account-stats.c
index 108355c..67d92ce 100644
--- a/libmcclient/mc-account-stats.c
+++ b/libmcclient/mc-account-stats.c
@@ -22,6 +22,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
diff --git a/libmcclient/mc-account.c b/libmcclient/mc-account.c
index 80c2222..ac40416 100644
--- a/libmcclient/mc-account.c
+++ b/libmcclient/mc-account.c
@@ -21,10 +21,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <stdio.h>
 #include <string.h>
 #include "mc-account.h"
+#include "mc-account-manager.h"
 #include "mc-account-priv.h"
+#include "mc-interfaces.h"
 #include "dbus-api.h"
 #include "mc-signals-marshal.h"
 
diff --git a/libmcclient/mc-account.h b/libmcclient/mc-account.h
index f915c32..ff7c555 100644
--- a/libmcclient/mc-account.h
+++ b/libmcclient/mc-account.h
@@ -27,6 +27,9 @@
 
 #include <telepathy-glib/proxy.h>
 #include <telepathy-glib/enums.h>
+#include <libmcclient/mc-enums.h>
+#include <libmcclient/mc-gtypes.h>
+#include <libmcclient/mc-interfaces.h>
 
 G_BEGIN_DECLS
 
@@ -44,6 +47,12 @@ struct _McAccount {
     McAccountPrivate *priv;
 };
 
+#ifndef MC_ACCOUNT_DBUS_OBJECT_BASE
+#define MC_ACCOUNT_DBUS_OBJECT_BASE "/org/freedesktop/Telepathy/Account/"
+#define MC_ACCOUNT_DBUS_OBJECT_BASE_LEN \
+    (sizeof (MC_ACCOUNT_DBUS_OBJECT_BASE) - 1)
+#endif
+
 GType mc_account_get_type (void);
 
 #define MC_TYPE_ACCOUNT (mc_account_get_type ())
diff --git a/libmcclient/mc-dispatch-operation.c b/libmcclient/mc-dispatch-operation.c
index a821410..5d55bc8 100644
--- a/libmcclient/mc-dispatch-operation.c
+++ b/libmcclient/mc-dispatch-operation.c
@@ -21,8 +21,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#define MC_INTERNAL
+
 #include <string.h>
 #include "mc-dispatch-operation.h"
+#include "mc-account-manager.h"
+#include "mc-gtypes.h"
+#include "mc-interfaces.h"
 #include "dbus-api.h"
 #include "mc-signals-marshal.h"
 
diff --git a/libmcclient/mc-enums.h b/libmcclient/mc-enums.h
new file mode 100644
index 0000000..81e6e25
--- /dev/null
+++ b/libmcclient/mc-enums.h
@@ -0,0 +1,6 @@
+#ifndef __MC_ENUMS_H__
+#define __MC_ENUMS_H__
+
+#include <libmcclient/_gen/enums.h>
+
+#endif
diff --git a/libmcclient/mc-gtypes.h b/libmcclient/mc-gtypes.h
new file mode 100644
index 0000000..3a77e39
--- /dev/null
+++ b/libmcclient/mc-gtypes.h
@@ -0,0 +1,32 @@
+/* vi: set et sw=4 ts=8 cino=t0,(0: */
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */
+/*
+ * Copyright (C) 2009 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 __MC_GTYPES_H__
+#define __MC_GTYPES_H__
+
+#include <dbus/dbus-glib.h>
+
+G_BEGIN_DECLS
+
+#include <libmcclient/_gen/gtypes.h>
+
+G_END_DECLS
+
+#endif
diff --git a/libmcclient/mc-interfaces.h b/libmcclient/mc-interfaces.h
new file mode 100644
index 0000000..018014c
--- /dev/null
+++ b/libmcclient/mc-interfaces.h
@@ -0,0 +1,12 @@
+#ifndef __MC_INTERFACES_H__
+#define __MC_INTERFACES_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#include <libmcclient/_gen/interfaces.h>
+
+G_END_DECLS
+
+#endif
diff --git a/libmcclient/mc-profile.c b/libmcclient/mc-profile.c
index 19f9fd3..3ebb0cf 100644
--- a/libmcclient/mc-profile.c
+++ b/libmcclient/mc-profile.c
@@ -23,6 +23,8 @@
  *
  */
 
+#define MC_INTERNAL
+
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <string.h>
diff --git a/libmcclient/mc-svc-client.h b/libmcclient/mc-svc-client.h
new file mode 100644
index 0000000..0f5c55d
--- /dev/null
+++ b/libmcclient/mc-svc-client.h
@@ -0,0 +1,41 @@
+/* vi: set et sw=4 ts=8 cino=t0,(0: */
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */
+/*
+ * mc-svc-client.h - the Telepathy Client D-Bus interface
+ * (service side)
+ *
+ * Copyright (C) 2009 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 __MC_META_SVC_CLIENT_H__
+#define __MC_META_SVC_CLIENT_H__
+
+#include <libmcclient/_gen/svc-client.h>
+
+#ifndef MC_CLIENT_DBUS_OBJECT_BASE
+#define MC_CLIENT_DBUS_OBJECT_BASE "/org/freedesktop/Telepathy/Client/"
+#define MC_CLIENT_DBUS_OBJECT_BASE_LEN \
+    (sizeof (MC_CLIENT_DBUS_OBJECT_BASE) - 1)
+#endif
+
+#ifndef MC_CLIENT_DBUS_SERVICE_BASE
+#define MC_CLIENT_DBUS_SERVICE_BASE "org.freedesktop.Telepathy.Client."
+#define MC_CLIENT_DBUS_SERVICE_BASE_LEN \
+    (sizeof (MC_CLIENT_DBUS_SERVICE_BASE) - 1)
+#endif
+
+#endif
-- 
1.5.6.5




More information about the telepathy-commits mailing list