Enlightenment CVS committal
Author : rephorm
Project : e17
Module : proto
Dir : e17/proto/e_dbus/src/bin
Modified Files:
Makefile.am notify.c
Added Files:
notification_daemon.c
Log Message:
add daemon test and implement more of client test
===================================================================
RCS file: /cvs/e/e17/proto/e_dbus/src/bin/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- Makefile.am 11 Jul 2007 00:45:13 -0000 1.7
+++ Makefile.am 11 Jul 2007 00:48:59 -0000 1.8
@@ -14,7 +14,8 @@
e_dbus_test_client \
e_dbus_hal \
e_dbus_nm \
- e_dbus_notify
+ e_dbus_notify \
+
e_dbus_notification_daemon
e_dbus_test_SOURCES = \
test.c
@@ -61,3 +62,9 @@
e_dbus_notify_LDADD = $(top_builddir)/src/lib/dbus/libedbus.la
$(top_builddir)/src/lib/notification/libenotify.la $(LIBS)
e_dbus_notify_DEPENDENCIES = $(top_builddir)/src/lib/dbus/libedbus.la
$(top_builddir)/src/lib/notification/libenotify.la
+
+e_dbus_notification_daemon_SOURCES = \
+ notification_daemon.c
+
+e_dbus_notification_daemon_LDADD = $(top_builddir)/src/lib/dbus/libedbus.la
$(top_builddir)/src/lib/notification/libenotify.la $(LIBS)
+e_dbus_notification_daemon_DEPENDENCIES =
$(top_builddir)/src/lib/dbus/libedbus.la
$(top_builddir)/src/lib/notification/libenotify.la
===================================================================
RCS file: /cvs/e/e17/proto/e_dbus/src/bin/notify.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- notify.c 11 Jul 2007 00:46:37 -0000 1.3
+++ notify.c 11 Jul 2007 00:48:59 -0000 1.4
@@ -16,19 +16,65 @@
{
printf("Error: %s\n", err->message);
}
- ecore_main_loop_quit();
+
+ free(notify);
+}
+
+int
+cb_timer(void *data)
+{
+ E_Notification *n;
+ char buf[1024];
+ static int num = 0;
+ static const char *icons[] = {
+ "xterm",
+ "firefox",
+ "gvim"
+ };
+
+ snprintf(buf, sizeof(buf), "<i>%s</i> says <b>Hello</b> #%d", icons[num%3],
num / 3);
+ n = e_notification_full_new(icons[num%3], 0, icons[num%3], "Summary", buf,
-1);
+ e_notification_send(n, cb_sent, NULL);
+ e_notification_unref(n);
+ num++;
+
+ return 1;
+}
+
+void
+cb_action_invoked(void *data, int type, void *event)
+{
+ E_Notification_Event_Action_Invoked *ev;
+
+ ev = event;
+ printf("Action (%d): %s\n", ev->notification_id, ev->action_id);
+ free(ev);
+}
+
+void
+cb_note_closed(void *data, int type, void *event)
+{
+ E_Notification_Event_Notification_Closed *ev;
+ static const char *reasons[] = {
+ "Expired",
+ "Dismissed",
+ "Requested",
+ "Undefined"
+ };
+
+ ev = event;
+ printf("Note %d closed: %s\n", ev->notification_id, reasons[ev->reason]);
+ free(ev);
}
int
main(int argc, char **argv)
{
int ret = 0;
- E_Notification *n;
ecore_init();
if (e_notification_init())
{
- n = e_notification_full_new("Elicit", 0, "elicit", "Summary", "The
<b>body</b>", -1);
- e_notification_send(n, cb_sent, NULL);
+ ecore_timer_add(1, cb_timer, NULL);
ecore_main_loop_begin();
e_notification_shutdown();
}
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs