diff options
author | Simon McVittie <smcv@debian.org> | 2018-01-22 16:47:21 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2018-01-22 18:27:20 +0000 |
commit | b6f7c810cf97914b6b90836f3d59ea256f318bcb (patch) | |
tree | 5407a8a4625a0ea1c8d49d2f9ce46c7e326dd4a7 /dbus | |
parent | 892d30196cbad5449c42b08f4d5496b2ffcdb562 (diff) | |
download | dbus-glib-b6f7c810cf97914b6b90836f3d59ea256f318bcb.tar.gz |
Make dbus-gmain.h internal, and rename its symbols
If we embed dbus-gmain in dbus-glib, dbus-python, at-spi2-core and
others as a submodule or subtree, we won't want it to export the
same ABI in all of them.
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/Makefile.am | 2 | ||||
-rw-r--r-- | dbus/dbus-glib-lowlevel.h | 6 | ||||
-rw-r--r-- | dbus/dbus-glib.c | 48 | ||||
-rw-r--r-- | dbus/dbus-gmain.c | 16 | ||||
-rw-r--r-- | dbus/dbus-gmain.h | 13 |
5 files changed, 68 insertions, 17 deletions
diff --git a/dbus/Makefile.am b/dbus/Makefile.am index 91ca3ab..ae56918 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -27,6 +27,7 @@ DBUS_GLIB_INTERNALS = \ libdbus_glib_1_la_SOURCES = \ dbus-glib.c \ dbus-gmain.c \ + dbus-gmain.h \ dbus-gmarshal.c \ dbus-gmarshal.h \ dbus-gobject.c \ @@ -45,7 +46,6 @@ libdbus_glib_HEADERS = \ dbus-gvalue-parse-variant.h \ dbus-glib.h \ dbus-glib-lowlevel.h \ - dbus-gmain.h \ $(NULL) libdbus_glibdir = $(includedir)/dbus-1.0/dbus diff --git a/dbus/dbus-glib-lowlevel.h b/dbus/dbus-glib-lowlevel.h index bd479ad..d08f951 100644 --- a/dbus/dbus-glib-lowlevel.h +++ b/dbus/dbus-glib-lowlevel.h @@ -25,7 +25,6 @@ #define DBUS_GLIB_LOWLEVEL_H #include <dbus/dbus-glib.h> -#include <dbus/dbus-gmain.h> #include <dbus/dbus.h> G_BEGIN_DECLS @@ -38,6 +37,11 @@ void dbus_set_g_error (GError **gerror, GType dbus_connection_get_g_type (void) G_GNUC_CONST; GType dbus_message_get_g_type (void) G_GNUC_CONST; +void dbus_connection_setup_with_g_main (DBusConnection *connection, + GMainContext *context); +void dbus_server_setup_with_g_main (DBusServer *server, + GMainContext *context); + void dbus_g_proxy_send (DBusGProxy *proxy, DBusMessage *message, dbus_uint32_t *client_serial); diff --git a/dbus/dbus-glib.c b/dbus/dbus-glib.c index 66bab44..1219c18 100644 --- a/dbus/dbus-glib.c +++ b/dbus/dbus-glib.c @@ -24,6 +24,7 @@ #include <config.h> #include "dbus/dbus-glib.h" #include "dbus/dbus-glib-lowlevel.h" +#include "dbus-gmain.h" #include "dbus-gtest.h" #include "dbus-gutils.h" #include "dbus-gvalue.h" @@ -589,3 +590,50 @@ dbus_g_bus_get_private (DBusBusType type, return DBUS_G_CONNECTION_FROM_CONNECTION (connection); } + +/** + * dbus_connection_setup_with_g_main: + * @connection: the connection + * @context: the #GMainContext or %NULL for default context + * + * Sets the watch and timeout functions of a #DBusConnection + * to integrate the connection with the GLib main loop. + * Pass in %NULL for the #GMainContext unless you're + * doing something specialized. + * + * If called twice for the same context, does nothing the second + * time. If called once with context A and once with context B, + * context B replaces context A as the context monitoring the + * connection. + * + * Deprecated: New code should use GDBus instead. + */ +void +dbus_connection_setup_with_g_main (DBusConnection *connection, + GMainContext *context) +{ + dbus_gmain_set_up_connection (connection, context); +} + +/** + * dbus_server_setup_with_g_main: + * @server: the server + * @context: the #GMainContext or %NULL for default + * + * 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. + * + * If called twice for the same context, does nothing the second + * time. If called once with context A and once with context B, + * context B replaces context A as the context monitoring the + * connection. + * + * Deprecated: New code should use GDBus instead. + */ +void +dbus_server_setup_with_g_main (DBusServer *server, + GMainContext *context) +{ + dbus_gmain_set_up_server (server, context); +} diff --git a/dbus/dbus-gmain.c b/dbus/dbus-gmain.c index 412a7a6..034354c 100644 --- a/dbus/dbus-gmain.c +++ b/dbus/dbus-gmain.c @@ -508,7 +508,7 @@ connection_setup_new_from_old (GMainContext *context, } /** - * dbus_connection_setup_with_g_main: + * dbus_gmain_set_up_connection: * @connection: the connection * @context: the #GMainContext or %NULL for default context * @@ -521,12 +521,10 @@ connection_setup_new_from_old (GMainContext *context, * time. If called once with context A and once with context B, * context B replaces context A as the context monitoring the * connection. - * - * Deprecated: New code should use GDBus instead. */ void -dbus_connection_setup_with_g_main (DBusConnection *connection, - GMainContext *context) +dbus_gmain_set_up_connection (DBusConnection *connection, + GMainContext *context) { ConnectionSetup *old_setup; ConnectionSetup *cs; @@ -588,7 +586,7 @@ dbus_connection_setup_with_g_main (DBusConnection *connection, } /** - * dbus_server_setup_with_g_main: + * dbus_gmain_set_up_server: * @server: the server * @context: the #GMainContext or %NULL for default * @@ -600,12 +598,10 @@ dbus_connection_setup_with_g_main (DBusConnection *connection, * time. If called once with context A and once with context B, * context B replaces context A as the context monitoring the * connection. - * - * Deprecated: New code should use GDBus instead. */ void -dbus_server_setup_with_g_main (DBusServer *server, - GMainContext *context) +dbus_gmain_set_up_server (DBusServer *server, + GMainContext *context) { ConnectionSetup *old_setup; ConnectionSetup *cs; diff --git a/dbus/dbus-gmain.h b/dbus/dbus-gmain.h index 111772e..e442c2d 100644 --- a/dbus/dbus-gmain.h +++ b/dbus/dbus-gmain.h @@ -29,14 +29,17 @@ G_BEGIN_DECLS -void dbus_connection_setup_with_g_main (DBusConnection *connection, - GMainContext *context); -void dbus_server_setup_with_g_main (DBusServer *server, - GMainContext *context); +G_GNUC_INTERNAL +void dbus_gmain_set_up_connection (DBusConnection *connection, + GMainContext *context); + +G_GNUC_INTERNAL +void dbus_gmain_set_up_server (DBusServer *server, + GMainContext *context); G_END_DECLS -#endif /* DBUS_GLIB_LOWLEVEL_H */ +#endif /* DBUS_GMAIN_H */ |