summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-14 15:08:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-14 15:11:54 +0900
commitaba7c4559f703db4f48621210fa654eddacba272 (patch)
treeab58941e8f3d9f3ef82d176f8c2656a0821f0b74
parent9db673784c7534cfce8b844ac26f1114db4b1b3a (diff)
update some filters
-rw-r--r--examples/yalefeu.cfgbin0 -> 977 bytes
-rw-r--r--font_effect_ui.config2
-rw-r--r--font_effect_ui.includes84
-rw-r--r--main.c73
4 files changed, 133 insertions, 26 deletions
diff --git a/examples/yalefeu.cfg b/examples/yalefeu.cfg
new file mode 100644
index 0000000..369a0df
--- /dev/null
+++ b/examples/yalefeu.cfg
Binary files differ
diff --git a/font_effect_ui.config b/font_effect_ui.config
index 4f3005e..20f20a1 100644
--- a/font_effect_ui.config
+++ b/font_effect_ui.config
@@ -1,3 +1,5 @@
1// ADD PREDEFINED MACROS HERE! 1// ADD PREDEFINED MACROS HERE!
2#define HAS_FILTER_CHAIN 2#define HAS_FILTER_CHAIN
3#define HAS_FILTER_CHAIN_IMG 3#define HAS_FILTER_CHAIN_IMG
4#define EFL_EO_API_SUPPORT
5#define EFL_BETA_API_SUPPORT
diff --git a/font_effect_ui.includes b/font_effect_ui.includes
index f7348a8..52903a2 100644
--- a/font_effect_ui.includes
+++ b/font_effect_ui.includes
@@ -1,16 +1,68 @@
1/home/jpeg/e/core/efl/src/lib/evas 1/opt/e/include/ecore-audio-1
2/home/jpeg/e/core/efl/src/lib/eina 2/opt/e/include/ethumb-1
3/home/jpeg/e/core/efl/src/lib/ecore 3/opt/e/include/enlightenment
4/home/jpeg/e/core/efl/src/lib/edje 4/opt/e/include/edje-1
5/home/jpeg/e/core/efl/src/lib/efl 5/opt/e/include/eet-cxx-1
6/home/jpeg/e/core/efl/src/lib/eio 6/opt/e/include/eet-cxx-1/eet-cxx
7/home/jpeg/e/core/efl/src/lib/eo 7/opt/e/include/ecore-ipc-1
8/home/jpeg/e/core/elementary/src/lib 8/opt/e/include/elementary-cxx-1
9/home/jpeg/e/core/efl/build/src/lib/evas 9/opt/e/include/clouseau-0
10/home/jpeg/e/core/efl/build/src/lib/eina 10/opt/e/include/evas-1
11/home/jpeg/e/core/efl/build/src/lib/ecore 11/opt/e/include/evas-1/canvas
12/home/jpeg/e/core/efl/build/src/lib/edje 12/opt/e/include/maelstrom-0
13/home/jpeg/e/core/efl/build/src/lib/efl/build 13/opt/e/include/eina-1
14/home/jpeg/e/core/efl/build/src/lib/eio 14/opt/e/include/eina-1/eina
15/home/jpeg/e/core/efl/build/src/lib/eo 15/opt/e/include/enventor-0
16/home/jpeg/e/core/elementary/build/src/lib 16/opt/e/include/ecore-imf-evas-1
17/opt/e/include/ecore-1
18/opt/e/include/ecore-avahi-1
19/opt/e/include/cairo
20/opt/e/include/ecore-audio-cxx-1
21/opt/e/include/eet_cxx-1
22/opt/e/include/eet_cxx-1/eet_cxx
23/opt/e/include/efreet-1
24/opt/e/include/elementary-1
25/opt/e/include/eina-cxx-1
26/opt/e/include/eina-cxx-1/eina-cxx
27/opt/e/include/emotion-1
28/opt/e/include/emile-1
29/opt/e/include/ethumb-client-1
30/opt/e/include/efx-1
31/opt/e/include/ecore-wayland-1
32/opt/e/include/ecore-input-evas-1
33/opt/e/include/etrophy-0
34/opt/e/include/ecore-imf-1
35/opt/e/include/edje-cxx-1
36/opt/e/include/eolian-1
37/opt/e/include/eo-cxx-1
38/opt/e/include/eolian-cxx-1
39/opt/e/include/eolian-cxx-1/grammar
40/opt/e/include/elua-1
41/opt/e/include/eflete-0
42/opt/e/include/ecore-x-1
43/opt/e/include/embryo-1
44/opt/e/include/eeze-1
45/opt/e/include/elocation-1
46/opt/e/include/eldbus-1
47/opt/e/include/ecore-input-1
48/opt/e/include/efl-1
49/opt/e/include/efl-1/interfaces
50/opt/e/include/ecore-drm-1
51/opt/e/include/ecore-con-1
52/opt/e/include/ecore-evas-1
53/opt/e/include/eet-1
54/opt/e/include/ecore-file-1
55/opt/e/include/eio-1
56/opt/e/include/ewe
57/opt/e/include/ephysics-1
58/opt/e/include/ecore-cxx-1
59/opt/e/include/ecore_cxx-1
60/opt/e/include/evas-cxx-1
61/opt/e/include/evas-cxx-1/canvas
62/opt/e/include/eo-1
63/opt/e/include/efl-cxx-1
64/opt/e/include/edi-0
65/opt/e/include/eio-cxx-1
66/opt/e/include/esskyuehl-1
67/opt/e/include/eldbus_cxx-1
68/opt/e/include/ecore-fb-1
diff --git a/main.c b/main.c
index 6332521..938470c 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,7 @@
1#define _GNU_SOURCE // asprintfc 1#define _GNU_SOURCE // asprintfc
2#define EFL_GFX_FILTER_BETA 2#define EFL_GFX_FILTER_BETA
3#define DEFL_EO_API_SUPPORT 1
4#define DEFL_BETA_API_SUPPORT 1
3 5
4#include <Elementary.h> 6#include <Elementary.h>
5#include <Ecore.h> 7#include <Ecore.h>
@@ -29,7 +31,7 @@ const char *home = NULL;
29#define HAS_FILTER_CHAIN_TXT 31#define HAS_FILTER_CHAIN_TXT
30#undef HAS_FILTER_CHAIN_IMG 32#undef HAS_FILTER_CHAIN_IMG
31#undef HAS_FILTER_CHAIN_TB 33#undef HAS_FILTER_CHAIN_TB
32#define TEXTVIEW_PROXY 34#undef TEXTVIEW_PROXY
33 35
34#define IMAGE_COUNT 2 36#define IMAGE_COUNT 2
35#define FIXED_SIZED_SOURCE 1 37#define FIXED_SIZED_SOURCE 1
@@ -299,6 +301,7 @@ _config_reload(const char *path)
299 free(fontsize); 301 free(fontsize);
300 } 302 }
301 303
304#ifdef HAS_FILTER_CHAIN_TB
302 // Textblock 305 // Textblock
303 utf8 = eet_read(ef, "textblockeditor", &size); 306 utf8 = eet_read(ef, "textblockeditor", &size);
304 if (utf8) 307 if (utf8)
@@ -308,6 +311,7 @@ _config_reload(const char *path)
308 free(markup); 311 free(markup);
309 free(utf8); 312 free(utf8);
310 } 313 }
314#endif
311 315
312 eet_close(ef); 316 eet_close(ef);
313 317
@@ -403,6 +407,7 @@ _config_save(const char *path)
403 fontsize = elm_spinner_value_get(size_spinner); 407 fontsize = elm_spinner_value_get(size_spinner);
404 ok &= eet_write(ef, "fontsize", &fontsize, sizeof(int), 0); 408 ok &= eet_write(ef, "fontsize", &fontsize, sizeof(int), 0);
405 409
410#ifdef HAS_FILTER_CHAIN_TB
406 // Textblock markup 411 // Textblock markup
407 utf8 = elm_entry_markup_to_utf8(elm_object_text_get(textblockeditor)); 412 utf8 = elm_entry_markup_to_utf8(elm_object_text_get(textblockeditor));
408 if (utf8) 413 if (utf8)
@@ -410,6 +415,7 @@ _config_save(const char *path)
410 ok &= eet_write(ef, "textblockeditor", utf8, strlen(utf8) + 1, 0); 415 ok &= eet_write(ef, "textblockeditor", utf8, strlen(utf8) + 1, 0);
411 free(utf8); 416 free(utf8);
412 } 417 }
418#endif
413 419
414 eet_close(ef); 420 eet_close(ef);
415 return ok; 421 return ok;
@@ -626,7 +632,7 @@ _size_spinner_cb(void *data EINA_UNUSED,
626 val = elm_spinner_value_get(obj); 632 val = elm_spinner_value_get(obj);
627 evas_object_text_font_get(textview, &font, NULL); 633 evas_object_text_font_get(textview, &font, NULL);
628 evas_object_text_font_set(textview, font, (int) val); 634 evas_object_text_font_set(textview, font, (int) val);
629 elm_box_recalculate(elm_object_parent_widget_get(textview)); 635 //elm_box_recalculate(elm_object_parent_widget_get(textview));
630 636
631 _style_apply(); 637 _style_apply();
632} 638}
@@ -789,6 +795,37 @@ _home_dir_get(void)
789} 795}
790 796
791#ifdef TEXTVIEW_PROXY 797#ifdef TEXTVIEW_PROXY
798static Eina_Bool
799_render_post_cb(void *data, const Eo_Event *ev EINA_UNUSED)
800{
801 Eo *img = data;
802 uint32_t *pixels;
803 int length, stride;
804 Efl_Canvas_Image *o;
805 int w, h;
806
807 efl_gfx_view_size_get(img, &w, &h);
808 pixels = efl_gfx_buffer_map(img, &length, EFL_GFX_BUFFER_ACCESS_MODE_READ,
809 0, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, &stride);
810
811 if (pixels)
812 {
813 o = eo_add(EFL_CANVAS_IMAGE_CLASS, img);
814 efl_gfx_buffer_copy_set(o, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888);
815 efl_file_save(o, "/tmp/proxy.png", NULL, NULL);
816 eo_del(o);
817 eo_event_callback_del(evas_object_evas_get(img),
818 EVAS_CANVAS_EVENT_RENDER_POST,
819 _render_post_cb, img);
820 }
821
822 efl_gfx_buffer_unmap(img, pixels, length);
823
824 /* Note: DO NOT return false here! This would cause a major deadlock in
825 * async render. */
826 return EINA_TRUE;
827}
828
792static void 829static void
793_textview_update(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, 830_textview_update(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
794 void *event_info EINA_UNUSED) 831 void *event_info EINA_UNUSED)
@@ -797,6 +834,11 @@ _textview_update(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
797 int x, y, w, h; 834 int x, y, w, h;
798 evas_object_geometry_get(obj, &x, &y, &w, &h); 835 evas_object_geometry_get(obj, &x, &y, &w, &h);
799 evas_object_geometry_set(img, x, y, w, h); 836 evas_object_geometry_set(img, x, y, w, h);
837
838 eo_event_callback_priority_add(evas_object_evas_get(img),
839 EVAS_CANVAS_EVENT_RENDER_POST,
840 EO_CALLBACK_PRIORITY_AFTER,
841 _render_post_cb, img);
800} 842}
801#endif 843#endif
802 844
@@ -886,12 +928,10 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
886 textview = o; 928 textview = o;
887 929
888#ifdef TEXTVIEW_PROXY 930#ifdef TEXTVIEW_PROXY
889#warning HIJACKING TEXT BY A PROXY IN FRONT 931 o = eo_add(EFL_CANVAS_PROXY_CLASS, win,
890 o = evas_object_image_filled_add(evas); 932 efl_canvas_proxy_source_set(eo_self, textview),
891 evas_object_image_source_set(o, textview); 933 efl_canvas_proxy_source_clip_set(eo_self, 1));
892 //evas_object_image_source_clip_set(o, 1); 934 evas_obj_no_render_set(textview, 1);
893 evas_object_clip_set(o, evas_object_clip_get(textview));
894 evas_object_image_source_visible_set(o, 0);
895 evas_object_event_callback_add(textview, EVAS_CALLBACK_RESIZE, _textview_update, o); 935 evas_object_event_callback_add(textview, EVAS_CALLBACK_RESIZE, _textview_update, o);
896 evas_object_event_callback_add(textview, EVAS_CALLBACK_MOVE, _textview_update, o); 936 evas_object_event_callback_add(textview, EVAS_CALLBACK_MOVE, _textview_update, o);
897 evas_object_show(o); 937 evas_object_show(o);
@@ -999,10 +1039,12 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
999 else elm_object_event_callback_add(o, _panes_key_cb, NULL); 1039 else elm_object_event_callback_add(o, _panes_key_cb, NULL);
1000 1040
1001 // Bottom: font size, padding info 1041 // Bottom: font size, padding info
1002 Eo *hbox = elm_box_add(vbox); 1042 //Eo *hbox = eo_add(EFL_UI_BOX_CLASS, vbox);
1043 Eo *hbox = elm_box_add(win);
1003 evas_object_show(hbox); 1044 evas_object_show(hbox);
1004 elm_box_pack_end(vbox, hbox); 1045 elm_box_pack_end(vbox, hbox);
1005 elm_box_horizontal_set(hbox, EINA_TRUE); 1046 elm_box_horizontal_set(hbox, 1);
1047 //efl_pack_direction_set(hbox, EFL_PACK_DIRECTION_RIGHT);
1006 elm_box_padding_set(hbox, PADDING, PADDING); 1048 elm_box_padding_set(hbox, PADDING, PADDING);
1007 evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0); 1049 evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
1008 evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); 1050 evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -1292,6 +1334,17 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
1292 evas_object_smart_callback_add(o, "file,chosen", _load_file_chosen_cb, NULL); 1334 evas_object_smart_callback_add(o, "file,chosen", _load_file_chosen_cb, NULL);
1293 elm_table_pack(tbl, o, 1, 1, 1, 1); 1335 elm_table_pack(tbl, o, 1, 1, 1, 1);
1294 1336
1337#if 0
1338 o = eo_add(EFL_CANVAS_SNAPSHOT_CLASS, win);
1339 //o = evas_object_image_filled_add(evas_object_evas_get(win));
1340 //evas_object_image_snapshot_set(o, 1);
1341 //evas_object_pass_events_set(o, 1);
1342 efl_gfx_filter_program_set(o, "padding_set(0) ; blur {3}", "test");
1343 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1344 elm_win_resize_object_add(win, o);
1345 evas_object_show(o);
1346#endif
1347
1295 // Reload config 1348 // Reload config
1296 _config_reload(AUTOSAVE_CONFIG); 1349 _config_reload(AUTOSAVE_CONFIG);
1297 1350