Efl: Remove part name in Efl.Container (use Efl.Part)

This touches Edje and also Elementary where part names are used.
This commit blew up in size since now all content part APIs
(get, set, unset) require to use Efl.Part instead.

This is a big refactoring commit, but no logic should
have been changed. Fingers crossed.
This commit is contained in:
Jean-Philippe Andre 2016-05-24 20:40:18 +09:00
parent 56a7a66e97
commit 99924852ab
67 changed files with 933 additions and 476 deletions

View File

@ -9,8 +9,10 @@ edje_eolian_type_files = \
lib/edje/edje_types.eot
edje_eolian_priv_files = \
lib/edje/efl_canvas_layout_internal.eo \
lib/edje/efl_canvas_layout_internal_box.eo \
lib/edje/efl_canvas_layout_internal_table.eo
lib/edje/efl_canvas_layout_internal_table.eo \
lib/edje/efl_canvas_layout_internal_swallow.eo
edje_eolian_c = $(edje_eolian_files:%.eo=%.eo.c)
edje_eolian_h = $(edje_eolian_files:%.eo=%.eo.h) \

View File

@ -119,6 +119,22 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_grid.eo \
lib/elementary/efl_ui_layout_internal_box.eo \
lib/elementary/efl_ui_layout_internal_table.eo \
lib/elementary/elm_button_internal_part.eo \
lib/elementary/elm_ctxpopup_internal_part.eo \
lib/elementary/elm_dayselector_internal_part.eo \
lib/elementary/elm_entry_internal_part.eo \
lib/elementary/elm_fileselector_entry_internal_part.eo \
lib/elementary/elm_flip_internal_part.eo \
lib/elementary/elm_hover_internal_part.eo \
lib/elementary/elm_layout_internal_part.eo \
lib/elementary/elm_mapbuf_internal_part.eo \
lib/elementary/elm_naviframe_internal_part.eo \
lib/elementary/elm_notify_internal_part.eo \
lib/elementary/elm_panel_internal_part.eo \
lib/elementary/elm_player_internal_part.eo \
lib/elementary/elm_progressbar_internal_part.eo \
lib/elementary/elm_popup_internal_part.eo \
lib/elementary/elm_scroller_internal_part.eo \
$(NULL)
# Legacy classes - not part of public EO API
@ -508,6 +524,7 @@ includesub_HEADERS = \
lib/elementary/elm_win_standard.h \
lib/elementary/elm_helper.h \
lib/elementary/efl_ui_box_private.h \
lib/elementary/elm_part_helper.h \
$(NULL)
includesubdir = $(includedir)/elementary-@VMAJ@/

View File

