summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2018-01-16 16:33:30 +0900
committerThiep Ha <thiepha@gmail.com>2018-01-16 16:35:14 +0900
commit07e7bbd4b5cc17bbf8c1e48e500396e66f98120e (patch)
tree383b0ba1ab325b5af278cfd43d4831a415fe5295
parentd36c849e2003aaa54432b74bcabe9f838d992a36 (diff)
selection_dnd: fix warnings in clang
Fix warnings about type convert and vars init in clang and remove comments.
-rw-r--r--src/lib/elementary/efl_selection.c12
-rw-r--r--src/lib/elementary/efl_selection_manager.c12
-rw-r--r--src/lib/elementary/efl_ui_dnd.c27
-rw-r--r--src/lib/elementary/efl_ui_dnd_container.eo6
4 files changed, 29 insertions, 28 deletions
diff --git a/src/lib/elementary/efl_selection.c b/src/lib/elementary/efl_selection.c
index cbbe98286c..84f81a89c4 100644
--- a/src/lib/elementary/efl_selection.c
+++ b/src/lib/elementary/efl_selection.c
@@ -165,8 +165,8 @@ _selection_data_ready_cb(void *data, Efl_Object *obj, Efl_Selection_Data *seldat
165 ddata.len = seldata->data.len; 165 ddata.len = seldata->data.len;
166 ddata.x = seldata->pos.x; 166 ddata.x = seldata->pos.x;
167 ddata.y = seldata->pos.y; 167 ddata.y = seldata->pos.y;
168 ddata.format = seldata->format; 168 ddata.format = (Elm_Sel_Format)seldata->format;
169 ddata.action = seldata->action; 169 ddata.action = (Elm_Xdnd_Action)seldata->action;
170 wdata->datacb(wdata->udata, obj, &ddata); 170 wdata->datacb(wdata->udata, obj, &ddata);
171 free(ddata.data); 171 free(ddata.data);
172} 172}
@@ -216,7 +216,8 @@ elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type type,
216#endif 216#endif
217 wdata->udata = udata; 217 wdata->udata = udata;
218 wdata->datacb = datacb; 218 wdata->datacb = datacb;
219 efl_selection_manager_selection_get(sel_man, (Evas_Object *)obj, type, format, 219 efl_selection_manager_selection_get(sel_man, (Evas_Object *)obj, (Efl_Selection_Type)type,
220 (Efl_Selection_Format)format,
220 wdata, _selection_data_ready_cb, NULL, seatid); 221 wdata, _selection_data_ready_cb, NULL, seatid);
221 return EINA_TRUE; 222 return EINA_TRUE;
222} 223}
@@ -238,7 +239,8 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type type,
238#ifdef HAVE_ELEMENTARY_WL2 239#ifdef HAVE_ELEMENTARY_WL2
239 seatid = _wl_default_seat_id_get(obj); 240 seatid = _wl_default_seat_id_get(obj);
240#endif 241#endif
241 f = efl_selection_manager_selection_set(sel_man, obj, type, format, data, seatid); 242 f = efl_selection_manager_selection_set(sel_man, obj, (Efl_Selection_Type)type,
243 (Efl_Selection_Format)format, data, seatid);
242 244
243 ldata->obj = obj; 245 ldata->obj = obj;
244 ldata->type = type; 246 ldata->type = type;
@@ -256,7 +258,7 @@ elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type type)
256#ifdef HAVE_ELEMENTARY_WL2 258#ifdef HAVE_ELEMENTARY_WL2
257 seatid = _wl_default_seat_id_get(obj); 259 seatid = _wl_default_seat_id_get(obj);
258#endif 260#endif
259 efl_selection_manager_selection_clear(sel_man, obj, type, seatid); 261 efl_selection_manager_selection_clear(sel_man, obj, (Efl_Selection_Type)type, seatid);
260 262
261 return EINA_TRUE; 263 return EINA_TRUE;
262} 264}
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
index db7cc5cfca..ed543ef172 100644
--- a/src/lib/elementary/efl_selection_manager.c
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -882,7 +882,7 @@ _efl_sel_manager_x11_selection_notify(void *udata, int type EINA_UNUSED, void *e
882 else 882 else
883 { 883 {
884 sel_debug("Drop on container"); 884 sel_debug("Drop on container");
885 Eina_Position2D pos, posret; 885 Eina_Position2D pos, posret = {0, 0};
886 evas_object_geometry_get(dropable->obj, &pos.x, &pos.y, NULL, NULL); 886 evas_object_geometry_get(dropable->obj, &pos.x, &pos.y, NULL, NULL);
887 //get item 887 //get item
888 pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + pos.x, 888 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
1490 } 1490 }
1491 else 1491 else
1492 { 1492 {
1493 Eina_Position2D posret; 1493 Eina_Position2D posret = {0, 0};
1494 Efl_Object *it = NULL; 1494 Efl_Object *it = NULL;
1495 1495
1496 if (dropable->item_func) 1496 if (dropable->item_func)
@@ -1563,7 +1563,7 @@ _x11_dnd_dropable_handle(Efl_Selection_Manager_Data *pd, Sel_Manager_Dropable *d
1563 } 1563 }
1564 else 1564 else
1565 { 1565 {
1566 Eina_Position2D posret; 1566 Eina_Position2D posret = {0, 0};
1567 Efl_Object *it = NULL; 1567 Efl_Object *it = NULL;
1568 if (dropable->item_func) 1568 if (dropable->item_func)
1569 it = dropable->item_func(dropable->item_func_data, dropable->obj, 1569 it = dropable->item_func(dropable->item_func_data, dropable->obj,
@@ -1907,7 +1907,7 @@ found:
1907 //for container 1907 //for container
1908 Efl_Object *it = NULL; 1908 Efl_Object *it = NULL;
1909 Evas_Coord x0 = 0, y0 = 0; 1909 Evas_Coord x0 = 0, y0 = 0;
1910 Eina_Position2D pos, posret; 1910 Eina_Position2D pos, posret = {0, 0};
1911 1911
1912 evas_object_geometry_get(dropable->obj, &x0, &y0, NULL, NULL); 1912 evas_object_geometry_get(dropable->obj, &x0, &y0, NULL, NULL);
1913 pos = EINA_POSITION2D(seat_sel->saved_types->pos.x + x0, 1913 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)
4393} 4393}
4394 4394
4395static void 4395static void
4396_cont_obj_mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info) 4396_cont_obj_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
4397{ 4397{
4398 Sel_Manager_Drag_Container *dc = dc; 4398 Sel_Manager_Drag_Container *dc = data;
4399 Evas_Event_Mouse_Move *ev = event_info; 4399 Evas_Event_Mouse_Move *ev = event_info;
4400 4400
4401 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) 4401 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
diff --git a/src/lib/elementary/efl_ui_dnd.c b/src/lib/elementary/efl_ui_dnd.c
index ce60d32595..8f83ef9dc9 100644
--- a/src/lib/elementary/efl_ui_dnd.c
+++ b/src/lib/elementary/efl_ui_dnd.c
@@ -238,7 +238,7 @@ _dnd_drag_pos_cb(void *data, const Efl_Event *event)
238 238
239 if (pos->pos_cb) 239 if (pos->pos_cb)
240 pos->pos_cb(pos->pos_data, event->object, ddata->pos.x, ddata->pos.y, 240 pos->pos_cb(pos->pos_data, event->object, ddata->pos.x, ddata->pos.y,
241 ddata->action); 241 (Elm_Xdnd_Action)ddata->action);
242} 242}
243 243
244static void 244static void
@@ -287,8 +287,8 @@ _dnd_drop_cb(void *data, const Efl_Event *event)
287 287
288 ddata.x = org_ddata->pos.x; 288 ddata.x = org_ddata->pos.x;
289 ddata.y = org_ddata->pos.y; 289 ddata.y = org_ddata->pos.y;
290 ddata.format = org_ddata->format; 290 ddata.format = (Elm_Sel_Format)org_ddata->format;
291 ddata.action = org_ddata->action; 291 ddata.action = (Elm_Xdnd_Action)org_ddata->action;
292 ddata.data = calloc(1, org_ddata->data.len); 292 ddata.data = calloc(1, org_ddata->data.len);
293 if (!ddata.data) return; 293 if (!ddata.data) return;
294 ddata.data = memcpy(ddata.data, org_ddata->data.mem, org_ddata->data.len); 294 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,
337 337
338 ic->icon_data = icon_create_data; 338 ic->icon_data = icon_create_data;
339 ic->icon_cb = icon_create_cb; 339 ic->icon_cb = icon_create_cb;
340 efl_selection_manager_drag_start(sel_man, obj, format, sl, action, 340 efl_selection_manager_drag_start(sel_man, obj, (Efl_Selection_Format)format, sl,
341 (Efl_Selection_Action)action,
341 ic, _dnd_icon_create_cb, NULL, seatid); 342 ic, _dnd_icon_create_cb, NULL, seatid);
342 343
343 return EINA_TRUE; 344 return EINA_TRUE;
@@ -352,7 +353,7 @@ elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
352#ifdef HAVE_ELEMENTARY_WL2 353#ifdef HAVE_ELEMENTARY_WL2
353 seatid = _wl_default_seat_id_get(obj); 354 seatid = _wl_default_seat_id_get(obj);
354#endif 355#endif
355 efl_selection_manager_drag_action_set(sel_man, obj, action, seatid); 356 efl_selection_manager_drag_action_set(sel_man, obj, (Efl_Selection_Action)action, seatid);
356 357
357 return EINA_TRUE; 358 return EINA_TRUE;
358} 359}
@@ -445,7 +446,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
445 _dnd_drag_pos_cb, pos); 446 _dnd_drag_pos_cb, pos);
446 efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP, 447 efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
447 _dnd_drop_cb, drop); 448 _dnd_drop_cb, drop);
448 efl_selection_manager_drop_target_add(sel_man, obj, format, seatid); 449 efl_selection_manager_drop_target_add(sel_man, obj, (Efl_Selection_Format)format, seatid);
449 450
450 451
451 return EINA_TRUE; 452 return EINA_TRUE;
@@ -497,7 +498,7 @@ elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
497 free(drop->pos); 498 free(drop->pos);
498 free(drop); 499 free(drop);
499 } 500 }
500 efl_selection_manager_drop_target_del(sel_man, obj, format, seatid); 501 efl_selection_manager_drop_target_del(sel_man, obj, (Efl_Selection_Format)format, seatid);
501 502
502 return EINA_TRUE; 503 return EINA_TRUE;
503} 504}
@@ -537,7 +538,7 @@ _dnd_cont_drag_pos_cb(void *data, const Efl_Event *event)
537 } 538 }
538 if (pos->pos_cb) 539 if (pos->pos_cb)
539 pos->pos_cb(pos->pos_data, event->object, ddata->item, ddata->pos.x, ddata->pos.y, 540 pos->pos_cb(pos->pos_data, event->object, ddata->item, ddata->pos.x, ddata->pos.y,
540 xret, yret, ddata->action); 541 xret, yret, (Elm_Xdnd_Action)ddata->action);
541} 542}
542 543
543static void 544static void
@@ -550,8 +551,8 @@ _dnd_cont_drop_cb(void *data, const Efl_Event *event)
550 551
551 ddata.x = org_ddata->pos.x; 552 ddata.x = org_ddata->pos.x;
552 ddata.y = org_ddata->pos.y; 553 ddata.y = org_ddata->pos.y;
553 ddata.format = org_ddata->format; 554 ddata.format = (Elm_Sel_Format)org_ddata->format;
554 ddata.action = org_ddata->action; 555 ddata.action = (Elm_Xdnd_Action)org_ddata->action;
555 ddata.data = calloc(1, org_ddata->data.len); 556 ddata.data = calloc(1, org_ddata->data.len);
556 if (!ddata.data) return; 557 if (!ddata.data) return;
557 ddata.data = memcpy(ddata.data, org_ddata->data.mem, org_ddata->data.len); 558 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,
657 _dnd_cont_drag_pos_cb, pos); 658 _dnd_cont_drag_pos_cb, pos);
658 efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP, 659 efl_event_callback_add(obj, EFL_UI_DND_EVENT_DRAG_DROP,
659 _dnd_cont_drop_cb, drop); 660 _dnd_cont_drop_cb, drop);
660 efl_selection_manager_container_drop_item_add(sel_man, obj, format, 661 efl_selection_manager_container_drop_item_add(sel_man, obj, (Efl_Selection_Format)format,
661 item_get_cb, _dnd_item_func, NULL, 662 item_get_cb, _dnd_item_func, NULL,
662 seatid); 663 seatid);
663 664
@@ -690,7 +691,7 @@ _cont_drag_data_func(void *data, Efl_Object *obj, Efl_Selection_Format *format,
690 di = data; 691 di = data;
691 if (!di) return; 692 if (!di) return;
692 di->data_get_cb(obj, di->it, &di->user_info); 693 di->data_get_cb(obj, di->it, &di->user_info);
693 if (format) *format = di->user_info.format; 694 if (format) *format = (Efl_Selection_Format)di->user_info.format;
694 if (drag_data) 695 if (drag_data)
695 { 696 {
696 if (di->user_info.data) 697 if (di->user_info.data)
@@ -699,7 +700,7 @@ _cont_drag_data_func(void *data, Efl_Object *obj, Efl_Selection_Format *format,
699 drag_data->len = strlen(di->user_info.data); 700 drag_data->len = strlen(di->user_info.data);
700 } 701 }
701 } 702 }
702 if (action) *action = di->user_info.action; 703 if (action) *action = (Efl_Selection_Action)di->user_info.action;
703} 704}
704 705
705static Eina_List * 706static Eina_List *
diff --git a/src/lib/elementary/efl_ui_dnd_container.eo b/src/lib/elementary/efl_ui_dnd_container.eo
index abafe55661..8a8ec2f489 100644
--- a/src/lib/elementary/efl_ui_dnd_container.eo
+++ b/src/lib/elementary/efl_ui_dnd_container.eo
@@ -14,13 +14,11 @@ mixin Efl.Ui.Dnd.Container {
14 time: double; [[The drag delay time]] 14 time: double; [[The drag delay time]]
15 } 15 }
16 } 16 }
17 drag_item_add { //drag_item_callback //property 17 drag_item_add {
18 [[This registers a drag for items in a container. Many items can be 18 [[This registers a drag for items in a container. Many items can be
19 dragged at a time. During dragging, there are three events emitted: 19 dragged at a time. During dragging, there are three events emitted:
20 EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]] 20 EFL_DND_EVENT_DRAG_POS, EFL_DND_EVENT_DRAG_ACCEPT, EFL_DND_EVENT_DRAG_DONE.]]
21 params { 21 params {
22 //@in time_to_drag: double; [[Time since mouse down happens to drag starts]] //drag_delay: property
23 //@in anim_durataion: double; [[animation duration]] //just config
24 @in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]] 22 @in data_func: Efl.Dnd.Drag_Data_Get; [[Data and its format]]
25 @in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]] 23 @in item_func: Efl.Dnd.Item_Get; [[Item to determine drag start]]
26 @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]] 24 @in icon_func: Efl.Dnd.Drag_Icon_Create; [[Icon used during drag]]
@@ -28,7 +26,7 @@ mixin Efl.Ui.Dnd.Container {
28 @in seat: uint; [[Specified seat for multiple seats case.]] 26 @in seat: uint; [[Specified seat for multiple seats case.]]
29 } 27 }
30 } 28 }
31 drag_item_del { //remove 29 drag_item_del {
32 [[Remove drag function of items in the container object.]] 30 [[Remove drag function of items in the container object.]]
33 params { 31 params {
34 @in seat: uint; [[Specified seat for multiple seats case.]] 32 @in seat: uint; [[Specified seat for multiple seats case.]]