cursor: fix ABI break in widget item cursor APIs

Summary:
fix ABI break in widget item cursor APIs
by efl_ui_cursor interface implementing.

item's view were not elementary widget mostly,
reimplementing efl_ui_cursor on efl_ui_widget
cannot resolve item's cursor API call.

Test Plan:
check,
elm_object_item_cursor_XXX
API is working properly on elm_object_item.

Reviewers: cedric, jpeg, raster

Reviewed By: raster

Subscribers: stefan_schmidt, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6046
This commit is contained in:
SangHyeon Lee 2018-05-19 01:13:43 +09:00 committed by Carsten Haitzler (Rasterman)
parent 5d1898dd9e
commit ebdb3b71a1
3 changed files with 53 additions and 16 deletions

View File

@ -4784,7 +4784,7 @@ EOLIAN static const char *
_elm_widget_item_cursor_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
return elm_object_cursor_get(item->view);
return elm_object_sub_cursor_get(item->view);
}
EOLIAN static void
@ -4817,7 +4817,7 @@ _elm_widget_item_cursor_style_set(Eo *eo_item EINA_UNUSED,
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
elm_object_cursor_style_set(item->view, style);
elm_object_sub_cursor_style_set(item->view, style);
}
/**
@ -4836,7 +4836,7 @@ _elm_widget_item_cursor_style_get(const Eo *eo_item EINA_UNUSED,
Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
return elm_object_cursor_style_get(item->view);
return elm_object_sub_cursor_style_get(item->view);
}
/**
@ -4863,7 +4863,7 @@ _elm_widget_item_cursor_engine_only_set(Eo *eo_item EINA_UNUSED,
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
ELM_WIDGET_ITEM_RETURN_IF_ONDEL(item);
elm_object_cursor_theme_search_enabled_set(item->view, !engine_only);
elm_object_sub_cursor_theme_search_enabled_set(item->view, !engine_only);
}
/**
@ -4882,7 +4882,7 @@ EOLIAN static Eina_Bool
_elm_widget_item_cursor_engine_only_get(const Eo *eo_item EINA_UNUSED, Elm_Widget_Item_Data *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, EINA_FALSE);
return !elm_object_cursor_theme_search_enabled_get(item->view);
return !elm_object_sub_cursor_theme_search_enabled_get(item->view);
}
EOLIAN static void

View File

@ -664,6 +664,13 @@ void elm_cursor_theme(Elm_Cursor *cur);
void elm_object_sub_cursor_set(Evas_Object *eventarea,
Evas_Object *owner,
const char *cursor);
const char * elm_object_sub_cursor_get(const Evas_Object *obj);
Eina_Bool elm_object_sub_cursor_style_set(Evas_Object *obj,
const char *style);
const char * elm_object_sub_cursor_style_get(const Evas_Object *obj);
Eina_Bool elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj,
Eina_Bool theme_search);
Eina_Bool elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj);
void elm_menu_clone(Evas_Object *from_menu,
Evas_Object *to_menu,

View File

@ -680,13 +680,19 @@ _efl_ui_widget_efl_ui_cursor_cursor_set(Evas_Object *obj, Elm_Widget_Smart_Data
return EINA_TRUE;
}
EOLIAN const char *
_efl_ui_widget_efl_ui_cursor_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
const char *
elm_object_sub_cursor_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
return cur->cursor_name;
}
EOLIAN const char *
_efl_ui_widget_efl_ui_cursor_cursor_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
return elm_object_sub_cursor_get(obj);
}
EAPI void
elm_object_cursor_unset(Evas_Object *obj)
{
@ -751,9 +757,8 @@ elm_object_cursor_unset(Evas_Object *obj)
free(cur);
}
EOLIAN Eina_Bool
_efl_ui_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
const char *style)
Eina_Bool
elm_object_sub_cursor_style_set(Evas_Object *obj, const char *style)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
@ -787,13 +792,26 @@ _efl_ui_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart
return EINA_TRUE;
}
EOLIAN const char *
_efl_ui_widget_efl_ui_cursor_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
EOLIAN Eina_Bool
_efl_ui_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
const char *style)
{
return elm_object_sub_cursor_style_set(obj, style);
}
const char *
elm_object_sub_cursor_style_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, NULL);
return cur->style ? cur->style : "default";
}
EOLIAN const char *
_efl_ui_widget_efl_ui_cursor_cursor_style_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
return elm_object_sub_cursor_style_get(obj);
}
/**
* Notify cursor should recalculate its theme.
* @internal
@ -809,9 +827,8 @@ elm_cursor_theme(Elm_Cursor *cur)
_elm_cursor_set_hot_spots(cur);
}
EOLIAN Eina_Bool
_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
Eina_Bool theme_search)
Eina_Bool
elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj, Eina_Bool theme_search)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
cur->theme_search = theme_search;
@ -821,10 +838,23 @@ _efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, E
}
EOLIAN Eina_Bool
_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_set(Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
Eina_Bool theme_search)
{
return elm_object_sub_cursor_theme_search_enabled_set(obj, theme_search);
}
Eina_Bool
elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj, EINA_FALSE);
return cur->theme_search;
}
EOLIAN Eina_Bool
_efl_ui_widget_efl_ui_cursor_cursor_theme_search_enabled_get(const Evas_Object *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED)
{
return elm_object_sub_cursor_theme_search_enabled_get(obj);
}
#include "efl_ui_cursor.eo.c"