@ -1,19 +1,25 @@
#include "edje_private.h"
#define EFL_CANVAS_LAYOUT_INTERNAL_PROTECTED
#define EFL_CANVAS_LAYOUT_INTERNAL_BOX_PROTECTED
#define EFL_CANVAS_LAYOUT_INTERNAL_TABLE_PROTECTED
#define EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_PROTECTED
#include "efl_canvas_layout_internal.eo.h"
#include "efl_canvas_layout_internal_box.eo.h"
#include "efl_canvas_layout_internal_table.eo.h"
#include "efl_canvas_layout_internal_swallow.eo.h"
#include "../evas/canvas/evas_box.eo.h"
#include "../evas/canvas/evas_table.eo.h"
#define BOX_CLASS EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS
#define TABLE_CLASS EFL_CANVAS_LAYOUT_INTERNAL_TABLE_CLASS
#define BOX_CLASS EFL_CANVAS_LAYOUT_INTERNAL_BOX_CLASS
#define TABLE_CLASS EFL_CANVAS_LAYOUT_INTERNAL_TABLE_CLASS
#define SWALLOW_CLASS EFL_CANVAS_LAYOUT_INTERNAL_SWALLOW_CLASS
typedef struct _Edje_Part_Data Edje_Box_Data;
typedef struct _Edje_Part_Data Edje_Table_Data;
typedef struct _Edje_Part_Data Edje_Swallow_Data;
typedef struct _Part_Item_Iterator Part_Item_Iterator;
struct _Edje_Part_Data
@ -38,92 +44,109 @@ struct _Part_Item_Iterator
#define RETURN_VOID do { PROXY_UNREF(obj, pd); return; } while(0)
#define PROXY_CALL(a) ({ PROXY_REF(obj, pd); a; })
/* ugly macros to avoid code duplication */
#define PROXY_RESET(type) \
do { if (_ ## type ## _proxy) \
{ \
eo_del_intercept_set(_ ## type ## _proxy, NULL); \
eo_unref(_ ## type ## _proxy); \
_ ## type ## _proxy = NULL; \
} } while (0)
#define PROXY_DEL_CB(type) \
static void \
type ## _del_cb(Eo *proxy) \
{ \
if (_ ## type ## _proxy) \
{ \
eo_del_intercept_set(proxy, NULL); \
eo_unref(proxy); \
return; \
} \
if (eo_parent_get(proxy)) \
{ \
eo_ref(proxy); \
eo_parent_set(proxy, NULL); \
} \
_ ## type ## _proxy = proxy; \
}
#define PROXY_IMPLEMENTATION(type, TYPE, datatype) \
Eo * \
_edje_ ## type ## _internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp) \
{ \
Edje_Box_Data *pd; \
Eo *proxy; \
\
pd = eo_data_scope_get(_ ## type ## _proxy, TYPE ## _CLASS); \
if (!pd) \
{ \
if (_ ## type ## _proxy) \
{ \
ERR("Found invalid handle for efl_part. Reset."); \
_ ## type ## _proxy = NULL; \
} \
return eo_add(TYPE ## _CLASS, ed->obj, \
_edje_real_part_set(eo_self, ed, rp, rp->part->name)); \
} \
\
if (EINA_UNLIKELY(pd->temp)) \
{ \
/* warn about misuse, since non-implemented functions may trigger this \
* misuse by accident. */ \
ERR("Misuse of efl_part detected. Handles returned by efl_part() are " \
"valid for a single function call! Did you call a non implemented " \
"function?"); \
} \
proxy = _ ## type ## _proxy; \
_ ## type ## _proxy = NULL; \
_edje_real_part_set(proxy, ed, rp, rp->part->name); \
return proxy; \
} \
\
EOLIAN static void \
_efl_canvas_layout_internal_ ## type ## _efl_canvas_layout_internal_real_part_set(Eo *obj, datatype *pd, void *ed, void *rp, const char *part) \
{ \
pd->ed = ed; \
pd->rp = rp; \
pd->part = part; \
pd->temp = 1; \
eo_del_intercept_set(obj, type ## _del_cb); \
eo_parent_set(obj, pd->ed->obj); \
} \
\
EOLIAN static Eo_Base * \
_efl_canvas_layout_internal_ ## type ## _eo_base_finalize(Eo *obj, datatype *pd) \
{ \
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL); \
return eo_finalize(eo_super(obj, TYPE ## _CLASS)); \
}
static Eo *_box_proxy = NULL;
static Eo *_table_proxy = NULL;
static Eo *_swallow_proxy = NULL;
void
_edje_internal_proxy_shutdown(void)
{
if (_box_proxy)
{
eo_del_intercept_set(_box_proxy, NULL);
eo_unref(_box_proxy);
_box_proxy = NULL;
}
if (_table_proxy)
{
eo_del_intercept_set(_table_proxy, NULL);
eo_unref(_table_proxy);
_table_proxy = NULL;
}
PROXY_RESET(box);
PROXY_RESET(table);
PROXY_RESET(swallow);
}
static void
_box_del_cb(Eo *proxy)
{
if (_box_proxy)
{
eo_del_intercept_set(proxy, NULL);
eo_unref(proxy);
return;
}
if (eo_parent_get(proxy))
{
eo_ref(proxy);
eo_parent_set(proxy, NULL);
}
_box_proxy = proxy;
}
PROXY_DEL_CB(box)
PROXY_DEL_CB(table)
PROXY_DEL_CB(swallow)
Eo *
_edje_box_internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp)
{
Edje_Box_Data *pd;
Eo *proxy;
PROXY_IMPLEMENTATION(box, BOX, Edje_Box_Data)
PROXY_IMPLEMENTATION(table, TABLE, Edje_Table_Data)
PROXY_IMPLEMENTATION(swallow, SWALLOW, Edje_Swallow_Data)
pd = eo_data_scope_get(_box_proxy, BOX_CLASS);
if (!pd)
{
if (_box_proxy)
{
ERR("Found invalid handle for efl_part. Reset.");
_box_proxy = NULL;
}
return eo_add
(BOX_CLASS, ed->obj,
efl_canvas_layout_internal_box_real_part_set(eo_self, ed, rp, rp->part->name));
}
if (EINA_UNLIKELY(pd->temp))
{
/* warn about misuse, since non-implemented functions may trigger this
* misuse by accident. */
ERR("Misuse of efl_part detected. Handles returned by efl_part() are "
"valid for a single function call! Did you call a non implemented "
"function?");
}
proxy = _box_proxy;
_box_proxy = NULL;
efl_canvas_layout_internal_box_real_part_set(proxy, ed, rp, rp->part->name);
return proxy;
}
#undef PROXY_RESET
#undef PROXY_DEL_CB
#undef PROXY_IMPLEMENTATION
EOLIAN static void
_efl_canvas_layout_internal_box_real_part_set(Eo *obj, Edje_Box_Data *pd, void *ed, void *rp, const char *part)
{
pd->ed = ed;
pd->rp = rp;
pd->part = part;
pd->temp = 1;
eo_del_intercept_set(obj, _box_del_cb);
eo_parent_set(obj, pd->ed->obj);
}
EOLIAN static Eo_Base *
_efl_canvas_layout_internal_box_eo_base_finalize(Eo *obj, Edje_Box_Data *pd)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL);
return eo_finalize(eo_super(obj, BOX_CLASS));
}
/* Legacy features */
@ -313,76 +336,6 @@ _efl_canvas_layout_internal_box_efl_pack_linear_pack_direction_get(Eo *obj, Edje
RETURN_VAL(EFL_ORIENT_NONE);
}
/* Table */
static void
_table_del_cb(Eo *proxy)
{
if (_table_proxy)
{
eo_del_intercept_set(proxy, NULL);
eo_unref(proxy);
return;
}
if (eo_parent_get(proxy))
{
eo_ref(proxy);
eo_parent_set(proxy, NULL);
}
_table_proxy = proxy;
}
Eo *
_edje_table_internal_proxy_get(Edje_Object *obj EINA_UNUSED, Edje *ed, Edje_Real_Part *rp)
{
Edje_Box_Data *pd;
Eo *proxy;
pd = eo_data_scope_get(_table_proxy, TABLE_CLASS);
if (!pd)
{
if (_table_proxy)
{
ERR("Found invalid handle for efl_part. Reset.");
_table_proxy = NULL;
}
return eo_add
(TABLE_CLASS, ed->obj,
efl_canvas_layout_internal_table_real_part_set(eo_self, ed, rp, rp->part->name));
}
if (EINA_UNLIKELY(pd->temp))
{
/* warn about misuse, since non-implemented functions may trigger this
* misuse by accident. */
ERR("Misuse of efl_part detected. Handles returned by efl_part() are "
"valid for a single function call! Did you call a non implemented "
"function?");
}
proxy = _table_proxy;
_table_proxy = NULL;
efl_canvas_layout_internal_table_real_part_set(proxy, ed, rp, rp->part->name);
return proxy;
}
EOLIAN static void
_efl_canvas_layout_internal_table_real_part_set(Eo *obj EINA_UNUSED, Edje_Table_Data *pd, void *ed, void *rp, const char *part)
{
pd->ed = ed;
pd->rp = rp;
pd->part = part;
pd->temp = 1;
eo_del_intercept_set(obj, _table_del_cb);
eo_parent_set(obj, pd->ed->obj);
}
EOLIAN static Eo_Base *
_efl_canvas_layout_internal_table_eo_base_finalize(Eo *obj, Edje_Table_Data *pd)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(pd->rp && pd->ed && pd->part, NULL);
return eo_finalize(eo_super(obj, TABLE_CLASS));
}
EOLIAN static Eina_Iterator *
_efl_canvas_layout_internal_table_efl_container_content_iterate(Eo *obj, Edje_Table_Data *pd)
{
@ -546,6 +499,29 @@ _efl_canvas_layout_internal_table_efl_pack_grid_grid_position_get(Eo *obj, Edje_
RETURN_VAL(ret);
}
/* Swallow parts */
EOLIAN static Efl_Gfx *
_efl_canvas_layout_internal_swallow_efl_container_content_get(Eo *obj, Edje_Swallow_Data *pd)
{
RETURN_VAL(_edje_efl_container_content_get(pd->ed, pd->part));
}
EOLIAN static Eina_Bool
_efl_canvas_layout_internal_swallow_efl_container_content_set(Eo *obj, Edje_Swallow_Data *pd, Efl_Gfx *content)
{
RETURN_VAL(_edje_efl_container_content_set(pd->ed, pd->part, content));
}
EOLIAN static Efl_Gfx *
_efl_canvas_layout_internal_swallow_efl_container_content_unset(Eo *obj, Edje_Swallow_Data *pd)
{
Efl_Gfx *content = _edje_efl_container_content_get(pd->ed, pd->part);
if (!content) RETURN_VAL(NULL);
PROXY_CALL(efl_content_remove(obj, content));
RETURN_VAL(content);
}
/* Legacy API implementation */
#ifdef DEGUG
@ -681,5 +657,7 @@ edje_object_part_table_clear(Edje_Object *obj, const char *part, Eina_Bool clear
return efl_pack_unpack_all(table);
}
#include "efl_canvas_layout_internal.eo.c"
#include "efl_canvas_layout_internal_box.eo.c"
#include "efl_canvas_layout_internal_table.eo.c"
#include "efl_canvas_layout_internal_swallow.eo.c"

View File

@ -2000,9 +2000,6 @@ class Edje.Object (Evas.Smart.Clipped, Efl.File, Efl.Container, Efl.Part)
Efl.File.file.get;
Efl.File.mmap.set;
Efl.File.mmap.get;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
Efl.Container.content_remove;
Efl.Container.content_part_name.get;
Efl.Part.part;

View File

@ -2959,6 +2959,11 @@ Eina_Bool _edje_part_table_unpack(Edje *ed, const char *part, Evas_Object *child
Eina_Bool _edje_part_table_col_row_size_get(Edje *ed, const char *part, int *cols, int *rows);
Eina_Bool _edje_part_table_clear(Edje *ed, const char *part, Eina_Bool clear);
/* part containers: swallow */
Eo *_edje_swallow_internal_proxy_get(Edje_Object *obj, Edje *ed, Edje_Real_Part *rp);
Efl_Gfx *_edje_efl_container_content_get(Edje *ed, const char *part);
Eina_Bool _edje_efl_container_content_set(Edje *ed, const char *part, Efl_Gfx *obj_swallow);
void _edje_internal_proxy_shutdown(void);
#ifdef HAVE_LIBREMIX

View File

@ -3511,9 +3511,8 @@ _edje_object_text_markup_filter_callback_del_full(Eo *obj EINA_UNUSED, Edje *ed,
return NULL;
}
EOLIAN Eina_Bool
_edje_object_efl_container_content_set(Eo *obj EINA_UNUSED, Edje *ed,
const char *part, Efl_Gfx *obj_swallow)
Eina_Bool
_edje_efl_container_content_set(Edje *ed, const char *part, Efl_Gfx *obj_swallow)
{
Edje_Real_Part *rp, *rpcur;
Edje_User_Defined *eud = NULL;
@ -3872,8 +3871,8 @@ _edje_object_efl_container_content_remove(Eo *obj EINA_UNUSED, Edje *ed, Evas_Ob
return EINA_TRUE;
}
EOLIAN Efl_Gfx *
_edje_object_efl_container_content_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part)
Efl_Gfx *
_edje_efl_container_content_get(Edje *ed, const char *part)
{
Edje_Real_Part *rp;
@ -3896,21 +3895,6 @@ _edje_object_efl_container_content_get(Eo *obj EINA_UNUSED, Edje *ed, const char
return rp->typedata.swallow->swallowed_object;
}
/* new in eo */
EOLIAN Efl_Gfx *
_edje_object_efl_container_content_unset(Eo *obj, Edje *ed EINA_UNUSED, const char *part)
{
Efl_Gfx *content;
content = efl_content_get(obj, part);
if (!content) return NULL;
if (efl_content_remove(obj, content))
return content;
return NULL;
}
/* new in eo */
EOLIAN const char *
_edje_object_efl_container_content_part_name_get(Eo *obj EINA_UNUSED, Edje *ed EINA_UNUSED, Efl_Gfx *content)
@ -3940,6 +3924,8 @@ _edje_object_efl_part_part(Eo *obj, Edje *ed, const char *part)
return _edje_box_internal_proxy_get(obj, ed, rp);
else if (rp->part->type == EDJE_PART_TYPE_TABLE)
return _edje_table_internal_proxy_get(obj, ed, rp);
else if (rp->part->type == EDJE_PART_TYPE_SWALLOW)
return _edje_swallow_internal_proxy_get(obj, ed, rp);
else return NULL; /* FIXME/TODO: text & others (color, ...) */
}
@ -6822,7 +6808,7 @@ _edje_part_mask_flags_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Evas_Event_F
EAPI Eina_Bool
edje_object_part_swallow(Edje_Object *obj, const char *part, Evas_Object *obj_swallow)
{
return efl_content_set(obj, part, obj_swallow);
return efl_content_set(efl_part(obj, part), obj_swallow);
}
EAPI void
@ -6834,7 +6820,7 @@ edje_object_part_unswallow(Edje_Object *obj, Evas_Object *obj_swallow)
EAPI Evas_Object *
edje_object_part_swallow_get(const Edje_Object *obj, const char *part)
{
return efl_content_get(obj, part);
return efl_content_get(efl_part(obj, part));
}
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/

View File

@ -0,0 +1,15 @@
interface Efl.Canvas.Layout_Internal ()
{
[[Internal APIs used by Edje part objects.]]
eo_prefix: _edje;
methods {
@property real_part @protected {
set {}
values {
ed: void*;
rp: void*;
part: const(char)*;
}
}
}
}

View File

@ -1,23 +1,14 @@
class Efl.Canvas.Layout_Internal.Box (Eo.Base, Efl.Pack.Linear)
class Efl.Canvas.Layout_Internal.Box (Eo.Base, Efl.Canvas.Layout_Internal, Efl.Pack.Linear)
{
[[Represents a Box created as part of a layout.
Can not be deleted, this is only a representation of an internal object
of an EFL layout.
Its lifetime is limited to one function call only, unless an extra
reference is explicitely held.
]]
data: Edje_Box_Data;
methods {
@property real_part @protected {
set {}
values {
ed: void*;
rp: void*;
part: const(char)*;
}
}
}
implements {
Eo.Base.finalize;
Efl.Canvas.Layout_Internal.real_part.set;
Efl.Container.content_iterate;
Efl.Container.content_count;
Efl.Container.content_remove;

View File

@ -0,0 +1,16 @@
class Efl.Canvas.Layout_Internal.Swallow (Eo.Base, Efl.Canvas.Layout_Internal, Efl.Container)
{
[[Represents a SWALLOW part of an Edje object.
Its lifetime is limited to one function call only, unless an extra
reference is explicitely held.
]]
data: Edje_Swallow_Data;
implements {
Eo.Base.finalize;
Efl.Canvas.Layout_Internal.real_part.set;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
}
}

View File

@ -1,4 +1,4 @@
class Efl.Canvas.Layout_Internal.Table (Eo.Base, Efl.Pack.Grid)
class Efl.Canvas.Layout_Internal.Table (Eo.Base, Efl.Canvas.Layout_Internal, Efl.Pack.Grid)
{
[[Represents a Table created as part of a layout.
@ -6,18 +6,9 @@ class Efl.Canvas.Layout_Internal.Table (Eo.Base, Efl.Pack.Grid)
of an EFL layout.
]]
data: Edje_Table_Data;
methods {
@property real_part @protected {
set {}
values {
ed: void*;
rp: void*;
part: const(char)*;
}
}
}
implements {
Eo.Base.finalize;
Efl.Canvas.Layout_Internal.real_part.set;
Efl.Container.content_iterate;
Efl.Container.content_count;
Efl.Container.content_remove;

View File

@ -4,19 +4,6 @@ interface Efl.Container (Efl.Gfx)
eo_prefix: efl_content;
event_prefix: efl_container;
methods {
@property content {
[[Swallowed sub-object contained in this object.]]
set {
return: bool;
}
get {}
keys {
part: const(char)*; [[the part in which to swallow the object]]
}
values {
content: Efl.Gfx; [[the object to swallow.]]
}
}
@property content_part_name {
[[The name of the part under which an object is swallowed.]]
get {}
@ -27,11 +14,18 @@ interface Efl.Container (Efl.Gfx)
name: const(char)*;
}
}
content_unset {
[[Unswallow the object in the given part of the container and return it.]]
params {
@in name: const(char)* @nullable;
@property content {
[[Swallowed sub-object contained in this object.]]
set {
return: bool;
}
get {}
values {
content: Efl.Gfx; [[the object to swallow.]]
}
}
content_unset {
[[Unswallow the object in the current container and return it.]]
return: Efl.Gfx;
}
content_remove {

View File

@ -13,6 +13,9 @@
#include "elm_priv.h"
#include "elm_widget_ctxpopup.h"
#include "elm_ctxpopup_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_CTXPOPUP_CLASS
#define MY_CLASS_NAME "Elm_Ctxpopup"
@ -772,15 +775,12 @@ _elm_ctxpopup_elm_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
/* kind of a big and tricky override here: an internal box will hold
* the actual content. content aliases won't be of much help here */
EOLIAN static Eina_Bool
_elm_ctxpopup_efl_container_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_ctxpopup_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part, Evas_Object *content)
{
Eina_Bool int_ret = EINA_TRUE;
if ((part) && (strcmp(part, "default")))
{
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
return int_ret;
return efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
}
if (!content) return EINA_FALSE;
@ -806,30 +806,22 @@ _elm_ctxpopup_efl_container_content_set(Eo *obj, Elm_Ctxpopup_Data *sd, const ch
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_ctxpopup_efl_container_content_get(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
static Evas_Object*
_elm_ctxpopup_content_get(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
{
if ((part) && (strcmp(part, "default")))
{
Evas_Object *ret = NULL;
ret = efl_content_get(eo_super(obj, MY_CLASS), part);
return ret;
}
return efl_content_get(efl_part(eo_super(obj, MY_CLASS), part));
return sd->content;
}
EOLIAN static Evas_Object*
_elm_ctxpopup_efl_container_content_unset(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
static Evas_Object*
_elm_ctxpopup_content_unset(Eo *obj, Elm_Ctxpopup_Data *sd, const char *part)
{
Evas_Object *content = NULL;
if ((part) && (strcmp(part, "default")))
{
content = efl_content_unset(eo_super(obj, MY_CLASS), part);
return content;
}
return efl_content_unset(efl_part(eo_super(obj, MY_CLASS), part));
content = sd->content;
if (!content) return content;
@ -1131,7 +1123,7 @@ _elm_ctxpopup_evas_object_smart_add(Eo *obj, Elm_Ctxpopup_Data *priv)
(priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
/* box will be our content placeholder, thus the parent's version call */
efl_content_set(eo_super(obj, MY_CLASS), "elm.swallow.content", priv->box);
efl_content_set(efl_part(eo_super(obj, MY_CLASS), "elm.swallow.content"), priv->box);
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
@ -1482,5 +1474,15 @@ _elm_ctxpopup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Ctxpopup
return ret;
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_ctxpopup, ELM_CTXPOPUP, ELM_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_ctxpopup, ELM_CTXPOPUP, ELM_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_ctxpopup, ELM_CTXPOPUP, ELM_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, ELM_LAYOUT, Elm_Ctxpopup_Data, Elm_Part_Data)
#include "elm_ctxpopup_internal_part.eo.c"
/* Efl.Part end */
#include "elm_ctxpopup_item.eo.c"
#include "elm_ctxpopup.eo.c"

View File

@ -10,6 +10,9 @@
#include "elm_interface_fileselector.h"
#include "elm_widget_fileselector_entry.h"
#include "elm_fileselector_entry_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_FILESELECTOR_ENTRY_CLASS
#define MY_CLASS_NAME "Elm_Fileselector_Entry"
@ -230,12 +233,12 @@ _elm_fileselector_entry_elm_layout_text_get(Eo *obj, Elm_Fileselector_Entry_Data
return elm_object_text_get(sd->button);
}
EOLIAN static Eina_Bool
_elm_fileselector_entry_efl_container_content_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_fileselector_entry_content_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, Evas_Object *content)
{
if (part && strcmp(part, "button icon"))
{
return efl_content_set(eo_super(obj, MY_CLASS), part, content);
return efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
}
elm_layout_content_set(sd->button, NULL, content);
@ -243,23 +246,23 @@ _elm_fileselector_entry_efl_container_content_set(Eo *obj, Elm_Fileselector_Entr
return EINA_TRUE;
}
EOLIAN static Evas_Object *
_elm_fileselector_entry_efl_container_content_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
static Evas_Object *
_elm_fileselector_entry_content_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
{
if (part && strcmp(part, "button icon"))
{
return efl_content_get(eo_super(obj, MY_CLASS), part);
return efl_content_get(efl_part(eo_super(obj, MY_CLASS), part));
}
return elm_layout_content_get(sd->button, NULL);
}
EOLIAN static Evas_Object *
_elm_fileselector_entry_efl_container_content_unset(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
static Evas_Object *
_elm_fileselector_entry_content_unset(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
{
if (part && strcmp(part, "button icon"))
{
return efl_content_unset(eo_super(obj, MY_CLASS), part);
return efl_content_unset(efl_part(eo_super(obj, MY_CLASS), part));
}
return elm_layout_content_unset(sd->button, NULL);
@ -550,4 +553,14 @@ _elm_fileselector_entry_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
#include "elm_fileselector_entry_internal_part.eo.c"
/* Efl.Part end */
#include "elm_fileselector_entry.eo.c"

View File

@ -11,6 +11,9 @@
#include "elm_widget_naviframe.h"
#include "elm_widget_container.h"
#include "elm_naviframe_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_NAVIFRAME_CLASS
#define MY_CLASS_NAME "Elm_Naviframe"
@ -1043,8 +1046,8 @@ _elm_naviframe_elm_layout_text_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED,
/* we have to keep a "manual" set here because of the callbacks on the
* children */
EOLIAN static Eina_Bool
_elm_naviframe_efl_container_content_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_naviframe_content_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, Evas_Object *content)
{
Elm_Object_Item *it;
@ -1059,8 +1062,8 @@ _elm_naviframe_efl_container_content_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UN
return EINA_FALSE;
}
EOLIAN static Evas_Object*
_elm_naviframe_efl_container_content_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
static Evas_Object*
_elm_naviframe_content_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
@ -1069,8 +1072,8 @@ _elm_naviframe_efl_container_content_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UN
return elm_object_item_part_content_get(it, part);
}
EOLIAN static Evas_Object*
_elm_naviframe_efl_container_content_unset(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
static Evas_Object*
_elm_naviframe_content_unset(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
@ -2003,5 +2006,15 @@ _elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
return &atspi_actions[0];
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
#include "elm_naviframe_internal_part.eo.c"
/* Efl.Part end */
#include "elm_naviframe_item.eo.c"
#include "elm_naviframe.eo.c"

View File

@ -12,6 +12,9 @@
#include "elm_widget_layout.h"
#include "elm_widget_player.h"
#include "elm_player_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_PLAYER_CLASS
#define MY_CLASS_NAME "Elm_Player"
@ -576,8 +579,8 @@ _str_free(char *data)
* treating this special case here and delegating other objects to own
* layout */
EOLIAN static Eina_Bool
_elm_player_efl_container_content_set(Eo *obj, Elm_Player_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_player_content_set(Eo *obj, Elm_Player_Data *sd, const char *part, Evas_Object *content)
{
Eina_Bool int_ret = EINA_FALSE;
double pos, length;
@ -585,11 +588,11 @@ _elm_player_efl_container_content_set(Eo *obj, Elm_Player_Data *sd, const char *
if (part && strcmp(part, "video"))
{
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
return int_ret;
}
if ((!part) || (!strcmp(part, "video"))) part = "elm.swallow.content";
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
if (!_elm_video_check(content)) return EINA_FALSE;
if (sd->video == content) goto end;
@ -641,6 +644,7 @@ end:
return EINA_TRUE;
}
EOLIAN static void
_elm_player_evas_object_smart_add(Eo *obj, Elm_Player_Data *priv)
{
@ -714,8 +718,7 @@ EAPI Evas_Object *
elm_player_add(Evas_Object *parent)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
Evas_Object *obj = eo_add(MY_CLASS, parent);
return obj;
return eo_add(MY_CLASS, parent);
}
EOLIAN static Eo *
@ -747,4 +750,12 @@ _elm_player_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSE
return &atspi_actions[0];
}
/* Efl.Part implementation */
ELM_PART_OVERRIDE(elm_player, ELM_PLAYER, ELM_LAYOUT, Elm_Player_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_player, ELM_PLAYER, ELM_LAYOUT, Elm_Player_Data, Elm_Part_Data)
#include "elm_player_internal_part.eo.c"
/* End of Efl.Part */
#include "elm_player.eo.c"

View File

@ -13,6 +13,9 @@
#include "elm_popup_item.eo.h"
#include "elm_popup_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_POPUP_CLASS
#define MY_CLASS_NAME "Elm_Popup"
@ -527,7 +530,7 @@ _elm_popup_elm_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *s
{
if (sobj == it->icon)
{
efl_content_unset(VIEW(it), CONTENT_PART);
efl_content_unset(efl_part(VIEW(it), CONTENT_PART));
elm_layout_signal_emit(VIEW(it),
"elm,state,item,icon,hidden", "elm");
it->icon = NULL;
@ -672,8 +675,8 @@ _create_scroller(Evas_Object *obj)
_on_table_del, obj);
if (!sd->scroll)
{
efl_content_set(sd->content_area, CONTENT_PART, sd->tbl);
efl_content_set(sd->main_layout, CONTENT_PART, sd->content_area);
efl_content_set(efl_part(sd->content_area, CONTENT_PART), sd->tbl);
efl_content_set(efl_part(sd->main_layout, CONTENT_PART), sd->content_area);
}
//spacer
@ -789,7 +792,7 @@ _item_icon_set(Elm_Popup_Item_Data *it,
{
elm_widget_sub_object_add(WIDGET(it), it->icon);
evas_object_data_set(it->icon, "_popup_icon_parent_item", it);
efl_content_set(VIEW(it), CONTENT_PART, it->icon);
efl_content_set(efl_part(VIEW(it), CONTENT_PART), it->icon);
elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,visible", "elm");
}
else
@ -833,7 +836,7 @@ _item_icon_unset(Elm_Popup_Item_Data *it)
if (!it->icon) return NULL;
elm_widget_sub_object_del(WIDGET(it), icon);
evas_object_data_del(icon, "_popup_icon_parent_item");
efl_content_unset(VIEW(it), CONTENT_PART);
efl_content_unset(efl_part(VIEW(it), CONTENT_PART));
elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,hidden", "elm");
it->icon = NULL;
@ -1005,7 +1008,7 @@ _content_text_set(Evas_Object *obj,
else
{
if (!sd->scroll)
efl_content_set(sd->main_layout, CONTENT_PART, sd->content_area);
efl_content_set(efl_part(sd->main_layout, CONTENT_PART), sd->content_area);
else
elm_object_content_set(sd->scr, sd->content_area);
}
@ -1013,7 +1016,7 @@ _content_text_set(Evas_Object *obj,
if (sd->text_content_obj)
{
sd->text_content_obj = efl_content_unset(sd->content_area, CONTENT_PART);
sd->text_content_obj = efl_content_unset(efl_part(sd->content_area, CONTENT_PART));
evas_object_del(sd->text_content_obj);
sd->text_content_obj = NULL;
}
@ -1032,7 +1035,7 @@ _content_text_set(Evas_Object *obj,
evas_object_size_hint_align_set
(sd->text_content_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_content_set
(sd->content_area, CONTENT_PART, sd->text_content_obj);
(efl_part(sd->content_area, CONTENT_PART), sd->text_content_obj);
/* access */
if (_elm_config->access_mode)
@ -1120,7 +1123,7 @@ _title_icon_set(Evas_Object *obj,
title_visibility_current = (sd->title_text) || (sd->title_icon);
efl_content_set
(sd->main_layout, "elm.swallow.title.icon", sd->title_icon);
(efl_part(sd->main_layout, "elm.swallow.title.icon"), sd->title_icon);
if (sd->title_icon)
elm_layout_signal_emit(sd->main_layout, "elm,state,title,icon,visible", "elm");
@ -1146,13 +1149,11 @@ _content_set(Evas_Object *obj,
if (content)
{
if (!sd->scroll)
efl_content_set
(sd->main_layout, CONTENT_PART, sd->content_area);
efl_content_set(efl_part(sd->main_layout, CONTENT_PART), sd->content_area);
else
elm_object_content_set(sd->scr, sd->content_area);
efl_content_set
(sd->content_area, CONTENT_PART, content);
efl_content_set(efl_part(sd->content_area, CONTENT_PART), content);
evas_object_event_callback_add
(content, EVAS_CALLBACK_DEL, _on_content_del, obj);
@ -1208,8 +1209,7 @@ _action_button_set(Evas_Object *obj,
evas_object_event_callback_add
(sd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_size_hints_changed_cb, sd->main_layout);
efl_content_set
(sd->main_layout, "elm.swallow.action_area", sd->action_area);
efl_content_set(efl_part(sd->main_layout, "elm.swallow.action_area"), sd->action_area);
_visuals_set(obj);
}
@ -1223,8 +1223,8 @@ _action_button_set(Evas_Object *obj,
(sd->action_area, buf, sd->buttons[idx]->btn);
}
EOLIAN static Eina_Bool
_elm_popup_efl_container_content_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_popup_content_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
{
unsigned int i;
Eina_Bool ret = EINA_TRUE;
@ -1246,7 +1246,7 @@ _elm_popup_efl_container_content_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, c
_action_button_set(obj, content, i);
}
else
ret = efl_content_set(_pd->main_layout, part, content);
ret = efl_content_set(efl_part(_pd->main_layout, part), content);
elm_layout_sizing_eval(obj);
@ -1280,8 +1280,8 @@ _action_button_get(const Evas_Object *obj,
return button;
}
EOLIAN static Evas_Object*
_elm_popup_efl_container_content_get(Eo *obj, Elm_Popup_Data *_pd, const char *part)
static Evas_Object*
_elm_popup_content_get(Eo *obj, Elm_Popup_Data *_pd, const char *part)
{
Evas_Object *content = NULL;
unsigned int i;
@ -1300,7 +1300,7 @@ _elm_popup_efl_container_content_get(Eo *obj, Elm_Popup_Data *_pd, const char *p
content = _action_button_get(obj, i);
}
else
content = efl_content_get(_pd->main_layout, part);
content = efl_content_get(efl_part(_pd->main_layout, part));
if (!content)
goto err;
@ -1324,7 +1324,7 @@ _content_unset(Evas_Object *obj)
evas_object_event_callback_del
(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
content = efl_content_unset(sd->content_area, CONTENT_PART);
content = efl_content_unset(efl_part(sd->content_area, CONTENT_PART));
sd->content = NULL;
elm_layout_sizing_eval(obj);
@ -1342,14 +1342,14 @@ _title_icon_unset(Evas_Object *obj)
if (!sd->title_icon) return NULL;
icon = sd->title_icon;
efl_content_unset(sd->main_layout, "elm.swallow.title.icon");
efl_content_unset(efl_part(sd->main_layout, "elm.swallow.title.icon"));
sd->title_icon = NULL;
return icon;
}
EOLIAN static Evas_Object*
_elm_popup_efl_container_content_unset(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part)
static Evas_Object*
_elm_popup_content_unset(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part)
{
Evas_Object *content = NULL;
unsigned int i;
@ -1798,8 +1798,7 @@ _elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Obje
ELM_POPUP_ITEM_DATA_GET(eo_it, it);
if (sd->content || sd->text_content_obj)
{
prev_content =
efl_content_get(sd->content_area, CONTENT_PART);
prev_content = efl_content_get(efl_part(sd->content_area, CONTENT_PART));
evas_object_del(prev_content);
}
@ -1840,14 +1839,14 @@ _elm_popup_scrollable_set(Eo *obj, Elm_Popup_Data *pd, Eina_Bool scroll)
if (!pd->scroll)
{
efl_content_set(pd->content_area, CONTENT_PART, pd->tbl);
efl_content_set(pd->main_layout, CONTENT_PART, pd->content_area);
efl_content_set(efl_part(pd->content_area, CONTENT_PART), pd->tbl);
efl_content_set(efl_part(pd->main_layout, CONTENT_PART), pd->content_area);
if (pd->theme_scroll)
elm_layout_signal_emit(pd->content_area, "elm,scroll,disable", "elm");
}
else
{
efl_content_set(pd->main_layout, CONTENT_PART, pd->tbl);
efl_content_set(efl_part(pd->main_layout, CONTENT_PART), pd->tbl);
if (pd->theme_scroll)
elm_layout_signal_emit(pd->content_area, "elm,scroll,enable", "elm");
}
@ -1902,5 +1901,15 @@ _elm_popup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Popup_Data
return ret;
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
#include "elm_popup_internal_part.eo.c"
/* Efl.Part end */
#include "elm_popup.eo.c"
#include "elm_popup_item.eo.c"

View File

@ -10,6 +10,8 @@
#include "elm_priv.h"
#include "elm_widget_button.h"
#include "elm_widget_layout.h"
#include "elm_button_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_BUTTON_CLASS
@ -148,12 +150,12 @@ _elm_button_elm_widget_sub_object_del(Eo *obj, Elm_Button_Data *_pd EINA_UNUSED,
/* FIXME: replicated from elm_layout just because button's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
EOLIAN static Eina_Bool
_elm_button_efl_container_content_set(Eo *obj, Elm_Button_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_button_content_set(Eo *obj, Elm_Button_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
_icon_signal_emit(obj);
@ -443,4 +445,12 @@ _elm_button_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_button, ELM_BUTTON, ELM_LAYOUT, Elm_Button_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_button, ELM_BUTTON, ELM_LAYOUT, Elm_Button_Data, Elm_Part_Data)
#include "elm_button_internal_part.eo.c"
/* Efl.Part end */
#include "elm_button.eo.c"

View File

@ -82,10 +82,10 @@ class Elm.Button (Elm.Layout, Evas.Clickable_Interface,
Elm.Widget.theme_apply;
Elm.Widget.sub_object_del;
Elm.Widget.event;
Efl.Container.content.set;
Elm.Layout.text_aliases.get;
Elm.Layout.content_aliases.get;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
}

View File

@ -0,0 +1,7 @@
class Elm.Button.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
}
}

View File

@ -214,14 +214,12 @@ class Elm.Ctxpopup (Elm.Layout, Elm.Interface.Atspi_Widget_Action, Efl.Orientati
Elm.Widget.translate;
Elm.Widget.theme_apply;
Elm.Widget.event;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Elm.Layout.sub_object_add_enable;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Elm.Interface.Atspi_Accessible.state_set.get;
Efl.Orientation.orientation;
Efl.Part.part;
}
events {
dismissed;

View File

@ -0,0 +1,9 @@
class Elm.Ctxpopup.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -9,6 +9,9 @@
#include "elm_widget_dayselector.h"
#include "elm_widget_container.h"
#include "elm_dayselector_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_DAYSELECTOR_CLASS
#define MY_CLASS_NAME "Elm_Dayselector"
@ -216,8 +219,8 @@ _item_find(const Evas_Object *obj,
return NULL;
}
EOLIAN static Eina_Bool
_elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item, Evas_Object *content)
static Eina_Bool
_elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item, Evas_Object *content)
{
Eina_Bool int_ret = EINA_FALSE;
@ -239,7 +242,7 @@ _elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
{
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
int_ret = efl_content_set(eo_super(obj, MY_CLASS), buf, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), buf), content);
if (!int_ret) return EINA_FALSE;
if (!content) return EINA_TRUE; /* item deletion already handled */
@ -255,7 +258,7 @@ _elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
int_ret = efl_content_set(eo_super(obj, MY_CLASS), buf, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), buf), content);
if (!int_ret)
{
eo_unref(eo_it);
@ -298,8 +301,8 @@ _elm_dayselector_item_eo_base_constructor(Eo *eo_item, Elm_Dayselector_Item_Data
return eo_item;
}
EOLIAN static Evas_Object*
_elm_dayselector_efl_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item)
static Evas_Object*
_elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item)
{
int day;
char buf[1024];
@ -314,7 +317,7 @@ _elm_dayselector_efl_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd,
content = VIEW(it);
content = efl_content_unset(eo_super(obj, MY_CLASS), buf);
content = efl_content_unset(efl_part(eo_super(obj, MY_CLASS), buf));
if (!content) return NULL;
sd->items = eina_list_remove(sd->items, it);
@ -612,6 +615,15 @@ _elm_dayselector_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
#include "elm_dayselector_internal_part.eo.c"
/* Efl.Part end */
#include "elm_dayselector.eo.c"
#include "elm_dayselector_item.eo.c"

View File

@ -155,9 +155,8 @@ class Elm.Dayselector (Elm.Layout)
Elm.Widget.theme_apply;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.translate;
Efl.Container.content_unset;
Efl.Container.content.set;
Elm.Layout.sizing_eval;
Efl.Part.part;
}
events {
dayselector,changed;

View File

@ -0,0 +1,8 @@
class Elm.Dayselector.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content_unset;
}
}

View File

@ -12,6 +12,9 @@
#include "elm_priv.h"
#include "elm_widget_entry.h"
#include "elm_entry_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_ENTRY_CLASS
#define MY_CLASS_NAME "Elm_Entry"
@ -3048,11 +3051,11 @@ _elm_entry_elm_layout_signal_callback_del(Eo *obj, Elm_Entry_Data *sd, const cha
return data;
}
EOLIAN static Eina_Bool
_elm_entry_efl_container_content_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_entry_content_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
/* too bad entry does not follow the pattern
@ -3066,11 +3069,11 @@ _elm_entry_efl_container_content_set(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, c
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_entry_efl_container_content_unset(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *part)
static Evas_Object*
_elm_entry_content_unset(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, const char *part)
{
Evas_Object *ret = NULL;
ret = efl_content_unset(eo_super(obj, MY_CLASS), part);
ret = efl_content_unset(efl_part(eo_super(obj, MY_CLASS), part));
if (!ret) return NULL;
/* too bad entry does not follow the pattern
@ -5927,4 +5930,13 @@ _elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Entry_Data *sd)
return ret ? strdup(ret) : NULL;
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
#include "elm_entry_internal_part.eo.c"
/* Efl.Part end */
#include "elm_entry.eo.c"

View File

@ -950,8 +950,6 @@ class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface,
Elm.Widget.disable;
Elm.Widget.sub_object_del;
Elm.Widget.focus_next_manager_is;
Efl.Container.content_unset;
Efl.Container.content.set;
Elm.Layout.theme_enable;
Elm.Layout.sizing_eval;
Elm.Layout.text.get;
@ -990,6 +988,7 @@ class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface,
Elm.Interface.Atspi.Text.Editable.paste;
Efl.File.file.set;
Efl.File.file.get;
Efl.Part.part;
}
events {
activated;

View File

@ -0,0 +1,8 @@
class Elm.Entry.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content_unset;
}
}

View File

@ -13,9 +13,6 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm.Interface.Fileselector,
Elm.Widget.focus_next;
Elm.Widget.disable;
Elm.Widget.focus_direction_manager_is;
Efl.Container.content.get;
Efl.Container.content_unset;
Efl.Container.content.set;
Elm.Layout.text.set;
Elm.Layout.text.get;
Elm.Layout.sizing_eval;
@ -24,6 +21,7 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm.Interface.Fileselector,
Elm.Interface.Fileselector.is_save;
Elm.Interface.Fileselector.path;
Elm.Interface.Fileselector.expandable;
Efl.Part.part;
}
events {
changed;

View File

@ -0,0 +1,9 @@
class Elm.Fileselector.Entry.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -9,6 +9,9 @@
#include "elm_widget_flip.h"
#include "elm_widget_container.h"
#include "elm_flip_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_FLIP_CLASS
#define MY_CLASS_NAME "Elm_Flip"
@ -1770,8 +1773,8 @@ _flip_content_unset(Evas_Object *obj,
return content;
}
EOLIAN static Eina_Bool
_elm_flip_efl_container_content_set(Eo *obj, Elm_Flip_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_flip_content_set(Eo *obj, Elm_Flip_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
{
if (!part || !strcmp(part, "front"))
return _flip_content_set(obj, content, EINA_TRUE);
@ -1780,8 +1783,8 @@ _elm_flip_efl_container_content_set(Eo *obj, Elm_Flip_Data *_pd EINA_UNUSED, con
return EINA_FALSE;
}
EOLIAN static Evas_Object*
_elm_flip_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Flip_Data *sd, const char *part)
static Evas_Object*
_elm_flip_content_get(Eo *obj EINA_UNUSED, Elm_Flip_Data *sd, const char *part)
{
if (!part || !strcmp(part, "front"))
return sd->front.content;
@ -1790,8 +1793,8 @@ _elm_flip_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Flip_Data *sd, cons
return NULL;
}
EOLIAN static Evas_Object*
_elm_flip_efl_container_content_unset(Eo *obj EINA_UNUSED, Elm_Flip_Data *_pd EINA_UNUSED, const char *part)
static Evas_Object*
_elm_flip_content_unset(Eo *obj EINA_UNUSED, Elm_Flip_Data *_pd EINA_UNUSED, const char *part)
{
if (!part || !strcmp(part, "front"))
return _flip_content_unset(obj, EINA_TRUE);
@ -2066,4 +2069,14 @@ _elm_flip_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_IMPLEMENT(elm_flip, ELM_FLIP, Elm_Flip_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_flip, ELM_FLIP, Elm_Flip_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_flip, ELM_FLIP, Elm_Flip_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_flip, ELM_FLIP, Elm_Flip_Data, Elm_Part_Data)
#include "elm_flip_internal_part.eo.c"
/* Efl.Part end */
#include "elm_flip.eo.c"

View File

@ -33,7 +33,7 @@ enum Elm.Flip.Direction
right [[Allows interaction with the right portion of the widget]]
}
class Elm.Flip (Elm.Widget, Efl.Container)
class Elm.Flip (Elm.Widget, Efl.Part)
{
legacy_prefix: elm_flip;
eo_prefix: elm_obj_flip;
@ -240,9 +240,7 @@ class Elm.Flip (Elm.Widget, Efl.Container)
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_next;
Elm.Widget.sub_object_del;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Efl.Part.part;
}
events {
animate,begin;

View File

@ -0,0 +1,10 @@
class Elm.Flip.Internal.Part (Eo.Base, Efl.Container)
{
data: Elm_Part_Data;
implements {
Eo.Base.destructor;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -12,6 +12,9 @@
#include "elm_priv.h"
#include "elm_widget_hover.h"
#include "elm_hover_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_HOVER_CLASS
#define MY_CLASS_NAME "Elm_Hover"
@ -396,8 +399,8 @@ _elm_hover_subs_del(Elm_Hover_Data *sd)
sd->smt_sub = NULL;
}
EOLIAN static Eina_Bool
_elm_hover_efl_container_content_set(Eo *obj, Elm_Hover_Data *sd, const char *swallow, Evas_Object *content)
static Eina_Bool
_elm_hover_content_set(Eo *obj, Elm_Hover_Data *sd, const char *swallow, Evas_Object *content)
{
Eina_Bool int_ret;
@ -435,7 +438,7 @@ _elm_hover_efl_container_content_set(Eo *obj, Elm_Hover_Data *sd, const char *sw
}
}
int_ret = efl_content_set(eo_super(obj, MY_CLASS), swallow, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), swallow), content);
if (!int_ret) return EINA_FALSE;
if (strstr(swallow, "elm.swallow.slot."))
@ -455,36 +458,26 @@ end:
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_hover_efl_container_content_get(Eo *obj, Elm_Hover_Data *sd, const char *swallow)
static Evas_Object*
_elm_hover_content_get(Eo *obj, Elm_Hover_Data *sd, const char *swallow)
{
Evas_Object *ret;
ret = NULL;
if (!swallow) return ret;
if (!strcmp(swallow, "smart"))
ret = efl_content_get(eo_super(obj, MY_CLASS), sd->smt_sub->swallow);
else
ret = efl_content_get(eo_super(obj, MY_CLASS), swallow);
return ret;
}
EOLIAN static Evas_Object*
_elm_hover_efl_container_content_unset(Eo *obj, Elm_Hover_Data *sd, const char *swallow)
{
Evas_Object *ret = NULL;
if (!swallow) return NULL;
if (!strcmp(swallow, "smart"))
ret = efl_content_unset
(eo_super(obj, MY_CLASS), sd->smt_sub->swallow);
return efl_content_get(efl_part(eo_super(obj, MY_CLASS), sd->smt_sub->swallow));
else
ret = efl_content_unset
(eo_super(obj, MY_CLASS), swallow);
return ret;
return efl_content_get(efl_part(eo_super(obj, MY_CLASS), swallow));
}
static Evas_Object*
_elm_hover_content_unset(Eo *obj, Elm_Hover_Data *sd, const char *swallow)
{
if (!swallow) return NULL;
if (!strcmp(swallow, "smart"))
return efl_content_unset(efl_part(eo_super(obj, MY_CLASS), sd->smt_sub->swallow));
else
return efl_content_unset(efl_part(eo_super(obj, MY_CLASS), swallow));
}
static void
@ -850,4 +843,14 @@ _elm_hover_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
return &atspi_actions[0];
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
#include "elm_hover_internal_part.eo.c"
/* Efl.Part end */
#include "elm_hover.eo.c"

View File

@ -72,12 +72,10 @@ class Elm.Hover (Elm.Layout, Evas.Clickable_Interface, Elm.Interface.Atspi_Widge
Elm.Widget.focus_direction_manager_is;
Elm.Widget.focus_next_manager_is;
Elm.Widget.sub_object_del;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Elm.Layout.sizing_eval;
Elm.Layout.content_aliases.get;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
events {
smart,changed;

View File

@ -0,0 +1,9 @@
class Elm.Hover.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -137,29 +137,24 @@ _elm_inwin_activate(Eo *obj, void *_pd EINA_UNUSED)
}
EAPI void
elm_win_inwin_content_set(Evas_Object *obj,
Evas_Object *content)
elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
{
ELM_INWIN_CHECK(obj);
efl_content_set(obj, NULL, content);
efl_content_set(obj, content);
}
EAPI Evas_Object *
elm_win_inwin_content_get(const Evas_Object *obj)
{
ELM_INWIN_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_get((Eo *)obj, NULL);
return ret;
return efl_content_get(obj);
}
EAPI Evas_Object *
elm_win_inwin_content_unset(Evas_Object *obj)
{
ELM_INWIN_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_unset(obj, NULL);
return ret;
return efl_content_unset(obj);
}
static void

View File

@ -28,5 +28,4 @@ class Elm.Inwin (Elm.Layout)
Elm.Layout.content_aliases.get;
Elm.Layout.sizing_eval;
}
}

View File

@ -10,6 +10,9 @@
#include "elm_priv.h"
#include "elm_widget_layout.h"
#include "elm_layout_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_LAYOUT_CLASS
#define MY_CLASS_NAME "Elm_Layout"
@ -975,13 +978,12 @@ elm_layout_content_set(Evas_Object *obj,
Evas_Object *content)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
Eina_Bool ret = EINA_FALSE;
ret = efl_content_set(obj, swallow, content);
return ret;
return efl_content_set(efl_part(obj, swallow), content);
}
EOLIAN static Eina_Bool
_elm_layout_efl_container_content_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_layout_content_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, Evas_Object *content)
{
Elm_Layout_Sub_Object_Data *sub_d;
const Eina_List *l;
@ -1053,14 +1055,12 @@ elm_layout_content_get(const Evas_Object *obj,
const char *swallow)
{
ELM_LAYOUT_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_get((Eo *) obj, swallow);
return ret;
return efl_content_get(efl_part(obj, swallow));
}
EOLIAN static Evas_Object*
_elm_layout_efl_container_content_get(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part)
static Evas_Object*
_elm_layout_content_get(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part)
{
const Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
@ -1074,6 +1074,7 @@ _elm_layout_efl_container_content_get(Eo *obj, Elm_Layout_Smart_Data *sd, const
{
if (sub_d->type == SWALLOW)
return sub_d->obj;
/* FIXME: Implement as efl_part */
if ((sub_d->type == TABLE_PACK) || _sub_box_is(sub_d))
return _elm_layout_pack_proxy_get(obj, sub_d->obj, sub_d->part);
}
@ -1084,7 +1085,7 @@ _elm_layout_efl_container_content_get(Eo *obj, Elm_Layout_Smart_Data *sd, const
if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_FALSE))
return NULL;
return efl_content_get(wd->resize_obj, part);
return efl_content_get(efl_part(wd->resize_obj, part));
}
EAPI Evas_Object *
@ -1093,12 +1094,12 @@ elm_layout_content_unset(Evas_Object *obj,
{
ELM_LAYOUT_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_unset(obj, swallow);
ret = efl_content_unset(efl_part(obj, swallow));
return ret;
}
EOLIAN static Evas_Object*
_elm_layout_efl_container_content_unset(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part)
static Evas_Object*
_elm_layout_content_unset(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part)
{
Elm_Layout_Sub_Object_Data *sub_d;
const Eina_List *l;
@ -1135,6 +1136,24 @@ _elm_layout_efl_container_content_unset(Eo *obj, Elm_Layout_Smart_Data *sd, cons
return NULL;
}
EOLIAN static Eina_Bool
_elm_layout_efl_container_content_set(Eo *obj, Elm_Layout_Smart_Data *sd, Evas_Object *content)
{
return _elm_layout_content_set(obj, sd, NULL, content);
}
EOLIAN static Evas_Object*
_elm_layout_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Layout_Smart_Data *sd)
{
return _elm_layout_content_get(obj, sd, NULL);
}
EOLIAN static Evas_Object*
_elm_layout_efl_container_content_unset(Eo *obj, Elm_Layout_Smart_Data *sd)
{
return _elm_layout_content_unset(obj, sd, NULL);
}
EOLIAN static Eina_Bool
_elm_layout_efl_container_content_remove(Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED,
Efl_Gfx *content)
@ -1899,6 +1918,8 @@ EOLIAN static void _elm_layout_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Legacy APIs */
EAPI Eina_Bool
@ -1916,7 +1937,7 @@ elm_layout_file_get(Eo *obj, const char **file, const char **group)
EAPI Eina_Bool
elm_layout_box_append(Elm_Layout *obj, const char *part, Evas_Object *child)
{
Eo *box = efl_content_get(obj, part);
Eo *box = efl_content_get(efl_part(obj, part));
if (!box) return EINA_FALSE;
efl_pack(box, child);
return EINA_TRUE;
@ -1925,7 +1946,7 @@ elm_layout_box_append(Elm_Layout *obj, const char *part, Evas_Object *child)
EAPI Eina_Bool
elm_layout_box_prepend(Elm_Layout *obj, const char *part, Evas_Object *child)
{
Eo *box = efl_content_get(obj, part);
Eo *box = efl_content_get(efl_part(obj, part));
if (!box) return EINA_FALSE;
efl_pack_begin(box, child);
return EINA_TRUE;
@ -1934,13 +1955,13 @@ elm_layout_box_prepend(Elm_Layout *obj, const char *part, Evas_Object *child)
EAPI Eina_Bool
elm_layout_box_insert_before(Elm_Layout *obj, const char *part, Evas_Object *child, const Evas_Object *reference)
{
return efl_pack_before(efl_content_get(obj, part), child, reference);
return efl_pack_before(efl_content_get(efl_part(obj, part)), child, reference);
}
EAPI Eina_Bool
elm_layout_box_insert_at(Elm_Layout *obj, const char *part, Evas_Object *child, unsigned int pos)
{
Eo *box = efl_content_get(obj, part);
Eo *box = efl_content_get(efl_part(obj, part));
if (!box) return EINA_FALSE;
efl_pack_at(box, child, pos);
return EINA_TRUE;
@ -1949,7 +1970,7 @@ elm_layout_box_insert_at(Elm_Layout *obj, const char *part, Evas_Object *child,
EAPI Evas_Object *
elm_layout_box_remove(Elm_Layout *obj, const char *part, Evas_Object *child)
{
Eo *box = efl_content_get(obj, part);
Eo *box = efl_content_get(efl_part(obj, part));
if (!box) return NULL;
if (!efl_pack_unpack(box, child))
return NULL;
@ -1959,7 +1980,7 @@ elm_layout_box_remove(Elm_Layout *obj, const char *part, Evas_Object *child)
EAPI Eina_Bool
elm_layout_box_remove_all(Elm_Layout *obj, const char *part, Eina_Bool clear)
{
Eo *box = efl_content_get(obj, part);
Eo *box = efl_content_get(efl_part(obj, part));
if (!box) return EINA_FALSE;
if (clear)
efl_pack_clear(box);
@ -1971,7 +1992,7 @@ elm_layout_box_remove_all(Elm_Layout *obj, const char *part, Eina_Bool clear)
EAPI Eina_Bool
elm_layout_table_pack(Elm_Layout *obj, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
{
Eo *table = efl_content_get(obj, part);
Eo *table = efl_content_get(efl_part(obj, part));
if (!table) return EINA_FALSE;
efl_pack_grid(table, child, col, row, colspan, rowspan);
return EINA_TRUE;
@ -1980,7 +2001,7 @@ elm_layout_table_pack(Elm_Layout *obj, const char *part, Evas_Object *child, uns
EAPI Evas_Object *
elm_layout_table_unpack(Elm_Layout *obj, const char *part, Evas_Object *child)
{
Eo *table = efl_content_get(obj, part);
Eo *table = efl_content_get(efl_part(obj, part));
if (!table) return NULL;
if (efl_pack_unpack(table, child))
return child;
@ -1990,7 +2011,7 @@ elm_layout_table_unpack(Elm_Layout *obj, const char *part, Evas_Object *child)
EAPI Eina_Bool
elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear)
{
Eo *table = efl_content_get(obj, part);
Eo *table = efl_content_get(efl_part(obj, part));
if (!table) return EINA_FALSE;
if (clear)
efl_pack_clear(table);
@ -1999,4 +2020,14 @@ elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear)
return EINA_TRUE;
}
/* Efl.Part implementation */
ELM_PART_IMPLEMENT(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
#include "elm_layout_internal_part.eo.c"
/* Efl.Part end */
#include "elm_layout.eo.c"

View File

@ -17,7 +17,7 @@ struct Elm.Layout_Part_Alias_Description
real_part: const(char)*; [[Target part name for the alias set on Elm.Layout_Part_Proxies_Description::real_part. An example of usage would be "default" on that field, with "elm.content.swallow" on this one]]
}
class Elm.Layout (Elm.Widget, Efl.Container, Efl.File)
class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File)
{
legacy_prefix: elm_layout;
eo_prefix: elm_obj_layout;
@ -343,13 +343,14 @@ class Elm.Layout (Elm.Widget, Efl.Container, Efl.File)
Elm.Widget.disable;
Elm.Widget.sub_object_del;
Elm.Widget.on_focus;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Efl.Container.content_part_name.get;
Efl.Container.content_count;
Efl.Container.content_remove;
Efl.Container.content_iterate;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
Efl.Part.part;
}
events {
theme,changed;

View File

@ -0,0 +1,10 @@
class Elm.Layout.Internal.Part (Eo.Base, Efl.Container)
{
data: Elm_Part_Data;
implements {
Eo.Base.destructor;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -16,6 +16,8 @@
#include "../evas/canvas/evas_box.eo.h"
#include "../evas/canvas/evas_table.eo.h"
#warning TODO: Implement proper lifecycle of proxy objects (single call)
/* layout internals for box & table */
Eina_Bool _elm_layout_box_append(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, Evas_Object *child);
Eina_Bool _elm_layout_box_prepend(Eo *obj, Elm_Layout_Smart_Data *sd, const char *part, Evas_Object *child);
@ -269,7 +271,7 @@ _efl_ui_layout_internal_box_efl_pack_linear_pack_direction_get(Eo *obj EINA_UNUS
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_ORIENT_NONE);
return efl_pack_direction_get(efl_content_get(wd->resize_obj, pd->part));
return efl_pack_direction_get(efl_content_get(efl_part(wd->resize_obj, pd->part)));
}
EOLIAN static void

View File

@ -11,6 +11,9 @@
#include "elm_widget_container.h"
#include "elm_mapbuf.eo.h"
#include "elm_mapbuf_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_MAPBUF_CLASS
#define MY_CLASS_NAME "Elm_Mapbuf"
@ -54,8 +57,8 @@ _changed_size_hints_cb(void *data,
}
static void
_elm_mapbuf_content_unset(Elm_Mapbuf_Data *sd, Evas_Object *obj,
Evas_Object *content)
_elm_mapbuf_content_unset_internal(Elm_Mapbuf_Data *sd, Evas_Object *obj,
Evas_Object *content)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@ -79,7 +82,7 @@ _elm_mapbuf_elm_widget_sub_object_del(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object
if (!int_ret) return EINA_FALSE;
if (sobj == sd->content)
_elm_mapbuf_content_unset(sd, (Evas_Object *)obj, sobj);
_elm_mapbuf_content_unset_internal(sd, (Evas_Object *)obj, sobj);
return EINA_TRUE;
}
@ -190,8 +193,8 @@ _elm_mapbuf_evas_object_smart_hide(Eo *obj, Elm_Mapbuf_Data *sd)
_configure(obj);
}
EOLIAN static Eina_Bool
_elm_mapbuf_efl_container_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_mapbuf_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *part, Evas_Object *content)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@ -222,15 +225,15 @@ _elm_mapbuf_efl_container_content_set(Eo *obj, Elm_Mapbuf_Data *sd, const char *
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_mapbuf_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, const char *part)
static Evas_Object*
_elm_mapbuf_content_get(Eo *obj EINA_UNUSED, Elm_Mapbuf_Data *sd, const char *part)
{
if (part && strcmp(part, "default")) return NULL;
return sd->content;
}
EOLIAN static Evas_Object*
_elm_mapbuf_efl_container_content_unset(Eo *obj, Elm_Mapbuf_Data *sd, const char *part)
static Evas_Object*
_elm_mapbuf_content_unset(Eo *obj, Elm_Mapbuf_Data *sd, const char *part)
{
Evas_Object *content;
if (part && strcmp(part, "default")) return NULL;
@ -238,10 +241,28 @@ _elm_mapbuf_efl_container_content_unset(Eo *obj, Elm_Mapbuf_Data *sd, const char
content = sd->content;
elm_widget_sub_object_del(obj, content);
_elm_mapbuf_content_unset(sd, obj, content);
_elm_mapbuf_content_unset_internal(sd, obj, content);
return content;
}
EOLIAN static Eina_Bool
_elm_mapbuf_efl_container_content_set(Eo *obj, Elm_Mapbuf_Data *sd, Evas_Object *content)
{
return _elm_mapbuf_content_set(obj, sd, NULL, content);
}
EOLIAN static Evas_Object*
_elm_mapbuf_efl_container_content_get(Eo *obj, Elm_Mapbuf_Data *sd)
{
return _elm_mapbuf_content_get(obj, sd, NULL);
}
EOLIAN static Evas_Object*
_elm_mapbuf_efl_container_content_unset(Eo *obj, Elm_Mapbuf_Data *sd)
{
return _elm_mapbuf_content_unset(obj, sd, NULL);
}
EOLIAN static void
_elm_mapbuf_evas_object_smart_del(Eo *obj, Elm_Mapbuf_Data *priv)
{
@ -418,4 +439,14 @@ _elm_mapbuf_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_IMPLEMENT(elm_mapbuf, ELM_MAPBUF, Elm_Mapbuf_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_mapbuf, ELM_MAPBUF, Elm_Mapbuf_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_mapbuf, ELM_MAPBUF, Elm_Mapbuf_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_mapbuf, ELM_MAPBUF, Elm_Mapbuf_Data, Elm_Part_Data)
#include "elm_mapbuf_internal_part.eo.c"
/* Efl.Part end */
#include "elm_mapbuf.eo.c"

View File

@ -1,4 +1,4 @@
class Elm.Mapbuf (Elm.Widget, Efl.Container)
class Elm.Mapbuf (Elm.Widget, Efl.Container, Efl.Part)
{
legacy_prefix: elm_mapbuf;
eo_prefix: elm_private_mapbuf;
@ -140,6 +140,7 @@ class Elm.Mapbuf (Elm.Widget, Efl.Container)
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Efl.Part.part;
}
}

View File

@ -0,0 +1,10 @@
class Elm.Mapbuf.Internal.Part (Eo.Base, Efl.Container)
{
data: Elm_Part_Data;
implements {
Eo.Base.destructor;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -153,14 +153,12 @@ class Elm.Naviframe (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
Elm.Widget.translate;
Elm.Widget.theme_apply;
Elm.Widget.event;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Elm.Layout.text.set;
Elm.Layout.text.get;
Elm.Layout.signal_emit;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
events {
transition,finished;

View File

@ -0,0 +1,9 @@
class Elm.Naviframe.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -11,6 +11,9 @@
#include "elm_widget_notify.h"
#include "elm_widget_container.h"
#include "elm_notify_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_NOTIFY_CLASS
#define MY_CLASS_NAME "Elm_Notify"
@ -370,8 +373,8 @@ _elm_notify_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd,
return elm_widget_focus_direction_get(cur, base, degree, direction, direction_item, weight);
}
EOLIAN static Eina_Bool
_elm_notify_efl_container_content_set(Eo *obj, Elm_Notify_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_notify_content_set(Eo *obj, Elm_Notify_Data *sd, const char *part, Evas_Object *content)
{
if (part && strcmp(part, "default")) return EINA_FALSE;
if (sd->content == content) return EINA_TRUE;
@ -393,16 +396,16 @@ _elm_notify_efl_container_content_set(Eo *obj, Elm_Notify_Data *sd, const char *
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_notify_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, const char *part)
static Evas_Object*
_elm_notify_content_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, const char *part)
{
if (part && strcmp(part, "default")) return NULL;
return sd->content;
}
EOLIAN static Evas_Object*
_elm_notify_efl_container_content_unset(Eo *obj, Elm_Notify_Data *sd, const char *part)
static Evas_Object*
_elm_notify_content_unset(Eo *obj, Elm_Notify_Data *sd, const char *part)
{
Evas_Object *content;
@ -416,6 +419,24 @@ _elm_notify_efl_container_content_unset(Eo *obj, Elm_Notify_Data *sd, const char
return content;
}
EOLIAN static Eina_Bool
_elm_notify_efl_container_content_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *content)
{
return _elm_notify_content_set(obj, sd, NULL, content);
}
EOLIAN static Evas_Object*
_elm_notify_efl_container_content_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
return _elm_notify_content_get(obj, sd, NULL);
}
EOLIAN static Evas_Object*
_elm_notify_efl_container_content_unset(Eo *obj, Elm_Notify_Data *sd)
{
return _elm_notify_content_unset(obj, sd, NULL);
}
static void
_hide_finished_cb(void *data,
Evas_Object *obj EINA_UNUSED,
@ -693,4 +714,14 @@ _elm_notify_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_IMPLEMENT(elm_notify, ELM_NOTIFY, Elm_Notify_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_notify, ELM_NOTIFY, Elm_Notify_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_notify, ELM_NOTIFY, Elm_Notify_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_notify, ELM_NOTIFY, Elm_Notify_Data, Elm_Part_Data)
#include "elm_notify_internal_part.eo.c"
/* Efl.Part end */
#include "elm_notify.eo.c"

View File

@ -1,4 +1,4 @@
class Elm.Notify (Elm.Widget, Efl.Container)
class Elm.Notify (Elm.Widget, Efl.Container, Efl.Part)
{
legacy_prefix: elm_notify;
eo_prefix: elm_obj_notify;
@ -97,6 +97,7 @@ class Elm.Notify (Elm.Widget, Efl.Container)
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Efl.Part.part;
}
events {
block,clicked;

View File

@ -0,0 +1,10 @@
class Elm.Notify.Internal.Part (Eo.Base, Efl.Container)
{
data: Elm_Part_Data;
implements {
Eo.Base.destructor;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -12,6 +12,9 @@
#include "els_box.h"
#include "elm_panel_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_PANEL_CLASS
#define MY_CLASS_NAME "Elm_Panel"
@ -245,9 +248,8 @@ _elm_panel_elm_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(sd->event, minw, minh);
if (edje_object_part_exists
(wd->resize_obj, "elm.swallow.event"))
efl_content_set(eo_super(obj, MY_CLASS), "elm.swallow.event", sd->event);
if (edje_object_part_exists(wd->resize_obj, "elm.swallow.event"))
efl_content_set(efl_part(eo_super(obj, MY_CLASS), "elm.swallow.event"), sd->event);
}
elm_layout_sizing_eval(obj);
@ -909,8 +911,8 @@ _elm_panel_elm_widget_event(Eo *obj, Elm_Panel_Data *_pd EINA_UNUSED, Evas_Objec
return EINA_TRUE;
}
EOLIAN static Eina_Bool
_elm_panel_efl_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_panel_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Object *content)
{
if (part)
{
@ -923,7 +925,7 @@ _elm_panel_efl_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *pa
if (strcmp(part, "default"))
{
Eina_Bool int_ret = EINA_TRUE;
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
return int_ret;
}
}
@ -945,8 +947,8 @@ _elm_panel_efl_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *pa
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_panel_efl_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
static Evas_Object*
_elm_panel_content_get(Eo *obj, Elm_Panel_Data *sd, const char *part)
{
if (part)
{
@ -959,7 +961,7 @@ _elm_panel_efl_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *pa
if (strcmp(part, "default"))
{
Evas_Object *ret = NULL;
ret = efl_content_get(eo_super(obj, MY_CLASS), part);
ret = efl_content_get(efl_part(eo_super(obj, MY_CLASS), part));
return ret;
}
}
@ -967,8 +969,8 @@ _elm_panel_efl_container_content_get(Eo *obj, Elm_Panel_Data *sd, const char *pa
return sd->content;
}
EOLIAN static Evas_Object*
_elm_panel_efl_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *part)
static Evas_Object*
_elm_panel_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *part)
{
Evas_Object *ret = NULL;
@ -982,7 +984,7 @@ _elm_panel_efl_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *
}
if (strcmp(part, "default"))
{
ret = efl_content_unset(eo_super(obj, MY_CLASS), part);
ret = efl_content_unset(efl_part(eo_super(obj, MY_CLASS), part));
return ret;
}
}
@ -1039,7 +1041,7 @@ _elm_panel_evas_object_smart_add(Eo *obj, Elm_Panel_Data *priv)
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(priv->event, minw, minh);
efl_content_set(eo_super(obj, MY_CLASS), "elm.swallow.event", priv->event);
efl_content_set(efl_part(eo_super(obj, MY_CLASS), "elm.swallow.event"), priv->event);
}
}
@ -1524,4 +1526,14 @@ _elm_panel_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
return &atspi_actions[0];
}
/* Efl.Part begin */
ELM_PART_IMPLEMENT(elm_panel, ELM_PANEL, Elm_Panel_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_panel, ELM_PANEL, Elm_Panel_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_panel, ELM_PANEL, Elm_Panel_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_panel, ELM_PANEL, Elm_Panel_Data, Elm_Part_Data)
#include "elm_panel_internal_part.eo.c"
/* Efl.Part end */
#include "elm_panel.eo.c"

View File

@ -80,10 +80,8 @@ class Elm.Panel (Elm.Layout, Elm.Interface_Scrollable,
Elm.Widget.access;
Elm.Widget.event;
Elm.Widget.on_focus_region;
Efl.Container.content.get;
Efl.Container.content_unset;
Efl.Container.content.set;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
}

View File

@ -0,0 +1,10 @@
class Elm.Panel.Internal.Part (Eo.Base, Efl.Container)
{
data: Elm_Part_Data;
implements {
Eo.Base.destructor;
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -0,0 +1,120 @@
#ifndef _ELM_PART_HELPER_H
#define _ELM_PART_HELPER_H
#include "elm_layout_internal_part.eo.h"
#define ELM_PART_REF(obj, pd) do { if (!(pd->temp++)) eo_ref(obj); } while(0)
#define ELM_PART_UNREF(obj, pd) do { if (pd->temp) { if (!(--pd->temp)) eo_unref(obj); } } while(0)
#define ELM_PART_RETURN_VAL(a) do { typeof(a) _ret = a; ELM_PART_UNREF(obj, pd); return _ret; } while(0)
#define ELM_PART_RETURN_VOID do { ELM_PART_UNREF(obj, pd); return; } while(0)
#define ELM_PART_CALL(a) ({ ELM_PART_REF(obj, pd); a; })
typedef struct _Elm_Part_Data Elm_Part_Data;
struct _Elm_Part_Data
{
Eo *obj;
void *sd;
char *part;
unsigned char temp;
};
// Note: this generic implementation can be improved to support part object
// caching or something...
// Main part proxy implementation
#define ELM_PART_IMPLEMENT(type, TYPE, typedata, partdata) \
\
static EOLIAN void \
_ ## type ## _internal_part_eo_base_destructor(Eo *obj, partdata *pd) \
{ \
free(pd->part); \
eo_data_xunref(pd->obj, pd->sd, obj); \
eo_destructor(eo_super(obj, TYPE ## _INTERNAL_PART_CLASS)); \
} \
\
static EOLIAN Eo_Base * \
_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
{ \
partdata *pd; \
Eo *proxy; \
\
proxy = eo_add(TYPE ## _INTERNAL_PART_CLASS, (Eo *) obj); \
pd = eo_data_scope_get(proxy, TYPE ## _INTERNAL_PART_CLASS); \
if (pd) \
{ \
pd->obj = (Eo *) obj; \
pd->sd = eo_data_xref(pd->obj, TYPE ## _CLASS, proxy); \
pd->part = part ? strdup(part) : NULL; \
pd->temp = 1; \
} \
\
return proxy; \
}
#define ELM_PART_IMPLEMENT_CONTENT_SET(type, TYPE, typedata, partdata) \
static EOLIAN Eina_Bool \
_ ## type ## _internal_part_efl_container_content_set(Eo *obj, partdata *pd, Efl_Gfx *content) \
{ \
ELM_PART_RETURN_VAL(_ ## type ## _content_set(pd->obj, pd->sd, pd->part, content)); \
}
#define ELM_PART_IMPLEMENT_CONTENT_GET(type, TYPE, typedata, partdata) \
static EOLIAN Efl_Gfx * \
_ ## type ## _internal_part_efl_container_content_get(Eo *obj, partdata *pd) \
{ \
ELM_PART_RETURN_VAL(_ ## type ## _content_get(pd->obj, pd->sd, pd->part)); \
}
#define ELM_PART_IMPLEMENT_CONTENT_UNSET(type, TYPE, typedata, partdata) \
static EOLIAN Efl_Gfx * \
_ ## type ## _internal_part_efl_container_content_unset(Eo *obj, partdata *pd) \
{ \
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, pd->sd, pd->part)); \
}
// For widgets that inherit from something with parts (eg. from Elm.Layout)
#define ELM_PART_OVERRIDE(type, TYPE, SUPER, typedata, partdata) \
static EOLIAN Eo_Base * \
_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
{ \
partdata *pd; \
Eo *proxy; \
\
proxy = eo_add(TYPE ## _INTERNAL_PART_CLASS, (Eo *) obj); \
pd = eo_data_scope_get(proxy, SUPER ## _INTERNAL_PART_CLASS); \
if (pd) \
{ \
pd->obj = (Eo *) obj; \
pd->sd = eo_data_xref(pd->obj, SUPER ## _CLASS, proxy); \
pd->part = part ? strdup(part) : NULL; \
pd->temp = 1; \
} \
\
return proxy; \
}
#define ELM_PART_OVERRIDE_CONTENT_SET(type, TYPE, SUPER, typedata, partdata) \
static EOLIAN Eina_Bool \
_ ## type ## _internal_part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \
{ \
partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
ELM_PART_RETURN_VAL(_ ## type ## _content_set(pd->obj, pd->sd, pd->part, content)); \
}
#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, SUPER, typedata, partdata) \
static EOLIAN Efl_Gfx * \
_ ## type ## _internal_part_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED) \
{ \
partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
ELM_PART_RETURN_VAL(_ ## type ## _content_get(pd->obj, pd->sd, pd->part)); \
}
#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, SUPER, typedata, partdata) \
static EOLIAN Efl_Gfx * \
_ ## type ## _internal_part_efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED) \
{ \
partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, pd->sd, pd->part)); \
}
#endif

View File

@ -10,9 +10,9 @@ class Elm.Player (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
Evas.Object.Smart.del;
Elm.Widget.theme_apply;
Elm.Widget.event;
Efl.Container.content.set;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
events {
forward,clicked;

View File

@ -0,0 +1,7 @@
class Elm.Player.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
}
}

View File

@ -179,15 +179,13 @@ class Elm.Popup (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
Elm.Widget.translate;
Elm.Widget.sub_object_del;
Elm.Widget.event;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Elm.Layout.text.set;
Elm.Layout.text.get;
Elm.Layout.sizing_eval;
Elm.Layout.signal_emit;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Elm.Interface.Atspi_Accessible.state_set.get;
Efl.Part.part;
}
events {
block,clicked;

View File

@ -0,0 +1,9 @@
class Elm.Popup.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -11,6 +11,9 @@
#include "elm_widget_progressbar.h"
#include "elm_widget_layout.h"
#include "elm_progressbar_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_PROGRESSBAR_CLASS
#define MY_CLASS_NAME "Elm_Progressbar"
@ -174,11 +177,11 @@ _elm_progressbar_elm_widget_sub_object_del(Eo *obj, Elm_Progressbar_Data *_pd EI
/* FIXME: replicated from elm_layout just because progressbar's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
* whenever we can changed the theme API */
EOLIAN static Eina_Bool
_elm_progressbar_efl_container_content_set(Eo *obj, Elm_Progressbar_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
static Eina_Bool
_elm_progressbar_content_set(Eo *obj, Elm_Progressbar_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
if (!int_ret) return EINA_FALSE;
_icon_signal_emit(obj);
@ -649,4 +652,12 @@ _elm_progressbar_class_constructor(Eo_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
/* Efl.Part begin */
ELM_PART_OVERRIDE(elm_progressbar, ELM_PROGRESSBAR, ELM_LAYOUT, Elm_Progressbar_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_progressbar, ELM_PROGRESSBAR, ELM_LAYOUT, Elm_Progressbar_Data, Elm_Part_Data)
#include "elm_progressbar_internal_part.eo.c"
/* Efl.Part end */
#include "elm_progressbar.eo.c"

View File

@ -63,7 +63,6 @@ class Elm.Progressbar (Elm.Layout, Efl.Ui.Progress,
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.sub_object_del;
Efl.Container.content.set;
Elm.Layout.text_aliases.get;
Elm.Layout.content_aliases.get;
Elm.Layout.sizing_eval;
@ -71,6 +70,7 @@ class Elm.Progressbar (Elm.Layout, Efl.Ui.Progress,
Efl.Ui.Progress.progress_value;
Efl.Ui.Progress.unit_format;
Efl.Orientation.orientation;
Efl.Part.part;
}
events {
changed;

View File

@ -0,0 +1,7 @@
class Elm.Progressbar.Internal.Part (Elm.Layout.Internal.Part)
{
data: null;
implements {
Efl.Container.content.set;
}
}

View File

@ -12,6 +12,9 @@
#include "elm_widget_layout.h"
#include "elm_widget_scroller.h"
#include "elm_scroller_internal_part.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS ELM_SCROLLER_CLASS
#define MY_CLASS_NAME "Elm_Scroller"
@ -757,14 +760,12 @@ _loop_content_set(Evas_Object *obj, Elm_Scroller_Data *sd, Evas_Object *content)
}
}
EOLIAN static Eina_Bool
_elm_scroller_efl_container_content_set(Eo *obj, Elm_Scroller_Data *sd, const char *part, Evas_Object *content)
static Eina_Bool
_elm_scroller_content_set(Eo *obj, Elm_Scroller_Data *sd, const char *part, Evas_Object *content)
{
if (part && strcmp(part, "default"))
{
Eina_Bool int_ret = EINA_FALSE;
int_ret = efl_content_set(eo_super(obj, MY_CLASS), part, content);
return int_ret;
return efl_content_set(efl_part(eo_super(obj, MY_CLASS), part), content);
}
if (sd->content == content) return EINA_TRUE;
@ -802,27 +803,24 @@ _elm_scroller_efl_container_content_set(Eo *obj, Elm_Scroller_Data *sd, const ch
return EINA_TRUE;
}
EOLIAN static Evas_Object*
_elm_scroller_efl_container_content_get(Eo *obj, Elm_Scroller_Data *sd, const char *part)
static Evas_Object*
_elm_scroller_content_get(Eo *obj, Elm_Scroller_Data *sd, const char *part)
{
if (part && strcmp(part, "default"))
{
Evas_Object *ret = NULL;
ret = efl_content_get(eo_super(obj, MY_CLASS), part);
return ret;
return efl_content_get(efl_part(eo_super(obj, MY_CLASS), part));
}
return sd->content;
}
EOLIAN static Evas_Object*
_elm_scroller_efl_container_content_unset(Eo *obj, Elm_Scroller_Data *sd, const char *part)
static Evas_Object*
_elm_scroller_content_unset(Eo *obj, Elm_Scroller_Data *sd, const char *part)
{
Evas_Object *ret = NULL;
if (part && strcmp(part, "default"))
{
ret = efl_content_unset(eo_super(obj, MY_CLASS), part);
return ret;
return efl_content_unset(efl_part(eo_super(obj, MY_CLASS), part));
}
if (!sd->content) return NULL;
@ -1414,4 +1412,23 @@ _elm_scroller_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
return &atspi_actions[0];
}
/* Efl.Part begin */
/* FIXME: Should be OVERRIDE, but... it doesn't work (buggy scrollers in
* elm_test). Why? No idea! */
#if 0
ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
#else
ELM_PART_IMPLEMENT(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_SET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
#endif
#include "elm_scroller_internal_part.eo.c"
/* Efl.Part end */
#include "elm_scroller.eo.c"

View File

@ -72,14 +72,12 @@ class Elm.Scroller (Elm.Layout, Elm.Interface_Scrollable,
Elm.Widget.focus_direction;
Elm.Widget.sub_object_del;
Elm.Widget.event;
Efl.Container.content.get;
Efl.Container.content.set;
Efl.Container.content_unset;
Elm.Layout.sizing_eval;
Elm.Interface_Scrollable.page_size.set;
Elm.Interface_Scrollable.policy.set;
Elm.Interface_Scrollable.single_direction;
Elm.Interface.Atspi_Widget_Action.elm_actions.get;
Efl.Part.part;
}
events {
scroll,page,changed;

View File

@ -0,0 +1,10 @@
class Elm.Scroller.Internal.Part (Eo.Base, Efl.Container) // FIXME: (Elm.Layout.Internal.Part)
{
data: Elm_Part_Data; // FIXME: null;
implements {
Eo.Base.destructor; // FIXME: remove
Efl.Container.content.set;
Efl.Container.content.get;
Efl.Container.content_unset;
}
}

View File

@ -1713,7 +1713,7 @@ _elm_toolbar_item_elm_widget_item_part_content_set(Eo *eo_item EINA_UNUSED, Elm_
if (part && strcmp(part, "object") && strcmp(part, "elm.swallow.object"))
{
efl_content_set(VIEW(item), part, content);
efl_content_set(efl_part(VIEW(item), part), content);
return;
}
if (item->object == content) return;
@ -1732,13 +1732,9 @@ EOLIAN static Evas_Object *
_elm_toolbar_item_elm_widget_item_part_content_get(Eo *eo_it EINA_UNUSED, Elm_Toolbar_Item_Data *it,
const char *part)
{
Evas_Object *content;
if (part && strcmp(part, "object") && strcmp(part, "elm.swallow.object"))
{
content = efl_content_get(VIEW(it), part);
if (content) return content;
else return NULL;
return efl_content_get(efl_part(VIEW(it), part));
}
return it->object;
}
@ -1755,8 +1751,7 @@ _elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, El
if (part && strcmp(part, "object") && strcmp(part, "elm.swallow.object"))
{
o = efl_content_unset(VIEW(item), part);
return o;
return efl_content_unset(efl_part(VIEW(item), part));
}
elm_layout_content_unset(VIEW(item), "elm.swallow.object");

View File

@ -3657,7 +3657,7 @@ elm_widget_content_part_set(Evas_Object *obj,
Evas_Object *content)
{
ELM_WIDGET_CHECK(obj);
efl_content_set(obj, part, content);
efl_content_set(efl_part(obj, part), content);
}
EAPI Evas_Object *
@ -3665,9 +3665,7 @@ elm_widget_content_part_get(const Evas_Object *obj,
const char *part)
{
ELM_WIDGET_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_get((Eo *) obj, part);
return ret;
return efl_content_get(efl_part(obj, part));
}
EAPI Evas_Object *
@ -3675,9 +3673,7 @@ elm_widget_content_part_unset(Evas_Object *obj,
const char *part)
{
ELM_WIDGET_CHECK(obj) NULL;
Evas_Object *ret = NULL;
ret = efl_content_unset(obj, part);
return ret;
return efl_content_unset(efl_part(obj, part));
}
EOLIAN static void

View File

@ -393,17 +393,17 @@ START_TEST(edje_test_swallows_eoapi)
o1 = eo_add(EDJE_OBJECT_CLASS, ly);
fail_if(!efl_content_set(ly, "swallow", o1));
fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
ck_assert_ptr_eq(eo_parent_get(o1), ly);
efl_content_remove(ly, o1);
ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
fail_if(!efl_content_set(ly, "swallow", o1));
fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
ck_assert_ptr_eq(eo_parent_get(o1), ly);
o2 = eo_add(EDJE_OBJECT_CLASS, ly);
fail_if(!efl_content_set(ly, "swallow", o2));
fail_if(!efl_content_set(efl_part(ly, "swallow"), o2));
ck_assert_ptr_eq(eo_parent_get(o2), ly);
/* o1 is deleted at this point. */
ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));

View File

@ -38,17 +38,17 @@ START_TEST(elm_layout_swallows)
evas_object_show(ly);
bt = eo_add(ELM_BUTTON_CLASS, ly);
fail_if(!efl_content_set(ly, "element1", bt));
fail_if(!efl_content_set(efl_part(ly, "element1"), bt));
ck_assert_ptr_eq(eo_parent_get(bt), ly);
bt = efl_content_unset(ly, "element1");
bt = efl_content_unset(efl_part(ly, "element1"));
ck_assert_ptr_eq(eo_parent_get(bt), evas_common_evas_get(bt));
fail_if(!efl_content_set(ly, "element1", bt));
fail_if(!efl_content_set(efl_part(ly, "element1"), bt));
ck_assert_ptr_eq(eo_parent_get(bt), ly);
bt2 = eo_add(ELM_BUTTON_CLASS, ly);
fail_if(!efl_content_set(ly, "element1", bt2));
fail_if(!efl_content_set(efl_part(ly, "element1"), bt2));
ck_assert_ptr_eq(eo_parent_get(bt2), ly);
/* bt is deleted at this point. */
ck_assert_ptr_eq(eo_parent_get(bt), evas_common_evas_get(bt));