summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-04-06 15:33:50 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-04-06 15:33:50 -0400
commit04f191fea7159b0f54061c2ce3e1b978ab698746 (patch)
tree029c153914492dc1ea8fc370c4001c465302b940
parenta9b37d162ebaf0409860c974f50f52325b222c8b (diff)
colorclass: move test translate+list callbacks to main
enable remote editing of all colorclasses in elm_test
-rw-r--r--src/bin/test.c28
-rw-r--r--src/bin/test_colorclass.c27
2 files changed, 28 insertions, 27 deletions
diff --git a/src/bin/test.c b/src/bin/test.c
index a3d71cb8a..4a109839c 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -905,6 +905,32 @@ add_tests:
905 evas_object_show(win); 905 evas_object_show(win);
906} 906}
907 907
908static char *
909colorclass_tl_cb(char *str)
910{
911 /* FIXME: translate? */
912 return str;
913}
914
915static Eina_List *
916colorclass_list_cb(void)
917{
918 Eina_List *l, *ret = NULL;
919 Eina_Iterator *it;
920 Eina_File *f;
921
922 it = edje_file_iterator_new();
923 if (!it) return NULL;
924 EINA_ITERATOR_FOREACH(it, f)
925 {
926 l = elm_color_class_util_edje_file_list(f);
927 if (l)
928 ret = eina_list_merge(ret, l);
929 }
930 eina_iterator_free(it);
931 return ret;
932}
933
908/* this is your elementary main function - it MUST be called IMMEDIATELY 934/* this is your elementary main function - it MUST be called IMMEDIATELY
909 * after elm_init() and MUST be passed argc and argv, and MUST be called 935 * after elm_init() and MUST be passed argc and argv, and MUST be called
910 * elm_main and not be static - must be a visible symbol with EAPI_MAIN infront */ 936 * elm_main and not be static - must be a visible symbol with EAPI_MAIN infront */
@@ -954,6 +980,8 @@ elm_main(int argc, char **argv)
954 } 980 }
955 } 981 }
956 982
983 elm_color_class_translate_cb_set(colorclass_tl_cb);
984 elm_color_class_list_cb_set(colorclass_list_cb);
957 /* put here any init specific to this app like parsing args etc. */ 985 /* put here any init specific to this app like parsing args etc. */
958 my_win_main(autorun, test_win_only); /* create main window */ 986 my_win_main(autorun, test_win_only); /* create main window */
959 elm_run(); /* and run the program now and handle all events etc. */ 987 elm_run(); /* and run the program now and handle all events etc. */
diff --git a/src/bin/test_colorclass.c b/src/bin/test_colorclass.c
index 86d801720..724098270 100644
--- a/src/bin/test_colorclass.c
+++ b/src/bin/test_colorclass.c
@@ -3,30 +3,6 @@
3#endif 3#endif
4#include <Elementary.h> 4#include <Elementary.h>
5 5
6static char *
7tl_cb(char *str)
8{
9 return str;
10}
11
12static Eina_List *
13name_cb(void)
14{
15 Eina_List *l, *ret = NULL;
16 Eina_Iterator *it;
17 Eina_File *f;
18
19 it = edje_file_iterator_new();
20 if (!it) return NULL;
21 EINA_ITERATOR_FOREACH(it, f)
22 {
23 l = elm_color_class_util_edje_file_list(f);
24 if (l)
25 ret = eina_list_merge(ret, l);
26 }
27 eina_iterator_free(it);
28 return ret;
29}
30 6
31void 7void
32test_colorclass() 8test_colorclass()
@@ -36,9 +12,6 @@ test_colorclass()
36 win = elm_win_util_standard_add("colorclass", "Color Classes"); 12 win = elm_win_util_standard_add("colorclass", "Color Classes");
37 elm_win_autodel_set(win, EINA_TRUE); 13 elm_win_autodel_set(win, EINA_TRUE);
38 14
39 elm_color_class_translate_cb_set(tl_cb);
40 /* uncomment when edje_mmap_color_class_iterator_new() stops crashing */
41 //elm_color_class_list_cb_set(name_cb);
42 cc = elm_color_class_editor_add(win, 0); 15 cc = elm_color_class_editor_add(win, 0);
43 elm_win_resize_object_add(win, cc); 16 elm_win_resize_object_add(win, cc);
44 evas_object_size_hint_weight_set(cc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 17 evas_object_size_hint_weight_set(cc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);