[glib/gdbus] Move all dbus-1 using bits into separate headers and mark as unstable



commit 562449f8432456cc1a1cb4646995a1ea4df3a169
Author: David Zeuthen <davidz redhat com>
Date:   Wed Apr 29 18:58:03 2009 -0400

    Move all dbus-1 using bits into separate headers and mark as unstable
    
    This allows us to do an ABI transition in the future from
    e.g. libdbus-1 to libdbus-2 or whatever without breaking API or ABI of
    applications only using high-level bits like GDBusProxy,
    g_bus_name_own(), g_bus_name_watch() and so on.
    
    The idea is that D-Bus bindings for other languages can do a similar
    thing; e.g. they can provide a langauge specific type/object mapping
    built on top of DBusMessage (e.g. they will rely on the headers
    provided by gdbus-lowlevel-2.0.pc) and then be able to gracefully
    transition without breaking apps built on top of this (assuming they
    don't leak dbus-1 bits into their public API).
    
    See
    
     http://bugzilla.gnome.org/show_bug.cgi?id=579571#c37
     http://bugzilla.gnome.org/show_bug.cgi?id=579571#c49
     http://bugzilla.gnome.org/show_bug.cgi?id=579571#c63
    
    for discussion.
---
 Makefile.am                                        |    6 ++-
 configure.in                                       |    2 +
 gdbus-2.0.pc.in                                    |    2 +-
 gdbus-lowlevel-2.0-uninstalled.pc.in               |    6 ++
 gdbus-lowlevel-2.0.pc.in                           |   11 +++
 gdbus/Makefile.am                                  |   41 +++++++----
 gdbus/gbusnameowner.c                              |    1 +
 gdbus/gbusnameowner.h                              |    1 -
 gdbus/gbusnamewatcher.c                            |    1 +
 gdbus/gbusnamewatcher.h                            |    1 -
 gdbus/{gdbusmainloop.h => gdbus-lowlevel.h}        |   30 +++-----
 gdbus/gdbus.h                                      |    3 +-
 gdbus/gdbus.symbols                                |   11 +++-
 gdbus/gdbusconnection-lowlevel.h                   |   76 ++++++++++++++++++++
 gdbus/gdbusconnection.c                            |   62 +++++++++-------
 gdbus/gdbusconnection.h                            |   42 -----------
 gdbus/gdbusenums.h                                 |    7 +-
 gdbus/gdbuserror-lowlevel.h                        |   65 +++++++++++++++++
 gdbus/gdbuserror.c                                 |   21 ++++++
 gdbus/gdbuserror.h                                 |   30 --------
 .../{gdbusmainloop.h => gdbusmainloop-lowlevel.h}  |    6 +-
 gdbus/gdbusmainloop.c                              |   21 +++++-
 gdbus/gdbusnameowning.h                            |    1 -
 gdbus/gdbusnamewatching.h                          |    1 -
 gdbus/gdbusprivate.c                               |    2 +
 gdbus/gdbusproxy.c                                 |    1 +
 gdbus/gdbusproxy.h                                 |    1 -
 gdbus/gdbusstructure.c                             |    1 +
 gdbus/gdbusstructure.h                             |    1 -
 gdbus/gdbusvariant.h                               |    1 -
 gdbus/tests/connection.c                           |    2 +
 31 files changed, 305 insertions(+), 152 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 966d5c1..44e3a9e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,7 +59,11 @@ EXTRA_DIST += 			\
 	gthread-2.0-uninstalled.pc.in	\
 	gmodule-no-export-2.0-uninstalled.pc.in \
 	gio-2.0-uninstalled.pc.in		\
-	gio-unix-2.0-uninstalled.pc.in
+	gio-unix-2.0-uninstalled.pc.in		\
+	gdbus-2.0.pc.in				\
+	gdbus-2.0-uninstalled.pc.in		\
+	gdbus-lowlevel-2.0.pc.in		\
+	gdbus-lowlevel-2.0-uninstalled.pc.in
 
 
 # These may be in the builddir too
diff --git a/configure.in b/configure.in
index 3c304fa..195542c 100644
--- a/configure.in
+++ b/configure.in
@@ -3396,6 +3396,8 @@ gio-2.0-uninstalled.pc
 gio-unix-2.0-uninstalled.pc
 gdbus-2.0.pc
 gdbus-2.0-uninstalled.pc
+gdbus-lowlevel-2.0.pc
+gdbus-lowlevel-2.0-uninstalled.pc
 glib-zip
 glib-gettextize
 Makefile
diff --git a/gdbus-2.0.pc.in b/gdbus-2.0.pc.in
index afd3470..696be6b 100644
--- a/gdbus-2.0.pc.in
+++ b/gdbus-2.0.pc.in
@@ -8,4 +8,4 @@ Description: glib D-Bus library
 Version: @VERSION@
 Requires: glib-2.0,gobject-2.0,gio-2.0,gmodule-no-export-2.0
 Libs: -L${libdir} -lgdbus-2.0
-Cflags: 
+Cflags:
diff --git a/gdbus-lowlevel-2.0-uninstalled.pc.in b/gdbus-lowlevel-2.0-uninstalled.pc.in
new file mode 100644
index 0000000..c4df293
--- /dev/null
+++ b/gdbus-lowlevel-2.0-uninstalled.pc.in
@@ -0,0 +1,6 @@
+Name: GDBus lowlevel APIs Uninstalled
+Description: gdbus library lowlevel headers, Not Installed
+Version: @VERSION@
+Requires: gdbus-2.0-uninstalled,dbus-1
+Libs: ${pc_top_builddir}/${pcfiledir}/gdbus/libgdbus-2.0.la
+Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@
diff --git a/gdbus-lowlevel-2.0.pc.in b/gdbus-lowlevel-2.0.pc.in
new file mode 100644
index 0000000..5485efc
--- /dev/null
+++ b/gdbus-lowlevel-2.0.pc.in
@@ -0,0 +1,11 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+
+Name: GDBus lowlevel APIs
+Description: glib D-Bus low-level headers
+Version: @VERSION@
+Requires: gdbus-2.0,dbus-1
+Libs: -L${libdir} -lgdbus-2.0
+Cflags: -I${includedir}/dbus-1.0/gdbus-lowlevel
diff --git a/gdbus/Makefile.am b/gdbus/Makefile.am
index 43a3e0b..343506f 100644
--- a/gdbus/Makefile.am
+++ b/gdbus/Makefile.am
@@ -38,16 +38,17 @@ endif
 endif
 
 AM_CPPFLAGS = \
-	-DG_LOG_DOMAIN=\"GLib-DBus\"			\
-	-I$(top_builddir)				\
-	-I$(top_srcdir)					\
-	-I$(top_srcdir)/glib				\
-	-I$(top_srcdir)/gio				\
-	-I$(top_srcdir)/gobject				\
-	-I$(top_srcdir)/gmodule				\
-	$(GLIB_DEBUG_FLAGS)				\
-	-DG_DISABLE_DEPRECATED				\
-	-DG_DBUS_COMPILATION				\
+	-DG_LOG_DOMAIN=\"GLib-DBus\"				\
+	-I$(top_builddir)					\
+	-I$(top_srcdir)						\
+	-I$(top_srcdir)/glib					\
+	-I$(top_srcdir)/gio					\
+	-I$(top_srcdir)/gobject					\
+	-I$(top_srcdir)/gmodule					\
+	$(GLIB_DEBUG_FLAGS)					\
+	-DG_DISABLE_DEPRECATED					\
+	-DG_DBUS_COMPILATION					\
+	-DG_DBUS_I_UNDERSTAND_THAT_ABI_AND_API_IS_UNSTABLE	\
 	$(NULL)
 
 lib_LTLIBRARIES = libgdbus-2.0.la
@@ -77,7 +78,6 @@ gdbus_headers =				\
 	gdbusenums.h			\
 	gdbustypes.h			\
 	gdbuserror.h			\
-	gdbusmainloop.h			\
 	gdbusconnection.h		\
 	gbusnameowner.h			\
 	gbusnamewatcher.h		\
@@ -94,8 +94,10 @@ libgdbus_2_0_la_SOURCES =						\
 	gdbusenumtypes.h						\
 	gdbus-marshal.h 		gdbus-marshal.c 		\
 	gdbusenumtypes.h		gdbusenumtypes.c		\
+	gdbuserror-lowlevel.h						\
 	gdbuserror.h			gdbuserror.c			\
-	gdbusmainloop.h			gdbusmainloop.c			\
+	gdbusmainloop-lowlevel.h	gdbusmainloop.c			\
+	gdbusconnection.h-lowlevel.h					\
 	gdbusconnection.h		gdbusconnection.c		\
 	gbusnameowner.h			gbusnameowner.c			\
 	gbusnamewatcher.h		gbusnamewatcher.c		\
@@ -157,7 +159,20 @@ libgdbus_2_0_la_DEPENDENCIES = $(gdbus_def)
 gdbusincludedir=$(includedir)/glib-2.0/gdbus/
 gdbusinclude_HEADERS = 			\
 	$(gdbus_headers)		\
-	gdbusenumtypes.h
+	gdbusenumtypes.h		\
+	$(NULL)
+
+gdbuslowlevel_headers = 		\
+	gdbus-lowlevel.h		\
+	gdbuserror-lowlevel.h		\
+	gdbusconnection-lowlevel.h	\
+	gdbusmainloop-lowlevel.h	\
+	$(NULL)
+
+gdbuslowlevelincludedir=$(includedir)/dbus-1.0/gdbus-lowlevel/gdbus
+gdbuslowlevelinclude_HEADERS = 			\
+		$(gdbuslowlevel_headers)	\
+		$(NULL)
 
 # these sources (also mentioned above) are generated.
 BUILT_SOURCES = 			\
diff --git a/gdbus/gbusnameowner.c b/gdbus/gbusnameowner.c
index 50a42c5..f2c8e1b 100644
--- a/gdbus/gbusnameowner.c
+++ b/gdbus/gbusnameowner.c
@@ -29,6 +29,7 @@
 #include "gbusnameowner.h"
 #include "gdbusenumtypes.h"
 #include "gdbusconnection.h"
+#include "gdbusconnection-lowlevel.h"
 #include "gdbuserror.h"
 #include "gdbusprivate.h"
 
diff --git a/gdbus/gbusnameowner.h b/gdbus/gbusnameowner.h
index 7151326..42d9ef9 100644
--- a/gdbus/gbusnameowner.h
+++ b/gdbus/gbusnameowner.h
@@ -28,7 +28,6 @@
 #define __G_BUS_NAME_OWNER_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gbusnamewatcher.c b/gdbus/gbusnamewatcher.c
index b65f1a3..0d2742f 100644
--- a/gdbus/gbusnamewatcher.c
+++ b/gdbus/gbusnamewatcher.c
@@ -29,6 +29,7 @@
 #include "gbusnamewatcher.h"
 #include "gdbusenumtypes.h"
 #include "gdbusconnection.h"
+#include "gdbusconnection-lowlevel.h"
 #include "gdbuserror.h"
 #include "gdbusprivate.h"
 
diff --git a/gdbus/gbusnamewatcher.h b/gdbus/gbusnamewatcher.h
index 06ae840..2c98c06 100644
--- a/gdbus/gbusnamewatcher.h
+++ b/gdbus/gbusnamewatcher.h
@@ -28,7 +28,6 @@
 #define __G_BUS_NAME_WATCHER_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gdbusmainloop.h b/gdbus/gdbus-lowlevel.h
similarity index 56%
copy from gdbus/gdbusmainloop.h
copy to gdbus/gdbus-lowlevel.h
index 77bb0f0..be4660b 100644
--- a/gdbus/gdbusmainloop.h
+++ b/gdbus/gdbus-lowlevel.h
@@ -20,26 +20,20 @@
  * Author: David Zeuthen <davidz redhat com>
  */
 
-#if !defined (__G_DBUS_G_DBUS_H_INSIDE__) && !defined (G_DBUS_COMPILATION)
-#error "Only <gdbus/gdbus.h> can be included directly."
-#endif
-
-#ifndef __G_DBUS_MAINLOOP_H__
-#define __G_DBUS_MAINLOOP_H__
-
-#include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
+#ifndef __G_DBUS_LOWLEVEL_H__
+#define __G_DBUS_LOWLEVEL_H__
 
-G_BEGIN_DECLS
+#define __G_DBUS_G_DBUS_LOWLEVEL_H_INSIDE__
 
-void g_dbus_integrate_dbus_1_connection   (DBusConnection *connection,
-                                           GMainContext   *context);
-void g_dbus_unintegrate_dbus_1_connection (DBusConnection *connection);
+#ifndef G_DBUS_I_UNDERSTAND_THAT_ABI_AND_API_IS_UNSTABLE
+#error "This part of the GDBus ABI and API marked as unstable. It is only provided for language bindings. You need to define G_DBUS_I_UNDERSTAND_THAT_ABI_AND_API_IS_UNSTABLE to this API."
+#endif
 
-void g_dbus_integrate_dbus_1_server       (DBusServer   *server,
-                                           GMainContext *context);
-void g_dbus_unintegrate_dbus_1_server     (DBusServer   *server);
+#include <dbus/dbus.h>
+#include <gdbus/gdbus.h>
+#include <gdbus/gdbuserror-lowlevel.h>
+#include <gdbus/gdbusconnection-lowlevel.h>
 
-G_END_DECLS
+#undef __G_DBUS_G_DBUS_LOWLEVEL_H_INSIDE__
 
-#endif /* __G_DBUS_CONNECTION_H__ */
+#endif /* __G_DBUS_LOWLEVEL_H__ */
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 65595e4..48d946e 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -27,7 +27,6 @@
 
 #include <gdbus/gdbustypes.h>
 #include <gdbus/gdbusenumtypes.h>
-#include <gdbus/gdbusmainloop.h>
 #include <gdbus/gdbusconnection.h>
 #include <gdbus/gdbuserror.h>
 #include <gdbus/gbusnameowner.h>
@@ -38,6 +37,6 @@
 #include <gdbus/gdbusstructure.h>
 #include <gdbus/gdbusvariant.h>
 
-#undef __G_DBUS_D_DBUS_H_INSIDE__
+#undef __G_DBUS_G_DBUS_H_INSIDE__
 
 #endif /* __G_DBUS_H__ */
diff --git a/gdbus/gdbus.symbols b/gdbus/gdbus.symbols
index 31bdb0e..6a32e5c 100644
--- a/gdbus/gdbus.symbols
+++ b/gdbus/gdbus.symbols
@@ -25,6 +25,11 @@ g_dbus_connection_get_bus_type
 g_dbus_connection_get_exit_on_close
 g_dbus_connection_set_exit_on_close
 g_dbus_connection_get_is_initialized
+#endif
+#endif
+
+#if IN_HEADER(__G_DBUS_CONNECTION_LOWLEVEL_H__)
+#if IN_FILE(__G_DBUS_CONNECTION_C__)
 g_dbus_connection_get_dbus_1_connection
 g_dbus_connection_send_dbus_1_message
 g_dbus_connection_send_dbus_1_message_with_reply
@@ -36,7 +41,7 @@ g_dbus_connection_dbus_1_signal_unsubscribe
 #endif
 #endif
 
-#if IN_HEADER(__G_DBUS_MAINLOOP_H__)
+#if IN_HEADER(__G_DBUS_MAINLOOP_LOWLEVEL_H__)
 #if IN_FILE(__G_DBUS_MAINLOOP_C__)
 g_dbus_integrate_dbus_1_connection
 g_dbus_unintegrate_dbus_1_connection
@@ -85,6 +90,10 @@ g_dbus_proxy_flags_get_type G_GNUC_CONST
 #if IN_FILE(__G_DBUS_ERROR_C__)
 g_dbus_error_quark
 g_dbus_error_get_remote_exception
+#endif
+#endif
+#if IN_HEADER(__G_DBUS_ERROR_LOWLEVEL_H__)
+#if IN_FILE(__G_DBUS_ERROR_C__)
 g_dbus_error_new_for_dbus_error
 g_dbus_error_new_for_dbus_error_valist
 g_dbus_error_new_for_gerror
diff --git a/gdbus/gdbusconnection-lowlevel.h b/gdbus/gdbusconnection-lowlevel.h
new file mode 100644
index 0000000..05a708b
--- /dev/null
+++ b/gdbus/gdbusconnection-lowlevel.h
@@ -0,0 +1,76 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * 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 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., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz redhat com>
+ */
+
+#if !defined (__G_DBUS_G_DBUS_LOWLEVEL_H_INSIDE__) && !defined (G_DBUS_COMPILATION)
+#error "Only <gdbus/gdbus-lowlevel.h> can be included directly."
+#endif
+
+#ifndef __G_DBUS_CONNECTION_LOWLEVEL_H__
+#define __G_DBUS_CONNECTION_LOWLEVEL_H__
+
+#include <gdbus/gdbus-lowlevel.h>
+#include <dbus/dbus.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GDBusSignalCallback1:
+ * @connection: A #GDBusConnection.
+ * @message: A #DBusMessage.
+ * @user_data: User data passed when subscribing to the signal.
+ *
+ * Signature for callback function used in g_dbus_connection_dbus_1_signal_subscribe().
+ */
+typedef void (*GDBusSignalCallback1) (GDBusConnection  *connection,
+                                      DBusMessage      *message,
+                                      gpointer          user_data);
+
+DBusConnection  *g_dbus_connection_get_dbus_1_connection                 (GDBusConnection    *connection);
+void             g_dbus_connection_send_dbus_1_message                   (GDBusConnection    *connection,
+                                                                          DBusMessage        *message);
+guint            g_dbus_connection_send_dbus_1_message_with_reply        (GDBusConnection    *connection,
+                                                                          DBusMessage        *message,
+                                                                          gint                timeout_msec,
+                                                                          GCancellable       *cancellable,
+                                                                          GAsyncReadyCallback callback,
+                                                                          gpointer            user_data);
+void             g_dbus_connection_send_dbus_1_message_block             (GDBusConnection    *connection,
+                                                                          guint               pending_call_id);
+void             g_dbus_connection_send_dbus_1_message_cancel            (GDBusConnection    *connection,
+                                                                          guint               pending_call_id);
+DBusMessage     *g_dbus_connection_send_dbus_1_message_with_reply_finish (GDBusConnection    *connection,
+                                                                          GAsyncResult       *res,
+                                                                          GError            **error);
+guint            g_dbus_connection_dbus_1_signal_subscribe               (GDBusConnection    *connection,
+                                                                          const gchar        *sender,
+                                                                          const gchar        *interface_name,
+                                                                          const gchar        *member,
+                                                                          const gchar        *object_path,
+                                                                          const gchar        *arg0,
+                                                                          GDBusSignalCallback1 callback,
+                                                                          gpointer            user_data);
+void             g_dbus_connection_dbus_1_signal_unsubscribe             (GDBusConnection    *connection,
+                                                                          guint               subscription_id);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_CONNECTION_LOWLEVEL_H__ */
diff --git a/gdbus/gdbusconnection.c b/gdbus/gdbusconnection.c
index f077a91..ec528da 100644
--- a/gdbus/gdbusconnection.c
+++ b/gdbus/gdbusconnection.c
@@ -27,7 +27,8 @@
 #include <glib/gi18n.h>
 
 #include "gdbusconnection.h"
-#include "gdbusmainloop.h"
+#include "gdbusconnection-lowlevel.h"
+#include "gdbusmainloop-lowlevel.h"
 #include "gdbuserror.h"
 #include "gdbusprivate.h"
 #include "gdbusenumtypes.h"
@@ -96,7 +97,6 @@ enum
   PROP_IS_OPEN,
   PROP_IS_INITIALIZED,
   PROP_EXIT_ON_CLOSE,
-  PROP_DBUS_1_CONNECTION,
 };
 
 static void distribute_signals (GDBusConnection *connection,
@@ -184,10 +184,6 @@ g_dbus_connection_get_property (GObject    *object,
 
   switch (prop_id)
     {
-    case PROP_DBUS_1_CONNECTION:
-      g_value_set_pointer (value, g_dbus_connection_get_dbus_1_connection (connection));
-      break;
-
     case PROP_BUS_TYPE:
       g_value_set_enum (value, g_dbus_connection_get_bus_type (connection));
       break;
@@ -228,10 +224,6 @@ g_dbus_connection_set_property (GObject      *object,
 
   switch (prop_id)
     {
-    case PROP_DBUS_1_CONNECTION:
-      g_dbus_connection_set_dbus_1_connection (connection, g_value_get_pointer (value));
-      break;
-
     case PROP_BUS_TYPE:
       connection->priv->bus_type = g_value_get_enum (value);
       break;
@@ -267,24 +259,6 @@ g_dbus_connection_class_init (GDBusConnectionClass *klass)
   gobject_class->get_property = g_dbus_connection_get_property;
 
   /**
-   * GDBusConnection:dbus-1-connection:
-   *
-   * The underlying #DBusConnection object for the connection or %NULL
-   * if the connection is not open.
-   */
-  g_object_class_install_property (gobject_class,
-                                   PROP_DBUS_1_CONNECTION,
-                                   g_param_spec_pointer ("dbus-1-connection",
-                                                         _("dbus-1-connection"),
-                                                         _("The underlying DBusConnection object for the connection"),
-                                                         G_PARAM_WRITABLE |
-                                                         G_PARAM_READABLE |
-                                                         G_PARAM_CONSTRUCT_ONLY |
-                                                         G_PARAM_STATIC_NAME |
-                                                         G_PARAM_STATIC_BLURB |
-                                                         G_PARAM_STATIC_NICK));
-
-  /**
    * GDBusConnection:bus-type:
    *
    * When constructing an object, set this to the type of the message bus
@@ -559,6 +533,10 @@ g_dbus_connection_get_is_private (GDBusConnection *connection)
  * g_dbus_connection_get_dbus_1_connection:
  * @connection: A #GDBusConnection.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Gets the underlying #DBusConnection object for @connection.
  *
  * Returns: %NULL if the connection is not open, otherwise a
@@ -1064,6 +1042,10 @@ g_dbus_connection_get_unique_name (GDBusConnection *connection)
  * @connection: A #GDBusConnection.
  * @message: A #DBusMessage
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Sends @message on @connection. If @connection is closed, this function is a no-op.
  *
  * This function is intended for use by object mappings only.
@@ -1156,6 +1138,10 @@ send_dbus_1_message_with_reply_cancelled_cb (GCancellable *cancellable,
  * @connection: A #GDBusConnection.
  * @pending_call_id: A pending call id obtained from g_dbus_connection_send_dbus_1_message_with_reply().
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Cancels the pending call specified by @pending_call_id.
  *
  * The #GAsyncReadyCallback passed to g_dbus_connection_send_dbus_1_message_with_reply() will
@@ -1193,6 +1179,10 @@ g_dbus_connection_send_dbus_1_message_cancel (GDBusConnection *connection,
  * @connection: A #GDBusConnection.
  * @pending_call_id: A pending call id obtained from g_dbus_connection_send_dbus_1_message_with_reply().
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Blocks until the pending call specified by @pending_call_id is done. This will
  * not block in the main loop. You are guaranteed that the #GAsyncReadyCallback passed to
  * g_dbus_connection_send_dbus_1_message_with_reply() is invoked before this function returns.
@@ -1234,6 +1224,10 @@ g_dbus_connection_send_dbus_1_message_block (GDBusConnection *connection,
  * @callback: Callback function to invoke when the reply is ready.
  * @user_data: User data to pass to @callback.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Asynchronously sends @message on @connection and invokes @callback when the reply is
  * ready. In @callback you should call g_dbus_connection_send_dbus_1_message_with_reply_finish() to
  * get the reply.
@@ -1362,6 +1356,10 @@ g_dbus_connection_send_dbus_1_message_with_reply (GDBusConnection    *connection
  * to g_dbus_connection_send_dbus_1_message_with_reply().
  * @error: Return location for error or %NULL.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Finishes sending a message with reply.
  *
  * Note that @error is only set if the #GCancellable passed to g_dbus_connection_send_dbus_1_message_with_reply()
@@ -1599,6 +1597,10 @@ is_signal_data_for_name_lost_or_acquired (SignalData *signal_data)
  * @callback: Callback to invoke when there is a signal matching the requested data.
  * @user_data: User data to pass to @callback.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Subscribes to signals on @connection and invokes @callback with a #DBusMessage whenever the signal
  * is fired. This function handles setting up match rules on the bus.
  *
@@ -1709,6 +1711,10 @@ g_dbus_connection_dbus_1_signal_subscribe (GDBusConnection     *connection,
  * @connection: A #GDBusConnection.
  * @subscription_id: A subscription id obtained from g_dbus_connection_dbus_1_signal_subscribe().
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Unsubscribes from signals.
  **/
 void
diff --git a/gdbus/gdbusconnection.h b/gdbus/gdbusconnection.h
index 26e2ca1..137ad03 100644
--- a/gdbus/gdbusconnection.h
+++ b/gdbus/gdbusconnection.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_CONNECTION_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
@@ -99,47 +98,6 @@ gboolean         g_dbus_connection_get_exit_on_close          (GDBusConnection
 void             g_dbus_connection_set_exit_on_close          (GDBusConnection    *connection,
                                                                gboolean            exit_on_close);
 
-/* the following functions are intended only for language bindings and object mappings */
-
-/**
- * GDBusSignalCallback1:
- * @connection: A #GDBusConnection.
- * @message: A #DBusMessage.
- * @user_data: User data passed when subscribing to the signal.
- *
- * Signature for callback function used in g_dbus_connection_dbus_1_signal_subscribe().
- */
-typedef void (*GDBusSignalCallback1) (GDBusConnection  *connection,
-                                      DBusMessage      *message,
-                                      gpointer          user_data);
-
-DBusConnection  *g_dbus_connection_get_dbus_1_connection                 (GDBusConnection    *connection);
-void             g_dbus_connection_send_dbus_1_message                   (GDBusConnection    *connection,
-                                                                          DBusMessage        *message);
-guint            g_dbus_connection_send_dbus_1_message_with_reply        (GDBusConnection    *connection,
-                                                                          DBusMessage        *message,
-                                                                          gint                timeout_msec,
-                                                                          GCancellable       *cancellable,
-                                                                          GAsyncReadyCallback callback,
-                                                                          gpointer            user_data);
-void             g_dbus_connection_send_dbus_1_message_block             (GDBusConnection    *connection,
-                                                                          guint               pending_call_id);
-void             g_dbus_connection_send_dbus_1_message_cancel            (GDBusConnection    *connection,
-                                                                          guint               pending_call_id);
-DBusMessage     *g_dbus_connection_send_dbus_1_message_with_reply_finish (GDBusConnection    *connection,
-                                                                          GAsyncResult       *res,
-                                                                          GError            **error);
-guint            g_dbus_connection_dbus_1_signal_subscribe               (GDBusConnection    *connection,
-                                                                          const gchar        *sender,
-                                                                          const gchar        *interface_name,
-                                                                          const gchar        *member,
-                                                                          const gchar        *object_path,
-                                                                          const gchar        *arg0,
-                                                                          GDBusSignalCallback1 callback,
-                                                                          gpointer            user_data);
-void             g_dbus_connection_dbus_1_signal_unsubscribe             (GDBusConnection    *connection,
-                                                                          guint               subscription_id);
-
 G_END_DECLS
 
 #endif /* __G_DBUS_CONNECTION_H__ */
diff --git a/gdbus/gdbusenums.h b/gdbus/gdbusenums.h
index 8417de8..db98332 100644
--- a/gdbus/gdbusenums.h
+++ b/gdbus/gdbusenums.h
@@ -29,7 +29,6 @@
 
 #include <glib-object.h>
 #include <gio/gio.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
@@ -45,9 +44,9 @@ G_BEGIN_DECLS
 typedef enum
 {
   G_BUS_TYPE_NONE    = -1,
-  G_BUS_TYPE_SESSION = DBUS_BUS_SESSION,
-  G_BUS_TYPE_SYSTEM  = DBUS_BUS_SYSTEM,
-  G_BUS_TYPE_STARTER = DBUS_BUS_STARTER,
+  G_BUS_TYPE_SESSION = 0,
+  G_BUS_TYPE_SYSTEM  = 1,
+  G_BUS_TYPE_STARTER = 2
 } GBusType;
 
 /**
diff --git a/gdbus/gdbuserror-lowlevel.h b/gdbus/gdbuserror-lowlevel.h
new file mode 100644
index 0000000..482c5da
--- /dev/null
+++ b/gdbus/gdbuserror-lowlevel.h
@@ -0,0 +1,65 @@
+/* GDBus - GLib D-Bus Library
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * 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 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., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz redhat com>
+ */
+
+#if !defined (__G_DBUS_G_DBUS_LOWLEVEL_H_INSIDE__) && !defined (G_DBUS_COMPILATION)
+#error "Only <gdbus/gdbus-lowlevel.h> can be included directly."
+#endif
+
+#ifndef __G_DBUS_ERROR_LOWLEVEL_H__
+#define __G_DBUS_ERROR_LOWLEVEL_H__
+
+#include <gdbus/gdbus-lowlevel.h>
+
+G_BEGIN_DECLS
+
+/* Map DBusError to GError (only intended for object mappings) */
+
+GError *g_dbus_error_new_for_dbus_error_valist (DBusError   *dbus_error,
+                                                GType       *error_types,
+                                                const gchar *prepend_format,
+                                                va_list      va_args);
+
+GError *g_dbus_error_new_for_dbus_error (DBusError   *dbus_error,
+                                         GType       *error_types,
+                                         const gchar *prepend_format,
+                                         ...);
+
+void g_dbus_error_set_dbus_error (GError      **error,
+                                  DBusError    *dbus_error,
+                                  GType        *error_types,
+                                  const gchar  *prepend_format,
+                                  ...);
+
+void g_dbus_error_set_dbus_error_valist (GError      **error,
+                                         DBusError    *dbus_error,
+                                         GType        *error_types,
+                                         const gchar  *prepend_format,
+                                         va_list       va_args);
+
+/* Map GError to DBusError (only intended for object mappings) */
+
+void g_dbus_error_new_for_gerror (GError    *error,
+                                  DBusError *dbus_error);
+
+G_END_DECLS
+
+#endif /* __G_DBUS_ERROR_LOWLEVEL_H__ */
diff --git a/gdbus/gdbuserror.c b/gdbus/gdbuserror.c
index a76b375..ac9b715 100644
--- a/gdbus/gdbuserror.c
+++ b/gdbus/gdbuserror.c
@@ -27,6 +27,7 @@
 #include <glib/gi18n.h>
 
 #include "gdbuserror.h"
+#include "gdbuserror-lowlevel.h"
 #include "gdbusenumtypes.h"
 
 #include "gdbusalias.h"
@@ -126,6 +127,10 @@ g_dbus_error_get_remote_exception (GError  *error,
  * @error: A #GError.
  * @dbus_error: Return location for #DBusError.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Utility function to map a #GError to a #DBusError by getting the
  * D-Bus error name from the nick of the element of the registered
  * enumeration type for the error domain for @error.
@@ -298,6 +303,10 @@ _g_dbus_error_decode_gerror (const gchar *dbus_name,
  * @prepend_format: %NULL or format for message to prepend to the D-Bus error message.
  * @va_args: Arguments for @prepend_format.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Like g_dbus_error_new_for_dbus_error() but intended for language
  * bindings.
  *
@@ -397,6 +406,10 @@ g_dbus_error_new_for_dbus_error_valist (DBusError   *dbus_error,
  * @prepend_format: %NULL or format for message to prepend to the D-Bus error message.
  * @...: Arguments for @prepend_format.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Utility function to map a #DBusError to a #GError by matching the
  * name of @dbus_error with the nick names in the enumerations
  * specified by the @error_types array.
@@ -441,6 +454,10 @@ g_dbus_error_new_for_dbus_error (DBusError   *dbus_error,
  * @prepend_format: %NULL or format for message to prepend to the D-Bus error message.
  * @...: Arguments for @prepend_format.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Does nothing if @error is %NULL; if @error is non-%NULL, then
  * * error must be NULL. A new #GError is created and assigned to
  * * error using g_dbus_error_new_for_dbus_error().
@@ -477,6 +494,10 @@ g_dbus_error_set_dbus_error (GError      **error,
  * @prepend_format: %NULL or format for message to prepend to the D-Bus error message.
  * @va_args: Arguments for @prepend_format.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Like g_dbus_error_set_dbus_error() but intended for language
  * bindings.
  *
diff --git a/gdbus/gdbuserror.h b/gdbus/gdbuserror.h
index 3922ad6..8844fbe 100644
--- a/gdbus/gdbuserror.h
+++ b/gdbus/gdbuserror.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_ERROR_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
@@ -46,35 +45,6 @@ gboolean g_dbus_error_get_remote_exception (GError  *error,
                                             gchar  **out_name,
                                             gchar  **out_message);
 
-/* Map DBusError to GError (only intended for object mappings) */
-
-GError *g_dbus_error_new_for_dbus_error_valist (DBusError   *dbus_error,
-                                                GType       *error_types,
-                                                const gchar *prepend_format,
-                                                va_list      va_args);
-
-GError *g_dbus_error_new_for_dbus_error (DBusError   *dbus_error,
-                                         GType       *error_types,
-                                         const gchar *prepend_format,
-                                         ...);
-
-void g_dbus_error_set_dbus_error (GError      **error,
-                                  DBusError    *dbus_error,
-                                  GType        *error_types,
-                                  const gchar  *prepend_format,
-                                  ...);
-
-void g_dbus_error_set_dbus_error_valist (GError      **error,
-                                         DBusError    *dbus_error,
-                                         GType        *error_types,
-                                         const gchar  *prepend_format,
-                                         va_list       va_args);
-
-/* Map GError to DBusError (only intended for object mappings) */
-
-void g_dbus_error_new_for_gerror (GError    *error,
-                                  DBusError *dbus_error);
-
 G_END_DECLS
 
 #endif /* __G_DBUS_ERROR_H__ */
diff --git a/gdbus/gdbusmainloop.h b/gdbus/gdbusmainloop-lowlevel.h
similarity index 92%
rename from gdbus/gdbusmainloop.h
rename to gdbus/gdbusmainloop-lowlevel.h
index 77bb0f0..a3ecca2 100644
--- a/gdbus/gdbusmainloop.h
+++ b/gdbus/gdbusmainloop-lowlevel.h
@@ -24,8 +24,8 @@
 #error "Only <gdbus/gdbus.h> can be included directly."
 #endif
 
-#ifndef __G_DBUS_MAINLOOP_H__
-#define __G_DBUS_MAINLOOP_H__
+#ifndef __G_DBUS_MAINLOOP_LOWLEVEL_H__
+#define __G_DBUS_MAINLOOP_LOWLEVEL_H__
 
 #include <gdbus/gdbustypes.h>
 #include <dbus/dbus.h>
@@ -42,4 +42,4 @@ void g_dbus_unintegrate_dbus_1_server     (DBusServer   *server);
 
 G_END_DECLS
 
-#endif /* __G_DBUS_CONNECTION_H__ */
+#endif /* __G_DBUS_MAINLOOP_LOWLEVEL_H__ */
diff --git a/gdbus/gdbusmainloop.c b/gdbus/gdbusmainloop.c
index 5347585..ddac14f 100644
--- a/gdbus/gdbusmainloop.c
+++ b/gdbus/gdbusmainloop.c
@@ -24,7 +24,7 @@
 
 #include <glib/gi18n.h>
 
-#include "gdbusmainloop.h"
+#include "gdbusmainloop-lowlevel.h"
 #include "gdbusprivate.h"
 
 #include "gdbusalias.h"
@@ -33,7 +33,8 @@
  * SECTION:gdbusmainloop
  * @title: Main-loop integration
  * @short_description: Main-loop integration routines
- * @include: gdbus/gdbus.h
+ * @include: gdbus/gdbus-lowlevel.h
+ * @stability: Unstable
  *
  * Routines for integration #DBusConnection and #DBusServer objects
  * with the GLib main loop.
@@ -564,6 +565,10 @@ ensure_slots (void)
  * @connection: A #DBusConnection.
  * @context: the #GMainContext or #NULL for default context
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Sets the watch and timeout functions of @connection to integrate
  * the connection with the GLib main loop.  Pass in #NULL for the
  * #GMainContext unless you're doing something specialized.
@@ -635,6 +640,10 @@ g_dbus_integrate_dbus_1_connection (DBusConnection *connection,
  * g_dbus_unintegrate_dbus_1_connection:
  * @connection: A #DBusConnection.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Removes mainloop integration for @connection.
  **/
 void
@@ -675,6 +684,10 @@ g_dbus_unintegrate_dbus_1_connection (DBusConnection *connection)
  * @server: A #DBusServer.
  * @context: the #GMainContext or #NULL for default
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Sets the watch and timeout functions of a #DBusServer
  * to integrate the server with the GLib main loop.
  * In most cases the context argument should be #NULL.
@@ -746,6 +759,10 @@ g_dbus_integrate_dbus_1_server (DBusServer   *server,
  * g_dbus_unintegrate_dbus_1_server:
  * @server: A #DBusServer.
  *
+ * <para><note>
+ * This function is marked as unstable API. You must include <literal>gdbus/gdbus-lowlevel.h</literal> to use it.
+ * </note></para>
+ *
  * Removes mainloop integration for @server.
  **/
 void
diff --git a/gdbus/gdbusnameowning.h b/gdbus/gdbusnameowning.h
index 09040c5..147176b 100644
--- a/gdbus/gdbusnameowning.h
+++ b/gdbus/gdbusnameowning.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_NAME_OWNING_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gdbusnamewatching.h b/gdbus/gdbusnamewatching.h
index 900a0c2..680ba17 100644
--- a/gdbus/gdbusnamewatching.h
+++ b/gdbus/gdbusnamewatching.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_NAME_WATCHING_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gdbusprivate.c b/gdbus/gdbusprivate.c
index 411e0fd..dcb42a6 100644
--- a/gdbus/gdbusprivate.c
+++ b/gdbus/gdbusprivate.c
@@ -27,6 +27,8 @@
 
 #include <glib/gi18n.h>
 
+#include <dbus/dbus.h>
+
 #include "gdbustypes.h"
 #include "gdbusprivate.h"
 #include "gdbusvariant.h"
diff --git a/gdbus/gdbusproxy.c b/gdbus/gdbusproxy.c
index 7e80885..1689497 100644
--- a/gdbus/gdbusproxy.c
+++ b/gdbus/gdbusproxy.c
@@ -29,6 +29,7 @@
 #include "gdbusproxy.h"
 #include "gdbusenumtypes.h"
 #include "gdbusconnection.h"
+#include "gdbusconnection-lowlevel.h"
 #include "gdbuserror.h"
 #include "gdbusstructure.h"
 #include "gdbusvariant.h"
diff --git a/gdbus/gdbusproxy.h b/gdbus/gdbusproxy.h
index 6b63efd..2618fb0 100644
--- a/gdbus/gdbusproxy.h
+++ b/gdbus/gdbusproxy.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_PROXY_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gdbusstructure.c b/gdbus/gdbusstructure.c
index 02c7dcb..b2fa587 100644
--- a/gdbus/gdbusstructure.c
+++ b/gdbus/gdbusstructure.c
@@ -26,6 +26,7 @@
 #include <glib/gi18n.h>
 #include <gobject/gvaluecollector.h>
 
+#include "gdbus-lowlevel.h"
 #include "gdbusstructure.h"
 #include "gdbusenumtypes.h"
 #include "gdbusconnection.h"
diff --git a/gdbus/gdbusstructure.h b/gdbus/gdbusstructure.h
index 2978e52..43b5b03 100644
--- a/gdbus/gdbusstructure.h
+++ b/gdbus/gdbusstructure.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_STRUCTURE_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/gdbusvariant.h b/gdbus/gdbusvariant.h
index d455642..0637d51 100644
--- a/gdbus/gdbusvariant.h
+++ b/gdbus/gdbusvariant.h
@@ -28,7 +28,6 @@
 #define __G_DBUS_VARIANT_H__
 
 #include <gdbus/gdbustypes.h>
-#include <dbus/dbus.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdbus/tests/connection.c b/gdbus/tests/connection.c
index 087813d..60267d1 100644
--- a/gdbus/tests/connection.c
+++ b/gdbus/tests/connection.c
@@ -21,6 +21,8 @@
  */
 
 #include <gdbus/gdbus.h>
+#define G_DBUS_I_UNDERSTAND_THAT_ABI_AND_API_IS_UNSTABLE
+#include <gdbus/gdbus-lowlevel.h>
 #include <unistd.h>
 
 #include "tests.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]