Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2020-01-17 10:56:01 +09:00
commit 5c549c3736
23 changed files with 280 additions and 361 deletions

View File

@ -1226,182 +1226,3 @@ group { "efl/progressbar/horizontal:wheel";
}
}
}
group { "efl/progressbar/horizontal:double";
inherit: "efl/progressbar/horizontal";
data.item: "version" "123";
images {
image: "inset_bar_horiz_glow_base_double.png" COMP;
image: "inset_bar_horiz_glow_inv_base_double.png" COMP;
}
parts {
part { name: "efl.cur.progressbar1"; mouse_events: 0; type: SPACER;
insert_after: "inside";
scale: 1;
dragable.confine: "inside";
dragable.x: 1 1 1;
dragable.y: 0 0 0;
description { state: "default" 0.0;
fixed: 1 1;
min: 8 4;
max: 8 4;
rel1.to: "inside";
rel2.to: "inside";
}
}
part { name: "barend1"; type: SPACER;
scale: 1;
description { state: "default" 0.0;
fixed: 1 0;
min: 14 16;
rel1.to_x: "efl.cur.progressbar1";
rel1.relative: 1.0 0.0;
rel2.to_x: "efl.cur.progressbar1";
rel2.relative: 1.0 1.0;
align: 0.0 0.5;
}
description { state: "inv" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 0.0 1.0;
align: 1.0 0.5;
}
}
part { name: "bar1";
insert_after: "barend";
clip_to: "fract_clip";
scale: 1;
description { state: "default" 0.0;
rel1.to_x: "ins0";
rel1.to_y: "bg";
rel1.relative: (12/16) -0.25;
rel2.to_x: "barend1";
rel2.to_y: "bg";
rel2.relative: 1.0 1.25;
image.normal: "inset_bar_horiz_glow_base_double.png";
image.border: 0 72 0 0;
image.border_scale_by: 0.25; image.border_scale: 1;
color: 51 153 255 128;
}
description { state: "inv" 0.0;
inherit: "default" 0.0;
rel1.to_x: "barend";
rel1.relative: 0.0 -0.25;
rel2.to_x: "ins1";
rel2.relative: (4/16) 1.25;
image.normal: "inset_bar_horiz_glow_inv_base_double.png";
image.border: 72 0 0 0;
}
}
}
programs {
program { name: "inverted-on";
signal: "efl,state,inverted,on"; source: "efl";
action: STATE_SET "inv" 0.0;
target: "bar";
target: "bar1";
target: "barend";
target: "barend1";
target: "light";
}
program
{ name: "inverted-off";
signal: "efl,state,inverted,off"; source: "efl";
action: STATE_SET "default" 0.0;
target: "bar";
target: "bar1";
target: "barend";
target: "barend1";
target: "light";
}
}
}
group { "efl/progressbar/vertical:double";
inherit: "efl/progressbar/vertical";
data.item: "version" "123";
images {
image: "inset_bar_vert_glow_base_double.png" COMP;
image: "inset_bar_vert_glow_inv_base_double.png" COMP;
}
parts {
part { name: "efl.cur.progressbar1"; mouse_events: 0; type: SPACER;
insert_after: "inside";
scale: 1;
dragable.confine: "inside";
dragable.x: 0 0 0;
dragable.y: 1 1 1;
description { state: "default" 0.0;
fixed: 1 1;
min: 4 8;
max: 4 8;
rel1.to: "inside";
rel2.to: "inside";
}
}
part { name: "barend1"; type: SPACER;
scale: 1;
description { state: "default" 0.0;
fixed: 0 1;
min: 16 14;
rel1.to_y: "efl.cur.progressbar1";
rel1.relative: 0.0 1.0;
rel2.to_y: "efl.cur.progressbar1";
rel2.relative: 1.0 1.0;
align: 0.5 0.0;
}
description { state: "inv" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 0.0;
align: 0.5 1.0;
}
}
part { name: "bar1";
insert_after: "barend";
clip_to: "fract_clip";
scale: 1;
description { state: "default" 0.0;
rel1.to_y: "ins0";
rel1.to_x: "bg";
rel1.relative: -0.25 (12/16);
rel2.to_y: "barend1";
rel2.to_x: "bg";
rel2.relative: 1.25 1.0;
image.normal: "inset_bar_vert_glow_base_double.png";
image.border: 0 0 0 72;
image.border_scale_by: 0.25; image.border_scale: 1;
color: 51 153 255 128;
}
description { state: "inv" 0.0;
inherit: "default" 0.0;
rel1.to_y: "barend1";
rel1.relative: -0.25 0.0;
rel2.to_y: "ins1";
rel2.relative: 1.25 (4/16);
image.normal: "inset_bar_vert_glow_inv_base_double.png";
image.border: 0 0 72 0;
}
}
}
programs {
program { name: "inverted-on";
signal: "efl,state,inverted,on"; source: "efl";
action: STATE_SET "inv" 0.0;
target: "bar";
target: "barend";
target: "light";
target: "bar1";
target: "barend1";
}
program { name: "inverted-off";
signal: "efl,state,inverted,off"; source: "efl";
action: STATE_SET "default" 0.0;
target: "bar";
target: "barend";
target: "light";
target: "bar1";
target: "barend1";
}
}
}

