summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_gfx_filters.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/elementary/test_gfx_filters.c')
-rw-r--r--src/bin/elementary/test_gfx_filters.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index 35360b6..7ab9a63 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 <Efl_Ui.h> 6#include <Efl_Ui.h>
7#include "elm_spinner_eo.h" 7#include "elm_spinner_eo.h"
8#include "elm_priv.h" //FIXME remove this once efl.ui.text doesn't need elm_general.h 8
9static const int default_font_size = 48; 9static const int default_font_size = 48;
10 10
11typedef struct _Filter_Image 11typedef struct _Filter_Image
@@ -294,11 +294,9 @@ _font_size_change(void *data, const Efl_Event *ev)
294{ 294{
295 Eo *win = data; 295 Eo *win = data;
296 Eo *text; 296 Eo *text;
297 const char *font;
298 297
299 text = efl_key_wref_get(win, "text"); 298 text = efl_key_wref_get(win, "text");
300 efl_text_font_get(text, &font, NULL); 299 efl_text_font_size_set(text, elm_spinner_value_get(ev->object));
301 efl_text_font_set(text, font, elm_spinner_value_get(ev->object));
302} 300}
303 301
304static void 302static void
@@ -334,7 +332,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
334{ 332{
335 Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb; 333 Eo *win, *box, *box2, *o, *text = NULL, *spinner, *code, *split, *flip, *tb;
336 334
337 win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, 335 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
338 efl_text_set(efl_added, "Gfx Filter Editor"), 336 efl_text_set(efl_added, "Gfx Filter Editor"),
339 efl_ui_win_autodel_set(efl_added, 1)); 337 efl_ui_win_autodel_set(efl_added, 1));
340 338
@@ -351,8 +349,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
351 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)); 349 efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE));
352 efl_pack(box, box2); 350 efl_pack(box, box2);
353 351
354 /* FIXME: Efl.Ui.Text doesn't work as expected. */ 352 /* FIXME: Efl.Ui.Textbox doesn't work as expected. */
355 o = efl_add(EFL_UI_TEXT_CLASS, win, 353 o = efl_add(EFL_UI_TEXTBOX_CLASS, win,
356 efl_gfx_hint_weight_set(efl_added, 0.0, 1.0), 354 efl_gfx_hint_weight_set(efl_added, 0.0, 1.0),
357 efl_gfx_hint_align_set(efl_added, 1.0, 0.5)); 355 efl_gfx_hint_align_set(efl_added, 1.0, 0.5));
358 efl_text_set(o, "Filter:"); 356 efl_text_set(o, "Filter:");
@@ -462,7 +460,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
462 // Note: No TEXT object with EO APIs 460 // Note: No TEXT object with EO APIs
463 o = text = evas_object_text_add(evas_object_evas_get(win)); 461 o = text = evas_object_text_add(evas_object_evas_get(win));
464 efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _text_resize, NULL); 462 efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _text_resize, NULL);
465 efl_text_font_set(o, "Sans:style=Bold", default_font_size); 463 efl_text_font_family_set(o, "Sans:style=Bold");
464 efl_text_font_size_set(o, default_font_size);
466 efl_gfx_entity_scale_set(text, elm_config_scale_get()); 465 efl_gfx_entity_scale_set(text, elm_config_scale_get());
467 efl_text_set(o, "EFL"); 466 efl_text_set(o, "EFL");
468 efl_gfx_entity_visible_set(o, 1); 467 efl_gfx_entity_visible_set(o, 1);
@@ -492,7 +491,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
492 491
493 // Experimental textblock support 492 // Experimental textblock support
494 o = tb = evas_object_textblock_add(evas_object_evas_get(win)); 493 o = tb = evas_object_textblock_add(evas_object_evas_get(win));
495 efl_event_callback_add(o, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL); 494 efl_event_callback_add(o, EFL_CANVAS_TEXTBLOCK_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL);
496 efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _textblock_resize, NULL); 495 efl_event_callback_add(o, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _textblock_resize, NULL);
497 Evas_Textblock_Style *st = evas_textblock_style_new(); 496 Evas_Textblock_Style *st = evas_textblock_style_new();
498 evas_textblock_style_set(st, "DEFAULT='font=Sans font_size=20 color=#FFF wrap=word'"); 497 evas_textblock_style_set(st, "DEFAULT='font=Sans font_size=20 color=#FFF wrap=word'");
@@ -515,10 +514,11 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
515 "blur { 3, ox = 1, oy = 1, color = 'black' }" 514 "blur { 3, ox = 1, oy = 1, color = 'black' }"
516 "blend { color = 'lime' }"; 515 "blend { color = 'lime' }";
517 516
518 o = code = efl_add(EFL_UI_TEXT_EDITABLE_CLASS, win, 517 o = code = efl_add(EFL_UI_TEXTBOX_CLASS, win,
519 efl_ui_text_scrollable_set(efl_added, 1), 518 efl_ui_textbox_scrollable_set(efl_added, EINA_TRUE),
520 efl_text_multiline_set(efl_added, 1)); 519 efl_text_interactive_editable_set(efl_added, EINA_TRUE),
521 efl_event_callback_add(o, EFL_UI_TEXT_EVENT_CHANGED_USER, _code_changed_hack, win); 520 efl_text_multiline_set(efl_added, EINA_TRUE));
521 efl_event_callback_add(o, EFL_TEXT_INTERACTIVE_EVENT_CHANGED_USER, _code_changed_hack, win);
522 522
523 // Insert filter code inside style string: DEFAULT='blah blah <here>' 523 // Insert filter code inside style string: DEFAULT='blah blah <here>'
524 efl_gfx_filter_program_set(o, code_filter, "code"); 524 efl_gfx_filter_program_set(o, code_filter, "code");