local-export-daemon r7239 - trunk/src



Author: otaylor
Date: Mon Mar 17 19:36:17 2008
New Revision: 7239
URL: http://svn.gnome.org/viewvc/local-export-daemon?rev=7239&view=rev

Log:
merge in fixes and addition of VOID__UINT32 marshaller from hippo-dbus-helper version in bigboard/applet

Modified:
   trunk/src/hippo-dbus-helper.c
   trunk/src/hippo-dbus-helper.h

Modified: trunk/src/hippo-dbus-helper.c
==============================================================================
--- trunk/src/hippo-dbus-helper.c	(original)
+++ trunk/src/hippo-dbus-helper.c	Mon Mar 17 19:36:17 2008
@@ -993,7 +993,8 @@
             g_warning("no memory to append signal args");
         }
     }
-    
+
+    /* FIXME this is broken, signals only have in_args, not out_args */
     if (!dbus_message_has_signature(message, member->out_args)) {
         g_warning("Tried to emit signal %s %s with args %s but should have been %s",
                   interface, signal_name, dbus_message_get_signature(message), member->out_args);
@@ -1006,6 +1007,23 @@
     dbus_message_unref(message);
 }
 
+static void
+emit_signal_appender(DBusConnection          *connection,
+                            const char              *path,
+                            const char              *interface,
+                            const char              *signal_name,
+                            HippoDBusArgAppender     appender,
+                            void                    *appender_data,
+                            int                      first_arg_type,
+                            ...)
+{
+  va_list args;
+
+  va_start(args, first_arg_type);
+  emit_signal_valist_appender(connection, path, interface, signal_name, appender, appender_data, first_arg_type, args);
+  va_end(args);
+}
+
 void
 hippo_dbus_helper_emit_signal_valist(DBusConnection          *connection,
                                      const char              *path,
@@ -1026,10 +1044,8 @@
                                         HippoDBusArgAppender     appender,
                                         void                    *appender_data)
 {
-    va_list dummy_args;
-    
-    emit_signal_valist_appender(connection, path, interface, signal_name,
-                                appender, appender_data, DBUS_TYPE_INVALID, dummy_args);
+    emit_signal_appender(connection, path, interface, signal_name,
+                         appender, appender_data, DBUS_TYPE_INVALID);
 }
 
 void
@@ -1918,7 +1934,6 @@
     }
 }
 
-
 static DBusMessage*
 call_method_sync_valist_appender (HippoDBusProxy          *proxy,
                                   const char              *method,
@@ -1974,6 +1989,24 @@
     return NULL;
 }
 
+static DBusMessage*
+call_method_sync_appender (HippoDBusProxy          *proxy,
+                           const char              *method,
+                           DBusError               *error,
+                           HippoDBusArgAppender     appender,
+                           void                    *appender_data,
+                           int                      first_arg_type,
+                           ...)
+{
+    DBusMessage *result;
+    va_list args;
+
+    va_start(args, first_arg_type);
+    result = call_method_sync_valist_appender(proxy, method, error, appender, appender_data, first_arg_type, args);
+    va_end(args);
+    return result;
+}
+
 DBusMessage*
 hippo_dbus_proxy_call_method_sync_valist (HippoDBusProxy          *proxy,
                                           const char              *method,
@@ -1992,11 +2025,8 @@
                                              HippoDBusArgAppender   appender,
                                              void                  *appender_data)
 {
-    va_list dummy_valist;
-    
-    return call_method_sync_valist_appender(proxy, method, error,
-                                            appender, appender_data, DBUS_TYPE_INVALID,
-                                            dummy_valist);
+    return call_method_sync_appender(proxy, method, error,
+                                     appender, appender_data, DBUS_TYPE_INVALID);
 }
 
 DBusMessage*
@@ -2176,6 +2206,24 @@
     return;
 }
 
+static void
+call_method_async_appender(HippoDBusProxy          *proxy,
+                           const char              *method,
+                           HippoDBusReplyHandler    handler,
+                           void                    *data,
+                           DBusFreeFunction         free_data_func,
+                           HippoDBusArgAppender     appender,
+                           void                    *appender_data,
+                           int                      first_arg_type,
+                           ...)
+{
+  va_list args;
+
+  va_start(args, first_arg_type);
+  call_method_async_valist_appender(proxy, method, handler, data, free_data_func, appender, appender_data, first_arg_type, args);
+  va_end(args);
+}
+
 void
 hippo_dbus_proxy_call_method_async_valist(HippoDBusProxy          *proxy,
                                           const char              *method,
@@ -2198,10 +2246,8 @@
                                              HippoDBusArgAppender   appender,
                                              void                  *appender_data)
 {
-    va_list dummy_args;
-    
-    call_method_async_valist_appender(proxy, method, handler, data, free_data_func,
-                                      appender, appender_data, DBUS_TYPE_INVALID, dummy_args);
+    call_method_async_appender(proxy, method, handler, data, free_data_func,
+                               appender, appender_data, DBUS_TYPE_INVALID);
 }
 
 
@@ -2299,6 +2345,23 @@
 }
 
 dbus_bool_t
