This simplifies code and API.
Ref T5363
}
EOLIAN static Eina_Bool
-_efl_ui_text_elm_widget_on_focus_region(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_efl_ui_text_elm_widget_focus_region_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
Evas_Coord edje_x, edje_y, elm_x, elm_y;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.theme_apply;
Elm.Widget.on_focus;
- Elm.Widget.on_focus_region;
+ Elm.Widget.focus_region { get; }
Elm.Widget.on_disabled_update;
Elm.Widget.widget_sub_object_del;
Elm.Widget.focus_next_manager_is;
}
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_on_focus_region(Eo *obj, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_elm_entry_elm_widget_focus_region_get(Eo *obj, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
Evas_Coord cx, cy, cw, ch;
Evas_Coord edx, edy;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.theme_apply;
Elm.Widget.on_focus;
- Elm.Widget.on_focus_region;
+ Elm.Widget.focus_region { get; }
Elm.Widget.on_disabled_update;
Elm.Widget.widget_sub_object_del;
Elm.Widget.focus_next_manager_is;
}
EOLIAN static Eina_Bool
-_elm_gengrid_elm_widget_on_focus_region(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_elm_gengrid_elm_widget_focus_region_get(Eo *obj, Elm_Gengrid_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
- if (!sd->focused_item) return EINA_FALSE;
+ if (!sd->focused_item) goto end;
if (elm_object_focus_region_show_mode_get(obj) == ELM_FOCUS_REGION_SHOW_ITEM)
{
Evas_Coord vx, vy;
return EINA_TRUE;
}
- return EINA_FALSE;
+
+end:
+ return elm_obj_widget_focus_region_get(efl_super(obj, MY_CLASS), x, y, w, h);
}
static Eina_Bool _elm_gengrid_smart_focus_next_enable = EINA_FALSE;
Elm.Widget.focus_next;
Elm.Widget.focus_direction;
Elm.Widget.on_focus;
- Elm.Widget.on_focus_region;
+ Elm.Widget.focus_region { get; }
Elm.Widget.widget_event;
Elm.Widget.focus_highlight_geometry_get;
Elm.Widget.focused_item { get; }
}
EOLIAN static Eina_Bool
-_elm_panel_elm_widget_on_focus_region(Eo *obj,
+_elm_panel_elm_widget_focus_region_get(Eo *obj,
Elm_Panel_Data *sd,
Evas_Coord *x,
Evas_Coord *y,
Elm.Widget.on_disabled_update;
Elm.Widget.on_access_update;
Elm.Widget.widget_event;
- Elm.Widget.on_focus_region;
+ Elm.Widget.focus_region { get; }
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
Efl.Part.part;
}
}
}
-EOLIAN static Eina_Bool
-_elm_widget_on_focus_region(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Coord *x EINA_UNUSED, Evas_Coord *y EINA_UNUSED, Evas_Coord *w EINA_UNUSED, Evas_Coord *h EINA_UNUSED)
-{
- DBG("The %s widget does not implement the \"on_focus_region\" function.",
- efl_class_name_get(efl_class_get(obj)));
-
- return EINA_FALSE;
-}
-
static void
_parents_focus(Evas_Object *obj)
{
EOLIAN static Eina_Bool
_elm_widget_focus_region_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
- Eina_Bool int_ret = EINA_FALSE;
- int_ret = elm_obj_widget_on_focus_region((Eo *)obj, x, y, w, h);
- if (!int_ret)
- {
- evas_object_geometry_get(obj, NULL, NULL, w, h);
- if (x) *x = 0;
- if (y) *y = 0;
- }
+ efl_gfx_size_get(obj, w, h);
+ if (x) *x = 0;
+ if (y) *y = 0;
if ((*w <= 0) || (*h <= 0)) return EINA_FALSE;
return EINA_TRUE;
}
}
return: bool; [[$true if this widget can handle focus, $false otherwise]]
}
- on_focus_region {
- [['Virtual' function returning an inner area of a widget that should be brought into the visible area of a broader viewport, may this context arise.]]
- params {
- @out x: int; [[X coordinate]]
- @out y: int; [[Y coordinate]]
- @out w: int; [[Width]]
- @out h: int; [[Height]]
- }
- return: bool; [[$true on success, $false otherwise]]
- }
/* Scroll API. */
@property on_show_region_hook {
/* Old focus API. FIXME: Needs massive clean up! */
@property focus_region {
- [[Focus region property]]
+ [[Region to show when focus changes within this widget.
+
+ When this widget or one of its subwidgets is given focus, this
+ region should be shown, which means any parent scroller should
+ attempt to display the given area of this widget. For instance, an
+ entry given focus should scroll to show the text cursor if that
+ cursor moves. In this example, this region defines the relative
+ geometry of the cursor within the widget.
+
+ Note: The region is relative to the top-left corner of the widget,
+ i.e. X,Y start from 0,0 to indicate the top-left corner of the
+ widget.
+
+ See also @.focus_region_show.
+ ]]
get {
- return: bool; [[$true on success, $false otherwise]]
+ return: bool; [[If $false, @.focus_region_show will not do anything.]]
}
values {
x: int; [[X coordinate]]