aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_evas_mask.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-30 13:15:43 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-31 09:19:26 -0400
commit73874100192ebdb55bbf4c2fc8cd6648c2dd7afd (patch)
treeb5968d304ace14fad5f92f07902d00f2d1e24354 /src/bin/elementary/test_evas_mask.c
parentevas: enable setting any object as a clipper (diff)
downloadefl-73874100192ebdb55bbf4c2fc8cd6648c2dd7afd.tar.gz
elm_test: add smart object mask test to existing masking test
Summary: this adds another masking functionality using a layout object to the test when the toggle mask button is clicked enough times Depends on https://phab.enlightenment.org/D8849 Reviewers: cedric Reviewed By: cedric Subscribers: cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D8850
Diffstat (limited to 'src/bin/elementary/test_evas_mask.c')
-rw-r--r--src/bin/elementary/test_evas_mask.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index ed18d0fdc9..05d3933bcc 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -61,20 +61,31 @@ _gl_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
}
static void
-_toggle_mask(void *data, const Efl_Event *ev EINA_UNUSED)
+_toggle_mask(void *data, const Efl_Event *ev)
{
Eo *ly = data;
+ const char *clip = efl_key_data_get(ly, "clip");
+ const char *text;
- if (!efl_key_data_get(ly, "unclipped"))
+ if (eina_streq(clip, "image"))
{
elm_layout_signal_emit(ly, "unclip", "elm_test");
- efl_key_data_set(ly, "unclipped", "yup");
+ efl_key_data_set(ly, "clip", NULL);
+ text = "Toggle mask (none)";
}
- else
+ else if (eina_streq(clip, "smart"))
{
elm_layout_signal_emit(ly, "clip", "elm_test");
- efl_key_data_set(ly, "unclipped", NULL);
+ efl_key_data_set(ly, "clip", "image");
+ text = "Toggle mask (image)";
+ }
+ else
+ {
+ elm_layout_signal_emit(ly, "smartclip", "elm_test");
+ efl_key_data_set(ly, "clip", "smart");
+ text = "Toggle mask (smart)";
}
+ efl_text_set(ev->object, text);
}
static void
@@ -101,7 +112,7 @@ _rotate_win(void *data, const Efl_Event *ev EINA_UNUSED)
void
test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win, *box, *o, *gl, *ly, *box2;
+ Eo *win, *box, *o, *gl, *ly, *smart_mask, *box2;
Elm_Genlist_Item_Class *itc;
char buf[PATH_MAX];
@@ -121,9 +132,16 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
snprintf(buf, sizeof(buf), "%s/objects/test_masking.edj", elm_app_data_dir_get());
ly = efl_add(EFL_UI_LAYOUT_CLASS, win,
efl_file_set(efl_added, buf),
- efl_file_key_set(efl_added, "masking"));
+ efl_file_key_set(efl_added, "masking"),
+ efl_key_data_set(efl_added, "clip", "image"));
efl_pack(box, ly);
+ // FIXME: layout EO API
+ smart_mask = efl_add(EFL_UI_LAYOUT_CLASS, win,
+ efl_file_set(efl_added, buf),
+ efl_file_key_set(efl_added, "image"));
+ elm_object_part_content_set(ly, "mask2", smart_mask);
+
// FIXME: No genlist in EO API
o = gl = elm_genlist_add(win);
elm_genlist_homogeneous_set(gl, 1);
@@ -157,7 +175,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
// FIXME: button EO API
efl_add(EFL_UI_BUTTON_CLASS, win,
- efl_text_set(efl_added, "Toggle mask"),
+ efl_text_set(efl_added, "Toggle mask (image)"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_mask, ly),
efl_gfx_hint_weight_set(efl_added, 0.0, 0.0),
efl_pack(box2, efl_added));