summaryrefslogtreecommitdiff
path: root/gio/src/dbusserver.ccg
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2011-02-16 11:29:19 +0100
committerMurray Cumming <murrayc@murrayc.com>2011-02-16 11:29:19 +0100
commit4e118b927f83290bae27bcae707be8e1c83f47d5 (patch)
treeec7ec4fa6c8424e19a97dc935d6f4e61ece8d882 /gio/src/dbusserver.ccg
parentce84ddbd917364c61d50c3921c1f32fdde9f6698 (diff)
downloadglibmm-4e118b927f83290bae27bcae707be8e1c83f47d5.tar.gz
Move the DBus classes into a Gio::DBus namespace.
* gio/giomm.h: * gio/src/dbus*.[hg|ccg] * gio/src/error.hg: Rename all DBus* classes to remove the prefix, putting them in a Gio::DBus namespace. This required the use of the new _GMMPROC_EXTRA_NAMESPACE macro, to avoid generating a confused wrap_init.cc. Along the way, I removed unnecessary class predeclarations, instead including the relevant header, because that is more convenient for users of the API. * gio/src/dbuserror.[hg|ccg]: Renamed to dbuserrorutils.[hg|ccg] and renamed the Error namespace to ErrorUtils, to avoid a clash with the Gio::DBus::Error exception. * gio/src/filelist.am: * tools/m4/convert_gio.m4: Changed some conversions. * examples/dbus/busserver.cc: * examples/dbus/peer.cc: * examples/dbus/userbus.cc: Adapted. This is generally more organized. A prefix, instead of a namespace, looked generally wrong to C++ coders.
Diffstat (limited to 'gio/src/dbusserver.ccg')
-rw-r--r--gio/src/dbusserver.ccg60
1 files changed, 32 insertions, 28 deletions
diff --git a/gio/src/dbusserver.ccg b/gio/src/dbusserver.ccg
index f2bba79a..0aea4888 100644
--- a/gio/src/dbusserver.ccg
+++ b/gio/src/dbusserver.ccg
@@ -24,13 +24,16 @@
namespace Gio
{
+namespace DBus
+{
+
//TODO: Uncomment when bug #639478 is resolved.
/*
-DBusServer::DBusServer(const std::string& address,
+Server::Server(const std::string& address,
const std::string& guid,
- const Glib::RefPtr<DBusAuthObserver>& observer,
+ const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- DBusServerFlags flags)
+ ServerFlags flags)
: _CONSTRUCT("address",
(address.empty() ? static_cast<char*>(0) : address.c_str()),
"flags", static_cast<GDBusServerFlags>(flags),
@@ -40,10 +43,10 @@ DBusServer::DBusServer(const std::string& address,
init(cancellable);
}
-DBusServer::DBusServer(const std::string& address,
+Server::Server(const std::string& address,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
- DBusServerFlags flags)
+ ServerFlags flags)
: _CONSTRUCT("address",
(address.empty() ? static_cast<char*>(0) : address.c_str()),
"flags", static_cast<GDBusServerFlags>(flags),
@@ -53,10 +56,10 @@ DBusServer::DBusServer(const std::string& address,
init(cancellable);
}
-DBusServer::DBusServer(const std::string& address,
+Server::Server(const std::string& address,
const std::string& guid,
- const Glib::RefPtr<DBusAuthObserver>& observer,
- DBusServerFlags flags)
+ const Glib::RefPtr<AuthObserver>& observer,
+ ServerFlags flags)
: _CONSTRUCT("address",
(address.empty() ? static_cast<char*>(0) : address.c_str()),
"flags", static_cast<GDBusServerFlags>(flags),
@@ -66,9 +69,9 @@ DBusServer::DBusServer(const std::string& address,
init();
}
-DBusServer::DBusServer(const std::string& address,
+Server::Server(const std::string& address,
const std::string& guid,
- DBusServerFlags flags)
+ ServerFlags flags)
: _CONSTRUCT("address",
(address.empty() ? static_cast<char*>(0) : address.c_str()),
"flags", static_cast<GDBusServerFlags>(flags),
@@ -79,21 +82,21 @@ DBusServer::DBusServer(const std::string& address,
}
*/
-Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
+Glib::RefPtr<Server> Server::create_sync(const std::string& address,
const std::string& guid,
- const Glib::RefPtr<DBusAuthObserver>& observer,
+ const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- DBusServerFlags flags)
+ ServerFlags flags)
{
//TODO: Use the constructor instead of the code underneath when
//g_dbus_server_new_sync() does not do more than call g_initable_new().
//https://bugzilla.gnome.org/show_bug.cgi?id=639478
- //return Glib::RefPtr<DBusServer>(new DBusServer(address, guid, observer,
+ //return Glib::RefPtr<Server>(new Server(address, guid, observer,
//cancellable, flags));
GError* gerror = 0;
- Glib::RefPtr<DBusServer> result =
+ Glib::RefPtr<Server> result =
Glib::wrap(g_dbus_server_new_sync(address.c_str(),
static_cast<GDBusServerFlags>(flags),
guid.c_str(),
@@ -107,20 +110,20 @@ Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
return result;
}
-Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
+Glib::RefPtr<Server> Server::create_sync(const std::string& address,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
- DBusServerFlags flags)
+ ServerFlags flags)
{
//TODO: Use the constructor instead of the code underneath when
//g_dbus_server_new_sync() does not do more than call g_initable_new().
//https://bugzilla.gnome.org/show_bug.cgi?id=639478
- //return Glib::RefPtr<DBusServer>(new DBusServer(address, guid,
+ //return Glib::RefPtr<Server>(new Server(address, guid,
//cancellable, flags));
GError* gerror = 0;
- Glib::RefPtr<DBusServer> result =
+ Glib::RefPtr<Server> result =
Glib::wrap(g_dbus_server_new_sync(address.c_str(),
static_cast<GDBusServerFlags>(flags),
guid.c_str(), 0,
@@ -133,20 +136,20 @@ Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
return result;
}
-Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
+Glib::RefPtr<Server> Server::create_sync(const std::string& address,
const std::string& guid,
- const Glib::RefPtr<DBusAuthObserver>& observer,
- DBusServerFlags flags)
+ const Glib::RefPtr<AuthObserver>& observer,
+ ServerFlags flags)
{
//TODO: Use the constructor instead of the code underneath when
//g_dbus_server_new_sync() does not do more than call g_initable_new().
//https://bugzilla.gnome.org/show_bug.cgi?id=639478
- //return Glib::RefPtr<DBusServer>(new DBusServer(address, guid, observer,
+ //return Glib::RefPtr<Server>(new Server(address, guid, observer,
//flags));
GError* gerror = 0;
- Glib::RefPtr<DBusServer> result =
+ Glib::RefPtr<Server> result =
Glib::wrap(g_dbus_server_new_sync(address.c_str(),
static_cast<GDBusServerFlags>(flags),
guid.c_str(),
@@ -160,18 +163,18 @@ Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
return result;
}
-Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
+Glib::RefPtr<Server> Server::create_sync(const std::string& address,
const std::string& guid,
- DBusServerFlags flags)
+ ServerFlags flags)
{
//TODO: Use the constructor instead of the code underneath when
//g_dbus_server_new_sync() does not do more than call g_initable_new().
//https://bugzilla.gnome.org/show_bug.cgi?id=639478
- //return Glib::RefPtr<DBusServer>(new DBusServer(address, guid, flags));
+ //return Glib::RefPtr<Server>(new Server(address, guid, flags));
GError* gerror = 0;
- Glib::RefPtr<DBusServer> result =
+ Glib::RefPtr<Server> result =
Glib::wrap(g_dbus_server_new_sync(address.c_str(),
static_cast<GDBusServerFlags>(flags),
guid.c_str(), 0, 0, &gerror));
@@ -182,4 +185,5 @@ Glib::RefPtr<DBusServer> DBusServer::create_sync(const std::string& address,
return result;
}
+} // namespace DBus
} // namespace Gio