naviframe: Override resize_object_set

This is a first step into allowing me to removing the sub_obj argument.
Make elm_widget resize_object a protected property.

See also D265

Ref T5363
This commit is contained in:
Jean-Philippe Andre 2017-08-08 20:37:41 +09:00
parent 8b3c1eb069
commit 76088133dc
3 changed files with 38 additions and 9 deletions

View File

@ -5,6 +5,7 @@
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#define ELM_WIDGET_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@ -57,6 +58,25 @@ static const Elm_Action key_actions[] = {
{NULL, NULL}
};
EOLIAN static void
_elm_naviframe_elm_widget_resize_object_set(Eo *obj, Elm_Naviframe_Data *pd EINA_UNUSED,
Efl_Canvas_Object *sobj, Eina_Bool sub_obj)
{
if (!sobj || !efl_finalized_get(obj)) goto super;
EINA_SAFETY_ON_TRUE_RETURN(sub_obj);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (wd->resize_obj == sobj) return;
// Detach the previous page as resize object to avoid any modifications to
// it by the widget implementation. This preserves clip, smart membership,
// focus, etc...
wd->resize_obj = NULL;
super:
elm_obj_widget_resize_object_set(efl_super(obj, MY_CLASS), sobj, EINA_TRUE);
}
static void
_resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item_Data *it)
{

View File

@ -154,6 +154,7 @@ class Elm.Naviframe (Efl.Ui.Layout, Elm.Interface.Atspi_Widget_Action)
Elm.Widget.widget_event;
Efl.Canvas.Layout_Signal.signal_emit;
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
Elm.Widget.resize_object { set; }
Efl.Part.part;
}
events {

View File

@ -39,6 +39,23 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
event_prefix: elm_widget;
data: Elm_Widget_Smart_Data;
methods {
@property resize_object @protected {
[[This is the internal canvas object managed by a widget.
This property is protected as it is meant for widget implementations
only, to set and access the internal canvas object. Do use this
function unless you're implementing a widget.
]]
set {
[[Sets the new resize object for this widget.]]
}
values {
sobj: Efl.Canvas.Object @nullable;
[[A canvas object (often a $Efl.Canvas.Layout object).]]
sub_obj: bool; [[$true if sub object exists, $false otherwise]]
}
}
@property focus {
[[Focus property]]
values {
@ -241,15 +258,6 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
rotation: int; [[Orientation]]
}
}
@property resize_object {
[[Resize object property]]
set {
}
values {
sobj: Efl.Canvas.Object @nullable; [[Object]]
sub_obj: bool; [[$true if sub object exists, $false otherwise]]
}
}
@property domain_translatable_part_text {
[[Domain translatable text part property]]
set {