colorclass: move test translate+list callbacks to main

enable remote editing of all colorclasses in elm_test
This commit is contained in:
Mike Blumenkrantz 2015-04-06 15:33:50 -04:00
parent fa005eceb2
commit a0e1e94511
2 changed files with 28 additions and 27 deletions

View File

@ -905,6 +905,32 @@ add_tests:
evas_object_show(win);
}
static char *
colorclass_tl_cb(char *str)
{
/* FIXME: translate? */
return str;
}
static Eina_List *
colorclass_list_cb(void)
{
Eina_List *l, *ret = NULL;
Eina_Iterator *it;
Eina_File *f;
it = edje_file_iterator_new();
if (!it) return NULL;
EINA_ITERATOR_FOREACH(it, f)
{
l = elm_color_class_util_edje_file_list(f);
if (l)
ret = eina_list_merge(ret, l);
}
eina_iterator_free(it);
return ret;
}
/* this is your elementary main function - it MUST be called IMMEDIATELY
* after elm_init() and MUST be passed argc and argv, and MUST be called
* 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)
}
}
elm_color_class_translate_cb_set(colorclass_tl_cb);
elm_color_class_list_cb_set(colorclass_list_cb);
/* put here any init specific to this app like parsing args etc. */
my_win_main(autorun, test_win_only); /* create main window */
elm_run(); /* and run the program now and handle all events etc. */

View File

@ -3,30 +3,6 @@
#endif
#include <Elementary.h>
static char *
tl_cb(char *str)
{
return str;
}
static Eina_List *
name_cb(void)
{
Eina_List *l, *ret = NULL;
Eina_Iterator *it;
Eina_File *f;
it = edje_file_iterator_new();
if (!it) return NULL;
EINA_ITERATOR_FOREACH(it, f)
{
l = elm_color_class_util_edje_file_list(f);
if (l)
ret = eina_list_merge(ret, l);
}
eina_iterator_free(it);
return ret;
}
void
test_colorclass()
@ -36,9 +12,6 @@ test_colorclass()
win = elm_win_util_standard_add("colorclass", "Color Classes");
elm_win_autodel_set(win, EINA_TRUE);
elm_color_class_translate_cb_set(tl_cb);
/* uncomment when edje_mmap_color_class_iterator_new() stops crashing */
//elm_color_class_list_cb_set(name_cb);
cc = elm_color_class_editor_add(win, 0);
elm_win_resize_object_add(win, cc);
evas_object_size_hint_weight_set(cc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);