Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/bin


Modified Files:
        Makefile.am ecore_dbus_hal_test.c ecore_dbus_test.c 


Log Message:

Add abstract socket namespace support to ecore_con.
Lots of work on ecore_dbus
Hilights:
  - get the socket address for system/session/startup busses from the 
environment
  - can request/release a bus name
  - receive method calls (we need to add a way to register callbacks for 
specific methods)
  - send signals and method replies (untested)

*** API BREAKAGE ***
ecore_dbus_message_new_method_call() - the 'destination' param has moved to 
after the 'method' param to keep things consistent with newly supported message 
types and the param ordering in the spec.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/bin/Makefile.am,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- Makefile.am 26 Jul 2006 20:43:28 -0000      1.21
+++ Makefile.am 24 Sep 2006 07:24:51 -0000      1.22
@@ -95,7 +95,8 @@
 ecore_evas_test \
 ecore_config \
 ecore_dbus_test \
-ecore_dbus_hal_test
+ecore_dbus_hal_test \
+ecore_dbus_receiver_test
 
 ecore_test_SOURCES = \
 ecore_test.c
@@ -200,3 +201,19 @@
 $(top_builddir)/src/lib/ecore/libecore.la \
 $(ECORE_DBUS_LIB)
 
+
+ecore_dbus_receiver_test_SOURCES = \
+ecore_dbus_receiver_test.c \
+ecore_dbus_test.h
+
+ecore_dbus_receiver_test_LDADD = \
+$(top_builddir)/src/lib/ecore/libecore.la \
+$(ECORE_DBUS_LIB)
+
+ecore_dbus_receiver_test_CFLAGS = \
+$(CFLAGS) \
+$(INCLUDES)
+
+ecore_dbus_receiver_test_DEPENDENCIES = \
+$(top_builddir)/src/lib/ecore/libecore.la \
+$(ECORE_DBUS_LIB)
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_hal_test.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_dbus_hal_test.c       27 Jul 2006 15:28:43 -0000      1.4
+++ ecore_dbus_hal_test.c       24 Sep 2006 07:24:51 -0000      1.5
@@ -23,8 +23,7 @@
 {
 
    ecore_dbus_init();
-   svr = ecore_dbus_server_connect(ECORE_DBUS_BUS_SYSTEM,
-                                  "/var/run/dbus/system_dbus_socket", -1, 
NULL);
+   svr = ecore_dbus_server_system_connect(NULL);
    if (!svr)
      {
        printf("Couldn't connect to dbus system server!\n");
@@ -40,7 +39,7 @@
                                               ecore_dbus_event_server_add, 
NULL);
        handler[i++] = ecore_event_handler_add(ECORE_DBUS_EVENT_SERVER_DEL,
                                               ecore_dbus_event_server_del, 
NULL);
-       handler[i++] = ecore_event_handler_add(ECORE_DBUS_EVENT_SERVER_SIGNAL,
+       handler[i++] = ecore_event_handler_add(ECORE_DBUS_EVENT_SIGNAL,
                                               ecore_dbus_event_server_signal, 
NULL);
 
        ecore_main_loop_begin();
@@ -126,7 +125,7 @@
 static int
 ecore_dbus_event_server_signal(void *udata, int ev_type, void *ev)
 {
-   Ecore_DBus_Event_Server_Signal *event;
+   Ecore_DBus_Event_Signal *event;
 
    event = ev;
    printf("ecore_dbus_event_server_signal %s %s.%s\n", 
event_type_get(event->type),
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_test.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ecore_dbus_test.c   27 Jul 2006 15:34:15 -0000      1.11
+++ ecore_dbus_test.c   24 Sep 2006 07:24:51 -0000      1.12
@@ -9,6 +9,7 @@
 static int ecore_dbus_event_server_del(void *udata, int ev_type, void *ev);
 
 static void ecore_dbus_method_list_names_cb(void *data, 
Ecore_DBus_Method_Return *reply);
+static void ecore_dbus_method_test_cb(void *data, Ecore_DBus_Method_Return 
*reply);
 static void ecore_dbus_method_error_cb(void *data, const char *error);
 
 static const char *event_type_get(Ecore_DBus_Message_Type type);
@@ -18,12 +19,13 @@
 int
 main(int argc, char **argv)
 {
+   char *bus_addr = NULL, *socket_name = NULL;
    ecore_dbus_init();
-   svr = ecore_dbus_server_connect(ECORE_DBUS_BUS_SYSTEM,
-                                  "/var/run/dbus/system_dbus_socket", -1, 
NULL);
+
+   svr = ecore_dbus_server_session_connect(NULL);
    if (!svr)
      {
-       printf("Couldn't connect to dbus system server!\n");
+       printf("Couldn't connect to dbus system server (%s)!\n", socket_name);
      }
    else
      {
@@ -59,11 +61,11 @@
                                ecore_dbus_method_list_names_cb,
                                ecore_dbus_method_error_cb, NULL);
    ecore_dbus_message_new_method_call(event->server,
-                                     "org.freedesktop.DBus" /*destination*/,
-                                     "/org/freedesktop/DBus" /*path*/,
-                                     "org.freedesktop.DBus" /*interface*/,
-                                     "ListName" /*method*/,
-                                     ecore_dbus_method_list_names_cb,
+                                     "/org/enlightenment/Test" /*path*/,
+                                     "org.enlightenment.Test" /*interface*/,
+                                     "Test" /*method*/,
+                                     "org.enlightenment.Test" /*destination*/,
+                                     ecore_dbus_method_test_cb,
                                      ecore_dbus_method_error_cb, NULL,
                                      NULL /*fmt*/);
    return 0;
@@ -79,6 +81,13 @@
    svr = NULL;
    ecore_main_loop_quit();
    return 0;
+}
+
+static void
+ecore_dbus_method_test_cb(void *data,
+                         Ecore_DBus_Method_Return *reply)
+{
+   printf("test reply cb\n");
 }
 
 static void



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to