summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-10-26 10:30:23 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-02-02 13:32:30 -0500
commit8cc52073558fccf18d25a9f70e3f78e9dd4f5559 (patch)
treed4f24ca572012b862e9e2d3c013e09b7107d6f77
parentc648775b9571d327b082c7f80b83084ee8e1f35a (diff)
Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl_data.c99
1 files changed, 64 insertions, 35 deletions
diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c
index 2da7de47f..54a6f70f1 100644
--- a/src/bin/e_comp_wl_data.c
+++ b/src/bin/e_comp_wl_data.c
@@ -70,7 +70,7 @@ _e_comp_wl_data_offer_cb_source_destroy(struct wl_listener *listener, void *data
70 E_Comp_Wl_Data_Offer *offer; 70 E_Comp_Wl_Data_Offer *offer;
71 71
72 DBG("Data Offer Source Destroy"); 72 DBG("Data Offer Source Destroy");
73 offer = container_of(listener, E_Comp_Wl_Data_Offer, 73 offer = container_of(listener, E_Comp_Wl_Data_Offer,
74 source_destroy_listener); 74 source_destroy_listener);
75 if (!offer) return; 75 if (!offer) return;
76 76
@@ -256,14 +256,13 @@ _e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Sour
256 if (focus) 256 if (focus)
257 { 257 {
258 data_device_res = 258 data_device_res =
259 e_comp_wl_data_find_for_client(wl_resource_get_client(focus)); 259 e_comp_wl_data_find_for_client(wl_resource_get_client(focus));
260 if ((data_device_res) && (source)) 260 if ((data_device_res) && (source))
261 { 261 {
262 offer_res = 262 offer_res =
263 _e_comp_wl_data_device_data_offer_create(source, 263 _e_comp_wl_data_device_data_offer_create(source,
264 data_device_res); 264 data_device_res);
265 wl_data_device_send_selection(data_device_res, offer_res); 265 wl_data_device_send_selection(data_device_res, offer_res);
266
267 } 266 }
268 else if (data_device_res) 267 else if (data_device_res)
269 wl_data_device_send_selection(data_device_res, NULL); 268 wl_data_device_send_selection(data_device_res, NULL);
@@ -302,8 +301,10 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
302 if (e_client_has_xwindow(e_comp_wl->selection.target)) 301 if (e_client_has_xwindow(e_comp_wl->selection.target))
303 { 302 {
304 ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->selection.target), 303 ecore_x_client_message32_send(e_client_util_win_get(e_comp_wl->selection.target),
305 ECORE_X_ATOM_XDND_DROP, ECORE_X_EVENT_MASK_NONE, 304 ECORE_X_ATOM_XDND_DROP,
306 e_comp->cm_selection, 0, ecore_x_current_time_get(), 0, 0); 305 ECORE_X_EVENT_MASK_NONE,
306 e_comp->cm_selection, 0,
307 ecore_x_current_time_get(), 0, 0);
307 } 308 }
308 else 309 else
309#endif 310#endif
@@ -319,7 +320,8 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
319#ifndef HAVE_WAYLAND_ONLY 320#ifndef HAVE_WAYLAND_ONLY
320 if (e_comp_util_has_xwayland()) 321 if (e_comp_util_has_xwayland())
321 { 322 {
322 ecore_x_selection_owner_set(0, ECORE_X_ATOM_SELECTION_XDND, ecore_x_current_time_get()); 323 ecore_x_selection_owner_set(0, ECORE_X_ATOM_SELECTION_XDND,
324 ecore_x_current_time_get());
323 ecore_x_window_hide(e_comp->cm_selection); 325 ecore_x_window_hide(e_comp->cm_selection);
324 } 326 }
325#endif 327#endif
@@ -340,7 +342,8 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
340 342
341 DBG("Data Device Drag Start"); 343 DBG("Data Device Drag Start");
342 344
343 if ((e_comp_wl->kbd.focus) && (e_comp_wl->kbd.focus != origin_resource)) return; 345 if ((e_comp_wl->kbd.focus) && (e_comp_wl->kbd.focus != origin_resource))
346 return;
344 347
345 if (!(source = wl_resource_get_user_data(source_resource))) return; 348 if (!(source = wl_resource_get_user_data(source_resource))) return;
346 e_comp_wl->drag_source = source; 349 e_comp_wl->drag_source = source;
@@ -371,9 +374,10 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
371 } 374 }
372 375
373 evas_pointer_canvas_xy_get(e_comp->evas, &x, &y); 376 evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
374 e_comp_wl->drag = e_drag_new(x, y, 377 e_comp_wl->drag = e_drag_new(x, y, NULL, 0, NULL, 0, NULL,
375 NULL, 0, NULL, 0, NULL, _e_comp_wl_data_device_drag_finished); 378 _e_comp_wl_data_device_drag_finished);
376 e_comp_wl->drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas); 379 e_comp_wl->drag->button_mask =
380 evas_pointer_button_down_mask_get(e_comp->evas);
377 if (ec) 381 if (ec)
378 e_drag_object_set(e_comp_wl->drag, ec->frame); 382 e_drag_object_set(e_comp_wl->drag, ec->frame);
379 e_drag_start(e_comp_wl->drag, x, y); 383 e_drag_start(e_comp_wl->drag, x, y);
@@ -381,7 +385,9 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
381 if (e_comp_util_has_xwayland()) 385 if (e_comp_util_has_xwayland())
382 { 386 {
383 ecore_x_window_show(e_comp->cm_selection); 387 ecore_x_window_show(e_comp->cm_selection);
384 ecore_x_selection_owner_set(e_comp->cm_selection, ECORE_X_ATOM_SELECTION_XDND, ecore_x_current_time_get()); 388 ecore_x_selection_owner_set(e_comp->cm_selection,
389 ECORE_X_ATOM_SELECTION_XDND,
390 ecore_x_current_time_get());
385 } 391 }
386#endif 392#endif
387 if (e_comp_wl->ptr.ec) 393 if (e_comp_wl->ptr.ec)
@@ -441,7 +447,8 @@ _e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resour
441 } 447 }
442 448
443 eina_hash_add(e_comp_wl->mgr.data_resources, &client, res); 449 eina_hash_add(e_comp_wl->mgr.data_resources, &client, res);
444 wl_resource_set_implementation(res, &_e_data_device_interface, e_comp->wl_comp_data, 450 wl_resource_set_implementation(res, &_e_data_device_interface,
451 e_comp->wl_comp_data,
445 _e_comp_wl_data_device_cb_unbind); 452 _e_comp_wl_data_device_cb_unbind);
446} 453}
447 454
@@ -469,7 +476,8 @@ _e_comp_wl_data_cb_bind_manager(struct wl_client *client, void *data EINA_UNUSED
469 struct wl_resource *res; 476 struct wl_resource *res;
470 477
471 /* try to create data manager resource */ 478 /* try to create data manager resource */
472 e_comp_wl->mgr.resource = res = wl_resource_create(client, &wl_data_device_manager_interface, 1, id); 479 e_comp_wl->mgr.resource = res =
480 wl_resource_create(client, &wl_data_device_manager_interface, 1, id);
473 if (!res) 481 if (!res)
474 { 482 {
475 ERR("Could not create data device manager: %m"); 483 ERR("Could not create data device manager: %m");
@@ -628,8 +636,8 @@ _e_comp_wl_clipboard_selection_set(struct wl_listener *listener EINA_UNUSED, voi
628 sel_source->send(sel_source, mime_type, p[1]); 636 sel_source->send(sel_source, mime_type, p[1]);
629 637
630 e_comp_wl->clipboard.source = 638 e_comp_wl->clipboard.source =
631 e_comp_wl_clipboard_source_create(mime_type, 639 e_comp_wl_clipboard_source_create(mime_type,
632 e_comp_wl->selection.serial, p[0]); 640 e_comp_wl->selection.serial, p[0]);
633 641
634 if (!e_comp_wl->clipboard.source) 642 if (!e_comp_wl->clipboard.source)
635 close(p[0]); 643 close(p[0]);
@@ -658,17 +666,20 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
658 uint32_t serial; 666 uint32_t serial;
659 int x, y; 667 int x, y;
660 668
661 if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->drag_client)) return; 669 if (e_client_has_xwindow(ec) &&
670 e_client_has_xwindow(e_comp_wl->drag_client))
671 return;
662 if (!e_client_has_xwindow(ec)) 672 if (!e_client_has_xwindow(ec))
663 { 673 {
664 data_device_res = 674 data_device_res =
665 e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface)); 675 e_comp_wl_data_find_for_client(wl_resource_get_client(ec->comp_data->surface));
666 if (!data_device_res) return; 676 if (!data_device_res) return;
667 offer_res = e_comp_wl_data_device_send_offer(ec); 677 offer_res = e_comp_wl_data_device_send_offer(ec);
668 if (e_comp_wl->drag_source && (!offer_res)) return; 678 if (e_comp_wl->drag_source && (!offer_res)) return;
669 } 679 }
670 e_comp_wl->selection.target = ec; 680 e_comp_wl->selection.target = ec;
671 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, ec); 681 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_DEL,
682 _e_comp_wl_data_device_target_del, ec);
672 683
673#ifndef HAVE_WAYLAND_ONLY 684#ifndef HAVE_WAYLAND_ONLY
674 if (e_client_has_xwindow(ec)) 685 if (e_client_has_xwindow(ec))
@@ -703,8 +714,10 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
703 } 714 }
704 715
705 ecore_x_client_message32_send(e_client_util_win_get(ec), 716 ecore_x_client_message32_send(e_client_util_win_get(ec),
706 ECORE_X_ATOM_XDND_ENTER, ECORE_X_EVENT_MASK_NONE, 717 ECORE_X_ATOM_XDND_ENTER,
707 e_comp->cm_selection, d1, d2, d3, d4); 718 ECORE_X_EVENT_MASK_NONE,
719 e_comp->cm_selection, d1, d2, d3, d4);
720
708 return; 721 return;
709 } 722 }
710#endif 723#endif
@@ -712,7 +725,8 @@ e_comp_wl_data_device_send_enter(E_Client *ec)
712 y = wl_fixed_to_int(e_comp_wl->ptr.y) - e_comp_wl->selection.target->client.y; 725 y = wl_fixed_to_int(e_comp_wl->ptr.y) - e_comp_wl->selection.target->client.y;
713 serial = wl_display_next_serial(e_comp_wl->wl.disp); 726 serial = wl_display_next_serial(e_comp_wl->wl.disp);
714 wl_data_device_send_enter(data_device_res, serial, ec->comp_data->surface, 727 wl_data_device_send_enter(data_device_res, serial, ec->comp_data->surface,
715 wl_fixed_from_int(x), wl_fixed_from_int(y), offer_res); 728 wl_fixed_from_int(x), wl_fixed_from_int(y),
729 offer_res);
716} 730}
717 731
718E_API void 732E_API void
@@ -720,16 +734,20 @@ e_comp_wl_data_device_send_leave(E_Client *ec)
720{ 734{
721 struct wl_resource *res; 735 struct wl_resource *res;
722 736
723 if (e_client_has_xwindow(ec) && e_client_has_xwindow(e_comp_wl->drag_client)) return; 737 if (e_client_has_xwindow(ec) &&
724 evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL, _e_comp_wl_data_device_target_del, ec); 738 e_client_has_xwindow(e_comp_wl->drag_client))
739 return;
740 evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_DEL,
741 _e_comp_wl_data_device_target_del, ec);
725 if (e_comp_wl->selection.target == ec) 742 if (e_comp_wl->selection.target == ec)
726 e_comp_wl->selection.target = NULL; 743 e_comp_wl->selection.target = NULL;
727#ifndef HAVE_WAYLAND_ONLY 744#ifndef HAVE_WAYLAND_ONLY
728 if (e_client_has_xwindow(ec)) 745 if (e_client_has_xwindow(ec))
729 { 746 {
730 ecore_x_client_message32_send(e_client_util_win_get(ec), 747 ecore_x_client_message32_send(e_client_util_win_get(ec),
731 ECORE_X_ATOM_XDND_LEAVE, ECORE_X_EVENT_MASK_NONE, 748 ECORE_X_ATOM_XDND_LEAVE,
732 e_comp->cm_selection, 0, 0, 0, 0); 749 ECORE_X_EVENT_MASK_NONE,
750 e_comp->cm_selection, 0, 0, 0, 0);
733 return; 751 return;
734 } 752 }
735#endif 753#endif
@@ -749,7 +767,11 @@ e_comp_wl_data_device_send_offer(E_Client *ec)
749 if (!data_device_res) return NULL; 767 if (!data_device_res) return NULL;
750 source = e_comp_wl->drag_source; 768 source = e_comp_wl->drag_source;
751 if (source) 769 if (source)
752 offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res); 770 {
771 offer_res =
772 _e_comp_wl_data_device_data_offer_create(source, data_device_res);
773 }
774
753 return offer_res; 775 return offer_res;
754} 776}
755 777
@@ -784,17 +806,23 @@ e_comp_wl_data_device_keyboard_focus_set(void)
784 else if (source && e_client_has_xwindow(e_client_focused_get())) 806 else if (source && e_client_has_xwindow(e_client_focused_get()))
785 { 807 {
786 /* wl -> x11 */ 808 /* wl -> x11 */
787 ecore_x_selection_owner_set(e_comp->cm_selection, ECORE_X_ATOM_SELECTION_CLIPBOARD, ecore_x_current_time_get()); 809 ecore_x_selection_owner_set(e_comp->cm_selection,
810 ECORE_X_ATOM_SELECTION_CLIPBOARD,
811 ecore_x_current_time_get());
788 return; 812 return;
789 } 813 }
790 } while (0); 814 } while (0);
791#endif 815#endif
792 data_device_res = 816 data_device_res =
793 e_comp_wl_data_find_for_client(wl_resource_get_client(focus)); 817 e_comp_wl_data_find_for_client(wl_resource_get_client(focus));
794 if (!data_device_res) return; 818 if (!data_device_res) return;
795 819
796 if (source) 820 if (source)
797 offer_res = _e_comp_wl_data_device_data_offer_create(source, data_device_res); 821 {
822 offer_res =
823 _e_comp_wl_data_device_data_offer_create(source, data_device_res);
824 }
825
798 wl_data_device_send_selection(data_device_res, offer_res); 826 wl_data_device_send_selection(data_device_res, offer_res);
799} 827}
800 828
@@ -894,15 +922,16 @@ e_comp_wl_clipboard_source_create(const char *mime_type, uint32_t serial, int fd
894 { 922 {
895 if (!source->data_source.mime_types) 923 if (!source->data_source.mime_types)
896 source->data_source.mime_types = eina_array_new(1); 924 source->data_source.mime_types = eina_array_new(1);
897 eina_array_push(source->data_source.mime_types, eina_stringshare_add(mime_type)); 925 eina_array_push(source->data_source.mime_types,
926 eina_stringshare_add(mime_type));
898 } 927 }
899 928
900 if (fd > 0) 929 if (fd > 0)
901 { 930 {
902 source->fd_handler = 931 source->fd_handler =
903 ecore_main_fd_handler_add(fd, ECORE_FD_READ, 932 ecore_main_fd_handler_add(fd, ECORE_FD_READ,
904 _e_comp_wl_clipboard_source_save, 933 _e_comp_wl_clipboard_source_save,
905 e_comp->wl_comp_data, NULL, NULL); 934 e_comp->wl_comp_data, NULL, NULL);
906 if (!source->fd_handler) return NULL; 935 if (!source->fd_handler) return NULL;
907 } 936 }
908 937