if test "x${have_edbus_notify_test}" = "xyes" ; then
PKG_CHECK_MODULES([EDBUS_NOTIFY_TEST],
- [ecore >= 1.1.0 evas >= 1.1.0 eina >= 1.1.0 dbus-1 >= 0.62],
+ [ecore >= 1.1.0 ecore-evas >= 1.1.0 evas >= 1.1.0 eina >= 1.1.0 dbus-1 >= 0.62],
[have_edbus_notify_test="yes"],
[have_edbus_notify_test="no"])
fi
MAINTAINERCLEANFILES = Makefile.in
+AM_CFLAGS = \
+-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\"
+
EDBUS_CPPFLAGS = @EDBUS_CFLAGS@
bin_PROGRAMS =
endif
if BUILD_EDBUS_NOTIFY_TEST
+EXTRA_DIST = logo.png
+logodir = $(datadir)/e_dbus
+logo_DATA = logo.png
e_dbus_notify_SOURCES = notify.c
e_dbus_notify_CPPFLAGS = \
-I$(top_srcdir)/src/lib/dbus \
#include <stdio.h>
+#include <Evas.h>
#include <Ecore.h>
+#include <Ecore_Evas.h>
#include <E_DBus.h>
#include <E_Notify.h>
+#define LOGO PACKAGE_DATA_DIR "/logo.png"
+
void
cb_sent(void *data __UNUSED__, void *ret, DBusError *err)
{
static const char *icons[] = {
"xterm",
"firefox",
- "gvim"
+ "gvim",
+ "e"
};
- 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);
+ snprintf(buf, sizeof(buf), "<i>%s</i> says <b>Hello</b> #%d", icons[num % 4], num % 4);
+ n = e_notification_full_new(icons[num % 4], 0, (icons[num % 4][0] != 'e') ? icons[num % 4] : NULL, "Summary", buf, -1);
+
+ if (!e_notification_app_icon_get(n))
+ {
+ Ecore_Evas *ee;
+ Evas_Object *img;
+ E_Notification_Image *i;
+ ee = ecore_evas_buffer_new(1, 1);
+ if (ee)
+ {
+ img = evas_object_image_add(ecore_evas_get(ee));
+ evas_object_image_file_set(img, LOGO, NULL);
+ if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
+ evas_object_image_file_set(img, "logo.png", NULL);
+ if (evas_object_image_load_error_get(img) != EVAS_LOAD_ERROR_NONE)
+ {
+ fprintf(stderr, "ERROR LOADING IMAGE: %s\n", LOGO);
+ evas_object_del(img);
+ img = NULL;
+ }
+ else
+ ecore_evas_manual_render(ee);
+
+ i = e_notification_image_new();
+ if (e_notification_image_init(i, img))
+ e_notification_hint_image_data_set(n, i);
+ evas_object_del(img);
+ ecore_evas_free(ee);
+ }
+ }
+
e_notification_send(n, cb_sent, NULL);
e_notification_unref(n);
num++;
{
int ret = 0;
ecore_init();
+ ecore_evas_init();
if (e_notification_init())
{
ecore_timer_add(1, cb_timer, NULL);
e_notification_shutdown();
}
+ ecore_evas_shutdown();
ecore_shutdown();
return ret;
}