NetworkManager r3499 - in trunk: introspection libnm-glib src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3499 - in trunk: introspection libnm-glib src
- Date: Tue, 25 Mar 2008 11:31:33 +0000 (GMT)
Author: dcbw
Date: Tue Mar 25 11:31:33 2008
New Revision: 3499
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3499&view=rev
Log:
2008-03-25 Dan Williams <dcbw redhat com>
* introspection/nm-device-cdma.xml
introspection/nm-device-gsm.xml
introspection/Makefile.am
introspection/all.xml
- Add introspection for CDMA and GSM devices for PropertiesChanged signal
* src/nm-gsm-device.h
src/nm-gsm-device.c
src/nm-cdma-device.h
src/nm-cdma-device.c
src/Makefile.am
- Implement PropertiesChanged signals
* libnm-glib/nm-cdma-device.c
libnm-glib/nm-cdma-device.c
- Attach to PropertiesChanged signals
Added:
trunk/introspection/nm-device-cdma.xml
trunk/introspection/nm-device-gsm.xml
Modified:
trunk/introspection/Makefile.am
trunk/introspection/all.xml
trunk/libnm-glib/nm-cdma-device.c
trunk/src/Makefile.am
trunk/src/nm-cdma-device.c
trunk/src/nm-cdma-device.h
trunk/src/nm-gsm-device.c
trunk/src/nm-gsm-device.h
Modified: trunk/introspection/Makefile.am
==============================================================================
--- trunk/introspection/Makefile.am (original)
+++ trunk/introspection/Makefile.am Tue Mar 25 11:31:33 2008
@@ -2,6 +2,8 @@
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 \
Modified: trunk/introspection/all.xml
==============================================================================
--- trunk/introspection/all.xml (original)
+++ trunk/introspection/all.xml Tue Mar 25 11:31:33 2008
@@ -30,6 +30,8 @@
<xi:include href="nm-device.xml"/>
<xi:include href="nm-device-802-3-ethernet.xml"/>
<xi:include href="nm-device-802-11-wireless.xml"/>
+<xi:include href="nm-cdma-device.xml"/>
+<xi:include href="nm-gsm-device.xml"/>
<xi:include href="nm-ip4-config.xml"/>
<xi:include href="nm-settings.xml"/>
<xi:include href="nm-exported-connection.xml"/>
Added: trunk/introspection/nm-device-cdma.xml
==============================================================================
--- (empty file)
+++ trunk/introspection/nm-device-cdma.xml Tue Mar 25 11:31:33 2008
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+ <interface name="org.freedesktop.NetworkManager.Device.Cdma">
+
+ <signal name="PropertiesChanged">
+ <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
+ <tp:docstring>
+ A dictionary mapping property names to variant boxed values
+ </tp:docstring>
+ </arg>
+ </signal>
+
+ </interface>
+</node>
Added: trunk/introspection/nm-device-gsm.xml
==============================================================================
--- (empty file)
+++ trunk/introspection/nm-device-gsm.xml Tue Mar 25 11:31:33 2008
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+ <interface name="org.freedesktop.NetworkManager.Device.Gsm">
+
+ <signal name="PropertiesChanged">
+ <arg name="properties" type="a{sv}" tp:type="String_Variant_Map">
+ <tp:docstring>
+ A dictionary mapping property names to variant boxed values
+ </tp:docstring>
+ </arg>
+ </signal>
+
+ </interface>
+</node>
Modified: trunk/libnm-glib/nm-cdma-device.c
==============================================================================
--- trunk/libnm-glib/nm-cdma-device.c (original)
+++ trunk/libnm-glib/nm-cdma-device.c Tue Mar 25 11:31:33 2008
@@ -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 @@
{
}
+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 @@
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;
}
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Tue Mar 25 11:31:33 2008
@@ -83,6 +83,12 @@
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 @@
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)
Modified: trunk/src/nm-cdma-device.c
==============================================================================
--- trunk/src/nm-cdma-device.c (original)
+++ trunk/src/nm-cdma-device.c Tue Mar 25 11:31:33 2008
@@ -7,9 +7,20 @@
#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)
+#define NM_CDMA_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CDMA_DEVICE, NMCdmaDevicePrivate))
+
+typedef struct {
+ char *monitor_iface;
+ NMSerialDevice *monitor_device;
+
+ guint pending_id;
+} NMCdmaDevicePrivate;
+
enum {
PROP_0,
PROP_MONITOR_IFACE,
@@ -17,14 +28,14 @@
LAST_PROP
};
-#define NM_CDMA_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CDMA_DEVICE, NMCdmaDevicePrivate))
+enum {
+ PROPERTIES_CHANGED,
-typedef struct {
- char *monitor_iface;
- NMSerialDevice *monitor_device;
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
- guint pending_id;
-} NMCdmaDevicePrivate;
NMCdmaDevice *
nm_cdma_device_new (const char *udi,
@@ -417,4 +428,12 @@
"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);
}
Modified: trunk/src/nm-cdma-device.h
==============================================================================
--- trunk/src/nm-cdma-device.h (original)
+++ trunk/src/nm-cdma-device.h Tue Mar 25 11:31:33 2008
@@ -22,6 +22,9 @@
typedef struct {
NMSerialDeviceClass parent;
+
+ /* Signals */
+ void (*properties_changed) (NMCdmaDevice *device, GHashTable *properties);
} NMCdmaDeviceClass;
GType nm_cdma_device_get_type (void);
Modified: trunk/src/nm-gsm-device.c
==============================================================================
--- trunk/src/nm-gsm-device.c (original)
+++ trunk/src/nm-gsm-device.c Tue Mar 25 11:31:33 2008
@@ -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 @@
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 @@
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 @@
"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);
}
Modified: trunk/src/nm-gsm-device.h
==============================================================================
--- trunk/src/nm-gsm-device.h (original)
+++ trunk/src/nm-gsm-device.h Tue Mar 25 11:31:33 2008
@@ -22,6 +22,9 @@
typedef struct {
NMSerialDeviceClass parent;
+
+ /* Signals */
+ void (*properties_changed) (NMGsmDevice *device, GHashTable *properties);
} NMGsmDeviceClass;
GType nm_gsm_device_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]