10 #include <Ecore_Evas.h>
14 #define LOGO PACKAGE_DATA_DIR "/logo.png"
17 cb_sent(void *data __UNUSED__, void *ret, DBusError *err)
19 E_Notification_Return_Notify *notify;
23 printf("id: %d\n", notify->notification_id);
25 else if (dbus_error_is_set(err))
27 printf("Error: %s\n", err->message);
32 cb_timer(void *data __UNUSED__)
37 static const char *icons[] = {
44 snprintf(buf, sizeof(buf), "<i>%s</i> says <b>Hello</b> #%d", icons[num % 4], num % 4);
45 n = e_notification_full_new(icons[num % 4], 0, (icons[num % 4][0] != 'e') ? icons[num % 4] : NULL, "Summary", buf, -1);
47 if (!e_notification_app_icon_get(n))
51 E_Notification_Image *i;
52 ee = ecore_evas_buffer_new(1, 1);
55 img = evas_object_image_add(ecore_evas_get(ee));
56 evas_object_image_file_set(img, LOGO, NULL);
57 if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
58 evas_object_image_file_set(img, "logo.png", NULL);
59 if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
61 fprintf(stderr, "ERROR LOADING IMAGE: %s\n", LOGO);
66 ecore_evas_manual_render(ee);
68 i = e_notification_image_new();
69 if (e_notification_image_init(i, img))
70 e_notification_hint_image_data_set(n, i);
76 e_notification_send(n, cb_sent, NULL);
77 e_notification_unref(n);
80 return ECORE_CALLBACK_RENEW;
84 cb_action_invoked(void *data __UNUSED__, int type __UNUSED__, void *event)
86 E_Notification_Event_Action_Invoked *ev;
89 printf("Action (%d): %s\n", ev->notification_id, ev->action_id);
94 cb_note_closed(void *data __UNUSED__, int type __UNUSED__, void *event)
96 E_Notification_Event_Notification_Closed *ev;
97 static const char *reasons[] = {
105 printf("Note %d closed: %s\n", ev->notification_id, reasons[ev->reason]);
115 if (e_notification_init())
117 ecore_timer_add(1, cb_timer, NULL);
118 ecore_main_loop_begin();
119 e_notification_shutdown();
122 ecore_evas_shutdown();