From 77190cc60e3df79e3647ac8267bf5eb320623ddb Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 25 Aug 2011 10:01:59 +0000 Subject: [PATCH] =?utf8?q?From:=20J=C3=A9r=C3=A9my=20Zurcher=20=20Subject:=20[E-devel]=20patch=20:=20eina=5Fprefix=20+=20?= =?utf8?q?elementary=5Ftest?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit please find attached a small patch for eina_prefix it prevent segfault when for instance no elm_app_compile_*_dir_set is called prior to elm_app_info_set and another one for elementary/src/bin/test*.c which tends to replace usage of PACKAGE_DATA_DIR with elm_app_data_dir_get git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@62796 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/test_toolbar.c | 6 +++--- src/bin/test_tooltip.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/bin/test_toolbar.c b/src/bin/test_toolbar.c index b71a40c..6dca53a 100644 --- a/src/bin/test_toolbar.c +++ b/src/bin/test_toolbar.c @@ -690,7 +690,7 @@ test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in ph = ph1; elm_photo_size_set(ph, 40); - snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); elm_photo_file_set(ph, buf); evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ph, 0.5, 0.5); @@ -706,7 +706,7 @@ test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in ph = ph3; elm_photo_size_set(ph, 20); - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); elm_photo_file_set(ph, buf); evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ph, 0.5, 0.5); @@ -715,7 +715,7 @@ test_toolbar6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in ph = ph4; elm_photo_size_set(ph, 60); - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", elm_app_data_dir_get()); elm_photo_file_set(ph, buf); evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ph, 0.5, 0.5); diff --git a/src/bin/test_tooltip.c b/src/bin/test_tooltip.c index 21d1f0a..025f821 100644 --- a/src/bin/test_tooltip.c +++ b/src/bin/test_tooltip.c @@ -121,6 +121,49 @@ _tt_item_icon(void *data __UNUSED__, return ic; } +static Evas_Object * +_tt_item_icon2(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + Evas_Object *tt, + void *item __UNUSED__) +{ + Evas_Object *ic = elm_icon_add(tt); + char buf[PATH_MAX]; + snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + return ic; +} + +static Evas_Object * +_tt_item_icon3(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + Evas_Object *tt, + void *item __UNUSED__) +{ + Evas_Object *ic = elm_icon_add(tt); + char buf[PATH_MAX]; + snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get()); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + return ic; +} + +static Evas_Object * +_tt_item_label(void *data __UNUSED__, + Evas_Object *obj __UNUSED__, + Evas_Object *tt, + void *item __UNUSED__) +{ + Evas_Object *l = elm_label_add(tt); + elm_object_text_set(l, "Something useful here?" + "No probably not, but this is a super long label" + "which probably breaks on your system, now doesn't it?" + "Yeah, I thought so."); + elm_label_line_wrap_set(l, ELM_WRAP_MIXED); + return l; +} + static void _tt_item_icon_del(void *data, Evas_Object *obj __UNUSED__, -- 2.7.4