Enlightenment CVS committal Author : rephorm Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/bin Modified Files: ecore_dbus_receiver_test.c ecore_dbus_test.c Log Message: add quick test of object/method API =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_receiver_test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_dbus_receiver_test.c 24 Sep 2006 07:28:07 -0000 1.1 +++ ecore_dbus_receiver_test.c 27 Sep 2006 00:02:30 -0000 1.2 @@ -12,6 +12,9 @@ static void ecore_dbus_method_add_match_cb(void *data, Ecore_DBus_Method_Return *reply); static void ecore_dbus_method_error_cb(void *data, const char *error); +static void _test_object_init(Ecore_DBus_Server *svr); + + static Ecore_DBus_Server *svr = NULL; int @@ -56,9 +59,9 @@ event = ev; printf("ecore_dbus_event_server_add\n"); - + ecore_dbus_method_request_name(event->server, "org.enlightenment.Test", 0, NULL, ecore_dbus_method_error_cb, NULL); - ecore_dbus_method_add_match(event->server, "type=method_call,interface=org.enlightenment.Test", ecore_dbus_method_add_match_cb, ecore_dbus_method_error_cb, NULL); + _test_object_init(event->server); return 0; } @@ -97,6 +100,23 @@ { printf("Error: %s\n", error); ecore_main_loop_quit(); +} + + +static void +_test_object_test(Ecore_DBus_Event_Method_Call *event) +{ + printf("received call to test!\n"); +} + +static void +_test_object_init(Ecore_DBus_Server *svr) +{ + Ecore_DBus_Object *obj; + printf("init object!\n"); + if (!svr) return; + obj = ecore_dbus_object_add(svr, "/org/enlightenment/test"); + ecore_dbus_object_method_add(obj, "org.enlightenment.Test", "Test", _test_object_test); } #else =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/bin/ecore_dbus_test.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ecore_dbus_test.c 24 Sep 2006 07:24:51 -0000 1.12 +++ ecore_dbus_test.c 27 Sep 2006 00:02:30 -0000 1.13 @@ -19,13 +19,12 @@ int main(int argc, char **argv) { - char *bus_addr = NULL, *socket_name = NULL; ecore_dbus_init(); svr = ecore_dbus_server_session_connect(NULL); if (!svr) { - printf("Couldn't connect to dbus system server (%s)!\n", socket_name); + printf("Couldn't connect to dbus session server!\n"); } else { @@ -61,7 +60,7 @@ ecore_dbus_method_list_names_cb, ecore_dbus_method_error_cb, NULL); ecore_dbus_message_new_method_call(event->server, - "/org/enlightenment/Test" /*path*/, + "/org/enlightenment/test" /*path*/, "org.enlightenment.Test" /*interface*/, "Test" /*method*/, "org.enlightenment.Test" /*destination*/, @@ -140,6 +139,7 @@ } return "UNKNOWN"; } + #else int main(int argc, const char **argv) @@ -148,3 +148,5 @@ return -1; } #endif + + ------------------------------------------------------------------------- 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