Elm widget: rename parent to widget_parent and mark as protected.

This removes the conflicts between the different parents and also
indicates that this is to be used internally by widgets and should
not be confused with the normal user visible parent.

It is an internal attribute that should not be used by people
not implementing widgets. Marking it as protected signifies it
as such.
This commit is contained in:
Tom Hacohen 2016-04-11 17:51:15 +01:00
parent a73cdbdb46
commit aff4171e73
18 changed files with 35 additions and 22 deletions

View File

@ -5,7 +5,9 @@
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@ -1158,7 +1160,7 @@ _elm_ctxpopup_evas_object_smart_del(Eo *obj, Elm_Ctxpopup_Data *sd)
}
EOLIAN static void
_elm_ctxpopup_elm_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent)
_elm_ctxpopup_elm_widget_widget_parent_set(Eo *obj, Elm_Ctxpopup_Data *_pd EINA_UNUSED, Evas_Object *parent)
{
//default parent is to be hover parent
elm_ctxpopup_hover_parent_set(obj, parent);

View File

@ -5,6 +5,7 @@
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@ -596,7 +597,7 @@ _elm_hoversel_evas_object_smart_hide(Eo *obj, Elm_Hoversel_Data *sd)
}
EOLIAN static void
_elm_hoversel_elm_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, Evas_Object *parent)
_elm_hoversel_elm_widget_widget_parent_set(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED, Evas_Object *parent)
{
elm_hoversel_hover_parent_set(obj, parent);
}

View File

@ -4,6 +4,7 @@
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#include <Elementary.h>
@ -1572,7 +1573,7 @@ _parent_geom_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i
}
EOLIAN static void
_elm_popup_elm_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent)
_elm_popup_elm_widget_widget_parent_set(Eo *obj, Elm_Popup_Data *sd, Evas_Object *parent)
{
Evas_Coord x, y, w, h;
evas_object_geometry_get(parent, &x, &y, &w, &h);

View File

@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
#define ELM_WIDGET_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#include <Elementary.h>
@ -954,7 +955,7 @@ _elm_conformant_evas_object_smart_del(Eo *obj, Elm_Conformant_Data *sd)
}
EOLIAN static void
_elm_conformant_elm_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent)
_elm_conformant_elm_widget_widget_parent_set(Eo *obj, Elm_Conformant_Data *sd, Evas_Object *parent)
{
#ifdef HAVE_ELEMENTARY_X
Evas_Object *top = elm_widget_top_get(parent);

View File

@ -6,7 +6,7 @@ class Elm.Conformant (Elm.Layout)
Eo.Base.constructor;
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Elm.Widget.parent.set;
Elm.Widget.widget_parent.set;
Elm.Widget.theme_apply;
Elm.Layout.content_aliases.get;
}

View File

@ -203,7 +203,7 @@ class Elm.Ctxpopup (Elm.Layout, Elm.Interface_Atspi_Widget_Action, Efl.Orientati
Eo.Base.constructor;
Evas.Object_Smart.del;
Evas.Object_Smart.add;
Elm.Widget.parent.set;
Elm.Widget.widget_parent.set;
Elm.Widget.focus_direction;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.focus_next_manager_is;

View File

@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
#define ELM_WIDGET_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
@ -719,7 +720,7 @@ elm_hover_parent_set(Evas_Object *obj,
}
EOLIAN static void
_elm_hover_elm_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent)
_elm_hover_elm_widget_widget_parent_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *parent)
{
_elm_hover_parent_detach(obj);
@ -757,7 +758,7 @@ elm_hover_parent_get(const Evas_Object *obj)
}
EOLIAN static Evas_Object*
_elm_hover_elm_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
_elm_hover_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Hover_Data *sd)
{
return sd->parent;
}

View File

