summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-07-16 19:11:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-07-16 19:11:28 +0900
commitbed4799c8b96aa64ae34f87dd44184fc5067c7f9 (patch)
tree64bd1f79e64fd65c7c2e56f1e08382107831e71a
parent1ab66d2bef1286a7dd5ab8836f7f8cfa24c966fa (diff)
bla bla bla bla
-rw-r--r--CMakeLists.txt6
-rw-r--r--examples/logo_bump.cfgbin1186 -> 1166 bytes
-rw-r--r--examples/neon_curves.cfgbin946 -> 1548 bytes
-rw-r--r--examples/transluent_with_glow.cfgbin875 -> 920 bytes
-rw-r--r--main.c90
5 files changed, 86 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75d25b1..dd31de0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8)
3aux_source_directory(. SRC_LIST) 3aux_source_directory(. SRC_LIST)
4 4
5find_package(Eo REQUIRED) 5find_package(Eo REQUIRED)
6find_package(Efl REQUIRED)
6find_package(Eina REQUIRED) 7find_package(Eina REQUIRED)
7find_package(Eet REQUIRED) 8find_package(Eet REQUIRED)
8find_package(Evas REQUIRED) 9find_package(Evas REQUIRED)
@@ -12,6 +13,7 @@ find_package(Edje REQUIRED)
12find_package(Efreet REQUIRED) 13find_package(Efreet REQUIRED)
13find_package(Elementary REQUIRED) 14find_package(Elementary REQUIRED)
14find_package(Emotion REQUIRED) 15find_package(Emotion REQUIRED)
16find_package(Emile REQUIRED)
15 17
16add_definitions(-Wall -Wextra) 18add_definitions(-Wall -Wextra)
17 19
@@ -31,6 +33,7 @@ include_directories(
31 ${EVAS_INCLUDE_DIRS} 33 ${EVAS_INCLUDE_DIRS}
32 ${EET_INCLUDE_DIRS} 34 ${EET_INCLUDE_DIRS}
33 ${EMOTION_INCLUDE_DIRS} 35 ${EMOTION_INCLUDE_DIRS}
36 ${EMILE_INCLUDE_DIRS}
34 ) 37 )
35 38
36add_executable(${PROJECT_NAME} ${SRC_LIST}) 39add_executable(${PROJECT_NAME} ${SRC_LIST})
@@ -45,7 +48,8 @@ target_link_libraries(${PROJECT_NAME}
45 ${EVAS_LIBRARIES} 48 ${EVAS_LIBRARIES}
46 ${EET_LIBRARIES} 49 ${EET_LIBRARIES}
47 ${EMOTION_LIBRARIES} 50 ${EMOTION_LIBRARIES}
48 ${EVIL_LIBRARIES} 51 ${EMILE_LIBRARIES}
52 ${EFL_LIBRARIES}
49 ) 53 )
50 54
51# Make this program runnable by QuickLaunch 55# Make this program runnable by QuickLaunch
diff --git a/examples/logo_bump.cfg b/examples/logo_bump.cfg
index d07fe25..f670b95 100644
--- a/examples/logo_bump.cfg
+++ b/examples/logo_bump.cfg
Binary files differ
diff --git a/examples/neon_curves.cfg b/examples/neon_curves.cfg
index b14a2fc..44797a2 100644
--- a/examples/neon_curves.cfg
+++ b/examples/neon_curves.cfg
Binary files differ
diff --git a/examples/transluent_with_glow.cfg b/examples/transluent_with_glow.cfg
index a764996..2ffc292 100644
--- a/examples/transluent_with_glow.cfg
+++ b/examples/transluent_with_glow.cfg
Binary files differ
diff --git a/main.c b/main.c
index bc1df91..972e6cc 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,5 @@
1#define _GNU_SOURCE // asprintfc 1#define _GNU_SOURCE // asprintfc
2#define EFL_GFX_FILTER_BETA
2 3
3#include <Elementary.h> 4#include <Elementary.h>
4#include <Ecore.h> 5#include <Ecore.h>
@@ -36,6 +37,7 @@ const char *home = NULL;
36 37
37Eo *styleentry = NULL; 38Eo *styleentry = NULL;
38Eo *textview = NULL; 39Eo *textview = NULL;
40Eo *textproxy = NULL;
39Eo *textentry = NULL; 41Eo *textentry = NULL;
40Eo *paddinglbl = NULL; 42Eo *paddinglbl = NULL;
41Eo *proxies[IMAGE_COUNT] = { NULL }; 43Eo *proxies[IMAGE_COUNT] = { NULL };
@@ -110,9 +112,9 @@ _image_set(int k, const char *path)
110#ifdef HAS_FILTER_CHAIN 112#ifdef HAS_FILTER_CHAIN
111 char buf[32]; 113 char buf[32];
112 sprintf(buf, "image%d", k + 1); 114 sprintf(buf, "image%d", k + 1);
113 eo_do(textview, evas_obj_text_filter_source_set(buf, source)); 115 eo_do(textview, efl_gfx_filter_source_set(buf, source));
114#ifdef HAS_FILTER_CHAIN_IMG 116#ifdef HAS_FILTER_CHAIN_IMG
115 eo_do(imageview, evas_obj_image_filter_source_set(buf, source)); 117 eo_do(imageview, efl_gfx_filter_source_set(buf, source));
116#endif 118#endif
117#endif 119#endif
118 120
@@ -169,9 +171,9 @@ _video_set(const char *path)
169 } 171 }
170 172
171#ifdef HAS_FILTER_CHAIN 173#ifdef HAS_FILTER_CHAIN
172 eo_do(textview, evas_obj_text_filter_source_set("emotion", source)); 174 eo_do(textview, efl_gfx_filter_source_set("emotion", source));
173#ifdef HAS_FILTER_CHAIN_IMG 175#ifdef HAS_FILTER_CHAIN_IMG
174 eo_do(imageview, evas_obj_image_filter_source_set("emotion", source)); 176 eo_do(imageview, efl_gfx_filter_source_set("emotion", source));
175#endif 177#endif
176#endif 178#endif
177} 179}
@@ -580,9 +582,9 @@ _style_apply(void)
580 stylestr_utf8 = elm_entry_markup_to_utf8(stylestr); 582 stylestr_utf8 = elm_entry_markup_to_utf8(stylestr);
581 583
582 // Evas Text and Image 584 // Evas Text and Image
583 eo_do(textview, evas_obj_text_filter_program_set(stylestr_utf8)); 585 eo_do(textview, efl_gfx_filter_program_set(stylestr_utf8, "textview"));
584#ifdef HAS_FILTER_CHAIN_IMG 586#ifdef HAS_FILTER_CHAIN_IMG
585 eo_do(imageview, evas_obj_image_filter_program_set(stylestr_utf8)); 587 eo_do(imageview, efl_gfx_filter_program_set(stylestr_utf8, "imageview"));
586#endif 588#endif
587 for (int k = 0; k < IMAGE_COUNT; k++) 589 for (int k = 0; k < IMAGE_COUNT; k++)
588 { 590 {
@@ -591,15 +593,19 @@ _style_apply(void)
591 593
592 sprintf(buf, "image%d", k + 1); 594 sprintf(buf, "image%d", k + 1);
593 elm_image_file_get(proxyimages[k], &path, NULL); 595 elm_image_file_get(proxyimages[k], &path, NULL);
594 eo_do(textview, evas_obj_text_filter_source_set(buf, (path && *path) ? proxies[k] : NULL)); 596 eo_do(textview, efl_gfx_filter_source_set(buf, (path && *path) ? proxies[k] : NULL));
595#ifdef HAS_FILTER_CHAIN_IMG 597#ifdef HAS_FILTER_CHAIN_IMG
596 eo_do(imageview, evas_obj_image_filter_source_set(buf, (path && *path) ? proxies[k] : NULL)); 598 eo_do(imageview, efl_gfx_filter_source_set(buf, (path && *path) ? proxies[k] : NULL));
597#endif 599#endif
598 } 600 }
599 601
600 free(stylestr_utf8); 602 free(stylestr_utf8);
601 603
602 _padding_update(); 604 _padding_update();
605
606 evas_object_text_shadow_color_set(textview, 0, 0, 0, 255);
607 evas_object_color_set(textview, 255, 255, 255, 255);
608 evas_object_scale_set(textview, 1);
603#endif 609#endif
604} 610}
605 611
@@ -627,6 +633,27 @@ _apply_click_cb(void *data EINA_UNUSED,
627} 633}
628 634
629static void 635static void
636_color_click_cb(void *data EINA_UNUSED,
637 Evas_Object *obj EINA_UNUSED,
638 void *event_info EINA_UNUSED)
639{
640 int r, g, b, a;
641 evas_object_text_shadow_color_get(textview, &r, &g, &b, &a);
642 if (g == 255 && r == 255 && b == 255)
643 evas_object_text_shadow_color_set(textview, 255, 0, 255, 255);
644 else if (r == 255 && !g && b == 255)
645 evas_object_text_shadow_color_set(textview, 0, 255, 255, 255);
646 else if (g == 255 && g == 255 && !r)
647 evas_object_text_shadow_color_set(textview, 255, 255, 0, 255);
648 else
649 evas_object_text_shadow_color_set(textview, 255, 255, 255, 255);
650
651 evas_object_color_set(textview, 255, 0, 0, 255);
652 evas_object_color_set(imageview, 255, 0, 0, 255);
653 evas_object_scale_set(textview, 1.5);
654}
655
656static void
630_quicksave_click_cb(void *data EINA_UNUSED, 657_quicksave_click_cb(void *data EINA_UNUSED,
631 Evas_Object *obj EINA_UNUSED, 658 Evas_Object *obj EINA_UNUSED,
632 void *event_info EINA_UNUSED) 659 void *event_info EINA_UNUSED)
@@ -643,6 +670,15 @@ _quit_click_cb(void *data EINA_UNUSED,
643} 670}
644 671
645static void 672static void
673_snap_click_cb(void *data,
674 Evas_Object *obj EINA_UNUSED,
675 void *event_info EINA_UNUSED)
676{
677 Evas_Object *img = data;
678 evas_object_image_save(img, "/tmp/snap.png", NULL, NULL);
679}
680
681static void
646_reset_click_cb(void *data EINA_UNUSED, 682_reset_click_cb(void *data EINA_UNUSED,
647 Evas_Object *obj EINA_UNUSED, 683 Evas_Object *obj EINA_UNUSED,
648 void *event_info EINA_UNUSED) 684 void *event_info EINA_UNUSED)
@@ -710,7 +746,7 @@ _panes_key_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
710{ 746{
711 Evas_Event_Key_Down *ev = event_info; 747 Evas_Event_Key_Down *ev = event_info;
712 748
713 if (type != EVAS_CALLBACK_KEY_UP) 749 if (type != EVAS_CALLBACK_KEY_DOWN)
714 return EINA_FALSE; 750 return EINA_FALSE;
715 751
716 if (!strcmp(ev->key, "Escape")) 752 if (!strcmp(ev->key, "Escape"))
@@ -753,6 +789,16 @@ _home_dir_get(void)
753 return dir; 789 return dir;
754} 790}
755 791
792static void
793_textview_update(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
794 void *event_info EINA_UNUSED)
795{
796 Evas_Object *img = data;
797 int x, y, w, h;
798 evas_object_geometry_get(obj, &x, &y, &w, &h);
799 evas_object_geometry_set(img, x, y, w, h);
800}
801
756 802
757EAPI_MAIN int 803EAPI_MAIN int
758elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) 804elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
@@ -858,6 +904,15 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
858 elm_box_pack_start(vbox, o); 904 elm_box_pack_start(vbox, o);
859 textview = o; 905 textview = o;
860 906
907 // WARNING: HIJACKING TEXT BY A PROXY IN FRONT
908 o = evas_object_image_filled_add(evas);
909 evas_object_image_source_set(o, textview);
910 evas_object_image_source_visible_set(o, EINA_FALSE);
911 evas_object_event_callback_add(textview, EVAS_CALLBACK_RESIZE, _textview_update, o);
912 evas_object_event_callback_add(textview, EVAS_CALLBACK_MOVE, _textview_update, o);
913 evas_object_show(o);
914 textproxy = o;
915
861 // Evas_Object_Image 916 // Evas_Object_Image
862 //o = evas_object_image_filled_add(evas); 917 //o = evas_object_image_filled_add(evas);
863 vbox = elm_box_add(fr); 918 vbox = elm_box_add(fr);
@@ -997,6 +1052,13 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
997 elm_object_text_set(o, _("Apply")); 1052 elm_object_text_set(o, _("Apply"));
998 evas_object_smart_callback_add(o, "clicked", _apply_click_cb, NULL); 1053 evas_object_smart_callback_add(o, "clicked", _apply_click_cb, NULL);
999 1054
1055 // Color button
1056 o = elm_button_add(hbox);
1057 evas_object_show(o);
1058 elm_box_pack_end(hbox, o);
1059 elm_object_text_set(o, _("Colorize!"));
1060 evas_object_smart_callback_add(o, "clicked", _color_click_cb, NULL);
1061
1000 // Padding label 1062 // Padding label
1001 o = elm_label_add(hbox); 1063 o = elm_label_add(hbox);
1002 evas_object_show(o); 1064 evas_object_show(o);
@@ -1249,6 +1311,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
1249 evas_object_show(tbl); 1311 evas_object_show(tbl);
1250 elm_box_pack_end(vb, tbl); 1312 elm_box_pack_end(vb, tbl);
1251 1313
1314#if 0
1252 // Flip button 1315 // Flip button
1253 o = elm_button_add(tbl); 1316 o = elm_button_add(tbl);
1254 evas_object_show(o); 1317 evas_object_show(o);
@@ -1257,6 +1320,15 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
1257 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 1320 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
1258 evas_object_smart_callback_add(o, "clicked", _flip_click_cb, NULL); 1321 evas_object_smart_callback_add(o, "clicked", _flip_click_cb, NULL);
1259 elm_table_pack(tbl, o, 0, 0, 2, 1); 1322 elm_table_pack(tbl, o, 0, 0, 2, 1);
1323#endif
1324 // Snapshot button
1325 o = elm_button_add(tbl);
1326 evas_object_show(o);
1327 elm_object_text_set(o, _("Save snapshot"));
1328 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1329 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
1330 evas_object_smart_callback_add(o, "clicked", _snap_click_cb, textproxy);
1331 elm_table_pack(tbl, o, 0, 0, 2, 1);
1260 1332
1261 // Reset button 1333 // Reset button
1262 o = elm_button_add(tbl); 1334 o = elm_button_add(tbl);