summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 16:47:15 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 16:02:23 +0900
commit41e4a6125cfe0e7ae4ed71c64e2f6aac7a677534 (patch)
treec624c8d7ce325f04a557da83f67f841bc7f81f19 /src/bin
parent3e9825cb961a882ca91046451891afeb35c9a142 (diff)
tests: Fix Gfx Filters test case
Completely broken after a few commits (removal of legacy widgets from EO API, theme changes, etc...).
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/test_gfx_filters.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index c827b80b2d..7ba101da8a 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -5,7 +5,7 @@
5#include <Elementary.h> 5#include <Elementary.h>
6#include "elm_colorselector.eo.h" 6#include "elm_colorselector.eo.h"
7 7
8const int default_font_size = 48; 8static const int default_font_size = 48;
9 9
10typedef struct _Filter_Image 10typedef struct _Filter_Image
11{ 11{
@@ -152,7 +152,7 @@ _spinner_fill(Eo *obj)
152 } 152 }
153 elm_spinner_editable_set(obj, EINA_FALSE); 153 elm_spinner_editable_set(obj, EINA_FALSE);
154 elm_spinner_min_max_set(obj, 0, k - 1); 154 elm_spinner_min_max_set(obj, 0, k - 1);
155 elm_obj_spinner_wrap_set(obj, 1); 155 elm_spinner_wrap_set(obj, 1);
156} 156}
157 157
158static void 158static void
@@ -168,7 +168,7 @@ _filter_apply(Eo *win, const char *code, const char *name)
168} 168}
169 169
170static void 170static void
171_spinner_cb(void *data, const Efl_Event *ev EINA_UNUSED) 171_spinner_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
172{ 172{
173 Eo *win = data; 173 Eo *win = data;
174 Eo *text, *code, *spinner, *tb; 174 Eo *text, *code, *spinner, *tb;
@@ -305,10 +305,10 @@ _flip_click(void *data, const Efl_Event *ev EINA_UNUSED)
305} 305}
306 306
307static void 307static void
308_colsel_cb(void *data, const Efl_Event *ev) 308_colsel_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
309{ 309{
310 Eo *win = data; 310 Eo *win = data;
311 Eo *colsel = ev->object; 311 Eo *colsel = obj;
312 Eo *text, *tb; 312 Eo *text, *tb;
313 int r = 0, g = 0, b = 0, a = 255; 313 int r = 0, g = 0, b = 0, a = 255;
314 char buf[64]; 314 char buf[64];
@@ -350,20 +350,21 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
350 efl_text_set(o, "Filter:"); 350 efl_text_set(o, "Filter:");
351 efl_pack(box2, o); 351 efl_pack(box2, o);
352 352
353 o = spinner = efl_add(ELM_SPINNER_CLASS, win, 353 o = spinner = elm_spinner_add(win);
354 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0), 354 efl_gfx_size_hint_weight_set(o, 1.0, 1.0);
355 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5)); 355 efl_gfx_size_hint_align_set(o, -1.0, 0.5);
356 _spinner_fill(o); 356 _spinner_fill(o);
357 efl_pack(box2, o); 357 efl_pack(box2, o);
358 spinner = o; 358 evas_object_show(o);
359 359
360 o = efl_add(ELM_SPINNER_CLASS, win, 360 o = elm_spinner_add(win);
361 efl_gfx_size_hint_weight_set(efl_added, 0.0, 1.0), 361 efl_gfx_size_hint_weight_set(o, 0.0, 1.0);
362 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5), 362 efl_gfx_size_hint_align_set(o, -1.0, 0.5);
363 elm_spinner_min_max_set(efl_added, 6, 120), 363 elm_spinner_min_max_set(o, 6, 120);
364 elm_spinner_value_set(efl_added, default_font_size), 364 elm_spinner_value_set(o, default_font_size);
365 efl_event_callback_add(efl_added, ELM_SPINNER_EVENT_DELAY_CHANGED, _font_size_change, win)); 365 efl_event_callback_add(o, ELM_SPINNER_EVENT_DELAY_CHANGED, _font_size_change, win);
366 efl_pack(box2, o); 366 efl_pack(box2, o);
367 evas_object_show(o);
367 368
368 o = efl_add(EFL_UI_BUTTON_CLASS, win, 369 o = efl_add(EFL_UI_BUTTON_CLASS, win,
369 efl_text_set(efl_added, "Flip"), 370 efl_text_set(efl_added, "Flip"),
@@ -420,15 +421,16 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
420 { 0, 0, 0, 0 } 421 { 0, 0, 0, 0 }
421 }; 422 };
422 423
423 o = efl_add(ELM_COLORSELECTOR_CLASS, win, 424 o = elm_colorselector_add(win);
424 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0), 425 efl_gfx_size_hint_weight_set(o, 1.0, 0);
425 efl_gfx_size_hint_align_set(efl_added, -1.0, 0), 426 efl_gfx_size_hint_align_set(o, -1.0, 0);
426 elm_colorselector_mode_set(efl_added, ELM_COLORSELECTOR_PALETTE), 427 elm_colorselector_mode_set(o, ELM_COLORSELECTOR_PALETTE);
427 efl_gfx_size_hint_max_set(efl_added, maxsz), 428 efl_gfx_size_hint_max_set(o, maxsz);
428 efl_name_set(efl_added, "myColor"), 429 efl_name_set(o, "myColor");
429 elm_object_tooltip_text_set(efl_added, "Pick a color to use as variable 'myColor'"), 430 elm_object_tooltip_text_set(o, "Pick a color to use as variable 'myColor'");
430 efl_event_callback_add(efl_added, ELM_COLORSELECTOR_EVENT_CHANGED, _colsel_cb, win)); 431 evas_object_smart_callback_add(o, "changed", _colsel_cb, win);
431 efl_pack(box2, o); 432 efl_pack(box2, o);
433 evas_object_show(o);
432 434
433 for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(colors); k++) 435 for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(colors); k++)
434 elm_colorselector_palette_color_add(o, colors[k].r, colors[k].g, colors[k].b, colors[k].a); 436 elm_colorselector_palette_color_add(o, colors[k].r, colors[k].g, colors[k].b, colors[k].a);
@@ -440,7 +442,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
440 442
441 { 443 {
442 flip = efl_add(EFL_UI_FLIP_CLASS, win); 444 flip = efl_add(EFL_UI_FLIP_CLASS, win);
443 efl_content_set(efl_part(split, "top"), flip); 445 efl_content_set(efl_part(split, "first"), flip);
444 446
445 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, 447 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
446 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), 448 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
@@ -518,7 +520,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
518 // Efl.Ui.Text doesn't seem to trigger the proper events during edit 520 // Efl.Ui.Text doesn't seem to trigger the proper events during edit
519 efl_event_callback_add(o, EFL_EVENT_KEY_DOWN, _code_changed_hack, win); 521 efl_event_callback_add(o, EFL_EVENT_KEY_DOWN, _code_changed_hack, win);
520 522
521 efl_content_set(efl_part(split, "bottom"), code); 523 efl_content_set(efl_part(split, "second"), code);
522 } 524 }
523 525
524 efl_key_wref_set(win, "text", text); 526 efl_key_wref_set(win, "text", text);
@@ -526,9 +528,9 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
526 efl_key_wref_set(win, "code", code); 528 efl_key_wref_set(win, "code", code);
527 efl_key_wref_set(win, "flip", flip); 529 efl_key_wref_set(win, "flip", flip);
528 efl_key_wref_set(win, "spinner", spinner); 530 efl_key_wref_set(win, "spinner", spinner);
529 efl_event_callback_add(spinner, ELM_SPINNER_EVENT_CHANGED, _spinner_cb, win); 531 evas_object_smart_callback_add(spinner, "changed", _spinner_cb, win);
530 elm_spinner_value_set(spinner, 1.0); 532 elm_spinner_value_set(spinner, 1.0);
531 _spinner_cb(win, NULL); 533 _spinner_cb(win, spinner, NULL);
532 534
533 efl_gfx_size_set(win, EINA_SIZE2D(500, 600)); 535 efl_gfx_size_set(win, EINA_SIZE2D(500, 600));
534} 536}