aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
index 7908584..372470a 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
@@ -65,7 +65,7 @@ _ecore_x_dnd_init(void)
65 } 65 }
66 66
67 _ecore_x_dnd_init_count++; 67 _ecore_x_dnd_init_count++;
68} /* _ecore_x_dnd_init */ 68}
69 69
70void 70void
71_ecore_x_dnd_shutdown(void) 71_ecore_x_dnd_shutdown(void)
@@ -85,16 +85,16 @@ _ecore_x_dnd_shutdown(void)
85 _target = NULL; 85 _target = NULL;
86 86
87 _ecore_x_dnd_init_count = 0; 87 _ecore_x_dnd_init_count = 0;
88} /* _ecore_x_dnd_shutdown */ 88}
89 89
90static Eina_Bool 90static Eina_Bool
91_ecore_x_dnd_converter_copy(char *target __UNUSED__, 91_ecore_x_dnd_converter_copy(char *target __UNUSED__,
92 void *data, 92 void *data,
93 int size, 93 int size,
94 void **data_ret, 94 void **data_ret,
95 int *size_ret, 95 int *size_ret,
96 Ecore_X_Atom *tprop __UNUSED__, 96 Ecore_X_Atom *tprop __UNUSED__,
97 int *count __UNUSED__) 97 int *count __UNUSED__)
98{ 98{
99 XTextProperty text_prop; 99 XTextProperty text_prop;
100 char *mystr; 100 char *mystr;
@@ -130,11 +130,11 @@ _ecore_x_dnd_converter_copy(char *target __UNUSED__,
130 free(mystr); 130 free(mystr);
131 return EINA_FALSE; 131 return EINA_FALSE;
132 } 132 }
133} /* _ecore_x_dnd_converter_copy */ 133}
134 134
135EAPI void 135EAPI void
136ecore_x_dnd_aware_set(Ecore_X_Window win, 136ecore_x_dnd_aware_set(Ecore_X_Window win,
137 Eina_Bool on) 137 Eina_Bool on)
138{ 138{
139 Ecore_X_Atom prop_data = ECORE_X_DND_VERSION; 139 Ecore_X_Atom prop_data = ECORE_X_DND_VERSION;
140 140
@@ -144,7 +144,7 @@ ecore_x_dnd_aware_set(Ecore_X_Window win,
144 XA_ATOM, 32, &prop_data, 1); 144 XA_ATOM, 32, &prop_data, 1);
145 else 145 else
146 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE); 146 ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE);
147} /* ecore_x_dnd_aware_set */ 147}
148 148
149EAPI int 149EAPI int
150ecore_x_dnd_version_get(Ecore_X_Window win) 150ecore_x_dnd_version_get(Ecore_X_Window win)
@@ -208,11 +208,11 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
208 } 208 }
209 209
210 return 0; 210 return 0;
211} /* ecore_x_dnd_version_get */ 211}
212 212
213EAPI Eina_Bool 213EAPI Eina_Bool
214ecore_x_dnd_type_isset(Ecore_X_Window win, 214ecore_x_dnd_type_isset(Ecore_X_Window win,
215 const char *type) 215 const char *type)
216{ 216{
217 int num, i, ret = EINA_FALSE; 217 int num, i, ret = EINA_FALSE;
218 unsigned char *data; 218 unsigned char *data;
@@ -237,12 +237,12 @@ ecore_x_dnd_type_isset(Ecore_X_Window win,
237 237
238 XFree(data); 238 XFree(data);
239 return ret; 239 return ret;
240} /* ecore_x_dnd_type_isset */ 240}
241 241
242EAPI void 242EAPI void
243ecore_x_dnd_type_set(Ecore_X_Window win, 243ecore_x_dnd_type_set(Ecore_X_Window win,
244 const char *type, 244 const char *type,
245 Eina_Bool on) 245 Eina_Bool on)
246{ 246{
247 Ecore_X_Atom atom; 247 Ecore_X_Atom atom;
248 Ecore_X_Atom *oldset = NULL, *newset = NULL; 248 Ecore_X_Atom *oldset = NULL, *newset = NULL;
@@ -305,12 +305,12 @@ ecore_x_dnd_type_set(Ecore_X_Window win,
305 305
306 XFree(oldset); 306 XFree(oldset);
307 free(newset); 307 free(newset);
308} /* ecore_x_dnd_type_set */ 308}
309 309
310EAPI void 310EAPI void
311ecore_x_dnd_types_set(Ecore_X_Window win, 311ecore_x_dnd_types_set(Ecore_X_Window win,
312 const char **types, 312 const char **types,
313 unsigned int num_types) 313 unsigned int num_types)
314{ 314{
315 Ecore_X_Atom *newset = NULL; 315 Ecore_X_Atom *newset = NULL;
316 unsigned int i; 316 unsigned int i;
@@ -336,12 +336,12 @@ ecore_x_dnd_types_set(Ecore_X_Window win,
336 XA_ATOM, 32, data, num_types); 336 XA_ATOM, 32, data, num_types);
337 free(newset); 337 free(newset);
338 } 338 }
339} /* ecore_x_dnd_types_set */ 339}
340 340
341EAPI void 341EAPI void
342ecore_x_dnd_actions_set(Ecore_X_Window win, 342ecore_x_dnd_actions_set(Ecore_X_Window win,
343 Ecore_X_Atom *actions, 343 Ecore_X_Atom *actions,
344 unsigned int num_actions) 344 unsigned int num_actions)
345{ 345{
346 unsigned int i; 346 unsigned int i;
347 unsigned char *data = NULL; 347 unsigned char *data = NULL;
@@ -360,7 +360,7 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
360 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_ACTION_LIST, 360 ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_ACTION_LIST,
361 XA_ATOM, 32, data, num_actions); 361 XA_ATOM, 32, data, num_actions);
362 } 362 }
363} /* ecore_x_dnd_actions_set */ 363}
364 364
365/** 365/**
366 * The DND position update cb is called Ecore_X sends a DND position to a 366 * The DND position update cb is called Ecore_X sends a DND position to a
@@ -378,9 +378,9 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
378 */ 378 */
379EAPI void 379EAPI void
380ecore_x_dnd_callback_pos_update_set( 380ecore_x_dnd_callback_pos_update_set(
381 void (*cb)(void *, 381 void (*cb)(void *,
382 Ecore_X_Xdnd_Position *data), 382 Ecore_X_Xdnd_Position *data),
383 const void *data) 383 const void *data)
384{ 384{
385 _posupdatecb = cb; 385 _posupdatecb = cb;
386 _posupdatedata = (void *)data; /* Discard the const early */ 386 _posupdatedata = (void *)data; /* Discard the const early */
@@ -390,18 +390,18 @@ Ecore_X_DND_Source *
390_ecore_x_dnd_source_get(void) 390_ecore_x_dnd_source_get(void)
391{ 391{
392 return _source; 392 return _source;
393} /* _ecore_x_dnd_source_get */ 393}
394 394
395Ecore_X_DND_Target * 395Ecore_X_DND_Target *
396_ecore_x_dnd_target_get(void) 396_ecore_x_dnd_target_get(void)
397{ 397{
398 return _target; 398 return _target;
399} /* _ecore_x_dnd_target_get */ 399}
400 400
401EAPI Eina_Bool 401EAPI Eina_Bool
402ecore_x_dnd_begin(Ecore_X_Window source, 402ecore_x_dnd_begin(Ecore_X_Window source,
403 unsigned char *data, 403 unsigned char *data,
404 int size) 404 int size)
405{ 405{
406 LOGFN(__FILE__, __LINE__, __FUNCTION__); 406 LOGFN(__FILE__, __LINE__, __FUNCTION__);
407 if (!ecore_x_dnd_version_get(source)) 407 if (!ecore_x_dnd_version_get(source))
@@ -433,7 +433,7 @@ ecore_x_dnd_begin(Ecore_X_Window source,
433 _source->dest = None; 433 _source->dest = None;
434 434
435 return EINA_TRUE; 435 return EINA_TRUE;
436} /* ecore_x_dnd_begin */ 436}
437 437
438EAPI Eina_Bool 438EAPI Eina_Bool
439ecore_x_dnd_drop(void) 439ecore_x_dnd_drop(void)
@@ -471,8 +471,8 @@ ecore_x_dnd_drop(void)
471 else 471 else
472 { 472 {
473 /* Dropping on nothing */ 473 /* Dropping on nothing */
474 ecore_x_selection_xdnd_clear(); 474 ecore_x_selection_xdnd_clear();
475 _source->state = ECORE_X_DND_SOURCE_IDLE; 475 _source->state = ECORE_X_DND_SOURCE_IDLE;
476 } 476 }
477 477
478 ecore_x_window_ignore_set(_source->win, 0); 478 ecore_x_window_ignore_set(_source->win, 0);
@@ -480,13 +480,13 @@ ecore_x_dnd_drop(void)
480 _source->prev.window = 0; 480 _source->prev.window = 0;
481 481
482 return status; 482 return status;
483} /* ecore_x_dnd_drop */ 483}
484 484
485EAPI void 485EAPI void
486ecore_x_dnd_send_status(Eina_Bool will_accept, 486ecore_x_dnd_send_status(Eina_Bool will_accept,
487 Eina_Bool suppress, 487 Eina_Bool suppress,
488 Ecore_X_Rectangle rectangle, 488 Ecore_X_Rectangle rectangle,
489 Ecore_X_Atom action) 489 Ecore_X_Atom action)
490{ 490{
491 XEvent xev; 491 XEvent xev;
492 492
@@ -532,7 +532,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
532 } 532 }
533 533
534 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 534 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
535} /* ecore_x_dnd_send_status */ 535}
536 536
537EAPI void 537EAPI void
538ecore_x_dnd_send_finished(void) 538ecore_x_dnd_send_finished(void)
@@ -561,7 +561,7 @@ ecore_x_dnd_send_finished(void)
561 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 561 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
562 562
563 _target->state = ECORE_X_DND_TARGET_IDLE; 563 _target->state = ECORE_X_DND_TARGET_IDLE;
564} /* ecore_x_dnd_send_finished */ 564}
565 565
566EAPI void 566EAPI void
567ecore_x_dnd_source_action_set(Ecore_X_Atom action) 567ecore_x_dnd_source_action_set(Ecore_X_Atom action)
@@ -569,18 +569,18 @@ ecore_x_dnd_source_action_set(Ecore_X_Atom action)
569 _source->action = action; 569 _source->action = action;
570 if (_source->prev.window) 570 if (_source->prev.window)
571 _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y); 571 _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
572} /* ecore_x_dnd_source_action_set */ 572}
573 573
574EAPI Ecore_X_Atom 574EAPI Ecore_X_Atom
575ecore_x_dnd_source_action_get(void) 575ecore_x_dnd_source_action_get(void)
576{ 576{
577 return _source->action; 577 return _source->action;
578} /* ecore_x_dnd_source_action_get */ 578}
579 579
580void 580void
581_ecore_x_dnd_drag(Ecore_X_Window root, 581_ecore_x_dnd_drag(Ecore_X_Window root,
582 int x, 582 int x,
583 int y) 583 int y)
584{ 584{
585 XEvent xev; 585 XEvent xev;
586 Ecore_X_Window win; 586 Ecore_X_Window win;
@@ -701,6 +701,6 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
701 _source->prev.y = y; 701 _source->prev.y = y;
702 _source->prev.window = root; 702 _source->prev.window = root;
703 _source->dest = win; 703 _source->dest = win;
704} /* _ecore_x_dnd_drag */ 704}
705 705
706/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 706/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/