summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas <Coquinho@users.noreply.github.com>2020-08-05 11:49:12 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2021-01-06 13:49:44 -0300
commitf7c9d19d34dc04dd3842525601381f7f60865f2f (patch)
treefab92874f04b294bebb45f46bd1137b3c6443bd0
parent6bc474865731e5ed3fc9040c85ff2ff75ea89d0b (diff)
ethumb: Make ethumb optional
This commit is based on 748e89e703 with a small change to compile in Linux. Original changes: - ethumb(_client) depend on `ethumb` option - Remove ethumb(_client) from ignored subprojects - Remove ethumb_client from default elementary dependencies Additional changes: - Surround `_elm_unneed_ethumb();` call in `src/lib/elementary/elm_main.c` with `#ifdef HAVE_ETHUMB`. Co-authored-by: Felipe Magno de Almeida <felipe@expertise.dev>
-rw-r--r--meson.build10
-rw-r--r--meson_options.txt6
-rw-r--r--src/bin/elementary/meson.build6
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_fileselector.c2
-rw-r--r--src/bin/elementary/test_photo.c2
-rw-r--r--src/edje_external/elementary/meson.build5
-rw-r--r--src/edje_external/elementary/modules.inc2
-rw-r--r--src/examples/elementary/filemvc.c8
-rw-r--r--src/examples/elementary/fileselector_example.c2
-rw-r--r--src/examples/elementary/meson.build5
-rw-r--r--src/lib/efl/Efl_Config.h.in2
-rw-r--r--src/lib/elementary/Elementary.h4
-rw-r--r--src/lib/elementary/elm_icon.c20
-rw-r--r--src/lib/elementary/elm_main.c2
-rw-r--r--src/lib/elementary/elm_widget_icon.h3
-rw-r--r--src/lib/elementary/meson.build11
-rw-r--r--src/tests/elementary/elm_suite.c2
-rw-r--r--src/tests/elementary/meson.build5
19 files changed, 87 insertions, 12 deletions
diff --git a/meson.build b/meson.build
index ba34a9c311..267db9255e 100644
--- a/meson.build
+++ b/meson.build
@@ -345,9 +345,9 @@ subprojects = [
345 ['ephysics' ,['physics'] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []], 345 ['ephysics' ,['physics'] , false, true, false, false, false, false, true, ['eina', 'efl', 'eo'], []],
346 ['edje' ,[] , false, true, true, false, true, true, true, ['evas', 'eo', 'efl', lua_pc_name], []], 346 ['edje' ,[] , false, true, true, false, true, true, true, ['evas', 'eo', 'efl', lua_pc_name], []],
347 ['emotion' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], []], 347 ['emotion' ,[] , true, true, false, false, true, true, true, ['eina', 'efl', 'eo'], []],
348 ['ethumb' ,[] , true, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []], 348 ['ethumb' ,['ethumb'] , true, true, true, false, false, false, true, ['eina', 'efl', 'eo'], []],
349 ['ethumb_client' ,[] , false, true, true, false, false, true, true, ['eina', 'efl', 'eo', 'ethumb'], []], 349 ['ethumb_client' ,['ethumb'] , false, true, true, false, false, true, true, ['eina', 'efl', 'eo', 'ethumb'], []],
350 ['elementary' ,[] , true, true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']], 350 ['elementary' ,[] , true, true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']],
351 ['efl_canvas_wl' ,['wl'] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], 351 ['efl_canvas_wl' ,['wl'] , false, true, true, false, false, false, true, ['eina', 'efl', 'eo', 'evas', 'ecore'], []],
352 ['elua' ,['elua'] , false, true, true, false, true, false, false, ['eina', lua_pc_name], []], 352 ['elua' ,['elua'] , false, true, true, false, true, false, false, ['eina', lua_pc_name], []],
353 ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, false, ['eina'], []], 353 ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, false, ['eina'], []],
@@ -375,12 +375,15 @@ efl_one_include_dirs = []
375efl_one_sub_dirs = [] 375efl_one_sub_dirs = []
376tmp_empty = declare_dependency() 376tmp_empty = declare_dependency()
377 377
378efl_config_h = configuration_data()
379
378foreach package : subprojects 380foreach package : subprojects
379 package_name = package[0] 381 package_name = package[0]
380 package_version_name = '-'.join(package_name.split('_')) + '-' + version_major 382 package_version_name = '-'.join(package_name.split('_')) + '-' + version_major
381 automatic_pkgfile = true 383 automatic_pkgfile = true
382 if package[1].length() == 0 or get_option(package[1][0]) 384 if package[1].length() == 0 or get_option(package[1][0])
383 config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1') 385 config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1')
386 efl_config_h.set('HAVE_' + package_name.to_upper().underscorify(), '1')
384 387
385 dir_package_include = join_paths(dir_include, package_version_name) 388 dir_package_include = join_paths(dir_include, package_version_name)
386 dir_package_modules = join_paths(dir_lib, package_name, 'modules') 389 dir_package_modules = join_paths(dir_lib, package_name, 'modules')
@@ -628,7 +631,6 @@ endif
628# Configure files 631# Configure files
629# 632#
630 633
631efl_config_h = configuration_data()
632efl_config_h.set('EFL_VERSION_MAJOR', version_major) 634efl_config_h.set('EFL_VERSION_MAJOR', version_major)
633efl_config_h.set('EFL_VERSION_MINOR', version_minor) 635efl_config_h.set('EFL_VERSION_MINOR', version_minor)
634efl_config_h.set('EFL_VERSION_MICRO', version_micro) 636efl_config_h.set('EFL_VERSION_MICRO', version_micro)
diff --git a/meson_options.txt b/meson_options.txt
index f5ffb0e134..c2954e04d2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -58,6 +58,12 @@ option('physics',
58 description : 'Physics engine (bullet) in efl' 58 description : 'Physics engine (bullet) in efl'
59) 59)
60 60
61option('ethumb',
62 type : 'boolean',
63 value : true,
64 description : 'Library and service for thumbnail generation and caching'
65)
66
61option('eeze', 67option('eeze',
62 type : 'boolean', 68 type : 'boolean',
63 value : true, 69 value : true,
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 1d7aa75057..f703263770 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -128,7 +128,6 @@ elementary_test_src = [
128 'test_sys_notify.c', 128 'test_sys_notify.c',
129 'test_systray.c', 129 'test_systray.c',
130 'test_table.c', 130 'test_table.c',
131 'test_thumb.c',
132 'test_toolbar.c', 131 'test_toolbar.c',
133 'test_tooltip.c', 132 'test_tooltip.c',
134 'test_transit.c', 133 'test_transit.c',
@@ -172,10 +171,15 @@ if sys_windows == false
172 link_args += ['-rdynamic', '-fPIC'] 171 link_args += ['-rdynamic', '-fPIC']
173 package_c_args = package_c_args + ['-fPIC'] 172 package_c_args = package_c_args + ['-fPIC']
174endif 173endif
174
175if sys_windows == false and sys_sun == false 175if sys_windows == false and sys_sun == false
176 link_args += ['-pie'] 176 link_args += ['-pie']
177endif 177endif
178 178
179if get_option('ethumb')
180 elementary_test_src += ['test_thumb.c']
181endif
182
179elementary_test = executable('elementary_test', 183elementary_test = executable('elementary_test',
180 elementary_test_src, 184 elementary_test_src,
181 dependencies: [elementary, intl] + elementary_deps + elementary_pub_deps, 185 dependencies: [elementary, intl] + elementary_deps + elementary_pub_deps,
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index d0d374ece4..0661086cde 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -877,7 +877,9 @@ add_tests:
877 ADD_TEST(NULL, "Images", "Photocam Icon", test_photocam_icon); 877 ADD_TEST(NULL, "Images", "Photocam Icon", test_photocam_icon);
878 ADD_TEST_EO(NULL, "Images", "Image Zoomable animation", test_image_zoomable_animated); 878 ADD_TEST_EO(NULL, "Images", "Image Zoomable animation", test_image_zoomable_animated);
879 ADD_TEST(NULL, "Images", "Photo", test_photo); 879 ADD_TEST(NULL, "Images", "Photo", test_photo);
880#ifdef HAVE_ETHUMB
880 ADD_TEST(NULL, "Images", "Thumb", test_thumb); 881 ADD_TEST(NULL, "Images", "Thumb", test_thumb);
882#endif
881 ADD_TEST(NULL, "Images", "Image", test_image); 883 ADD_TEST(NULL, "Images", "Image", test_image);
882 ADD_TEST(NULL, "Images", "Image Scale Type", test_image_scale_type); 884 ADD_TEST(NULL, "Images", "Image Scale Type", test_image_scale_type);
883 ADD_TEST(NULL, "Images", "Image Align", test_image_swallow_align); 885 ADD_TEST(NULL, "Images", "Image Align", test_image_swallow_align);
diff --git a/src/bin/elementary/test_fileselector.c b/src/bin/elementary/test_fileselector.c
index 880162e9d2..722825cf25 100644
--- a/src/bin/elementary/test_fileselector.c
+++ b/src/bin/elementary/test_fileselector.c
@@ -549,7 +549,9 @@ test_fileselector(void *data EINA_UNUSED,
549 */ 549 */
550 setlocale(LC_ALL, ""); 550 setlocale(LC_ALL, "");
551 551
552#ifdef HAVE_ETHUMB
552 elm_need_ethumb(); 553 elm_need_ethumb();
554#endif
553 elm_need_efreet(); 555 elm_need_efreet();
554 556
555 win = elm_win_util_standard_add("fileselector", "File Selector"); 557 win = elm_win_util_standard_add("fileselector", "File Selector");
diff --git a/src/bin/elementary/test_photo.c b/src/bin/elementary/test_photo.c
index 7a6e0baf53..34f2e7a5bf 100644
--- a/src/bin/elementary/test_photo.c
+++ b/src/bin/elementary/test_photo.c
@@ -42,7 +42,9 @@ test_photo(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
42 "wood_01.jpg" 42 "wood_01.jpg"
43 }; 43 };
44 44
45#ifdef HAVE_ETHUMB
45 elm_need_ethumb(); 46 elm_need_ethumb();
47#endif
46 48
47 win = elm_win_util_standard_add("photo", "Photo"); 49 win = elm_win_util_standard_add("photo", "Photo");
48 elm_win_autodel_set(win, EINA_TRUE); 50 elm_win_autodel_set(win, EINA_TRUE);
diff --git a/src/edje_external/elementary/meson.build b/src/edje_external/elementary/meson.build
index 033b54eab8..31ad3d53a5 100644
--- a/src/edje_external/elementary/meson.build
+++ b/src/edje_external/elementary/meson.build
@@ -34,12 +34,15 @@ edje_external_elementary = [
34 'elm_slider.c', 34 'elm_slider.c',
35 'elm_slideshow.c', 35 'elm_slideshow.c',
36 'elm_spinner.c', 36 'elm_spinner.c',
37 'elm_thumb.c',
38 'elm_toolbar.c', 37 'elm_toolbar.c',
39 'elm_video.c', 38 'elm_video.c',
40 'elm_web.c' 39 'elm_web.c'
41] 40]
42 41
42if get_option('ethumb')
43 edje_external_elementary += ['elm_thumb.c']
44endif
45
43ecore_systemd_mod = shared_module('elementary', 46ecore_systemd_mod = shared_module('elementary',
44 edje_external_elementary, 47 edje_external_elementary,
45 dependencies: [edje, elementary, elementary_deps], 48 dependencies: [edje, elementary, elementary_deps],
diff --git a/src/edje_external/elementary/modules.inc b/src/edje_external/elementary/modules.inc
index dbfead5183..2037184966 100644
--- a/src/edje_external/elementary/modules.inc
+++ b/src/edje_external/elementary/modules.inc
@@ -31,7 +31,9 @@ DEFINE_TYPE(segment_control)
31DEFINE_TYPE(slider) 31DEFINE_TYPE(slider)
32DEFINE_TYPE(slideshow) 32DEFINE_TYPE(slideshow)
33DEFINE_TYPE(spinner) 33DEFINE_TYPE(spinner)
34#ifdef HAVE_ETHUMB
34DEFINE_TYPE(thumb) 35DEFINE_TYPE(thumb)
36#endif
35DEFINE_TYPE(toolbar) 37DEFINE_TYPE(toolbar)
36DEFINE_TYPE(video) 38DEFINE_TYPE(video)
37DEFINE_TYPE(web) 39DEFINE_TYPE(web)
diff --git a/src/examples/elementary/filemvc.c b/src/examples/elementary/filemvc.c
index dfe73c8b2b..e33c8c2f3a 100644
--- a/src/examples/elementary/filemvc.c
+++ b/src/examples/elementary/filemvc.c
@@ -22,7 +22,9 @@ struct _Efl_Model_Test_Filemvc_Data
22 Eo *treeview; 22 Eo *treeview;
23 Eo *formview; 23 Eo *formview;
24 Eo *treemodel; 24 Eo *treemodel;
25#ifdef HAVE_ETHUMB
25 Evas_Object *thumb; 26 Evas_Object *thumb;
27#endif
26 char imagedefault_path[256]; 28 char imagedefault_path[256];
27}; 29};
28typedef struct _Efl_Model_Test_Filemvc_Data Efl_Model_Test_Filemvc_Data; 30typedef struct _Efl_Model_Test_Filemvc_Data Efl_Model_Test_Filemvc_Data;
@@ -49,7 +51,9 @@ _list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event)
49{ 51{
50 Efl_Model_Test_Filemvc_Data *priv = data; 52 Efl_Model_Test_Filemvc_Data *priv = data;
51 Eo *child = event->info; 53 Eo *child = event->info;
54#ifdef HAVE_ETHUMB
52 ethumb_client_file_free(elm_thumb_ethumb_client_get()); 55 ethumb_client_file_free(elm_thumb_ethumb_client_get());
56#endif
53 57
54 printf("LIST selected model\n"); 58 printf("LIST selected model\n");
55 elm_view_form_model_set(priv->formview, child); 59 elm_view_form_model_set(priv->formview, child);
@@ -89,6 +93,7 @@ _label_init(Evas_Object *win, Evas_Object *box, const char *text)
89} 93}
90 94
91 95
96#ifdef HAVE_ETHUMB
92static void 97static void
93_thumb_error_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) 98_thumb_error_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
94{ 99{
@@ -97,6 +102,7 @@ _thumb_error_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UN
97 elm_thumb_file_set(priv->thumb, priv->imagedefault_path, NULL); 102 elm_thumb_file_set(priv->thumb, priv->imagedefault_path, NULL);
98 elm_thumb_reload(priv->thumb); 103 elm_thumb_reload(priv->thumb);
99} 104}
105#endif
100 106
101EAPI_MAIN int 107EAPI_MAIN int
102elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) 108elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
@@ -177,6 +183,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
177 elm_view_form_widget_add(priv.formview, "path", entry); 183 elm_view_form_widget_add(priv.formview, "path", entry);
178 184
179 /* Thumb widget */ 185 /* Thumb widget */
186#ifdef HAVE_ETHUMB
180 elm_need_ethumb(); 187 elm_need_ethumb();
181 priv.thumb = elm_thumb_add(win); 188 priv.thumb = elm_thumb_add(win);
182 _widget_init(priv.thumb); 189 _widget_init(priv.thumb);
@@ -185,6 +192,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
185 elm_view_form_widget_add(priv.formview, "path", priv.thumb); 192 elm_view_form_widget_add(priv.formview, "path", priv.thumb);
186 evas_object_smart_callback_add(priv.thumb, "generate,error", _thumb_error_cb, &priv); 193 evas_object_smart_callback_add(priv.thumb, "generate,error", _thumb_error_cb, &priv);
187 evas_object_smart_callback_add(priv.thumb, "load,error", _thumb_error_cb, &priv); 194 evas_object_smart_callback_add(priv.thumb, "load,error", _thumb_error_cb, &priv);
195#endif
188 196
189 //showall 197 //showall
190 evas_object_resize(win, 800, 400); 198 evas_object_resize(win, 800, 400);
diff --git a/src/examples/elementary/fileselector_example.c b/src/examples/elementary/fileselector_example.c
index db6dbee256..fa13f2a27a 100644
--- a/src/examples/elementary/fileselector_example.c
+++ b/src/examples/elementary/fileselector_example.c
@@ -113,7 +113,9 @@ elm_main(int argc EINA_UNUSED,
113 */ 113 */
114 setlocale(LC_ALL, ""); 114 setlocale(LC_ALL, "");
115 115
116#ifdef HAVE_ETHUMB
116 elm_need_ethumb(); /* let's have thumbnails of images on grid view */ 117 elm_need_ethumb(); /* let's have thumbnails of images on grid view */
118#endif
117 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 119 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
118 120
119 win = elm_win_util_standard_add("fileselector", "File Selector Example"); 121 win = elm_win_util_standard_add("fileselector", "File Selector Example");
diff --git a/src/examples/elementary/meson.build b/src/examples/elementary/meson.build
index 7abffa8a2f..563560efe9 100644
--- a/src/examples/elementary/meson.build
+++ b/src/examples/elementary/meson.build
@@ -90,7 +90,6 @@ examples = [
90 'table_example_02', 90 'table_example_02',
91 'theme_example_01', 91 'theme_example_01',
92 'theme_example_02', 92 'theme_example_02',
93 'thumb_example_01',
94 'toolbar_example_01', 93 'toolbar_example_01',
95 'toolbar_example_02', 94 'toolbar_example_02',
96 'toolbar_example_03', 95 'toolbar_example_03',
@@ -123,6 +122,10 @@ examples = [
123 'efl_canvas_textblock_obstacles_example' 122 'efl_canvas_textblock_obstacles_example'
124] 123]
125 124
125if get_option('ethumb')
126 examples += ['thumb_example_01']
127endif
128
126foreach example : examples 129foreach example : examples
127 executable(example, example + '.c', dependencies: [elementary, ecore, eio, m]) 130 executable(example, example + '.c', dependencies: [elementary, ecore, eio, m])
128endforeach 131endforeach
diff --git a/src/lib/efl/Efl_Config.h.in b/src/lib/efl/Efl_Config.h.in
index 3dbef96659..3f5937f1dd 100644
--- a/src/lib/efl/Efl_Config.h.in
+++ b/src/lib/efl/Efl_Config.h.in
@@ -14,4 +14,6 @@
14#define EFL_VERSION_MICRO @EFL_VERSION_MICRO@ 14#define EFL_VERSION_MICRO @EFL_VERSION_MICRO@
15#define EFL_BUILD_ID "@EFL_BUILD_ID@" 15#define EFL_BUILD_ID "@EFL_BUILD_ID@"
16 16
17#mesondefine HAVE_ETHUMB
18
17#endif 19#endif
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 1721be4f73..0ce8fd8e35 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -72,7 +72,9 @@
72#include <Efreet.h> 72#include <Efreet.h>
73#include <Efreet_Mime.h> 73#include <Efreet_Mime.h>
74#include <Efreet_Trash.h> 74#include <Efreet_Trash.h>
75#ifdef HAVE_ETHUMB
75#include <Ethumb_Client.h> 76#include <Ethumb_Client.h>
77#endif
76 78
77#ifdef ELM_EMAP 79#ifdef ELM_EMAP
78#include <EMap.h> 80#include <EMap.h>
@@ -225,7 +227,9 @@ ELM_API extern Elm_Version *elm_version;
225#include <elm_table.h> 227#include <elm_table.h>
226#include <elm_textpath.h> 228#include <elm_textpath.h>
227#include <elm_theme.h> 229#include <elm_theme.h>
230#ifdef HAVE_ETHUMB
228#include <elm_thumb.h> 231#include <elm_thumb.h>
232#endif
229#include <elm_toolbar.h> 233#include <elm_toolbar.h>
230#include <elm_transit.h> 234#include <elm_transit.h>
231/* this is actually elm_video */ 235/* this is actually elm_video */
diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c
index 9b28feada9..318692d546 100644
--- a/src/lib/elementary/elm_icon.c
+++ b/src/lib/elementary/elm_icon.c
@@ -20,11 +20,16 @@
20static Eina_List *_elm_icon_retry = NULL; 20static Eina_List *_elm_icon_retry = NULL;
21static int _icon_pending_request = 0; 21static int _icon_pending_request = 0;
22 22
23#ifdef HAVE_ETHUMB
23static const char SIG_THUMB_DONE[] = "thumb,done"; 24static const char SIG_THUMB_DONE[] = "thumb,done";
24static const char SIG_THUMB_ERROR[] = "thumb,error"; 25static const char SIG_THUMB_ERROR[] = "thumb,error";
26#endif
27
25static const Evas_Smart_Cb_Description _smart_callbacks[] = { 28static const Evas_Smart_Cb_Description _smart_callbacks[] = {
29#ifdef HAVE_ETHUMB
26 {SIG_THUMB_DONE, ""}, 30 {SIG_THUMB_DONE, ""},
27 {SIG_THUMB_ERROR, ""}, 31 {SIG_THUMB_ERROR, ""},
32#endif
28 {NULL, NULL} 33 {NULL, NULL}
29}; 34};
30 35
@@ -57,6 +62,7 @@ _icon_size_min_get(Evas_Object *icon)
57 return MAX(16, MIN(w, h)); 62 return MAX(16, MIN(w, h));
58} 63}
59 64
65#ifdef HAVE_ETHUMB
60static void 66static void
61_icon_thumb_stop(Elm_Icon_Data *sd, 67_icon_thumb_stop(Elm_Icon_Data *sd,
62 void *ethumbd) 68 void *ethumbd)
@@ -266,6 +272,8 @@ _icon_thumb_apply_cb(void *data,
266 return ECORE_CALLBACK_RENEW; 272 return ECORE_CALLBACK_RENEW;
267} 273}
268 274
275#endif
276
269static Eina_Bool 277static Eina_Bool
270_icon_freedesktop_set(Evas_Object *obj, 278_icon_freedesktop_set(Evas_Object *obj,
271 const char *theme, 279 const char *theme,
@@ -484,6 +492,8 @@ _elm_icon_standard_resize_cb(void *data,
484 eina_stringshare_del(refup); 492 eina_stringshare_del(refup);
485} 493}
486 494
495#ifdef HAVE_ETHUMB
496
487static void 497static void
488_elm_icon_thumb_resize_cb(void *data, 498_elm_icon_thumb_resize_cb(void *data,
489 Evas *e EINA_UNUSED, 499 Evas *e EINA_UNUSED,
@@ -496,12 +506,16 @@ _elm_icon_thumb_resize_cb(void *data,
496 elm_icon_thumb_set(obj, sd->thumb.file.path, sd->thumb.file.key); 506 elm_icon_thumb_set(obj, sd->thumb.file.path, sd->thumb.file.key);
497} 507}
498 508
509#endif
510
499EOLIAN static void 511EOLIAN static void
500_elm_icon_efl_canvas_group_group_add(Eo *obj, Elm_Icon_Data *priv) 512_elm_icon_efl_canvas_group_group_add(Eo *obj, Elm_Icon_Data *priv)
501{ 513{
502 efl_canvas_group_add(efl_super(obj, MY_CLASS)); 514 efl_canvas_group_add(efl_super(obj, MY_CLASS));
503 515
516#ifdef HAVE_ETHUMB
504 priv->thumb.request = NULL; 517 priv->thumb.request = NULL;
518#endif
505} 519}
506 520
507EOLIAN static void 521EOLIAN static void
@@ -509,6 +523,7 @@ _elm_icon_efl_canvas_group_group_del(Eo *obj, Elm_Icon_Data *sd)
509{ 523{
510 eina_stringshare_del(sd->stdicon); 524 eina_stringshare_del(sd->stdicon);
511 525
526#ifdef HAVE_ETHUMB
512 if (sd->thumb.request) 527 if (sd->thumb.request)
513 { 528 {
514 Ethumb_Client *ethumbd = elm_thumb_ethumb_client_get(); 529 Ethumb_Client *ethumbd = elm_thumb_ethumb_client_get();
@@ -520,6 +535,7 @@ _elm_icon_efl_canvas_group_group_del(Eo *obj, Elm_Icon_Data *sd)
520 eina_stringshare_del(sd->thumb.thumb.path); 535 eina_stringshare_del(sd->thumb.thumb.path);
521 eina_stringshare_del(sd->thumb.thumb.key); 536 eina_stringshare_del(sd->thumb.thumb.key);
522 ecore_event_handler_del(sd->thumb.eeh); 537 ecore_event_handler_del(sd->thumb.eeh);
538#endif
523 539
524 _edje_signals_free(sd); 540 _edje_signals_free(sd);
525 541
@@ -859,6 +875,8 @@ elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group)
859 875
860 evas_object_event_callback_del_full 876 evas_object_event_callback_del_full
861 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj); 877 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj);
878
879#ifdef HAVE_ETHUMB
862 evas_object_event_callback_del_full 880 evas_object_event_callback_del_full
863 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj); 881 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
864 882
@@ -879,6 +897,8 @@ elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group)
879 sd->thumb.eeh = ecore_event_handler_add 897 sd->thumb.eeh = ecore_event_handler_add
880 (ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj); 898 (ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj);
881 } 899 }
900#endif
901
882} 902}
883 903
884ELM_API Eina_Bool 904ELM_API Eina_Bool
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 20e27eb662..f22a205259 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -946,7 +946,9 @@ elm_quicklaunch_shutdown(void)
946 _elm_unneed_efreet(); 946 _elm_unneed_efreet();
947 _elm_unneed_e_dbus(); 947 _elm_unneed_e_dbus();
948 _elm_unneed_eldbus(); 948 _elm_unneed_eldbus();
949#ifdef HAVE_ETHUMB
949 _elm_unneed_ethumb(); 950 _elm_unneed_ethumb();
951#endif
950 _elm_unneed_web(); 952 _elm_unneed_web();
951 953
952#ifdef HAVE_ELEMENTARY_EMAP 954#ifdef HAVE_ELEMENTARY_EMAP
diff --git a/src/lib/elementary/elm_widget_icon.h b/src/lib/elementary/elm_widget_icon.h
index 929f7e3141..06290d6b95 100644
--- a/src/lib/elementary/elm_widget_icon.h
+++ b/src/lib/elementary/elm_widget_icon.h
@@ -25,6 +25,7 @@ struct _Elm_Icon_Data
25 Evas_Object *obj; // the object itself 25 Evas_Object *obj; // the object itself
26 const char *stdicon; 26 const char *stdicon;
27 27
28#ifdef HAVE_ETHUMB
28 struct 29 struct
29 { 30 {
30 struct 31 struct
@@ -41,7 +42,7 @@ struct _Elm_Icon_Data
41 42
42 Eina_Bool retry : 1; 43 Eina_Bool retry : 1;
43 } thumb; 44 } thumb;
44 45#endif
45 struct 46 struct
46 { 47 {
47 int requested_size; 48 int requested_size;
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index a6eda13dc6..e7b49877e6 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -844,7 +844,6 @@ elementary_src = files([
844 'elm_sys_notify_dbus.c', 844 'elm_sys_notify_dbus.c',
845 'elm_table.c', 845 'elm_table.c',
846 'elm_theme.c', 846 'elm_theme.c',
847 'elm_thumb.c',
848 'elm_toolbar.c', 847 'elm_toolbar.c',
849 'elm_transit.c', 848 'elm_transit.c',
850 'elm_util.c', 849 'elm_util.c',
@@ -953,10 +952,16 @@ elementary_src = files([
953 'efl_ui_spotlight_animation_manager.c', 952 'efl_ui_spotlight_animation_manager.c',
954]) 953])
955 954
956elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, eio, buildsystem] 955elementary_deps = [emile, eo, efl, edje, emotion, ecore_imf, ecore_con, eldbus, efreet, eio, buildsystem]
957elementary_pub_deps = [eina, eet, evas, ecore, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_con, 956elementary_pub_deps = [eina, eet, evas, ecore, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_con,
958 edje, eldbus, efreet, ethumb_client, efl] 957 edje, eldbus, efreet, efl]
959elementary_ext_deps = [atspi, dl, intl, buildsystem_simple] 958elementary_ext_deps = [atspi, dl, intl, buildsystem_simple]
959
960if get_option('ethumb')
961 elementary_src += files('elm_thumb.c')
962 elementary_deps += [ethumb, ethumb_client]
963 elementary_pub_deps += ethumb_client
964endif
960elm_options = configuration_data() 965elm_options = configuration_data()
961 966
962config_h.set_quoted('ELM_TOP_BUILD_DIR', meson.build_root()) 967config_h.set_quoted('ELM_TOP_BUILD_DIR', meson.build_root())
diff --git a/src/tests/elementary/elm_suite.c b/src/tests/elementary/elm_suite.c
index d6aa4636e8..2a2289b6dc 100644
--- a/src/tests/elementary/elm_suite.c
+++ b/src/tests/elementary/elm_suite.c
@@ -22,7 +22,9 @@ static const Efl_Test_Case etc[] = {
22 { "elm_actionslider", elm_test_actionslider}, 22 { "elm_actionslider", elm_test_actionslider},
23 { "elm_box", elm_test_box}, 23 { "elm_box", elm_test_box},
24 { "elm_table", elm_test_table}, 24 { "elm_table", elm_test_table},
25#ifdef HAVE_ETHUMB
25 { "elm_thumb", elm_test_thumb}, 26 { "elm_thumb", elm_test_thumb},
27#endif
26 { "elm_menu", elm_test_menu}, 28 { "elm_menu", elm_test_menu},
27 { "elm_photocam", elm_test_photocam}, 29 { "elm_photocam", elm_test_photocam},
28 { "elm_win", elm_test_win}, 30 { "elm_win", elm_test_win},
diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build
index d46db7da6b..63fa722c50 100644
--- a/src/tests/elementary/meson.build
+++ b/src/tests/elementary/meson.build
@@ -38,7 +38,6 @@ elementary_suite_src = [
38 'elm_test_actionslider.c', 38 'elm_test_actionslider.c',
39 'elm_test_box.c', 39 'elm_test_box.c',
40 'elm_test_table.c', 40 'elm_test_table.c',
41 'elm_test_thumb.c',
42 'elm_test_menu.c', 41 'elm_test_menu.c',
43 'elm_test_photocam.c', 42 'elm_test_photocam.c',
44 'elm_test_win.c', 43 'elm_test_win.c',
@@ -107,6 +106,10 @@ elementary_suite_src = [
107 'elm_test_widget_basics.c' 106 'elm_test_widget_basics.c'
108] 107]
109 108
109if get_option('ethumb')
110 elementary_suite_src += ['elm_test_thumb.c']
111endif
112
110elementary_suite = executable('elementary_suite', 113elementary_suite = executable('elementary_suite',
111 elementary_suite_src, 114 elementary_suite_src,
112 dependencies: [check, eina, elementary, elementary_deps, intl], 115 dependencies: [check, eina, elementary, elementary_deps, intl],