summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:51:12 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:52:48 +0900
commit6ecf3fd6b70201943259cb5d99169ad71aee7ddc (patch)
tree47f4c6402cedaa528b0c4a9c176f3835f2e2ff14
parentd39bbc149113da5d842f30d046dc04302e54275b (diff)
elm: Fix ui.win "bg" test case
elm_colorselector is legacy only (for now, unfortunately). This means that elm_colorselector_class_get() crashes with weak linking. Strong linking would make the compilation fail.
-rw-r--r--src/bin/elementary/test_bg.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 53c05ae38f..5ebf59f8e8 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -272,13 +272,13 @@ test_bg_options(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
272} 272}
273 273
274static void 274static void
275_colorsel_cb(void *data, const Efl_Event *ev) 275_colorsel_cb(void *data, Evas_Object *obj, void *event EINA_UNUSED)
276{ 276{
277 Efl_Ui_Win *win = data; 277 Efl_Ui_Win *win = data;
278 int r, g, b, a; 278 int r, g, b, a;
279 279
280 // Solid color API 280 // Solid color API
281 elm_colorselector_color_get(ev->object, &r, &g, &b, &a); 281 elm_colorselector_color_get(obj, &r, &g, &b, &a);
282 efl_gfx_color_set(efl_part(win, "background"), r, g, b, a); 282 efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);
283 efl_gfx_color_get(efl_part(win, "background"), &r, &g, &b, &a); 283 efl_gfx_color_get(efl_part(win, "background"), &r, &g, &b, &a);
284 printf("bg color: %d %d %d %d\n", r, g, b, a); 284 printf("bg color: %d %d %d %d\n", r, g, b, a);
@@ -327,7 +327,7 @@ _image_cb(void *data, const Efl_Event *ev)
327void 327void
328test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 328test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
329{ 329{
330 Evas_Object *win, *box; 330 Evas_Object *win, *box, *cs;
331 char buf[PATH_MAX]; 331 char buf[PATH_MAX];
332 332
333 win = efl_add(EFL_UI_WIN_CLASS, NULL, 333 win = efl_add(EFL_UI_WIN_CLASS, NULL,
@@ -340,15 +340,16 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
340 efl_gfx_size_hint_weight_set(efl_added, 1, 1), 340 efl_gfx_size_hint_weight_set(efl_added, 1, 1),
341 efl_content_set(win, efl_added)); 341 efl_content_set(win, efl_added));
342 342
343 efl_add(ELM_COLORSELECTOR_CLASS, win, 343 cs = elm_colorselector_add(win);
344 elm_colorselector_mode_set(efl_added, ELM_COLORSELECTOR_PALETTE), 344 elm_colorselector_mode_set(cs, ELM_COLORSELECTOR_PALETTE);
345 elm_colorselector_palette_color_add(efl_added, 64, 64, 64, 255), 345 elm_colorselector_palette_color_add(cs, 64, 64, 64, 255);
346 elm_colorselector_palette_color_add(efl_added, 255, 128, 128, 255), 346 elm_colorselector_palette_color_add(cs, 255, 128, 128, 255);
347 elm_colorselector_palette_color_add(efl_added, 0, 64, 64, 64), 347 elm_colorselector_palette_color_add(cs, 0, 64, 64, 64);
348 elm_colorselector_palette_color_add(efl_added, 0, 0, 0, 0), 348 elm_colorselector_palette_color_add(cs, 0, 0, 0, 0);
349 efl_event_callback_add(efl_added, ELM_COLORSELECTOR_EVENT_COLOR_ITEM_SELECTED, _colorsel_cb, win), 349 evas_object_smart_callback_add(cs, "color,item,selected", _colorsel_cb, win);
350 efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5), 350 evas_object_size_hint_align_set(cs, 0.5, 0.5);
351 efl_pack(box, efl_added)); 351 evas_object_show(cs);
352 efl_pack(box, cs);
352 353
353 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get()); 354 snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
354 efl_add(EFL_UI_IMAGE_CLASS, win, 355 efl_add(EFL_UI_IMAGE_CLASS, win,