elc_multibuttonentry: Fix to make multibuttonentry to be legacy only

To make multibuttonentry to be legacy only, inappropriate efl ui
interface usages are removed in multibuttonentry.
This commit is contained in:
Jaehyun Cho 2018-04-20 11:48:19 +09:00
parent fd85423ae3
commit 0bebd097b5
7 changed files with 28 additions and 372 deletions

View File

@ -1024,7 +1024,6 @@ elementary/themes/edc/efl/focus.edc \
elementary/themes/edc/efl/frame.edc \
elementary/themes/edc/efl/navigation_bar.edc \
elementary/themes/edc/efl/navigation_layout.edc \
elementary/themes/edc/efl/multibuttonentry.edc \
elementary/themes/edc/efl/nstate.edc \
elementary/themes/edc/efl/panes.edc \
elementary/themes/edc/efl/photocam.edc \

View File

@ -184,7 +184,6 @@ collections {
#include "edc/efl/popup.edc"
#include "edc/efl/video.edc"
#include "edc/efl/focus.edc"
#include "edc/efl/multibuttonentry.edc"
#include "edc/efl/tooltip.edc"
#include "edc/efl/photocam.edc"
#include "edc/efl/progress.edc"

View File

@ -1,341 +0,0 @@
group { "efl/multibuttonentry";
data.item: "horizontal_pad" 0;
data.item: "vertical_pad" 0;
data.item: "closed_height" 0;
parts {
rect { "bg";
scale;
desc { "default";
color_class: "multibuttonentry_bg";
}
}
swallow { "elm.swallow.background";
scale;
desc { "default";
rel.to: "bg";
}
}
swallow { "box.swallow";
desc { "default";
rel.to: "bg";
}
}
}
}
group { "efl/multibuttonentry/label";
parts {
text { "elm.text";
nomouse;
effect: GLOW;
scale;
desc { "default";
color: FN_COL_HIGHLIGHT;
color_class: "multibuttonentry_label";
text { font: FNBD; size: 10;
min: 1 1;
ellipsis: -1;
align: 0.5 0.5;
text_class: "multibuttonentry_label";
}
rel1.offset: 2 2;
rel2.offset: -5 -5;
}
}
}
}
group { "efl/multibuttonentry/guidetext";
parts {
text { "elm.text";
scale;
effect: SHADOW BOTTOM;
desc { "default";
rel1.offset: 2 2;
rel2.offset: -4 -4;
color: FN_COL_DISABLE;
text { font: FNBD; size: 10;
min: 0 1;
align: 0.0 0.5;
}
}
}
}
}
group { "efl/multibuttonentry/btn";
images.image: "button_normal.png" COMP;
images.image: "button_clicked.png" COMP;
images.image: "sym_close_dark_normal.png" COMP;
images.image: "sym_close_dark_selected.png" COMP;
images.image: "win_glow.png" COMP;
styles {
style { name: "efl_multibuttonentry_textblock_style";
base: "font="FN" align=0.5 font_size=10 color=#ffffffff style=shadow,bottom shadow_color=#00000080 text_class=multibuttonentry_item ellipsis=1.0";
tag: "br" "\n";
tag: "ps" "ps";
tag: "hilight" "+ font="FNBD;
tag: "b" "+ font="FNBD;
tag: "tab" "\t";
}
}
script {
public disabled = 0;
}
parts {
rect { "bg";
desc { "default";
color_class: "multibuttonentry_item_bg";
}
desc { "pressed";
color_class: "multibuttonentry_item_bg_selected";
}
}
image { "base";
desc { "default";
image.normal: "button_normal.png";
image.border: 4 4 3 5;
image.middle: SOLID;
rel1.offset: -1 0;
rel2.offset: 0 1;
fill.smooth: 0;
}
desc { "pressed";
inherit: "default";
image.normal: "button_clicked.png";
image.border: 5 5 4 6;
}
}
image { "glow";
nomouse;
desc { "default";
image.normal: "win_glow.png";
image.border: 9 9 9 9;
image.middle: 0;
rel1.offset: -2 -3;
rel1.to: "base";
rel2.offset: 1 0;
rel2.to: "base";
fill.smooth: 0;
color: 255 255 255 0;
hid;
}
desc { "focused";
inherit: "default";
color: 255 255 255 255;
vis;
}
desc { "unfocused";
inherit: "default";
}
}
image { "close";
nomouse;
desc { "default";
image.normal: "sym_close_dark_normal.png";
rel1.to: "del";
rel2.to: "del";
min: 15 15;
max: 15 15;
fixed: 1 1;
}
desc { "clicked";
inherit: "default";
image.normal: "sym_close_dark_selected.png";
}
}
rect { "del";
scale;
desc { "default";
fixed: 1 0;
min: 4 4;
align: 1.0 0.5;
aspect: 1.0 1.0; aspect_preference: VERTICAL;
rel1.relative: 1.0 0.0;
rel1.to: "base";
rel1.offset: -6 5;
rel2.offset: -6 -7;
rel2.to: "base";
color: 0 0 0 0;
}
}
textblock { "elm.btn.text";
nomouse;
scale;
desc { "default";
color_class: "multibuttonentry_item_text";
text { style: "efl_multibuttonentry_textblock_style";
min: 1 1;
ellipsis: -1;
text_class: "multibuttonentry_item_text";
}
hid;
rel1.offset: 5 5;
rel1.to: "base";
rel2.to_x: "del";
rel2.to_y: "base";
rel2.relative: 0.0 1.0;
rel2.offset: -3 -7;
}
}
textblock { "text";
nomouse;
scale;
desc { "default";
color_class: "multibuttonentry_item_text";
text { style: "efl_multibuttonentry_textblock_style";
text_source: "elm.btn.text";
min: 0 1;
align: 0.0 0.5;
text_class: "multibuttonentry_item_text";
}
align: 0.0 0.5;
rel1.offset: 5 5;
rel1.to: "base";
rel2.to_x: "del";
rel2.to_y: "base";
rel2.relative: 0.0 1.0;
rel2.offset: -3 -7;
}
desc { "pressed";
inherit: "default";
color_class: "multibuttonentry_item_text_pressed";
text {
text_class: "multibuttonentry_item_text_pressed";
}
}
desc { "disabled";
inherit: "default";
color_class: "multibuttonentry_item_text_disabled";
text {
text_class: "multibuttonentry_item_text_disabled";
}
}
}
}
programs {
program {
signal: "mouse,clicked,1";
source: "base";
script {
if (get_int(disabled) == 0) {
emit("clicked", "");
}
}
}
program {
signal: "elm,state,default";
source: "elm";
action: STATE_SET "default";
target: "glow";
}
program {
signal: "elm,state,focused";
source: "elm";
action: STATE_SET "focused";
target: "glow";
}
program {
signal: "elm,state,enabled";
source: "elm";
script {
set_state(PART:"text", "default", 0.0);
set_int(disabled , 0);
}
}
program {
signal: "elm,state,disabled";
source: "elm";
script {
new st[31];
new Float: vl;
get_state(PART:"glow", st, 30, vl);
if (!strcmp(st, "focused"))
set_state(PART:"glow", "default", 0.0);
set_state(PART:"text", "disabled", 0.0);
set_int(disabled , 1);
}
}
program {
signal: "elm,state,unfocused";
source: "elm";
action: STATE_SET "unfocused";
target: "glow";
}
program {
signal: "mouse,down,1";
source: "base";
script {
if (get_int(disabled) == 0) {
set_state(PART:"base", "pressed", 0.0);
set_state(PART:"bg", "pressed", 0.0);
set_state(PART:"text", "pressed", 0.0);
}
}
}
program {
signal: "mouse,up,1";
source: "base";
script {
if (get_int(disabled) == 0) {
set_state(PART:"base", "default", 0.0);
set_state(PART:"bg", "default", 0.0);
set_state(PART:"text", "default", 0.0);
}
}
}
program {
signal: "mouse,clicked,1";
source: "del";
action: SIGNAL_EMIT "elm,deleted" "elm";
}
program {
signal: "mouse,down,1";
source: "del";
action: STATE_SET "clicked";
target: "close";
}
program {
signal: "mouse,up,1";
source: "del";
action: STATE_SET "default";
target: "close";
}
}
}
group { "efl/multibuttonentry/closedbutton";
styles {
style { name: "textblock_style_efl_multibuttonentry_default";
base: "font="FNBD" font_size=10 text_class=multibuttonentry_closed style=glow color=#3399ffff glow_color=#3399ff18 align=center glow2_color=#3399ff12 wrap=char";
tag: "br" "\n";
tag: "ps" "ps";
tag: "hilight" "+ font="FNBD;
tag: "b" "+ font="FNBD;
tag: "tab" "\t";
}
}
parts {
rect { "bg";
desc { "default";
color: 0 0 0 0;
}
}
textblock { "elm.text";
nomouse;
scale;
desc { "default";
rel1.offset: 2 2;
rel1.to: "bg";
rel2.offset: -3 -3;
rel2.to: "bg";
text { style: "textblock_style_multibuttonentry_default";
min: 1 1;
ellipsis: -1;
}
}
}
}
}

View File

@ -206,13 +206,6 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_nstate.h>
# include <efl_ui_calendar.h>
# include <efl_ui_button_eo.h>
/* FIXME: Multibuttonentry must not use elm_widget_item */
# warning Efl.Ui.Multibutton is not available yet without Elementary.h
# if 0
# include <efl_ui_multibuttonentry.h>
# endif
# include <efl_ui_slider_eo.h>
# include <efl_ui_flip_eo.h>
# include <efl_ui_frame_eo.h>

View File

@ -1,9 +0,0 @@
class Efl.Ui.Multibuttonentry_Legacy (Efl.Ui.Multibuttonentry, Efl.Ui.Legacy)
{
[[Elementary multibuttonentry class]]
data: null;
implements {
class.constructor;
Efl.Object.constructor;
}
}

View File

@ -115,13 +115,20 @@ _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Da
{
ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
if (VIEW(item))
if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
if (!elm_layout_theme_set(VIEW(item), "multibuttonentry",
PART_NAME_BUTTON, elm_widget_style_get(obj)))
CRI("Failed to set layout!");
}
elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
elm_widget_theme_object_set
(obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
elm_widget_style_get(obj));
elm_widget_theme_object_set
(obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
elm_widget_style_get(obj));
elm_widget_theme_object_set
(obj,sd->guide_text, "multibuttonentry", PART_NAME_GUIDE_TEXT,
elm_widget_style_get(obj));
elm_layout_sizing_eval(obj);
@ -748,13 +755,14 @@ _item_new(Elm_Multibuttonentry_Data *sd,
efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED);
if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
if (!elm_layout_theme_set(VIEW(item), "multibuttonentry", PART_NAME_BUTTON,
elm_widget_style_get(obj)))
CRI("Failed to set layout!");
elm_object_part_text_set(VIEW(item), "elm.btn.text", str);
//entry is cleared when text is made to button
efl_text_set(sd->entry, "");
elm_object_text_set(sd->entry, "");
elm_layout_signal_callback_add
(VIEW(item), "mouse,clicked,1", "*", _on_item_clicked, EO_OBJ(item));
@ -1055,7 +1063,7 @@ _entry_focus_changed_cb(void *data, const Efl_Event *event)
{
const char *str;
str = efl_text_get(sd->entry);
str = elm_object_text_get(sd->entry);
if (str && str[0])
_item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL);
}
@ -1228,7 +1236,9 @@ _guide_text_set(Evas_Object *obj,
if (sd->guide_text)
{
elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
elm_widget_theme_object_set(obj, sd->guide_text, "multibuttonentry",
PART_NAME_GUIDE_TEXT,
elm_widget_style_get(obj));
evas_object_size_hint_weight_set
(sd->guide_text, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
@ -1425,7 +1435,9 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
sd->label = edje_object_add(evas_object_evas_get(obj));
if (!sd->label) return;
elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
elm_widget_theme_object_set
(obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
elm_widget_style_get(obj));
// ACCESS
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@ -1451,7 +1463,9 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
sd->end = edje_object_add(evas_object_evas_get(obj));
if (!sd->end) return;
elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
elm_widget_theme_object_set
(obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
elm_widget_style_get(obj));
edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
@ -1472,7 +1486,7 @@ _elm_multibuttonentry_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSE
if (label) _guide_text_set(obj, label);
}
else
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
elm_object_part_text_set(obj, part, label);
}
EOLIAN static const char*
@ -1489,7 +1503,7 @@ _elm_multibuttonentry_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const cha
text = sd->guide_text_str;
}
else
text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
text = elm_object_part_text_get(obj, part);
return text;
}
@ -1667,6 +1681,7 @@ EOLIAN static Eo *
_elm_multibuttonentry_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);

View File

@ -1,7 +1,7 @@
type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type; [[Elementary multibuttonentry item filter callback type]]
type Elm_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]]
class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable)
class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Legacy)
{
[[Elementary multibuttonentry class]]
legacy_prefix: elm_multibuttonentry;