View File

@ -159,7 +159,7 @@ static void
check_changed_cb(void *data, const Efl_Event *event)
{
Evas_Object *anim_view = data;
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object));
}
static void

View File

@ -52,7 +52,7 @@ static void
check_changed_cb(void *data, const Efl_Event *event)
{
Evas_Object *anim_view = data;
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object));
}
static void

View File

@ -4,7 +4,7 @@ interface Efl.Ui.Range_Display
A value range contains a value restricted between specified minimum and maximum
limits at all times.
This can be used for progressbars, sliders or spinners, for example.
This can be used for progress bars, sliders or spinners, for example.
@since 1.23
]]

View File

@ -1215,7 +1215,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
// del to start of previous word
Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj);
_cur_pos_copy(tc, cur);
_cur_pos_copy(cur, tc);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
@ -1250,7 +1250,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
// del to end of next word
Efl_Text_Cursor *tc = efl_canvas_textblock_cursor_create(obj);
_cur_pos_copy(tc, cur);
_cur_pos_copy(cur, tc);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);

View File

@ -134,62 +134,13 @@ _val_set(Evas_Object *obj)
}
}
//TODO: efl_ui_slider also use this.
static const char *
_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
static void
_sync_widget_theme_klass(Eo *obj, Efl_Ui_Progressbar_Data *pd)
{
const char *pos = NULL;
const char *temp_str = NULL;
if (is_legacy)
return cur_group;
temp_str = cur_group + len - strlen(search);
if (temp_str >= cur_group)
{
if (!strcmp(temp_str, search))
pos = temp_str;
}
return pos;
}
static char *
_efl_ui_progressbar_theme_group_get(Evas_Object *obj, Efl_Ui_Progressbar_Data *sd)
{
const char *pos = NULL;
const char *cur_group = elm_widget_theme_element_get(obj);
Eina_Strbuf *new_group = eina_strbuf_new();
Eina_Bool is_legacy = elm_widget_is_legacy(obj);
size_t len = 0;
if (cur_group)
{
len = strlen(cur_group);
pos = _theme_group_modify_pos_get(cur_group, "horizontal", len, is_legacy);
if (!pos)
pos = _theme_group_modify_pos_get(cur_group, "vertical", len, is_legacy);
// TODO: change separator when it is decided.
// can skip when prev_group == cur_group
if (!pos)
{
eina_strbuf_append(new_group, cur_group);
eina_strbuf_append(new_group, "/");
}
else
{
eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
}
}
if (_is_horizontal(sd->dir))
eina_strbuf_append(new_group, "horizontal");
if (efl_ui_layout_orientation_is_horizontal(pd->dir, EINA_TRUE))
elm_widget_theme_element_set(obj, "horizontal");
else
eina_strbuf_append(new_group, "vertical");
return eina_strbuf_release(new_group);
elm_widget_theme_element_set(obj, "vertical");
}
EOLIAN static Eina_Error
@ -197,7 +148,7 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
{
Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_ERROR_GENERIC);
char *group;
const char *statuspart[] =
{
"efl.text.status",
@ -208,13 +159,7 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
"efl.cur.progressbar",
"elm.cur.progressbar",
};
group = _efl_ui_progressbar_theme_group_get(obj, sd);
if (group)
{
elm_widget_theme_element_set(obj, group);
free(group);
}
_sync_widget_theme_klass(obj, sd);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
@ -284,6 +229,11 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
edje_object_message_signal_process(wd->resize_obj);
if (elm_widget_is_legacy(obj))
elm_layout_content_set(obj, "elm.swallow.bar", sd->spacer);
else
elm_layout_content_set(obj, "efl.bar", sd->spacer);
return int_ret;
}
@ -330,10 +280,7 @@ EOLIAN static void
_efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data *priv)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
char *group;
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "progressbar");
efl_canvas_group_add(efl_super(obj, MY_CLASS));
efl_ui_layout_finger_size_multiplier_set(obj, 0, 0);
@ -341,14 +288,6 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data
priv->dir = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL;
priv->val = MIN_RATIO_LVL;
priv->val_max = 1.0;
group = _efl_ui_progressbar_theme_group_get(obj, priv);
if (elm_widget_theme_object_set(obj, wd->resize_obj,
elm_widget_theme_klass_get(obj),
group,
elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC)
free(group);
efl_ui_format_string_set(obj, "%.0f%%", EFL_UI_FORMAT_STRING_TYPE_SIMPLE);
@ -356,11 +295,6 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data
evas_object_color_set(priv->spacer, 0, 0, 0, 0);
evas_object_pass_events_set(priv->spacer, EINA_TRUE);
if (elm_widget_is_legacy(obj))
elm_layout_content_set(obj, "elm.swallow.bar", priv->spacer);
else
elm_layout_content_set(obj, "efl.bar", priv->spacer);
_units_set(obj);
_val_set(obj);
@ -398,6 +332,9 @@ _efl_ui_progressbar_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Progressbar_Data
EOLIAN static Eo *
_efl_ui_progressbar_efl_object_constructor(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "progressbar");
obj = efl_constructor(efl_super(obj, MY_CLASS));
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_PROGRESS_BAR);
@ -681,10 +618,17 @@ _efl_ui_progressbar_efl_part_part_get(const Eo *obj, Efl_Ui_Progressbar_Data *sd
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
// Progress bars are dragable types
if (edje_object_part_drag_dir_get(wd->resize_obj, part) != (Edje_Drag_Dir)EFL_UI_DRAG_DIR_NONE)
return ELM_PART_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS, obj, part);
if (elm_widget_is_legacy(obj))
{
// Progress bars are dragable types
if (edje_object_part_drag_dir_get(wd->resize_obj, part) != (Edje_Drag_Dir)EFL_UI_DRAG_DIR_NONE)
return ELM_PART_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS, obj, part);
}
else
{
if (eina_streq(part, "efl.cur.progressbar"))
return ELM_PART_IMPLEMENT(EFL_UI_PROGRESSBAR_PART_CLASS, obj, part);
}
return efl_part_get(efl_super(obj, MY_CLASS), part);
}