@ -66,7 +66,7 @@ class Elm.Hover (Elm.Layout, Evas.Clickable_Interface, Elm.Interface_Atspi_Widge
Evas.Object_Smart.resize;
Elm.Widget.theme_apply;
Elm.Widget.sub_object_add;
Elm.Widget.parent;
Elm.Widget.widget_parent;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.focus_next_manager_is;
Elm.Widget.sub_object_del;

View File

@ -94,7 +94,7 @@ class Elm.Hoversel (Elm.Button, Evas.Selectable_Interface,
Evas.Object_Smart.show;
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Elm.Widget.parent.set;
Elm.Widget.widget_parent.set;
Elm.Widget.theme_apply;
Elm.Widget.translate;
Elm.Widget.event;

View File

@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
#define ELM_WIDGET_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#include <Elementary.h>
@ -79,7 +80,7 @@ _elm_inwin_evas_object_smart_add(Eo *obj, void *_pd EINA_UNUSED)
}
EOLIAN static void
_elm_inwin_elm_widget_parent_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *parent)
_elm_inwin_elm_widget_widget_parent_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *parent)
{
elm_win_resize_object_add(parent, obj);

View File

@ -21,7 +21,7 @@ class Elm.Inwin (Elm.Layout)
class.constructor;
Eo.Base.constructor;
Evas.Object_Smart.add;
Elm.Widget.parent.set;
Elm.Widget.widget_parent.set;
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_next;
Elm.Layout.content_aliases.get;

View File

@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
#define ELM_WIDGET_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
@ -831,7 +832,7 @@ elm_menu_parent_set(Evas_Object *obj,
}
EOLIAN static void
_elm_menu_elm_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent)
_elm_menu_elm_widget_widget_parent_set(Eo *obj, Elm_Menu_Data *sd, Evas_Object *parent)
{
Eina_List *l, *_l, *_ll, *ll = NULL;
Elm_Object_Item *eo_item;
@ -883,7 +884,7 @@ elm_menu_parent_get(const Evas_Object *obj)
}
EOLIAN static Evas_Object*
_elm_menu_elm_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
_elm_menu_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd)
{
return sd->parent;
}

View File

@ -73,7 +73,7 @@ class Elm.Menu (Elm.Widget, Evas.Clickable_Interface, Elm.Interface_Atspi_Select
Evas.Object_Smart.show;
Evas.Object_Smart.add;
Evas.Object_Smart.del;
Elm.Widget.parent;
Elm.Widget.widget_parent;
Elm.Widget.theme_apply;
Elm.Widget.translate;
Elm.Interface_Atspi_Accessible.children.get;

View File

@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
#define ELM_WIDGET_PROTECTED
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#include <Elementary.h>
@ -487,7 +488,7 @@ elm_notify_parent_set(Evas_Object *obj,
}
EOLIAN static void
_elm_notify_elm_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent)
_elm_notify_elm_widget_widget_parent_set(Eo *obj, Elm_Notify_Data *sd, Evas_Object *parent)
{
if (sd->parent)
{
@ -534,7 +535,7 @@ elm_notify_parent_get(const Evas_Object *obj)
}
EOLIAN static Evas_Object*
_elm_notify_elm_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
_elm_notify_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
{
return sd->parent;
}

View File

@ -84,7 +84,7 @@ class Elm.Notify (Elm.Container)
Evas.Object_Smart.del;
Evas.Object_Smart.resize;
Elm.Widget.focus_direction;
Elm.Widget.parent;
Elm.Widget.widget_parent;
Elm.Widget.theme_apply;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.focus_next_manager_is;

View File

@ -173,7 +173,7 @@ class Elm.Popup (Elm.Layout, Elm.Interface_Atspi_Widget_Action)
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
Elm.Widget.focus_next;
Elm.Widget.parent.set;
Elm.Widget.widget_parent.set;
Elm.Widget.translate;
Elm.Widget.sub_object_del;
Elm.Widget.event;

View File

@ -4,6 +4,7 @@
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
#define ELM_WIDGET_PROTECTED
#define ELM_WIDGET_ITEM_PROTECTED
#include <Elementary.h>
@ -855,7 +856,7 @@ _elm_object_focus_chain_del_cb(void *data,
}
EOLIAN static void
_elm_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED)
_elm_widget_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED)
{
}
@ -2913,7 +2914,7 @@ _elm_widget_focus_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Bool focus)
}
EOLIAN static Evas_Object*
_elm_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
_elm_widget_widget_parent_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd)
{
return sd->parent_obj;
}

View File

@ -206,10 +206,13 @@ abstract Elm.Widget (Evas.Object_Smart, Elm.Interface_Atspi_Accessible, Elm.Inte
highlight: bool;
}
}
@property parent {
@property widget_parent @protected {
[[The internal widget parent]]
set {
legacy: elm_widget_parent_set; /* Needed because we don't do duplication removal for legacy names. */
}
get {
legacy: elm_widget_parent_get; /* Needed because we don't do duplication removal for legacy names. */
}
values {
parent: Evas.Object * @nullable;