forked from enlightenment/efl
elm: Always pass valid part name inside part APIs
This affects the legacy content_set/get/unset part APIs. This should avoid some unwanted ERR messages in case an elm_object_ API is used on an elm widget that doesn't implement said API. What this does is request the widget for the name of the default part if NULL was passed in. Since some widgets are not elm_layout, they have to override the API themselves, which is why I made it an internal EO API (rather than a series of efl_isa()). In theory, part should never be NULL when reaching the internal implementation code in the widgets, at least for content. In EO, efl_part(obj, NULL) should be invalid. Ref T5629
This commit is contained in:
parent
82a955be90
commit
59081043a8
|
@ -2400,6 +2400,7 @@ ELM_PART_IMPLEMENT(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, Elm_Part_Data)
|
|||
ELM_PART_IMPLEMENT_CONTENT_SET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, Elm_Part_Data)
|
||||
ELM_PART_IMPLEMENT_CONTENT_GET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, Elm_Part_Data)
|
||||
ELM_PART_IMPLEMENT_CONTENT_UNSET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, Elm_Part_Data)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(efl_ui_flip, "front")
|
||||
#include "efl_ui_flip_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -2407,6 +2408,7 @@ ELM_PART_IMPLEMENT_CONTENT_UNSET(efl_ui_flip, EFL_UI_FLIP, Efl_Ui_Flip_Data, Elm
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_FLIP_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_flip), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_flip)
|
||||
|
||||
#include "efl_ui_flip.eo.c"
|
||||
|
|
|
@ -6660,7 +6660,7 @@ if (x < 0) { x = 0; bad = 1; } } while (0)
|
|||
|
||||
/* Efl.Part APIs */
|
||||
|
||||
#define WIN_PART_ERR(part) ERR("No such part in window: '%s'. Supported parts are: 'background'.", part);
|
||||
#define WIN_PART_ERR(part) ERR("No such part in window: '%s'. Supported parts are: 'content' and 'background'.", part);
|
||||
|
||||
static Eina_Bool
|
||||
_elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg)
|
||||
|
@ -6737,7 +6737,6 @@ static Eina_Bool
|
|||
_efl_ui_win_content_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, Eo *content)
|
||||
{
|
||||
sd->legacy.forbidden = EINA_TRUE;
|
||||
if (!part) part = "content";
|
||||
if (eina_streq(part, "content"))
|
||||
{
|
||||
if (sd->content == content) return EINA_TRUE;
|
||||
|
@ -6773,7 +6772,6 @@ static Efl_Canvas_Object *
|
|||
_efl_ui_win_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char *part)
|
||||
{
|
||||
sd->legacy.forbidden = EINA_TRUE;
|
||||
if (!part) part = "content";
|
||||
if (eina_streq(part, "content"))
|
||||
return sd->content;
|
||||
else if (eina_streq(part, "background"))
|
||||
|
@ -6909,25 +6907,26 @@ _efl_ui_win_internal_part_efl_file_file_get(Eo *obj, Elm_Part_Data *pd, const ch
|
|||
EOLIAN static Eina_Bool
|
||||
_efl_ui_win_efl_container_content_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *content)
|
||||
{
|
||||
return _efl_ui_win_content_set(obj, sd, NULL, content);
|
||||
return _efl_ui_win_content_set(obj, sd, "content", content);
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Object*
|
||||
_efl_ui_win_efl_container_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
|
||||
{
|
||||
return _efl_ui_win_content_get(obj, sd, NULL);
|
||||
return _efl_ui_win_content_get(obj, sd, "content");
|
||||
}
|
||||
|
||||
EOLIAN static Evas_Object*
|
||||
_efl_ui_win_efl_container_content_unset(Eo *obj, Efl_Ui_Win_Data *sd)
|
||||
{
|
||||
return _efl_ui_win_content_unset(obj, sd, NULL);
|
||||
return _efl_ui_win_content_unset(obj, sd, "content");
|
||||
}
|
||||
|
||||
ELM_PART_IMPLEMENT(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data)
|
||||
ELM_PART_IMPLEMENT_CONTENT_SET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data)
|
||||
ELM_PART_IMPLEMENT_CONTENT_GET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data)
|
||||
ELM_PART_IMPLEMENT_CONTENT_UNSET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(efl_ui_win, "content")
|
||||
#include "efl_ui_win_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -8110,6 +8109,7 @@ elm_win_teamwork_uri_open(Efl_Ui_Win *obj EINA_UNUSED, const char *uri EINA_UNUS
|
|||
|
||||
#define EFL_UI_WIN_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \
|
||||
EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor)
|
||||
|
||||
#include "efl_ui_win.eo.c"
|
||||
|
|
|
@ -1568,20 +1568,22 @@ _elm_ctxpopup_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Ctxpopup
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_CTXPOPUP_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup)
|
||||
|
||||
/* 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)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_ctxpopup, "default")
|
||||
#include "elm_ctxpopup_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_CTXPOPUP_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_ctxpopup), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup)
|
||||
|
||||
#include "elm_ctxpopup_item.eo.c"
|
||||
#include "elm_ctxpopup.eo.c"
|
||||
|
|
|
@ -681,6 +681,7 @@ ELM_PART_OVERRIDE_CONTENT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EL
|
|||
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_fileselector_entry, "button icon")
|
||||
#include "elm_fileselector_entry_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -688,6 +689,7 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_L
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_FILESELECTOR_ENTRY_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_fileselector_entry), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector_entry)
|
||||
|
||||
#include "elm_fileselector_entry.eo.c"
|
||||
|
|
|
@ -709,6 +709,7 @@ _elm_player_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSE
|
|||
|
||||
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)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_player, "video")
|
||||
#include "elm_player_internal_part.eo.c"
|
||||
|
||||
/* End of Efl.Part */
|
||||
|
@ -716,6 +717,7 @@ ELM_PART_OVERRIDE_CONTENT_SET(elm_player, ELM_PLAYER, ELM_LAYOUT, Elm_Player_Dat
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_PLAYER_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_player), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_player)
|
||||
|
||||
#include "elm_player.eo.c"
|
||||
|
|
|
@ -1929,6 +1929,7 @@ ELM_PART_OVERRIDE_CONTENT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data,
|
|||
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_popup, "default")
|
||||
#include "elm_popup_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -1936,6 +1937,7 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_POPUP_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_popup), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup)
|
||||
|
||||
#include "elm_popup.eo.c"
|
||||
|
|
|
@ -6054,6 +6054,7 @@ ELM_PART_OVERRIDE_CONTENT_SET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data,
|
|||
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_entry, "icon")
|
||||
#include "elm_entry_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -6061,6 +6062,7 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_ENTRY_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_entry), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_entry)
|
||||
|
||||
#include "elm_entry.eo.c"
|
||||
|
|
|
@ -2349,6 +2349,7 @@ _elm_layout_efl_part_part(const Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED,
|
|||
Elm_Part_Data *pd;
|
||||
Eo *proxy;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
||||
if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
|
||||
return NULL;
|
||||
|
||||
|
@ -2374,6 +2375,15 @@ _elm_layout_efl_part_part(const Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED,
|
|||
return proxy;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_elm_layout_default_content_part_get(const Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED)
|
||||
{
|
||||
const char *part = NULL;
|
||||
if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
|
||||
return NULL;
|
||||
return part;
|
||||
}
|
||||
|
||||
ELM_PART_IMPLEMENT_DESTRUCTOR(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)
|
||||
|
@ -2389,6 +2399,7 @@ ELM_PART_IMPLEMENT_TEXT_GET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_P
|
|||
|
||||
#define ELM_LAYOUT_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_layout), \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_layout), \
|
||||
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _elm_layout_efl_object_dbg_info_get)
|
||||
|
||||
#include "elm_layout.eo.c"
|
||||
|
|
|
@ -445,6 +445,7 @@ 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)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_mapbuf, "default")
|
||||
#include "elm_mapbuf_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -452,6 +453,7 @@ ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_mapbuf, ELM_MAPBUF, Elm_Mapbuf_Data, Elm_Pa
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_MAPBUF_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_mapbuf), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_mapbuf)
|
||||
|
||||
#include "elm_mapbuf.eo.c"
|
||||
|
|
|
@ -743,6 +743,7 @@ 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)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_notify, "default")
|
||||
#include "elm_notify_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -750,6 +751,7 @@ ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_notify, ELM_NOTIFY, Elm_Notify_Data, Elm_Pa
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_NOTIFY_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_notify), \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_notify)
|
||||
|
||||
#include "elm_notify.eo.c"
|
||||
|
|
|
@ -91,6 +91,11 @@ _ ## type ## _internal_part_efl_text_text_get(Eo *obj, partdata *pd) \
|
|||
ELM_PART_RETURN_VAL(_ ## type ## _text_get(pd->obj, pd->sd, pd->part)); \
|
||||
}
|
||||
|
||||
#define ELM_PART_CONTENT_DEFAULT_SET(type, part) \
|
||||
static const char * _ ## type ## _default_content_part_get(const Eo *obj EINA_UNUSED, void *sd EINA_UNUSED) { return part; }
|
||||
|
||||
#define ELM_PART_CONTENT_DEFAULT_OPS(type) \
|
||||
EFL_OBJECT_OP_FUNC(elm_widget_default_content_part_get, _ ## type ## _default_content_part_get)
|
||||
|
||||
// For widgets that inherit from something with parts (eg. from Elm.Layout)
|
||||
#define ELM_PART_OVERRIDE(type, TYPE, SUPER, typedata, partdata) \
|
||||
|
|
|
@ -1464,6 +1464,7 @@ ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm
|
|||
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)
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_scroller, "default")
|
||||
#include "elm_scroller_internal_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
@ -1471,6 +1472,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scro
|
|||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define ELM_SCROLLER_EXTRA_OPS \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_scroller), \
|
||||
EFL_CANVAS_GROUP_ADD_OPS(elm_scroller)
|
||||
|
||||
#include "elm_scroller.eo.c"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "elm_priv.h"
|
||||
#include "elm_widget_container.h"
|
||||
#include "elm_interface_scrollable.h"
|
||||
#include "elm_part_helper.h"
|
||||
|
||||
/* FIXME: remove this when we don't rely on evas event structs anymore */
|
||||
#define EFL_INTERNAL_UNSTABLE
|
||||
|
@ -3948,34 +3949,6 @@ _elm_widget_focus_reconfigure(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
|||
_elm_widget_focus_move_policy_reload(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_widget_content_part_set(Evas_Object *obj,
|
||||
const char *part,
|
||||
Evas_Object *content)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj);
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return;
|
||||
efl_content_set(efl_part(obj, part), content);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_widget_content_part_get(const Evas_Object *obj,
|
||||
const char *part)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj) NULL;
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
|
||||
return efl_content_get(efl_part(obj, part));
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_widget_content_part_unset(Evas_Object *obj,
|
||||
const char *part)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj) NULL;
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
|
||||
return efl_content_unset(efl_part(obj, part));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_widget_access_info_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, const char *txt)
|
||||
{
|
||||
|
@ -6521,10 +6494,64 @@ _elm_widget_focus_manager_factory(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd
|
|||
}
|
||||
|
||||
|
||||
/* Legacy APIs */
|
||||
|
||||
/* elm_object_content_xxx APIs are supposed to work on all objects for which
|
||||
* elm_object_widget_check() returns true. The below checks avoid printing out
|
||||
* undesired ERR messages. */
|
||||
EAPI void
|
||||
elm_widget_content_part_set(Evas_Object *obj,
|
||||
const char *part,
|
||||
Evas_Object *content)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj);
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return;
|
||||
if (!part)
|
||||
{
|
||||
part = elm_widget_default_content_part_get(obj);
|
||||
if (!part) return;
|
||||
}
|
||||
efl_content_set(efl_part(obj, part), content);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_widget_content_part_get(const Evas_Object *obj,
|
||||
const char *part)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj) NULL;
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
|
||||
if (!part)
|
||||
{
|
||||
part = elm_widget_default_content_part_get(obj);
|
||||
if (!part) return NULL;
|
||||
}
|
||||
return efl_content_get(efl_part(obj, part));
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_widget_content_part_unset(Evas_Object *obj,
|
||||
const char *part)
|
||||
{
|
||||
ELM_WIDGET_CHECK(obj) NULL;
|
||||
if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
|
||||
if (!part)
|
||||
{
|
||||
part = elm_widget_default_content_part_get(obj);
|
||||
if (!part) return NULL;
|
||||
}
|
||||
return efl_content_unset(efl_part(obj, part));
|
||||
}
|
||||
|
||||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
EFL_FUNC_BODY_CONST(elm_widget_default_content_part_get, const char *, NULL)
|
||||
|
||||
ELM_PART_CONTENT_DEFAULT_SET(elm_widget, NULL)
|
||||
|
||||
#define ELM_WIDGET_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_widget), \
|
||||
ELM_PART_CONTENT_DEFAULT_OPS(elm_widget), \
|
||||
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _elm_widget_efl_object_dbg_info_get)
|
||||
|
||||
#include "elm_widget_item.eo.c"
|
||||
|
|
|
@ -866,6 +866,9 @@ EAPI Eina_Bool _elm_layout_part_aliasing_eval(const Evas_Object *obj,
|
|||
const char **part,
|
||||
Eina_Bool is_text);
|
||||
|
||||
/* Internal EO APIs */
|
||||
const char *elm_widget_default_content_part_get(const Eo *obj);
|
||||
|
||||
|
||||
#define ELM_WIDGET_ITEM_PROTECTED
|
||||
#include "elm_widget_item.eo.h"
|
||||
|
|
Loading…
Reference in New Issue