#define MY_CLASS EFL_SELECTION_MIXIN
#define MY_CLASS_NAME "Efl.Selection"
-static inline Eo*
-_selection_manager_get(Eo *obj)
-{
- Eo *top = elm_widget_top_get(obj);
- if (!top)
- {
- top = obj;
- }
- Eo *sel_man = efl_key_data_get(top, "__selection_manager");
- if (!sel_man)
- {
- sel_man = efl_add(EFL_SELECTION_MANAGER_CLASS, top);
- efl_key_data_set(top, "__selection_manager", sel_man);
- }
- return sel_man;
-}
-
EOLIAN static void
_efl_selection_selection_get(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, Efl_Selection_Format format,
void *data_func_data, Efl_Selection_Data_Ready data_func, Eina_Free_Cb data_func_free_cb, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_selection_get(sel_man, obj, type, format,
data_func_data, data_func,
data_func_free_cb, seat);
EOLIAN static Eina_Future *
_efl_selection_selection_set(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, Efl_Selection_Format format, Eina_Slice data, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
return efl_selection_manager_selection_set(sel_man, obj, type, format, data, seat);
}
EOLIAN static void
_efl_selection_selection_clear(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_selection_clear(sel_man, obj, type, seat);
}
EOLIAN static Eina_Bool
_efl_selection_has_owner(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Type type, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
return efl_selection_manager_selection_has_owner(sel_man, obj, type, seat);
}
Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
{
int seatid = 1;
- Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+ Eo *sel_man = _efl_ui_selection_manager_get((Evas_Object *)obj);
Cnp_Data_Cb_Wrapper *wdata = calloc(1, sizeof(Cnp_Data_Cb_Wrapper));
if (!wdata) return EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WL2
-
+
seatid = _wl_default_seat_id_get((Evas_Object *)obj);
#endif
wdata->udata = udata;
int seatid = 1;
Eina_Future *f;
Sel_Lost_Data *ldata;
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
Eina_Slice data;
ldata = calloc(1, sizeof(Sel_Lost_Data));
if (type > ELM_SEL_TYPE_CLIPBOARD) return EINA_FALSE;
int seatid = 1;
- Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+ Eo *sel_man = _efl_ui_selection_manager_get((Evas_Object *)obj);
#ifdef HAVE_ELEMENTARY_WL2
seatid = _wl_default_seat_id_get(obj);
elm_selection_selection_has_owner(Evas_Object *obj)
{
int seatid = 1;
- Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+ Eo *sel_man = _efl_ui_selection_manager_get((Evas_Object *)obj);
#ifdef HAVE_ELEMENTARY_WL2
seatid = _wl_default_seat_id_get(obj);
elm_cnp_clipboard_selection_has_owner(Evas_Object *obj)
{
int seatid = 1;
- Eo *sel_man = _selection_manager_get((Evas_Object *)obj);
+ Eo *sel_man = _efl_ui_selection_manager_get((Evas_Object *)obj);
#ifdef HAVE_ELEMENTARY_WL2
seatid = _wl_default_seat_id_get(obj);
extern int _wl_default_seat_id_get(Evas_Object *obj);
-static inline Eo *
-_selection_manager_get(Eo *obj)
+Eo*
+_efl_ui_selection_manager_get(Eo *obj)
{
if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return NULL;
Eo *app = efl_app_get();
return sel_man;
}
+void
+_efl_ui_dnd_shutdown(void)
+{
+ Eo *app = efl_app_get();
+ Eo *sel_man = efl_key_data_get(app, "__selection_manager");
+
+ efl_del(sel_man);
+}
+
EOLIAN static void
_efl_ui_dnd_drag_start(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, Eina_Slice data,
Efl_Selection_Action action, void *icon_func_data, Efl_Dnd_Drag_Icon_Create icon_func, Eina_Free_Cb icon_func_free_cb,
unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_drag_start(sel_man, obj, format, data, action,
icon_func_data, icon_func, icon_func_free_cb,
seat);
EOLIAN static void
_efl_ui_dnd_drag_cancel(Eo *obj, void *pd EINA_UNUSED, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_drag_cancel(sel_man, obj, seat);
}
EOLIAN static void
_efl_ui_dnd_drag_action_set(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Action action, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_drag_action_set(sel_man, obj, action, seat);
}
EOLIAN static void
_efl_ui_dnd_drop_target_add(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_drop_target_add(sel_man, obj, format, seat);
}
EOLIAN static void
_efl_ui_dnd_drop_target_del(Eo *obj, void *pd EINA_UNUSED, Efl_Selection_Format format, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_drop_target_del(sel_man, obj, format, seat);
}
{
double drag_delay_time = pd->drag_delay_time;
double anim_time = elm_config_drag_anim_duration_get();
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_container_drag_item_add(sel_man, obj, drag_delay_time, anim_time,
data_func_data, data_func, data_func_free_cb,
item_func_data, item_func, item_func_free_cb,
static void
_efl_ui_dnd_container_drag_item_del(Eo *obj, Efl_Ui_Dnd_Container_Data *pd EINA_UNUSED, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_container_drag_item_del(sel_man, obj, seat);
}
EOLIAN static void
void *item_func_data, Efl_Dnd_Item_Get item_func, Eina_Free_Cb item_func_free_cb,
unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_container_drop_item_add(sel_man, obj, format, item_func_data, item_func, item_func_free_cb, seat);
}
EOLIAN static void
_efl_ui_dnd_container_drop_item_del(Eo *obj, Efl_Ui_Dnd_Container_Data *pd EINA_UNUSED, unsigned int seat)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
efl_selection_manager_container_drop_item_del(sel_man, obj, seat);
}
Elm_Drag_State drag_done_cb, void *drag_done_data)
{
if (!obj) return EINA_FALSE;
-
- Eo *sel_man = _selection_manager_get(obj);
+ if (!data) return EINA_FALSE;
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
Eina_Slice sl;
sl.mem = NULL;
elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
{
if (!obj) return EINA_FALSE;
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
#ifdef HAVE_ELEMENTARY_WL2
EAPI Eina_Bool
elm_drag_cancel(Evas_Object *obj)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
#ifdef HAVE_ELEMENTARY_WL2
Elm_Drop_Cb drop_cb, void *drop_data)
{
if (!obj) return EINA_FALSE;
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
Dnd_Drag_State *enter = NULL, *leave = NULL;
Dnd_Drag_Pos *pos = NULL;
Elm_Drop_Cb drop_cb, void *drop_data)
{
if(!obj) return EINA_FALSE;
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
//Eina_List *l, *l2;
Eina_List *drop_list;
Elm_Drag_Item_Container_Pos pos_cb, void *pos_data,
Elm_Drop_Item_Container_Cb drop_cb, void *drop_data)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
Dnd_Drag_State *enter = NULL, *leave = NULL;
Dnd_Cont_Drag_Pos *pos = NULL;
elm_drop_item_container_del(Evas_Object *obj)
{
if (!obj) return EINA_FALSE;
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
#ifdef HAVE_ELEMENTARY_WL2
elm_drag_item_container_add(Evas_Object *obj, double anim_tm, double tm_to_drag,
Elm_Xy_Item_Get_Cb item_get_cb, Elm_Item_Container_Data_Get_Cb data_get_cb)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
Eina_List *di_list;
Item_Container_Drag_Info *di;
EAPI Eina_Bool
elm_drag_item_container_del(Evas_Object *obj)
{
- Eo *sel_man = _selection_manager_get(obj);
+ Eo *sel_man = _efl_ui_selection_manager_get(obj);
int seatid = 1;
#ifdef HAVE_ELEMENTARY_WL2