[Pkg-e-commits] [SCM] D-Bus integration for EFL based applications branch, upstream-vcs, updated. 23d04eefa9ee5d52a56649843b7be65d0ca5039e

raster raster at alioth.debian.org
Mon Mar 10 15:18:21 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit 23d04eefa9ee5d52a56649843b7be65d0ca5039e
Author: raster <raster>
Date:   Sun Mar 9 16:08:42 2008 +0000

    stefan's nm patches for edbus.

diff --git a/src/lib/dbus/e_dbus_interfaces.c b/src/lib/dbus/e_dbus_interfaces.c
index 429e62e..772543b 100644
--- a/src/lib/dbus/e_dbus_interfaces.c
+++ b/src/lib/dbus/e_dbus_interfaces.c
@@ -6,6 +6,15 @@
  * objects on the bus should implement.
  */
 
+/**
+ * Ping the dbus peer
+ *
+ * @param conn the dbus connection
+ * @param destination the bus name that the object is on
+ * @param path the object path
+ * @param cb_return a callback for a successful return
+ * @param data data to pass to the callbacks
+ */
 EAPI void
 e_dbus_peer_ping(E_DBus_Connection*conn, const char *destination, const char *path, E_DBus_Method_Return_Cb cb_return, void *data)
 {
@@ -15,6 +24,15 @@ e_dbus_peer_ping(E_DBus_Connection*conn, const char *destination, const char *pa
   e_dbus_message_send(conn, msg, cb_return, -1, data);
 }
 
+/**
+ * Get the UUID of the peer
+ *
+ * @param conn the dbus connection
+ * @param destination the bus name that the object is on
+ * @param path the object path
+ * @param cb_return a callback for a successful return
+ * @param data data to pass to the callbacks
+ */
 EAPI void
 e_dbus_peer_get_machine_id(E_DBus_Connection*conn, const char *destination, const char *path, E_DBus_Method_Return_Cb cb_return, void *data)
 {
@@ -24,7 +42,6 @@ e_dbus_peer_get_machine_id(E_DBus_Connection*conn, const char *destination, cons
   e_dbus_message_send(conn, msg, cb_return, -1, data);
 }
 
-
 /**
  * Get the value of a property on an object
  *
diff --git a/src/lib/dbus/e_dbus_object.c b/src/lib/dbus/e_dbus_object.c
index d79697a..ea2c926 100644
--- a/src/lib/dbus/e_dbus_object.c
+++ b/src/lib/dbus/e_dbus_object.c
@@ -172,7 +172,7 @@ e_dbus_object_init(void)
   {
     if (introspectable_interface) e_dbus_interface_unref(introspectable_interface);
     introspectable_interface = NULL;
-    if (properties_interface) e_dbus_interface_unref(introspectable_interface);
+    if (properties_interface) e_dbus_interface_unref(properties_interface);
     properties_interface = NULL;
     return 0;
   }
@@ -188,6 +188,9 @@ e_dbus_object_shutdown(void)
 {
   e_dbus_interface_unref(introspectable_interface);
   introspectable_interface = NULL;
+
+  e_dbus_interface_unref(properties_interface);
+  properties_interface = NULL;
 }
 
 /**
diff --git a/src/lib/nm/E_Nm.h b/src/lib/nm/E_Nm.h
index e0300e5..9593c63 100644
--- a/src/lib/nm/E_Nm.h
+++ b/src/lib/nm/E_Nm.h
@@ -2,6 +2,7 @@
 #define E_HM_H
 
 #include <E_DBus.h>
+#include <Ecore_Data.h>
 
 #ifdef EAPI
 #undef EAPI
@@ -26,6 +27,77 @@
 
 typedef struct E_NM_Context E_NM_Context;
 
+/**
+ * Matching structs for the new "object" based DBus API
+ * VPN is missing as this was still missing the redesign for the new 0.7 API
+ */
+typedef struct E_NM_Device E_NM_Device;
+struct E_NM_Device
+{
+   char *udi; /* object_path */
+   char *interface;
+   char *driver;
+   uint capabilities;
+   int  ip4address;
+   uint state;
+   char *ip4config; /* object_path */
+   int  carrier;
+   uint type;
+};
+
+typedef struct E_NM_Device_Wireless E_NM_Device_Wireless;
+struct E_NM_Device_Wireless
+{
+   char *hwaddress;
+   int   mode;
+   uint bitrate;
+   char *activeaccesspoint; /* object_path */
+   uint wirelesscapabilities;
+};
+
+typedef struct E_NM_Device_Wired E_NM_Device_Wired;
+struct E_NM_Device_Wired
+{
+   char *hwaddress;
+   uint speed;
+};
+
+typedef struct E_NM_Access_Point E_NM_Access_Point;
+struct E_NM_Access_Point
+{
+   uint flags;
+   uint wpaflags;
+   uint rsnflags;
+   char *ssid;
+   uint frequency;
+   char *hwaddress;
+   int  mode;
+   uint rate;
+   uint strength;
+};
+
+typedef struct E_NM_IP4Config E_NM_IP4Config;
+struct E_NM_IP4Config
+{
+   uint address;
+   uint gateway;
+   uint netmask;
+   uint broadcast;
+   char *hostname;
+   Ecore_List *nameserver;  /* uints */
+   Ecore_List *domains; /* char* */
+   char *nisdomain;
+   Ecore_List *nisserver; /* uints */
+};
+
+typedef struct E_NM_Manager E_NM_Manager;
+struct E_NM_Manager
+{
+   int wirelessenabled; /* writeable*/
+   int wirelesshardwareenabled;
+   uint state;
+};
+
 typedef void (*E_NM_Cb_Manager_State_Change) (void *data, int state);
 typedef void (*E_NM_Cb_Manager_Device_Added) (void *data, const char *device);
 typedef void (*E_NM_Cb_Manager_Device_Removed) (void *data, const char *device);
diff --git a/src/lib/nm/e_nm_manager.c b/src/lib/nm/e_nm_manager.c
index e69ae86..265249e 100644
--- a/src/lib/nm/e_nm_manager.c
+++ b/src/lib/nm/e_nm_manager.c
@@ -18,7 +18,7 @@ e_nm_get_devices(E_NM_Context *ctx, E_DBus_Callback_Func cb_func, void *data)
   DBusMessage *msg;
   int ret;
 
-  msg = e_nm_manager_call_new("getDevices");
+  msg = e_nm_manager_call_new("GetDevices");
 
   ret = e_dbus_method_call_send(ctx->conn, msg, cb_nm_string_list, cb_func, free_nm_string_list, -1, data) ? 1 : 0;
   dbus_message_unref(msg);
diff --git a/src/lib/nm/e_nm_private.h b/src/lib/nm/e_nm_private.h
index 9d5d5ab..5f40a28 100644
--- a/src/lib/nm/e_nm_private.h
+++ b/src/lib/nm/e_nm_private.h
@@ -2,10 +2,13 @@
 #define E_NM_PRIVATE_H
 
 #define E_NM_SERVICE "org.freedesktop.NetworkManager"
-#define E_NM_INTERFACE_NETWORK_MANAGER "org.freedesktop.NetworkManager"
 #define E_NM_PATH_NETWORK_MANAGER "/org/freedesktop/NetworkManager"
+#define E_NM_INTERFACE_NETWORK_MANAGER "org.freedesktop.NetworkManager"
+#define E_NM_INTERFACE_ACCESSPOINT "org.freedesktop.NetworkManager.AccessPoint"
 #define E_NM_INTERFACE_DEVICE "org.freedesktop.NetworkManager.Device"
-
+#define E_NM_INTERFACE_DEVICE_WIRELESS "org.freedesktop.NetworkManager.Device.Wireless"
+#define E_NM_INTERFACE_DEVICE_WIRED "org.freedesktop.NetworkManager.Device.Wired"
+#define E_NM_INTERFACE_IP4CONFIG "org.freedesktop.NetworkManager.IP4Config"
 
 #define e_nm_manager_call_new(member) dbus_message_new_method_call(E_NM_SERVICE, E_NM_PATH_NETWORK_MANAGER, E_NM_INTERFACE_NETWORK_MANAGER, member)
 
@@ -29,7 +32,6 @@ struct E_NM_Context
 };
 
 
-
 int e_nm_get_from_nm(E_NM_Context *ctx, E_DBus_Callback_Func cb_func, void *data,
                      const char *method, int rettype);
 int e_nm_get_from_device(E_NM_Context *ctx, const char *device,

-- 
D-Bus integration for EFL based applications



More information about the Pkg-e-commits mailing list