diff --git a/introspection/Makefile.am b/introspection/Makefile.am index 743e90c354..e8ca586d06 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -2,6 +2,8 @@ EXTRA_DIST = \ nm-access-point.xml \ nm-device-802-11-wireless.xml \ nm-device-802-3-ethernet.xml \ + nm-device-cdma.xml \ + nm-device-gsm.xml \ nm-device.xml \ nm-ip4-config.xml \ nm-manager.xml \ diff --git a/introspection/all.xml b/introspection/all.xml index a4e7801372..07f8dbed40 100644 --- a/introspection/all.xml +++ b/introspection/all.xml @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + diff --git a/introspection/nm-device-cdma.xml b/introspection/nm-device-cdma.xml new file mode 100644 index 0000000000..2b43f8fdcb --- /dev/null +++ b/introspection/nm-device-cdma.xml @@ -0,0 +1,15 @@ + + + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/introspection/nm-device-gsm.xml b/introspection/nm-device-gsm.xml new file mode 100644 index 0000000000..650d656a7e --- /dev/null +++ b/introspection/nm-device-gsm.xml @@ -0,0 +1,15 @@ + + + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/libnm-glib/nm-cdma-device.c b/libnm-glib/nm-cdma-device.c index e2c4de0959..af337edeb3 100644 --- a/libnm-glib/nm-cdma-device.c +++ b/libnm-glib/nm-cdma-device.c @@ -1,6 +1,8 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #include "nm-cdma-device.h" +#include "nm-device-private.h" +#include "nm-object-private.h" G_DEFINE_TYPE (NMCdmaDevice, nm_cdma_device, NM_TYPE_DEVICE) @@ -17,6 +19,19 @@ nm_cdma_device_init (NMCdmaDevice *device) { } +static void +register_for_property_changed (NMCdmaDevice *device) +{ + NMCdmaDevicePrivate *priv = NM_CDMA_DEVICE_GET_PRIVATE (device); + const NMPropertiesChangedInfo property_changed_info[] = { + { NULL }, + }; + + nm_object_handle_properties_changed (NM_OBJECT (device), + priv->proxy, + property_changed_info); +} + static GObject* constructor (GType type, guint n_construct_params, @@ -37,6 +52,9 @@ constructor (GType type, NM_DBUS_SERVICE, nm_object_get_path (NM_OBJECT (object)), NM_DBUS_INTERFACE_CDMA_DEVICE); + + register_for_property_changed (NM_CDMA_DEVICE (object)); + return object; } diff --git a/src/Makefile.am b/src/Makefile.am index d96c19e158..f2eddd7008 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -83,6 +83,12 @@ nm-device-802-3-ethernet-glue.h: $(top_srcdir)/introspection/nm-device-802-3-eth nm-device-802-11-wireless-glue.h: $(top_srcdir)/introspection/nm-device-802-11-wireless.xml dbus-binding-tool --prefix=nm_device_802_11_wireless --mode=glib-server --output=nm-device-802-11-wireless-glue.h $(top_srcdir)/introspection/nm-device-802-11-wireless.xml +nm-cdma-device-glue.h: $(top_srcdir)/introspection/nm-device-cdma.xml + dbus-binding-tool --prefix=nm_cdma_device --mode=glib-server --output=nm-cdma-device-glue.h $(top_srcdir)/introspection/nm-device-cdma.xml + +nm-gsm-device-glue.h: $(top_srcdir)/introspection/nm-device-gsm.xml + dbus-binding-tool --prefix=nm_gsm_device --mode=glib-server --output=nm-gsm-device-glue.h $(top_srcdir)/introspection/nm-device-gsm.xml + nm-ip4-config-glue.h: $(top_srcdir)/introspection/nm-ip4-config.xml dbus-binding-tool --prefix=nm_ip4_config --mode=glib-server --output=nm-ip4-config-glue.h $(top_srcdir)/introspection/nm-ip4-config.xml @@ -95,6 +101,8 @@ built_sources = \ nm-device-interface-glue.h \ nm-device-802-3-ethernet-glue.h \ nm-device-802-11-wireless-glue.h \ + nm-cdma-device-glue.h \ + nm-gsm-device-glue.h \ nm-ip4-config-glue.h \ nm-active-connection-glue.h \ $(NULL) diff --git a/src/nm-cdma-device.c b/src/nm-cdma-device.c index 01d1361284..b0c23113c7 100644 --- a/src/nm-cdma-device.c +++ b/src/nm-cdma-device.c @@ -7,16 +7,11 @@ #include "nm-device-private.h" #include "nm-setting-cdma.h" #include "nm-utils.h" +#include "nm-properties-changed-signal.h" +#include "nm-cdma-device-glue.h" G_DEFINE_TYPE (NMCdmaDevice, nm_cdma_device, NM_TYPE_SERIAL_DEVICE) -enum { - PROP_0, - PROP_MONITOR_IFACE, - - LAST_PROP -}; - #define NM_CDMA_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CDMA_DEVICE, NMCdmaDevicePrivate)) typedef struct { @@ -26,6 +21,22 @@ typedef struct { guint pending_id; } NMCdmaDevicePrivate; +enum { + PROP_0, + PROP_MONITOR_IFACE, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + + NMCdmaDevice * nm_cdma_device_new (const char *udi, const char *data_iface, @@ -417,4 +428,12 @@ nm_cdma_device_class_init (NMCdmaDeviceClass *klass) "Monitoring interface", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMCdmaDeviceClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_cdma_device_object_info); } diff --git a/src/nm-cdma-device.h b/src/nm-cdma-device.h index 6275d8b9fe..953d9ac0e5 100644 --- a/src/nm-cdma-device.h +++ b/src/nm-cdma-device.h @@ -22,6 +22,9 @@ typedef struct { typedef struct { NMSerialDeviceClass parent; + + /* Signals */ + void (*properties_changed) (NMCdmaDevice *device, GHashTable *properties); } NMCdmaDeviceClass; GType nm_cdma_device_get_type (void); diff --git a/src/nm-gsm-device.c b/src/nm-gsm-device.c index 5361a96797..efa95a365b 100644 --- a/src/nm-gsm-device.c +++ b/src/nm-gsm-device.c @@ -7,15 +7,12 @@ #include "nm-device-private.h" #include "nm-setting-gsm.h" #include "nm-utils.h" +#include "nm-properties-changed-signal.h" +#include "nm-gsm-device-glue.h" G_DEFINE_TYPE (NMGsmDevice, nm_gsm_device, NM_TYPE_SERIAL_DEVICE) -enum { - PROP_0, - PROP_MONITOR_IFACE, - - LAST_PROP -}; +#define NM_GSM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GSM_DEVICE, NMGsmDevicePrivate)) typedef enum { NM_GSM_SECRET_NONE = 0, @@ -23,8 +20,6 @@ typedef enum { NM_GSM_SECRET_PUK } NMGsmSecret; -#define NM_GSM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GSM_DEVICE, NMGsmDevicePrivate)) - typedef struct { char *monitor_iface; NMSerialDevice *monitor_device; @@ -33,6 +28,20 @@ typedef struct { guint pending_id; } NMGsmDevicePrivate; +enum { + PROP_0, + PROP_MONITOR_IFACE, + + LAST_PROP +}; + +enum { + PROPERTIES_CHANGED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; static void enter_pin (NMSerialDevice *device, gboolean retry); static void automatic_registration (NMSerialDevice *device); @@ -725,4 +734,12 @@ nm_gsm_device_class_init (NMGsmDeviceClass *klass) "Monitoring interface", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + /* Signals */ + signals[PROPERTIES_CHANGED] = + nm_properties_changed_signal_new (object_class, + G_STRUCT_OFFSET (NMGsmDeviceClass, properties_changed)); + + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), + &dbus_glib_nm_gsm_device_object_info); } diff --git a/src/nm-gsm-device.h b/src/nm-gsm-device.h index ca88bdcfeb..edeb66312f 100644 --- a/src/nm-gsm-device.h +++ b/src/nm-gsm-device.h @@ -22,6 +22,9 @@ typedef struct { typedef struct { NMSerialDeviceClass parent; + + /* Signals */ + void (*properties_changed) (NMGsmDevice *device, GHashTable *properties); } NMGsmDeviceClass; GType nm_gsm_device_get_type (void);