9 #include <Ecore_Evas.h>
13 #define LOGO PACKAGE_DATA_DIR "/logo.png"
16 cb_sent(void *data __UNUSED__, void *ret, DBusError *err)
18 E_Notification_Return_Notify *notify;
22 printf("id: %d\n", notify->notification_id);
24 else if (dbus_error_is_set(err))
26 printf("Error: %s\n", err->message);
31 cb_timer(void *data __UNUSED__)
36 static const char *icons[] = {
43 snprintf(buf, sizeof(buf), "<i>%s</i> says <b>Hello</b> #%d", icons[num % 4], num % 4);
44 n = e_notification_full_new(icons[num % 4], 0, (icons[num % 4][0] != 'e') ? icons[num % 4] : NULL, "Summary", buf, -1);
46 if (!e_notification_app_icon_get(n))
50 E_Notification_Image *i;
51 ee = ecore_evas_buffer_new(1, 1);
54 img = evas_object_image_add(ecore_evas_get(ee));
55 evas_object_image_file_set(img, LOGO, NULL);
56 if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
57 evas_object_image_file_set(img, "logo.png", NULL);
58 if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
60 fprintf(stderr, "ERROR LOADING IMAGE: %s\n", LOGO);
65 ecore_evas_manual_render(ee);
67 i = e_notification_image_new();
68 if (e_notification_image_init(i, img))
69 e_notification_hint_image_data_set(n, i);
75 e_notification_send(n, cb_sent, NULL);
76 e_notification_unref(n);
79 return ECORE_CALLBACK_RENEW;
83 cb_action_invoked(void *data __UNUSED__, int type __UNUSED__, void *event)
85 E_Notification_Event_Action_Invoked *ev;
88 printf("Action (%d): %s\n", ev->notification_id, ev->action_id);
93 cb_note_closed(void *data __UNUSED__, int type __UNUSED__, void *event)
95 E_Notification_Event_Notification_Closed *ev;
96 static const char *reasons[] = {
104 printf("Note %d closed: %s\n", ev->notification_id, reasons[ev->reason]);
114 if (e_notification_init())
116 ecore_timer_add(1, cb_timer, NULL);
117 ecore_main_loop_begin();
118 e_notification_shutdown();
121 ecore_evas_shutdown();