forked from enlightenment/efl
selection_dnd: fix warnings in clang
Fix warnings about type convert and vars init in clang and remove comments.
This commit is contained in:
parent
d36c849e20
commit
07e7bbd4b5
|
@ -165,8 +165,8 @@ _selection_data_ready_cb(void *data, Efl_Object *obj, Efl_Selection_Data *seldat
|
|||
ddata.len = seldata->data.len;
|
||||
ddata.x = seldata->pos.x;
|
||||
ddata.y = seldata->pos.y;
|
||||
ddata.format = seldata->format;
|
||||
ddata.action = seldata->action;
|
||||
ddata.format = (Elm_Sel_Format)seldata->format;
|
||||
ddata.action = (Elm_Xdnd_Action)seldata->action;
|
||||
wdata->datacb(wdata->udata, obj, &ddata);
|
||||
free(ddata.data);
|
||||
}
|
||||
|
@ -216,7 +216,8 @@ elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type type,
|
|||
#endif
|
||||
wdata->udata = udata;
|
||||
wdata->datacb = datacb;
|
||||
efl_selection_manager_selection_get(sel_man, (Evas_Object *)obj, type, format,
|
||||
efl_selection_manager_selection_get(sel_man, (Evas_Object *)obj, (Efl_Selection_Type)type,
|
||||
(Efl_Selection_Format)format,
|
||||
wdata, _selection_data_ready_cb, NULL, seatid);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -238,7 +239,8 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type type,
|
|||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
seatid = _wl_default_seat_id_get(obj);
|
||||
#endif
|
||||
f = efl_selection_manager_selection_set(sel_man, obj, type, format, data, seatid);
|
||||
f = efl_selection_manager_selection_set(sel_man, obj, (Efl_Selection_Type)type,
|
||||
(Efl_Selection_Format)format, data, seatid);
|
||||
|
||||
ldata->obj = obj;
|
||||
ldata->type = type;
|
||||
|
@ -256,7 +258,7 @@ elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type type)
|
|||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
seatid = _wl_default_seat_id_get(obj);
|
||||
#endif
|
||||
efl_selection_manager_selection_clear(sel_man, obj, type, seatid);
|
||||
efl_selection_manager_selection_clear(sel_man, obj, (Efl_Selection_Type)type, seatid);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
|
|
@ -882,7 +882,7 @@ _efl_sel_manager_x11_selection_notify(void *udata, int type EINA_UNUSED, void *e
|
|||
else
|
||||
{
|
||||
sel_debug("Drop on container");
|
||||
Eina_Position2D pos, posret;
|
||||
Eina_Position2D pos, posret = {0, 0};
|
||||
evas_object_geometry_get(dropable->obj, &pos.x, &pos.y, NULL, NULL);
|
||||
//get item
|
||||
pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + pos.x,
|
||||
|
@ -1490,7 +1490,7 @@ _x11_dnd_dropable_handle(Efl_Selection_Manager_Data *pd, Sel_Manager_Dropable *d
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Position2D posret;
|
||||
Eina_Position2D posret = {0, 0};
|
||||
Efl_Object *it = NULL;
|
||||
|
||||
if (dropable->item_func)
|
||||
|
@ -1563,7 +1563,7 @@ _x11_dnd_dropable_handle(Efl_Selection_Manager_Data *pd, Sel_Manager_Dropable *d
|
|||
}
|
||||
else
|
||||
{
|
||||
Eina_Position2D posret;
|
||||
Eina_Position2D posret = {0, 0};
|
||||
Efl_Object *it = NULL;
|
||||
if (dropable->item_func)
|
||||
it = dropable->item_func(dropable->item_func_data, dropable->obj,
|
||||
|
@ -1907,7 +1907,7 @@ found:
|
|||
//for container
|
||||
Efl_Object *it = NULL;
|
||||
Evas_Coord x0 = 0, y0 = 0;
|
||||
Eina_Position2D pos, posret;
|
||||
Eina_Position2D pos, posret = {0, 0};
|
||||
|
||||
evas_object_geometry_get(dropable->obj, &x0, &y0, NULL, NULL);
|
||||
pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + x0,
|
||||
|
@ -4393,9 +4393,9 @@ _abort_drag(Evas_Object *obj EINA_UNUSED, Sel_Manager_Drag_Container *dc)
|
|||
}
|
||||
|
||||
static void
|
||||
_cont_obj_mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
|
||||
_cont_obj_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Sel_Manager_Drag_Container *dc = dc;
|
||||
Sel_Manager_Drag_Container *dc = data;
|
||||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
|
|
|
@ -238,7 +238,7 @@ _dnd_drag_pos_cb(void *data, const Efl_Event *event)
|
|||
|
||||
if (pos->pos_cb)
|
||||
pos->pos_cb(pos->pos_data, event->object, ddata->pos.x, ddata->pos.y,
|
||||
ddata->action);
|
||||
(Elm_Xdnd_Action)ddata->action);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -287,8 +287,8 @@ _dnd_drop_cb(void *data, const Efl_Event *event)
|
|||
|
||||
ddata.x = org_ddata->pos.x;
|
||||
ddata.y = org_ddata->pos.y;
|
||||
ddata.format = org_ddata->format;
|
||||
ddata.action = org_ddata->action;
|
||||
ddata.format = (Elm_Sel_Format)org_ddata->format;
|
||||
ddata.action = (Elm_Xdnd_Action)org_ddata->action;
|
||||
ddata.data = calloc(1, org_ddata->data.len);
|
||||
if (!ddata.data) return;
|
||||
ddata.data = memcpy(ddata.data, org_ddata->data.mem, org_ddata->data.len);
|
||||
|
@ -337,7 +337,8 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
|
||||
ic->icon_data = icon_create_data;
|
||||
ic->icon_cb = icon_create_cb;
|
||||
efl_selection_manager_drag_start(sel_man, obj, format, sl, action,
|
||||
efl_selection_manager_drag_start(sel_man, obj, (Efl_Selection_Format)format, sl,
|
||||
(Efl_Selection_Action)action,
|
||||
ic, _dnd_icon_create_cb, NULL, seatid);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -352,7 +353,7 @@ elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
|
|||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
seatid = _wl_default_seat_id_get(obj);
|
||||
#endif
|
||||
efl_selection_manager_drag_action_set(sel_man, obj, action, seatid);
|
||||
efl_selection_manager_drag_action_set(sel_man, obj, (Efl_Selection_Action)action, seatid);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -445,7 +446,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
|
|||
_dnd_drag_pos_cb, pos);
|
||||
efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
|
||||
_dnd_drop_cb, drop);
|
||||
efl_selection_manager_drop_target_add(sel_man, obj, format, seatid);
|
||||
efl_selection_manager_drop_target_add(sel_man, obj, (Efl_Selection_Format)format, seatid);
|
||||
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -497,7 +498,7 @@ elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
|
|||
free(drop->pos);
|
||||
free(drop);
|
||||
}
|
||||
efl_selection_manager_drop_target_del(sel_man, obj, format, seatid);
|
||||
efl_selection_manager_drop_target_del(sel_man, obj, (Efl_Selection_Format)format, seatid);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -537,7 +538,7 @@ _dnd_cont_drag_pos_cb(void *data, const Efl_Event *event)
|
|||
}
|
||||
if (pos->pos_cb)
|
||||
pos->pos_cb(pos->pos_data, event->object, ddata->item, ddata->pos.x, ddata->pos.y,
|
||||
xret, yret, ddata->action);
|
||||
xret, yret, (Elm_Xdnd_Action)ddata->action);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -550,8 +551,8 @@ _dnd_cont_drop_cb(void *data, const Efl_Event *event)
|
|||
|
||||
ddata.x = org_ddata->pos.x;
|
||||
ddata.y = org_ddata->pos.y;
|
||||
ddata.format = org_ddata->format;
|
||||
ddata.action = org_ddata->action;
|
||||
ddata.format = (Elm_Sel_Format)org_ddata->format;
|
||||
ddata.action = (Elm_Xdnd_Action)org_ddata->action;
|
||||
ddata.data = calloc(1, org_ddata->data.len);
|
||||
if (!ddata.data) return;
|
||||
ddata.data = memcpy(ddata.data, org_ddata->data.mem, org_ddata->data.len);
|
||||
|
@ -657,7 +658,7 @@ elm_drop_item_container_add(Evas_Object *obj,
|
|||
_dnd_cont_drag_pos_cb, pos);
|
||||
efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
|
||||
_dnd_cont_drop_cb, drop);
|
||||
efl_selection_manager_container_drop_item_add(sel_man, obj, format,
|
||||
efl_selection_manager_container_drop_item_add(sel_man, obj, (Efl_Selection_Format)format,
|
||||
item_get_cb, _dnd_item_func, NULL,
|
||||
seatid);
|
||||
|
||||
|
@ -690,7 +691,7 @@ _cont_drag_data_func(void *data, Efl_Object *obj, Efl_Selection_Format *format,
|
|||
di = data;
|
||||
if (!di) return;
|
||||
di->data_get_cb(obj, di->it, &di->user_info);
|
||||
if (format) *format = di->user_info.format;
|
||||
if (format) *format = (Efl_Selection_Format)di->user_info.format;
|
||||
if (drag_data)
|
||||
{
|
||||
if (di->user_info.data)
|
||||
|
@ -699,7 +700,7 @@ _cont_drag_data_func(void *data, Efl_Object *obj, Efl_Selection_Format *format,
|
|||
drag_data->len = strlen(di->user_info.data);
|
||||
}
|
||||
}
|
||||
if (action) *action = di->user_info.action;
|
||||
if (action) *action = (Efl_Selection_Action)di->user_info.action;
|
||||
}
|
||||
|
||||
static Eina_List *
|
||||
|
|
|
@ -14,13 +14,11 @@ mixin Efl.Ui.Dnd.Container {
|
|||
time: double; [[The drag delay time]]
|
||||
}
|
||||
}
|
||||
drag_item_add { //drag_item_callback //property
|
||||
drag_item_add {
|
||||
[[This registers a drag for items in a container. Many items can be
|
||||
dragged at a time. During dragging, there are three events emitted:
|
||||
EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]]
|
||||
params {
|
||||
//@in time_to_drag: double; [[Time since mouse down happens to drag starts]] //drag_delay: property
|
||||
//@in anim_durataion: double; [[animation duration]] //just config
|
||||
@in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]]
|
||||
@in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]]
|
||||
@in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]]
|
||||
|
@ -28,7 +26,7 @@ mixin Efl.Ui.Dnd.Container {
|
|||
@in seat: uint; [[Specified seat for multiple seats case.]]
|
||||
}
|
||||
}
|
||||
drag_item_del { //remove
|
||||
drag_item_del {
|
||||
[[Remove drag function of items in the container object.]]
|
||||
params {
|
||||
@in seat: uint; [[Specified seat for multiple seats case.]]
|
||||
|
|
Loading…
Reference in New Issue