View File

@ -2,24 +2,41 @@ class @beta Efl.Ui.Progressbar extends Efl.Ui.Layout_Base implements Efl.Ui.Rang
Efl.Ui.Layout_Orientable, Efl.Access.Value,
Efl.Text, Efl.Content, Efl.Text_Markup
{
[[Elementary progressbar class]]
[[Progress bar widget.
It shows a graphical indication of the current progress of some lengthy operation,
typically as a bar that gradually fills or a pointer that moves from one side of the
bar to the other. The bar can be horizontal or vertical, controlled with @Efl.Ui.Layout_Orientable.
The minimum and maximum values (or starting and ending values), along with the current
value can be set using the @Efl.Ui.Range_Display interface.
@.infinite_mode can be set when the progress state is unknown.
An optional textual label can be shown to indicate the exact numerical value of the progress.
]]
methods {
@property infinite_mode {
[[Start/stop a given progress bar "pulsing" animation, if this mode is enabled.]]
[[When this mode is enabled the progress bar indicates that there is an operation
going on, but does not give information about its progress.
This is typically shown as a "pulsing" animation or an endless spinning bar,
depending on the theme.
]]
set {
}
get {
}
values {
state: bool; [[$true if the progressbar should animate infinitely,
$false if the progressbar should animate based on a fixed endpoint.]]
state: bool; [[$true if the progress bar should animate infinitely.]]
}
}
@property show_progress_label {
[[Whether a textual progress label is shown alongside the progressbar to give an exact
numerical indication of the current progress.
[[Whether a textual progress label is shown alongside the progress bar to give an exact
numerical indication of the current progress. Control the conversion of the numerical
value to a text string using @Efl.Ui.Format.
Not to be confused with the widget label set through @Efl.Text.text.
The exact location and appearance of the progress label depend on the theme.
]]
values {
show: bool; [[$true to show the progress label.]]

View File

@ -1,8 +0,0 @@
class @beta Efl.Ui.Text_Part extends Efl.Ui.Layout_Part_Text
{
[[Efl UI Text internal part class]]
data: null;
implements {
Efl.Text.text { set; get; }
}
}

View File

@ -15,7 +15,7 @@
#include "elm_entry_common.h"
#include "elm_widget_entry.h"
#include "efl_ui_text_part.eo.h"
#include "efl_ui_textbox_part.eo.h"
#include "elm_part_helper.h"
#include "efl_canvas_textblock_internal.h"
@ -623,6 +623,9 @@ _efl_ui_textbox_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Textbox_Data *sd, Ein
{
const char *emission;
if (efl_ui_widget_disabled_get(obj) == disabled)
return;
efl_ui_widget_disabled_set(efl_super(obj, MY_CLASS), disabled);
elm_drop_target_del(obj, sd->drop_format,
@ -659,11 +662,11 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textbox_Data *sd)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
// Note: We are skipping elm_layout here! This is by design.
// This assumes the following inheritance: my_class -> layout -> widget ...
theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
theme_apply = efl_ui_widget_theme_apply(efl_super(obj,MY_CLASS));
if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC;
_update_text_theme(obj, sd);
efl_event_freeze(obj);
edje_object_mirrored_set
@ -707,6 +710,15 @@ _efl_ui_textbox_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textbox_Data *sd)
efl_unref(obj);
if (efl_content_get(efl_part(sd->entry_edje, "efl.text")) == NULL && !sd->scroller)
{
efl_pack_table(sd->text_table, sd->text_obj, 0, 0, 1, 1);
efl_pack_table(sd->text_table, sd->text_guide_obj, 0, 0, 1, 1);
efl_content_set(efl_part(sd->entry_edje, "efl.text"), sd->text_table);
}
_create_text_cursors(obj, sd);
return theme_apply;
}
@ -1772,25 +1784,25 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
// Main Text
// font_set
font_name = edje_object_data_get(wd->resize_obj, "font.name");
font_size = edje_object_data_get(wd->resize_obj, "font.size");
font_name = efl_layout_group_data_get(wd->resize_obj, "font.name");
font_size = efl_layout_group_data_get(wd->resize_obj, "font.size");
font_size_n = font_size ? atoi(font_size) : 0;
efl_text_font_family_set(sd->text_obj, font_name);
efl_text_font_size_set(sd->text_obj, font_size_n);
// color
if (disabled)
colorcode = edje_object_data_get(wd->resize_obj, "style.color_disabled");
colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color_disabled");
if (!colorcode)
colorcode = edje_object_data_get(wd->resize_obj, "style.color");
colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
{
efl_text_color_set(sd->text_obj, r, g, b, a);
}
// Guide Text
font_name = edje_object_data_get(wd->resize_obj, "guide.font.name");
font_size = edje_object_data_get(wd->resize_obj, "guide.font.size");
font_name = efl_layout_group_data_get(wd->resize_obj, "guide.font.name");
font_size = efl_layout_group_data_get(wd->resize_obj, "guide.font.size");
font_size_n = font_size ? atoi(font_size) : 0;
efl_text_font_family_set(sd->text_guide_obj, font_name);
efl_text_font_size_set(sd->text_guide_obj, font_size_n);
@ -1798,9 +1810,9 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
colorcode = NULL;
// color
if (disabled)
colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color_disabled");
colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color_disabled");
if (!colorcode)
colorcode = edje_object_data_get(wd->resize_obj, "guide.style.color");
colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color");
if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
{
efl_text_color_set(sd->text_guide_obj, r, g, b, a);
@ -1850,33 +1862,14 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
{
obj = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
elm_drop_target_add(obj, sd->drop_format,
_dnd_enter_cb, NULL,
_dnd_leave_cb, NULL,
_dnd_pos_cb, NULL,
_dnd_drop_cb, NULL);
if (elm_widget_theme_object_set(obj, wd->resize_obj,
elm_widget_theme_klass_get(obj),
elm_widget_theme_element_get(obj),
elm_widget_theme_style_get(obj)) == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("Failed to set layout!");
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_ENTRY);
//TODO: complete the usage of the text theme
_update_text_theme(obj, sd);
//efl_text_font_set(sd->text_obj, "Sans", 12);
efl_pack_table(sd->text_table, sd->text_obj, 0, 0, 1, 1);
efl_pack_table(sd->text_table, sd->text_guide_obj, 0, 0, 1, 1);
//edje_object_part_swallow(sd->entry_edje, "efl.text", sd->text_obj);
//edje_object_part_swallow(sd->entry_edje, "efl.text_guide", sd->text_guide_obj);
edje_object_part_swallow(sd->entry_edje, "efl.text", sd->text_table);
_update_guide_text(obj, sd);
sd->item_fallback_factory = efl_add(EFL_UI_TEXT_FACTORY_FALLBACK_CLASS, obj);
@ -1920,10 +1913,6 @@ _efl_ui_textbox_efl_object_finalize(Eo *obj,
efl_input_text_predictable_set(obj, EINA_TRUE);
efl_input_text_input_hint_set(obj, EFL_INPUT_TEXT_HINTS_TYPE_AUTO_COMPLETE);
_mirrored_set(obj, efl_ui_mirrored_get(obj));
_create_text_cursors(obj, sd);
sd->calc_force = EINA_TRUE;
return obj;
@ -3560,39 +3549,19 @@ _efl_ui_textbox_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd,
#undef STRCMP
static Eina_Bool
_part_is_efl_ui_text_part(const Eo *obj EINA_UNUSED, const char *part)
_part_is_efl_ui_textbox_part(const Eo *obj EINA_UNUSED, const char *part)
{
//Use Efl.Ui.Widget's "background" and "shadow" parts
if (eina_streq(part, "background") || eina_streq(part, "shadow"))
return EINA_FALSE;
if (eina_streq(part, "efl.text_guide") || eina_streq(part, "efl.text"))
return EINA_TRUE;
return EINA_TRUE;
return EINA_FALSE;
}
EOLIAN static Efl_Object *
_efl_ui_textbox_efl_part_part_get(const Eo *obj, Efl_Ui_Textbox_Data *priv EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (_part_is_efl_ui_text_part(obj, part)) return ELM_PART_IMPLEMENT(EFL_UI_TEXT_PART_CLASS, obj, part);
return efl_part_get(efl_super(obj, EFL_UI_TEXTBOX_CLASS), part);
}
ELM_PART_OVERRIDE_PARTIAL(efl_ui_textbox, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data, _part_is_efl_ui_textbox_part)
ELM_PART_OVERRIDE_TEXT_SET(efl_ui_textbox, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data)
ELM_PART_OVERRIDE_TEXT_GET(efl_ui_textbox, EFL_UI_TEXTBOX, Efl_Ui_Textbox_Data)
EOLIAN static void
_efl_ui_text_part_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, efl_ui_widget_part_class_get());
Efl_Ui_Textbox_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TEXTBOX_CLASS);
_efl_ui_textbox_text_set(pd->obj, sd, pd->part, text);
}
EOLIAN static const char *
_efl_ui_text_part_efl_text_text_get(const Eo *obj, void *_pd EINA_UNUSED)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, efl_ui_widget_part_class_get());
Efl_Ui_Textbox_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_TEXTBOX_CLASS);
return _efl_ui_textbox_text_get(pd->obj, sd, pd->part);
}
#include "efl_ui_text_part.eo.c"
#include "efl_ui_textbox_part.eo.c"
/* Efl.Part end */

View File

@ -0,0 +1,8 @@
class @beta Efl.Ui.Textbox_Part extends Efl.Ui.Layout_Part_Text
{
[[Efl UI Textbox internal part class]]
data: null;
implements {
Efl.Text.text { set; get; }
}
}

View File

@ -669,7 +669,7 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
_frame_set_facade(obj, pd, update_frame);
if (pd->autorepeat)
if (pd->looping)
{
int repeat_times = elm_transit_current_repeat_times_get(pd->transit);
if (pd->repeat_times != repeat_times)
@ -780,7 +780,7 @@ _ready_play(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed;
Elm_Transit *transit = elm_transit_add();
elm_transit_object_add(transit, pd->vg);
if (pd->autorepeat) elm_transit_repeat_times_set(transit, -1);
if (pd->looping) elm_transit_repeat_times_set(transit, -1);
elm_transit_effect_add(transit, _transit_cb, obj, _transit_del_cb);
elm_transit_progress_value_set(transit, pd->progress);
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
@ -937,21 +937,21 @@ _efl_ui_vg_animation_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
}
EOLIAN static void
_efl_ui_vg_animation_autorepeat_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool autorepeat)
_efl_ui_vg_animation_looping_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool looping)
{
if (pd->autorepeat == autorepeat) return;
pd->autorepeat = autorepeat;
if (pd->looping == looping) return;
pd->looping = looping;
if (pd->transit)
{
if (autorepeat) elm_transit_repeat_times_set(pd->transit, -1);
if (looping) elm_transit_repeat_times_set(pd->transit, -1);
else elm_transit_repeat_times_set(pd->transit, 0);
}
}
EOLIAN static Eina_Bool
_efl_ui_vg_animation_autorepeat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
_efl_ui_vg_animation_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
{
return pd->autorepeat;
return pd->looping;
}
EOLIAN static void

View File

@ -47,20 +47,20 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, E
autoplay: bool(false); [[Auto play mode.]]
}
}
@property autorepeat {
@property looping {
[[Turn on/off animation looping.
If @.autorepeat is $true, it repeats animation when animation frame is reached to
end. This auto repeat mode is valid to both playing and playing_backwards cases.
When $true, animation is restarted when it reaches the last frame.
This works both when playing forward and backward.
$true Enable auto play mode, disable otherwise.
$true Enable loop mode, disable otherwise.
]]
set {
}
get {
}
values {
autorepeat: bool; [[Loop mode, Default is $false.]]
looping: bool; [[Loop mode, Default is $false.]]
}
}
@property frame {

View File

@ -14,13 +14,13 @@ elm_animation_view_auto_play_get(const Efl_Ui_Vg_Animation *obj)
EAPI void
elm_animation_view_auto_repeat_set(Efl_Ui_Vg_Animation *obj, Eina_Bool autorepeat)
{
efl_ui_vg_animation_autorepeat_set(obj, autorepeat);
efl_ui_vg_animation_looping_set(obj, autorepeat);
}
EAPI Eina_Bool
elm_animation_view_auto_repeat_get(const Efl_Ui_Vg_Animation *obj)
{
return efl_ui_vg_animation_autorepeat_get(obj);
return efl_ui_vg_animation_looping_get(obj);
}
EAPI Eina_Bool

View File

@ -25,7 +25,7 @@ struct _Efl_Ui_Vg_Animation_Data
Eina_Bool playing_reverse : 1;
Eina_Bool autoplay : 1;
Eina_Bool autoplay_pause: 1;
Eina_Bool autorepeat : 1;
Eina_Bool looping : 1;
Eina_Bool playback_direction_changed : 1;
};

View File

@ -164,7 +164,7 @@ pub_eo_files = [
'elm_multibuttonentry_part.eo',
'elm_interface_scrollable.eo',
'efl_ui_image_zoomable_pan.eo',
'efl_ui_text_part.eo',
'efl_ui_textbox_part.eo',
'efl_ui_caching_factory.eo',
'efl_ui_widget_factory.eo',
'efl_ui_property_bind_part.eo',

View File

@ -263,11 +263,13 @@ _efl_canvas_vg_object_efl_file_file_set(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *p
evas_object_change(eo_obj, obj);
pd->vg_entry = NULL;
evas_object_change(eo_obj, obj);
pd->changed = EINA_TRUE;
}
}
Eina_Error err;
err = efl_file_set(efl_super(eo_obj, MY_CLASS), file);
if (err) return err;
return 0;
@ -292,6 +294,7 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd)
obj->cur->geometry.w,
obj->cur->geometry.h, NULL);
evas_object_change(eo_obj, obj);
pd->changed = EINA_TRUE;
return 0;
}

