Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : proto

Dir     : e17/proto/e_dbus/src/lib/notification


Modified Files:
        client.c 


Log Message:
refactor method call return callback into e_dbus

===================================================================
RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/client.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- client.c    11 Jul 2007 00:46:37 -0000      1.3
+++ client.c    11 Jul 2007 00:47:11 -0000      1.4
@@ -30,80 +30,29 @@
 }
 
 /**** client api ****/
-
-static void
-cb_notify(void *data, DBusMessage *msg, DBusError *err)
-{
-  E_DBus_Callback *cb;
-  E_Notification_Return_Notify *ret = NULL;
-  cb = data;
-  if (!cb) return;
-
-  if (!dbus_error_is_set(err))
-    ret = e_notify_unmarshal_notify_return(msg);
-
-  e_dbus_callback_call(cb, ret, err);
-}
-
 void
 e_notification_send(E_Notification *n, E_DBus_Callback_Func func, void *data)
 {
   DBusMessage *msg;
-  E_DBus_Callback *cb;
 
-  cb = e_dbus_callback_new(func, data);
   msg = e_notify_marshal_notify(n);
-  printf("msg: %p\n", msg);
-  e_dbus_message_send(client_conn, msg, cb_notify, -1, cb);
-}
-
-
-static void
-cb_get_capabilities(void *data, DBusMessage *msg, DBusError *err)
-{
-  E_DBus_Callback *cb;
-  E_Notification_Return_Get_Capabilities *ret = NULL;
-  cb = data;
-  if (!cb) return;
-
-  if (!dbus_error_is_set(err))
-    ret = e_notify_unmarshal_get_capabilities_return(msg);
-
-  e_dbus_callback_call(cb, ret, err);
+  e_dbus_method_call_send(client_conn, msg, e_notify_unmarshal_notify_return, 
func, -1, data);
 }
 
 void
 e_notification_get_capabilities(E_DBus_Callback_Func func, void *data)
 {
   DBusMessage *msg;
-  E_DBus_Callback *cb;
 
-  cb = e_dbus_callback_new(func, data);
   msg = e_notify_marshal_get_capabilities();
-  e_dbus_message_send(client_conn, msg, cb_notify, -1, cb);
-}
-
-static void
-cb_get_server_information(void *data, DBusMessage *msg, DBusError *err)
-{
-  E_DBus_Callback *cb;
-  E_Notification_Return_Get_Server_Information *ret = NULL;
-  cb = data;
-  if (!cb) return;
-
-  if (!dbus_error_is_set(err))
-    ret = e_notify_unmarshal_get_server_information_return(msg);
-
-  e_dbus_callback_call(cb, ret, err);
+  e_dbus_method_call_send(client_conn, msg, 
e_notify_unmarshal_get_capabilities_return, func, -1, data);
 }
 
 void
 e_notification_get_server_information(E_DBus_Callback_Func func, void *data)
 {
   DBusMessage *msg;
-  E_DBus_Callback *cb;
 
-  cb = e_dbus_callback_new(func, data);
   msg = e_notify_marshal_get_server_information();
-  e_dbus_message_send(client_conn, msg, cb_notify, -1, cb);
+  e_dbus_method_call_send(client_conn, msg, 
e_notify_unmarshal_get_server_information_return, func, -1, data);
 }



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to