diff options
author | Dan Winship <danw@gnome.org> | 2012-01-11 07:56:04 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2012-02-03 10:33:43 -0600 |
commit | cc90f1010eeaf6987fbe3e042bf96b01b52dd5de (patch) | |
tree | 8b67a8bb1294278f5ba43cd434eb310d74274b04 /libnm-glib/nm-object-private.h | |
parent | 5afcee46936ab547a95fdaa7e415aa3ba6de47d2 (diff) |
libnm-glib: simplify handling of object and object array properties
Add an "object_type" field to NMPropertiesInfo, and use that with
DBUS_TYPE_G_OBJECT_PATH and DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH
properties so that we don't need custom marshallers for each one.
When creating an NMDevice or NMActiveConnection, we need to fetch an
extra property first to figure out the exact subclass to use, so add a
bit of infrastructure for that as well. Also, do that preprocessing
asynchronously when processing a property change notification, so that
it doesn't block the main loop.
Diffstat (limited to 'libnm-glib/nm-object-private.h')
-rw-r--r-- | libnm-glib/nm-object-private.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libnm-glib/nm-object-private.h b/libnm-glib/nm-object-private.h index 7b14ad694..08aa525e5 100644 --- a/libnm-glib/nm-object-private.h +++ b/libnm-glib/nm-object-private.h @@ -30,12 +30,14 @@ void _nm_object_ensure_inited (NMObject *object); typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GValue *, gpointer); + typedef GObject * (*NMObjectCreatorFunc) (DBusGConnection *, const char *); typedef struct { const char *name; gpointer field; PropertyMarshalFunc func; + GType object_type; } NMPropertiesInfo; @@ -69,4 +71,12 @@ handle_ptr_array_return (GPtrArray *array) return array; } +/* object demarshalling support */ +typedef GType (*NMObjectTypeFunc) (DBusGConnection *, const char *); +typedef void (*NMObjectTypeCallbackFunc) (GType, gpointer); +typedef void (*NMObjectTypeAsyncFunc) (DBusGConnection *, const char *, NMObjectTypeCallbackFunc, gpointer); + +void _nm_object_register_type_func (GType base_type, NMObjectTypeFunc type_func, + NMObjectTypeAsyncFunc type_async_func); + #endif /* NM_OBJECT_PRIVATE_H */ |