View File

@ -380,7 +380,6 @@ evas_cache_vg_entry_create(Evas *evas,
}
eina_strbuf_free(hash_key);
vg_entry->ref++;
vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas);
//No File??
if (!vg_entry->vfd)

View File

@ -43,6 +43,9 @@ static const Efl_Test_Case etc[] = {
{ "efl_ui_view_model", efl_ui_test_view_model },
{ "efl_ui_group_item", efl_ui_test_group_item },
{ "efl_ui_text", efl_ui_test_text},
#ifdef BUILD_VG_LOADER_JSON
{ "efl_ui_vg_animation", efl_ui_test_vg_animation},
#endif
{ NULL, NULL }
};

View File

@ -54,6 +54,7 @@ void efl_ui_test_select_model(TCase *tc);
void efl_ui_test_view_model(TCase *tc);
void efl_ui_test_group_item(TCase *tc);
void efl_ui_test_text(TCase *tc);
void efl_ui_test_vg_animation(TCase *tc);
void loop_timer_interval_set(Eo *obj, double in);

View File

@ -178,6 +178,43 @@ EFL_START_TEST(text_change_event)
}
EFL_END_TEST
EFL_START_TEST(text_keys_handler)
{
Eo *txt;
Eo *win = win_add();
txt = efl_add(EFL_UI_TEXTBOX_CLASS, win);
efl_gfx_entity_size_set(txt, EINA_SIZE2D(300, 300));
efl_text_set(txt, "Hello");
efl_gfx_entity_visible_set(txt, EINA_TRUE);
Evas *e = evas_object_evas_get(txt);
efl_ui_focus_util_focus(txt);
efl_text_cursor_move(efl_text_interactive_main_cursor_get(txt), EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
evas_key_modifier_on(e, "Control");
evas_event_feed_key_down(e, "BackSpace", "BackSpace", "\b", "\b", time(NULL), NULL);
ecore_main_loop_iterate();
ck_assert_str_eq(efl_text_get(txt),"");
ck_assert_int_eq(efl_text_cursor_position_get(efl_text_interactive_main_cursor_get(txt)), 0);
evas_event_feed_key_up(e, "BackSpace", "BackSpace", "\b", "\b", time(NULL), NULL);
ecore_main_loop_iterate();
efl_text_set(txt, "Hello");
efl_text_cursor_position_set(efl_text_interactive_main_cursor_get(txt), 0);
evas_key_modifier_on(e, "Control");
evas_event_feed_key_down(e, "Delete", "Delete", "\177", "\177", time(NULL), NULL);
ecore_main_loop_iterate();
ck_assert_str_eq(efl_text_get(txt),"");
ck_assert_int_eq(efl_text_cursor_position_get(efl_text_interactive_main_cursor_get(txt)), 0);
evas_event_feed_key_up(e, "Delete", "Delete", "\177", "\177", time(NULL), NULL);
ecore_main_loop_iterate();
efl_del(txt);
efl_del(win);
}
EFL_END_TEST
void efl_ui_test_text(TCase *tc)
{
tcase_add_test(tc, text_cnp);
@ -186,4 +223,5 @@ void efl_ui_test_text(TCase *tc)
tcase_add_test(tc, text_user_change);
tcase_add_test(tc, text_scroll_mode);
tcase_add_test(tc, text_change_event);
tcase_add_test(tc, text_keys_handler);
}

View File

@ -0,0 +1,122 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Efl_Ui.h>
#include "efl_ui_suite.h"
#ifdef BUILD_VG_LOADER_JSON
EFL_START_TEST(vg_anim_playing_control)
{
Evas_Object *win, *vg_anim;
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
vg_anim = efl_add(EFL_UI_VG_ANIMATION_CLASS, win,
efl_content_set(win, efl_added));
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_NOT_READY);
// File load
efl_file_simple_load(vg_anim, TESTS_SRC_DIR"/emoji_wink.json", NULL);
ck_assert(efl_file_loaded_get(vg_anim));
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED);
// Play start
efl_player_playing_set(vg_anim, EINA_TRUE);
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_PLAYING);
// Play pause
efl_player_paused_set(vg_anim, EINA_TRUE);
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_PAUSED);
// Play resume
efl_player_paused_set(vg_anim, EINA_FALSE);
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_PLAYING);
// Playback speed
efl_player_playback_speed_set(vg_anim, 2.0);
ck_assert(EINA_DBL_EQ(efl_player_playback_speed_get(vg_anim), 2.0));
efl_player_playback_speed_set(vg_anim, -2.0);
ck_assert(EINA_DBL_EQ(efl_player_playback_speed_get(vg_anim), -2.0));
// playing backwards
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS);
// Play stop
efl_player_playing_set(vg_anim, EINA_FALSE);
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED);
// Auto repeat
efl_ui_vg_animation_looping_set(vg_anim, EINA_TRUE);
ck_assert_int_eq(efl_ui_vg_animation_looping_get(vg_anim), EINA_TRUE);
// Auto play
efl_ui_vg_animation_autoplay_set(vg_anim, EINA_TRUE);
ck_assert_int_eq(efl_ui_vg_animation_autoplay_get(vg_anim), EINA_TRUE);
}
EFL_END_TEST
EFL_START_TEST(vg_anim_frame_control)
{
Evas_Object *win, *vg_anim;
int frame_count = 0;
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
vg_anim = efl_add(EFL_UI_VG_ANIMATION_CLASS, win,
efl_content_set(win, efl_added));
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_NOT_READY);
// File load
// emoji_wink.json is 60 frames sample.
efl_file_simple_load(vg_anim, TESTS_SRC_DIR"/emoji_wink.json", NULL);
ck_assert(efl_file_loaded_get(vg_anim));
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED);
// Total frame
frame_count = efl_ui_vg_animation_frame_count_get(vg_anim);
ck_assert_int_eq(frame_count, 60);
// Frame set, get
efl_ui_vg_animation_frame_set(vg_anim, 30);
ck_assert_int_eq(efl_ui_vg_animation_frame_get(vg_anim), 30);
// Frame set, get
efl_player_playback_progress_set(vg_anim, 0.3);
ck_assert(EINA_DBL_EQ(efl_player_playback_progress_get(vg_anim), 0.3));
// Min/Max frame set,get
efl_ui_vg_animation_min_frame_set(vg_anim, 5);
ck_assert_int_eq(efl_ui_vg_animation_min_frame_get(vg_anim), 5);
efl_ui_vg_animation_frame_set(vg_anim, 1);
ck_assert_int_eq(efl_ui_vg_animation_frame_get(vg_anim), 5);
efl_ui_vg_animation_max_frame_set(vg_anim, 55);
ck_assert_int_eq(efl_ui_vg_animation_max_frame_get(vg_anim), 55);
efl_ui_vg_animation_frame_set(vg_anim, 60);
ck_assert_int_eq(efl_ui_vg_animation_frame_get(vg_anim), 55);
// Min/Max progress set,get
efl_ui_vg_animation_min_progress_set(vg_anim, 0.2);
ck_assert(EINA_DBL_EQ(efl_ui_vg_animation_min_progress_get(vg_anim), 0.2));
efl_ui_vg_animation_max_progress_set(vg_anim, 0.8);
ck_assert(EINA_DBL_EQ(efl_ui_vg_animation_max_progress_get(vg_anim), 0.8));
}
EFL_END_TEST
#endif
void efl_ui_test_vg_animation(TCase *tc)
{
tcase_add_checked_fixture(tc, fail_on_errors_setup, fail_on_errors_teardown);
#ifdef BUILD_VG_LOADER_JSON
tcase_add_test(tc, vg_anim_playing_control);
tcase_add_test(tc, vg_anim_frame_control);
#endif
}

File diff suppressed because one or more lines are too long

View File

@ -160,6 +160,7 @@ efl_ui_suite_src = [
'efl_ui_test_view_model.c',
'efl_ui_test_group_item.c',
'efl_ui_test_text.c',
'efl_ui_test_vg_animation.c',
]
efl_ui_suite = executable('efl_ui_suite',