+hippo_dbus_proxy_VOID__UINT32 (HippoDBusProxy  *proxy,
+                               const char      *method,
+                               dbus_uint32_t    in1)
+{
+    DBusMessage *reply;
+    DBusError derror;
+    
+    dbus_error_init(&derror);    
+    reply = hippo_dbus_proxy_call_method_sync(proxy, method, &derror,
+                                              DBUS_TYPE_UINT32, &in1,
+                                              DBUS_TYPE_INVALID);
+    
+    return hippo_dbus_proxy_finish_method_call_freeing_reply(reply, method, &derror,
+                                                             DBUS_TYPE_INVALID);
+}
+
+dbus_bool_t
 hippo_dbus_proxy_INT32__VOID(HippoDBusProxy *proxy,
                              const char     *method,
                              dbus_int32_t   *out1_p)
@@ -2318,7 +2381,7 @@
 dbus_bool_t
 hippo_dbus_proxy_INT32__INT32(HippoDBusProxy *proxy,
                               const char     *method,
-                              dbus_int32_t    in1_p,
+                              dbus_int32_t    in1,
                               dbus_int32_t   *out1_p)
 {
     DBusMessage *reply;
@@ -2326,7 +2389,7 @@
 
     dbus_error_init(&derror);    
     reply = hippo_dbus_proxy_call_method_sync(proxy, method, &derror,
-                                              DBUS_TYPE_INT32, &in1_p,
+                                              DBUS_TYPE_INT32, &in1,
                                               DBUS_TYPE_INVALID);
     
     return hippo_dbus_proxy_finish_method_call_freeing_reply(reply, method, &derror,

Modified: trunk/src/hippo-dbus-helper.h
==============================================================================
--- trunk/src/hippo-dbus-helper.h	(original)
+++ trunk/src/hippo-dbus-helper.h	Mon Mar 17 19:36:17 2008
@@ -8,6 +8,8 @@
 #include <dbus/dbus.h>
 #include <glib-object.h>
 
+#include "hippo-dbus-helper-rename.h"
+
 G_BEGIN_DECLS
 
 typedef enum {
@@ -83,7 +85,7 @@
     HippoDBusMemberType member_type;
     const char *name;
     const char *in_args;
-    const char *out_args;
+    const char *out_args; /* FIXME right now for signals we use out_args, should be in_args */
     /* for a signal the handler is NULL
      */
     HippoDBusHandler handler;
@@ -107,6 +109,8 @@
 
 struct HippoDBusSignalTracker
 {
+    /* FIXME there's no way to specify the object path */
+    /* FIXME specify the signature so it can be automatically checked */
     const char *interface;
     const char *signal;
     HippoDBusSignalHandler handler;
@@ -270,31 +274,34 @@
 
 dbus_bool_t hippo_dbus_proxy_VOID__VOID               (HippoDBusProxy  *proxy,
                                                        const char      *method);
+dbus_bool_t hippo_dbus_proxy_VOID__UINT32             (HippoDBusProxy  *proxy,
+                                                       const char      *method,
+                                                       dbus_uint32_t    in1);
 dbus_bool_t hippo_dbus_proxy_INT32__VOID              (HippoDBusProxy  *proxy,
                                                        const char      *method,
                                                        dbus_int32_t    *out1_p);
 dbus_bool_t hippo_dbus_proxy_INT32__INT32             (HippoDBusProxy  *proxy,
                                                        const char      *method,
-                                                       dbus_int32_t     in1_p,
+                                                       dbus_int32_t     in1,
                                                        dbus_int32_t    *out1_p);
 dbus_bool_t hippo_dbus_proxy_ARRAYINT32__INT32        (HippoDBusProxy  *proxy,
                                                        const char      *method,
-                                                       dbus_int32_t     in1_p,
+                                                       dbus_int32_t     in1,
                                                        dbus_int32_t   **out1_p,
-                                                       dbus_int32_t    *out1_len);
+                                                       dbus_int32_t    *out1_len_p);
 dbus_bool_t hippo_dbus_proxy_ARRAYINT32__VOID         (HippoDBusProxy  *proxy,
                                                        const char      *method,
                                                        dbus_int32_t   **out1_p,
-                                                       dbus_int32_t    *out1_len);
+                                                       dbus_int32_t    *out1_len_p);
 dbus_bool_t hippo_dbus_proxy_ARRAYINT32__INT32_STRING (HippoDBusProxy  *proxy,
                                                        const char      *method,
-                                                       dbus_int32_t     in1_p,
-                                                       const char      *in2_p,
+                                                       dbus_int32_t     in1,
+                                                       const char      *in2,
                                                        dbus_int32_t   **out1_p,
-                                                       dbus_int32_t    *out1_len);
+                                                       dbus_int32_t    *out1_len_p);
 dbus_bool_t hippo_dbus_proxy_STRING__INT32            (HippoDBusProxy  *proxy,
                                                        const char      *method,
-                                                       dbus_int32_t     in1_p,
+                                                       dbus_int32_t     in1,
                                                        char           **out1_p);
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]