forked from enlightenment/efl
elm: Split off text and content for efl_part
This is VERY tricky. For legacy, just create an internal class that has both. It's easier this way. For parts that are handled by Layout directly, we know from Edje which type to return. For EO objects we should know from the part name which kind of part we are dealing with: - text (overridden by the widget) - content (overridden by the widget) - special (new efl_part based functions) - generic (handled by Layout) Note: Efl.Ui.Slider was handling "span size" on ALL parts. That's bad... This is now limited to "span" only.
This commit is contained in:
parent
0339ad7740
commit
28b387821d
|
@ -98,7 +98,10 @@ elm_public_eolian_files = \
|
|||
lib/elementary/efl_ui_grid_static.eo \
|
||||
lib/elementary/efl_ui_layout_part.eo \
|
||||
lib/elementary/efl_ui_layout_part_box.eo \
|
||||
lib/elementary/efl_ui_layout_part_content.eo \
|
||||
lib/elementary/efl_ui_layout_part_text.eo \
|
||||
lib/elementary/efl_ui_layout_part_table.eo \
|
||||
lib/elementary/efl_ui_layout_part_legacy.eo \
|
||||
lib/elementary/efl_ui_button_part.eo \
|
||||
lib/elementary/elm_ctxpopup_part.eo \
|
||||
lib/elementary/efl_ui_panes_part.eo \
|
||||
|
|
|
@ -265,6 +265,11 @@ EAPI extern Elm_Version *elm_version;
|
|||
#ifdef EFL_EO_API_SUPPORT
|
||||
# include <efl_config_global.eo.h>
|
||||
# include <efl_ui_widget_part.eo.h>
|
||||
# include <efl_ui_layout_part.eo.h>
|
||||
# include <efl_ui_layout_part_box.eo.h>
|
||||
# include <efl_ui_layout_part_content.eo.h>
|
||||
# include <efl_ui_layout_part_text.eo.h>
|
||||
# include <efl_ui_layout_part_table.eo.h>
|
||||
# include <efl_ui_box.eo.h>
|
||||
# include <efl_ui_box_flow.eo.h>
|
||||
# include <efl_ui_box_stack.eo.h>
|
||||
|
|
|
@ -420,11 +420,11 @@ _efl_ui_button_class_constructor(Efl_Class *klass)
|
|||
/* Standard widget overrides */
|
||||
|
||||
ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
|
||||
EFL_TEXT_PART_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
|
||||
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data)
|
||||
ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data, _content_aliases)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_button, EFL_UI_BUTTON, Efl_Ui_Button_Data)
|
||||
#include "efl_ui_button_part.eo.c"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Efl.Ui.Button.Part (Efl.Ui.Layout.Part)
|
||||
class Efl.Ui.Button.Part (Efl.Ui.Layout.Part_Content)
|
||||
{
|
||||
[[Elementary button internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "elm_priv.h"
|
||||
#include "efl_ui_widget_frame.h"
|
||||
#include "elm_widget_layout.h"
|
||||
#include "elm_part_helper.h"
|
||||
|
||||
#define MY_CLASS EFL_UI_FRAME_CLASS
|
||||
#define MY_CLASS_PFX efl_ui_frame
|
||||
|
@ -197,18 +198,6 @@ _efl_ui_frame_efl_object_constructor(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UNUSED
|
|||
return obj;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_frame_efl_text_text_set(Eo *obj, Efl_Ui_Frame_Data *pd EINA_UNUSED, const char *text)
|
||||
{
|
||||
efl_text_set(efl_part(obj, _text_aliases[0].real_part), text);
|
||||
}
|
||||
|
||||
EOLIAN static const char *
|
||||
_efl_ui_frame_efl_text_text_get(Eo *obj, Efl_Ui_Frame_Data *pd EINA_UNUSED)
|
||||
{
|
||||
return efl_text_get(efl_part(obj, _text_aliases[0].real_part));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_frame_autocollapse_set(Eo *obj EINA_UNUSED, Efl_Ui_Frame_Data *sd, Eina_Bool autocollapse)
|
||||
{
|
||||
|
@ -267,6 +256,8 @@ _efl_ui_frame_class_constructor(Efl_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_frame, Efl_Ui_Frame_Data)
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
#include "elm_priv.h"
|
||||
#include "elm_widget_layout.h"
|
||||
|
||||
#include "efl_ui_layout_part.eo.h"
|
||||
#include "elm_part_helper.h"
|
||||
|
||||
#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
|
||||
|
@ -1246,7 +1244,7 @@ _efl_ui_layout_efl_container_content_count(Eo *eo_obj EINA_UNUSED, Efl_Ui_Layout
|
|||
return eina_list_count(sd->subs);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
static Eina_Bool
|
||||
_efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const char *text)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
|
||||
|
@ -1321,7 +1319,7 @@ _efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static const char*
|
||||
static const char*
|
||||
_efl_ui_layout_text_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char *part)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
||||
|
@ -2489,7 +2487,13 @@ _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED,
|
|||
if ((type == EDJE_PART_TYPE_BOX) || (type == EDJE_PART_TYPE_TABLE))
|
||||
return _efl_ui_layout_pack_proxy_get((Eo *) obj, type, part);
|
||||
|
||||
ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_LAYOUT);
|
||||
if ((type == EDJE_PART_TYPE_TEXT) || (type == EDJE_PART_TYPE_TEXTBLOCK))
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS);
|
||||
|
||||
if (type == EDJE_PART_TYPE_SWALLOW)
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS);
|
||||
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_LAYOUT_PART_CLASS);
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
@ -2510,6 +2514,8 @@ _efl_ui_layout_default_text_part_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_
|
|||
return part;
|
||||
}
|
||||
|
||||
/* Efl.Ui.Layout.Part (common) */
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_layout_part_efl_ui_cursor_cursor_set(Eo *obj, void *_pd EINA_UNUSED, const char *cursor)
|
||||
{
|
||||
|
@ -2558,12 +2564,26 @@ _efl_ui_layout_part_efl_ui_cursor_cursor_theme_search_enabled_get(Eo *obj, void
|
|||
ELM_PART_RETURN_VAL(!_efl_ui_layout_part_cursor_engine_only_get(sd, pd->part));
|
||||
}
|
||||
|
||||
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET(efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET(efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
/* Efl.Ui.Layout.Part_Content */
|
||||
ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_content, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
|
||||
/* Efl.Ui.Layout.Part_Text */
|
||||
ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_text, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
|
||||
/* Efl.Ui.Layout.Part_Legacy */
|
||||
ELM_PART_OVERRIDE_CONTENT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET_FULL(efl_ui_layout_part_legacy, efl_ui_layout, EFL_UI_LAYOUT, Efl_Ui_Layout_Data)
|
||||
|
||||
#include "efl_ui_layout_part.eo.c"
|
||||
#include "efl_ui_layout_part_content.eo.c"
|
||||
#include "efl_ui_layout_part_text.eo.c"
|
||||
#include "efl_ui_layout_part_legacy.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "elm_widget_layout.h"
|
||||
#include "elm_part_helper.h"
|
||||
|
||||
#include "efl_ui_layout_part_box.eo.h"
|
||||
#include "efl_ui_layout_part_table.eo.h"
|
||||
#include "../evas/canvas/evas_box.eo.h"
|
||||
#include "../evas/canvas/evas_table.eo.h"
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
class Efl.Ui.Layout.Part (Efl.Ui.Widget.Part, Efl.Container, Efl.Text, Efl.Ui.Cursor)
|
||||
class Efl.Ui.Layout.Part (Efl.Ui.Widget.Part, Efl.Ui.Cursor)
|
||||
{
|
||||
[[Elementary layout internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Container.content { get; set; }
|
||||
Efl.Container.content_unset;
|
||||
Efl.Text.text { set; get; }
|
||||
Efl.Ui.Cursor.cursor { get; set; }
|
||||
Efl.Ui.Cursor.cursor_style { get; set; }
|
||||
Efl.Ui.Cursor.cursor_theme_search_enabled { get; set; }
|
||||
|
|
|
@ -6,8 +6,9 @@ class Efl.Ui.Layout.Part.Box (Efl.Object, Efl.Pack.Linear,
|
|||
Can not be deleted, this is only a representation of an internal object
|
||||
of an EFL layout.
|
||||
]]
|
||||
data: Efl_Ui_Layout_Table_Data;
|
||||
data: Efl_Ui_Layout_Box_Data;
|
||||
methods {
|
||||
/* FIXME: Remove this. */
|
||||
@property real_part @protected {
|
||||
[[Real part property]]
|
||||
set {}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
class Efl.Ui.Layout.Part_Content (Efl.Ui.Layout.Part, Efl.Container)
|
||||
{
|
||||
[[Elementary layout internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Container.content { get; set; }
|
||||
Efl.Container.content_unset;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
class Efl.Ui.Layout.Part_Legacy (Efl.Ui.Layout.Part, Efl.Container, Efl.Text)
|
||||
{
|
||||
[[Elementary layout internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Container.content { get; set; }
|
||||
Efl.Container.content_unset;
|
||||
Efl.Text.text { set; get; }
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Grid)
|
|||
]]
|
||||
data: Efl_Ui_Layout_Table_Data;
|
||||
methods {
|
||||
/* FIXME: Remove this. */
|
||||
@property real_part @protected {
|
||||
[[Real part property]]
|
||||
set {}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class Efl.Ui.Layout.Part_Text (Efl.Ui.Layout.Part, Efl.Text)
|
||||
{
|
||||
[[Elementary layout internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Text.text { set; get; }
|
||||
}
|
||||
}
|
|
@ -531,7 +531,7 @@ _efl_ui_panes_class_constructor(Efl_Class *klass)
|
|||
|
||||
/* Efl.Part begin */
|
||||
|
||||
ELM_PART_OVERRIDE(efl_ui_panes, EFL_UI_PANES, Efl_Ui_Panes_Data)
|
||||
ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_panes, EFL_UI_PANES, Efl_Ui_Panes_Data, _content_aliases)
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_panes_part_hint_min_allow_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool allow)
|
||||
|
@ -613,11 +613,11 @@ _efl_ui_panes_part_split_ratio_min_set(Eo *obj, void *_pd EINA_UNUSED, double ra
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX);
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_panes)
|
||||
|
||||
#define EFL_UI_PANES_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_OPS(efl_ui_panes), \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_panes), \
|
||||
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panes)
|
||||
|
||||
/* Legacy APIs */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part)
|
||||
class Efl.Ui.Panes.Part (Efl.Ui.Layout.Part_Content)
|
||||
{
|
||||
[[Elementary Panes internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -641,15 +641,9 @@ _efl_ui_progressbar_class_constructor(Efl_Class *klass)
|
|||
}
|
||||
|
||||
/* Efl.Part begin */
|
||||
ELM_PART_OVERRIDE(efl_ui_progressbar, EFL_UI_PROGRESSBAR, Efl_Ui_Progressbar_Data)
|
||||
|
||||
static EOLIAN Eina_Bool
|
||||
_efl_ui_progressbar_part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Progressbar_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_PROGRESSBAR_CLASS);
|
||||
ELM_PART_RETURN_VAL(_efl_ui_progressbar_content_set(pd->obj, sd, pd->part, content));
|
||||
}
|
||||
ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_progressbar, EFL_UI_PROGRESSBAR, Efl_Ui_Progressbar_Data, _content_aliases)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_progressbar, EFL_UI_PROGRESSBAR, Efl_Ui_Progressbar_Data)
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_progressbar_part_efl_ui_range_range_value_set(Eo *obj, void *_pd EINA_UNUSED, double val)
|
||||
|
@ -675,12 +669,12 @@ _efl_ui_progressbar_part_efl_ui_range_range_value_get(Eo *obj, void *_pd EINA_UN
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_progressbar)
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar)
|
||||
|
||||
#define EFL_UI_PROGRESSBAR_EXTRA_OPS \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
|
||||
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_progressbar), \
|
||||
ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_progressbar), \
|
||||
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_progressbar), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Efl.Ui.Progressbar.Part (Efl.Ui.Layout.Part, Efl.Ui.Range)
|
||||
class Efl.Ui.Progressbar.Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Range)
|
||||
{
|
||||
[[Elementary progressbar internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1237,9 +1237,9 @@ EOLIAN static void
|
|||
_efl_ui_slider_efl_ui_range_span_size_set(Eo *obj, Efl_Ui_Slider_Data *sd, Evas_Coord size)
|
||||
{
|
||||
if (_is_horizontal(sd->dir))
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), EINA_SIZE2D(size, 1));
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "span"), EINA_SIZE2D(size, 1));
|
||||
else
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "elm.swallow.bar"), EINA_SIZE2D(1, size));
|
||||
efl_gfx_size_hint_min_set(efl_part(obj, "span"), EINA_SIZE2D(1, size));
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Coord
|
||||
|
@ -1507,28 +1507,19 @@ _efl_ui_slider_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
|
|||
|
||||
/* Standard widget overrides */
|
||||
|
||||
EFL_TEXT_PART_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
|
||||
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_slider, Efl_Ui_Slider_Data)
|
||||
|
||||
/* Efl.Part begin */
|
||||
ELM_PART_OVERRIDE(efl_ui_slider, EFL_UI_SLIDER, Efl_Ui_Slider_Data)
|
||||
|
||||
static Eina_Bool
|
||||
_efl_ui_slider_content_set(Eo *obj, Efl_Ui_Slider_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
|
||||
EOLIAN static Eo *
|
||||
_efl_ui_slider_efl_part_part(const Eo *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, const char *part)
|
||||
{
|
||||
Eina_Bool int_ret;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
||||
|
||||
int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
|
||||
if (!int_ret) return EINA_FALSE;
|
||||
if (eina_streq(part, "span"))
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(EFL_UI_SLIDER_PART_CLASS);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static EOLIAN Eina_Bool
|
||||
_efl_ui_slider_part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
|
||||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||
ELM_PART_RETURN_VAL(_efl_ui_slider_content_set(pd->obj, sd, pd->part, content));
|
||||
return efl_part(efl_super(obj, MY_CLASS), part);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1570,6 +1561,7 @@ _efl_ui_slider_part_efl_gfx_size_hint_hint_min_set(Eo *obj, void *_pd EINA_UNUSE
|
|||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||
|
||||
EINA_SAFETY_ON_FALSE_RETURN(eina_streq(pd->part, "span"));
|
||||
_span_size_set(pd->obj, sd, sz.w, sz.h);
|
||||
}
|
||||
|
||||
|
@ -1578,11 +1570,16 @@ _efl_ui_slider_part_efl_gfx_size_hint_hint_min_get(Eo *obj, void *_pd EINA_UNUSE
|
|||
{
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||
Eina_Size2D ret = { 0, 0 };
|
||||
|
||||
EINA_SAFETY_ON_FALSE_GOTO(eina_streq(pd->part, "span"), end);
|
||||
if (_is_horizontal(sd->dir))
|
||||
return EINA_SIZE2D(sd->size, 1);
|
||||
ret = EINA_SIZE2D(sd->size, 1);
|
||||
else
|
||||
return EINA_SIZE2D(1, sd->size);
|
||||
ret = EINA_SIZE2D(1, sd->size);
|
||||
|
||||
end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#include "efl_ui_slider_part.eo.c"
|
||||
|
@ -1750,12 +1747,12 @@ elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max)
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
|
||||
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider)
|
||||
ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_slider)
|
||||
|
||||
#define EFL_UI_SLIDER_EXTRA_OPS \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \
|
||||
ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \
|
||||
ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_slider), \
|
||||
ELM_LAYOUT_TEXT_ALIASES_OPS(efl_ui_slider), \
|
||||
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_slider), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_slider)
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
class Efl.Ui.Slider.Part (Efl.Ui.Layout.Part, Efl.Gfx.Size.Hint)
|
||||
class Efl.Ui.Slider.Part (Efl.Ui.Layout.Part_Content, Efl.Gfx.Size.Hint)
|
||||
{
|
||||
[[Elementary slider internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Container.content { set; }
|
||||
Efl.Gfx.Size.Hint.hint_min { set; get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Efl.Ui.Textpath.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Efl.Ui.Textpath.Part (Efl.Ui.Layout.Part_Text)
|
||||
{
|
||||
[[Efl UI Textpath internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm_Actionslider.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm_Actionslider.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary Actionslider internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm_Bubble.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm_Bubble.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary Bubble internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Ctxpopup.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Ctxpopup.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary contex popup internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Dayselector.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Dayselector.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary dayselector internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Entry.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm.Entry.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary entry internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Fileselector.Entry.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm.Fileselector.Entry.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary fileselector entry internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Fileselector.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm.Fileselector.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary fileselector entry internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Hover.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Hover.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[elementary hover internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm_Label.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm_Label.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary button internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Multibuttonentry.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm.Multibuttonentry.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary multibuttonentry internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Naviframe.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Naviframe.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary naviframe internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _ELM_PART_HELPER_H
|
||||
#define _ELM_PART_HELPER_H
|
||||
|
||||
#include "efl_ui_layout_part.eo.h"
|
||||
#include "efl_ui_layout_part_legacy.eo.h"
|
||||
|
||||
//#define ELM_PART_HOOK do { ERR("%s@%p:%s [%d]", efl_class_name_get(pd->obj), pd->obj, pd->part, (int) pd->temp); } while(0)
|
||||
#define ELM_PART_HOOK do {} while(0)
|
||||
|
@ -39,8 +39,19 @@ struct _Elm_Part_Data
|
|||
|
||||
// For any widget that has specific part handling
|
||||
|
||||
#define ELM_PART_OVERRIDE_IMPLEMENT(TYPE) \
|
||||
Eo *proxy = efl_add(TYPE ## _PART_CLASS, (Eo *) obj); \
|
||||
static inline Eina_Bool
|
||||
_elm_part_alias_find(const Elm_Layout_Part_Alias_Description *aliases, const char *part)
|
||||
{
|
||||
const Elm_Layout_Part_Alias_Description *alias;
|
||||
|
||||
for (alias = aliases; alias && alias->alias; alias++)
|
||||
if (eina_streq(alias->real_part, part))
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_IMPLEMENT(PART_CLASS) ({ \
|
||||
Eo *proxy = efl_add(PART_CLASS, (Eo *) obj); \
|
||||
Elm_Part_Data *pd = efl_data_scope_get(proxy, EFL_UI_WIDGET_PART_CLASS); \
|
||||
if (pd) \
|
||||
{ \
|
||||
|
@ -48,46 +59,56 @@ struct _Elm_Part_Data
|
|||
pd->part = eina_tmpstr_add(part); \
|
||||
pd->temp = 1; \
|
||||
} \
|
||||
return proxy;
|
||||
proxy; })
|
||||
|
||||
#define ELM_PART_OVERRIDE_ONLY_ALIASES(type, TYPE, typedata, aliases) \
|
||||
EOLIAN static Efl_Object * \
|
||||
_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
|
||||
{ \
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \
|
||||
if (_elm_part_alias_find(aliases, part)) \
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(TYPE ## _PART_CLASS); \
|
||||
return efl_part(efl_super(obj, MY_CLASS), part); \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE(type, TYPE, typedata) \
|
||||
static EOLIAN Efl_Object * \
|
||||
EOLIAN static Efl_Object * \
|
||||
_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
|
||||
{ \
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \
|
||||
ELM_PART_OVERRIDE_IMPLEMENT(TYPE); \
|
||||
return ELM_PART_OVERRIDE_IMPLEMENT(TYPE ## _PART_CLASS); \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_CONTENT_SET(type, TYPE, typedata) \
|
||||
static EOLIAN Eina_Bool \
|
||||
_ ## type ## _part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \
|
||||
#define ELM_PART_OVERRIDE_CONTENT_SET_FULL(full, type, TYPE, typedata) \
|
||||
EOLIAN static Eina_Bool \
|
||||
_ ## full ## _efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \
|
||||
{ \
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
|
||||
typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
|
||||
ELM_PART_RETURN_VAL(_ ## type ## _content_set(pd->obj, sd, pd->part, content)); \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, typedata) \
|
||||
static EOLIAN Efl_Gfx * \
|
||||
_ ## type ## _part_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
#define ELM_PART_OVERRIDE_CONTENT_GET_FULL(full, type, TYPE, typedata) \
|
||||
EOLIAN static Efl_Gfx * \
|
||||
_ ## full ## _efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
{ \
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
|
||||
typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
|
||||
ELM_PART_RETURN_VAL(_ ## type ## _content_get(pd->obj, sd, pd->part)); \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, typedata) \
|
||||
static EOLIAN Efl_Gfx * \
|
||||
_ ## type ## _part_efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
#define ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(full, type, TYPE, typedata) \
|
||||
EOLIAN static Efl_Gfx * \
|
||||
_ ## full ## _efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
{ \
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
|
||||
typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
|
||||
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, sd, pd->part)); \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_TEXT_SET(type, TYPE, typedata) \
|
||||
static EOLIAN void \
|
||||
_ ## type ## _part_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) \
|
||||
#define ELM_PART_OVERRIDE_TEXT_SET_FULL(full, type, TYPE, typedata) \
|
||||
EOLIAN static void \
|
||||
_ ## full ## _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); \
|
||||
typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
|
||||
|
@ -95,16 +116,31 @@ _ ## type ## _part_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char
|
|||
ELM_PART_RETURN_VOID; \
|
||||
}
|
||||
|
||||
#define ELM_PART_OVERRIDE_TEXT_GET(type, TYPE, typedata) \
|
||||
static EOLIAN const char *\
|
||||
_ ## type ## _part_efl_text_text_get(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
#define ELM_PART_OVERRIDE_TEXT_GET_FULL(full, type, TYPE, typedata) \
|
||||
EOLIAN static const char *\
|
||||
_ ## full ## _efl_text_text_get(Eo *obj, void *_pd EINA_UNUSED) \
|
||||
{ \
|
||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); \
|
||||
typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
|
||||
ELM_PART_RETURN_VAL(_ ## type ## _text_get(pd->obj, sd, pd->part)); \
|
||||
}
|
||||
|
||||
#define EFL_TEXT_PART_DEFAULT_IMPLEMENT(type, Type) \
|
||||
#define ELM_PART_OVERRIDE_CONTENT_SET(type, TYPE, typedata) \
|
||||
ELM_PART_OVERRIDE_CONTENT_SET_FULL(type ## _part, type, TYPE, typedata)
|
||||
|
||||
#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, typedata) \
|
||||
ELM_PART_OVERRIDE_CONTENT_GET_FULL(type ## _part, type, TYPE, typedata)
|
||||
|
||||
#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, typedata) \
|
||||
ELM_PART_OVERRIDE_CONTENT_UNSET_FULL(type ## _part, type, TYPE, typedata)
|
||||
|
||||
#define ELM_PART_OVERRIDE_TEXT_SET(type, TYPE, typedata) \
|
||||
ELM_PART_OVERRIDE_TEXT_SET_FULL(type ## _part, type, TYPE, typedata)
|
||||
|
||||
#define ELM_PART_OVERRIDE_TEXT_GET(type, TYPE, typedata) \
|
||||
ELM_PART_OVERRIDE_TEXT_GET_FULL(type ## _part, type, TYPE, typedata)
|
||||
|
||||
#define ELM_PART_TEXT_DEFAULT_IMPLEMENT(type, Type) \
|
||||
EOLIAN static void \
|
||||
_ ## type ## _efl_text_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *text) \
|
||||
{ \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Player.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Player.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary player internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Popup.Part (Efl.Ui.Layout.Part, Efl.Text)
|
||||
class Elm.Popup.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary popup internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm.Scroller.Part (Efl.Ui.Layout.Part)
|
||||
class Elm.Scroller.Part (Efl.Ui.Layout.Part_Legacy)
|
||||
{
|
||||
[[Elementary scroller internal part class]]
|
||||
data: null;
|
||||
|
|
|
@ -6638,7 +6638,7 @@ elm_widget_signal_callback_del(Eo *obj, const char *emission, const char *source
|
|||
|
||||
/* Efl.Part implementation */
|
||||
|
||||
static EOLIAN Efl_Object *
|
||||
EOLIAN static Efl_Object *
|
||||
_elm_widget_efl_part_part(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED, const char *part)
|
||||
{
|
||||
Elm_Part_Data *pd;
|
||||
|
@ -6659,7 +6659,7 @@ _elm_widget_efl_part_part(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED,
|
|||
return proxy;
|
||||
}
|
||||
|
||||
static EOLIAN void \
|
||||
EOLIAN static void \
|
||||
_efl_ui_widget_part_efl_object_destructor(Eo *obj, Elm_Part_Data *pd)
|
||||
{
|
||||
ELM_PART_HOOK;
|
||||
|
|
|
@ -9898,7 +9898,7 @@ _evas_textblock_cursor_copy(Evas_Textblock_Cursor *dst, const Efl_Text_Cursor_Cu
|
|||
dst->node = src->node;
|
||||
}
|
||||
|
||||
static EOLIAN void
|
||||
EOLIAN static void
|
||||
_efl_canvas_text_efl_text_cursor_cursor_copy(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
|
||||
Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src)
|
||||
{
|
||||
|
@ -11131,7 +11131,7 @@ evas_textblock_cursor_range_text_get(const Efl_Text_Cursor_Cursor *cur1, const E
|
|||
return _evas_textblock_cursor_range_text_get(cur1, cur2, format);
|
||||
}
|
||||
|
||||
static EOLIAN char *
|
||||
EOLIAN static char *
|
||||
_efl_canvas_text_range_text_get(Eo *eo_obj EINA_UNUSED,
|
||||
Efl_Canvas_Text_Data *pd EINA_UNUSED,
|
||||
const Efl_Text_Cursor_Cursor *cur1,
|
||||
|
@ -12327,7 +12327,7 @@ evas_textblock_cursor_range_simple_geometry_get(const Efl_Text_Cursor_Cursor *cu
|
|||
return efl_canvas_text_range_simple_geometry_get(cur1->obj, cur1, cur2);
|
||||
}
|
||||
|
||||
static EOLIAN Eina_Iterator *
|
||||
EOLIAN static Eina_Iterator *
|
||||
_efl_canvas_text_range_simple_geometry_get(Eo *eo_obj EINA_UNUSED,
|
||||
Efl_Canvas_Text_Data *o, const Efl_Text_Cursor_Cursor *cur1, const
|
||||
Evas_Textblock_Cursor *cur2)
|
||||
|
@ -12523,7 +12523,7 @@ evas_textblock_cursor_range_geometry_get(const Efl_Text_Cursor_Cursor *cur1, con
|
|||
return _efl_canvas_text_range_geometry_list_get(cur1->obj, o, cur1, cur2_obj);
|
||||
}
|
||||
|
||||
static EOLIAN Eina_Iterator *
|
||||
EOLIAN static Eina_Iterator *
|
||||
_efl_canvas_text_range_geometry_get(Eo *eo_obj EINA_UNUSED,
|
||||
Efl_Canvas_Text_Data *o, const Efl_Text_Cursor_Cursor *cur1, const
|
||||
Evas_Textblock_Cursor *cur2)
|
||||
|
|
Loading…
Reference in New Issue