DBusGProxy as parent gobject [PATCH]

Havoc Pennington hp at redhat.com
Wed Jan 4 08:31:51 PST 2006


On Tue, 2006-01-03 at 12:26 +0200, Ricardo Kekki wrote:
> I have now made a proposal for fixing the inheritance of DBusGProxy.
> 
> The first patch adds a property to the DBusGProxy so that it can 
> be initialized also by g_object_new calls.

The property should be "connection" IMO rather than "manager" and the
manager object should remain private.

> The second patch is not that nice. I'm not sure how this should be done. 
> The patch moves the DBusGProxy, DBusGProxyClass and DBusGProxyManager 
> definitions to the dbus-glib.h file.

You need to use the "private" feature of GObject to move the fields of
DBusGProxy into a private struct. See g_type_class_add_private, etc. GTK
has some examples of using it iirc you could grep for. There should be
no public fields, only accessors (properties, functions).

> The problem with the header patch is that DBusGProxyManager uses 
> DBusConnection which is defined in the dbus-connection.h. And including 
> dbus-connection.h is the problem. Another way to fix this would be to 
> change DBusGProxyManager to use DBusGConnect instead of DBusConnect.

The "connection" property would take a DBusGConnection I think.

Havoc




More information about the dbus mailing list