From: Руслан Ижбулатов Date: Sat, 24 Mar 2018 16:28:52 +0000 (+0000) Subject: GDK W32: adapt to GdkDragProtocol removal X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~736 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=38b4c8d1fa868441fc1ec83d9242b42c26c9ca19;p=gtk4.git GDK W32: adapt to GdkDragProtocol removal https://bugzilla.gnome.org/show_bug.cgi?id=773299 --- diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index e4d00ce0ef..92cc8c88cd 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -265,7 +265,7 @@ gdk_drag_context_new (GdkDisplay *display, g_set_object (&context->source_surface, source_surface); g_set_object (&context->dest_surface, dest_surface); context->actions = actions; - context->protocol = protocol; + context_win32->protocol = protocol; return context; } @@ -1834,7 +1834,7 @@ local_send_leave (GdkDragContext *context, current_dest_drag)); if ((current_dest_drag != NULL) && - (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && + (GDK_WIN32_DRAG_CONTEXT (current_dest_drag)->protocol == GDK_DRAG_PROTO_LOCAL) && (current_dest_drag->source_surface == context->source_surface)) { tmp_event = gdk_event_new (GDK_DRAG_LEAVE); @@ -1915,7 +1915,7 @@ local_send_motion (GdkDragContext *context, current_dest_drag)); if ((current_dest_drag != NULL) && - (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && + (GDK_WIN32_DRAG_CONTEXT (current_dest_drag)->protocol == GDK_DRAG_PROTO_LOCAL) && (current_dest_drag->source_surface == context->source_surface)) { GdkWin32DragContext *current_dest_drag_win32; @@ -1956,7 +1956,7 @@ local_send_drop (GdkDragContext *context, current_dest_drag)); if ((current_dest_drag != NULL) && - (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && + (GDK_WIN32_DRAG_CONTEXT (current_dest_drag)->protocol == GDK_DRAG_PROTO_LOCAL) && (current_dest_drag->source_surface == context->source_surface)) { GdkWin32DragContext *context_win32; @@ -1993,7 +1993,7 @@ gdk_drag_do_leave (GdkDragContext *context, if (!use_ole2_dnd) { - if (context->protocol == GDK_DRAG_PROTO_LOCAL) + if (GDK_WIN32_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_LOCAL) local_send_leave (context, time); } @@ -2320,7 +2320,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, if (dest_surface) { g_set_object (&context->dest_surface, dest_surface); - context->protocol = protocol; + context_win32->protocol = protocol; switch (protocol) { @@ -2368,7 +2368,7 @@ gdk_win32_drag_context_drag_motion (GdkDragContext *context, { if (context_win32->drag_status == GDK_DRAG_STATUS_DRAG) { - switch (context->protocol) + switch (context_win32->protocol) { case GDK_DRAG_PROTO_LOCAL: local_send_motion (context, x_root, y_root, suggested_action, time); @@ -2417,7 +2417,7 @@ gdk_win32_drag_context_drag_drop (GdkDragContext *context, if (!use_ole2_dnd) { if (context->dest_surface && - context->protocol == GDK_DRAG_PROTO_LOCAL) + GDK_WIN32_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_LOCAL) local_send_drop (context, time); } else @@ -2507,7 +2507,7 @@ gdk_win32_drag_context_drop_reply (GdkDragContext *context, if (!use_ole2_dnd) if (context->dest_surface) { - if (context->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES) + if (GDK_WIN32_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_WIN32_DROPFILES) _gdk_dropfiles_store (NULL); } } @@ -2646,7 +2646,7 @@ gdk_win32_drag_context_drop_status (GdkDragContext *context) static GdkAtom gdk_win32_drag_context_get_selection (GdkDragContext *context) { - switch (context->protocol) + switch (GDK_WIN32_DRAG_CONTEXT (context)->protocol) { case GDK_DRAG_PROTO_LOCAL: return _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_LOCAL_DND_SELECTION); diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 6f8f7e7caa..dab4d7542f 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -56,6 +56,7 @@ #include "gdkdeviceprivate.h" #include "gdkdevice-wintab.h" #include "gdkwin32dnd.h" +#include "gdkwin32dnd-private.h" #include "gdkdisplay-win32.h" //#include "gdkselection-win32.h" #include "gdkdndprivate.h" @@ -867,7 +868,7 @@ _gdk_win32_print_event (const GdkEvent *event) if (event->dnd.context != NULL) g_print ("ctx:%p: %s %s src:%p dest:%p", event->dnd.context, - _gdk_win32_drag_protocol_to_string (event->dnd.context->protocol), + _gdk_win32_drag_protocol_to_string (GDK_WIN32_DRAG_CONTEXT (event->dnd.context)->protocol), event->dnd.context->is_source ? "SOURCE" : "DEST", event->dnd.context->source_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->source_surface), event->dnd.context->dest_surface == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->dest_surface)); diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index d76106f3cd..cf73d6cf51 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -268,9 +268,6 @@ _gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol) switch (protocol) { #define CASE(x) case GDK_DRAG_PROTO_##x: return #x - CASE (MOTIF); - CASE (XDND); - CASE (ROOTWIN); CASE (NONE); CASE (WIN32_DROPFILES); CASE (OLE2); diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index 18684a9140..7cea29150f 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -151,6 +151,14 @@ typedef enum { GDK_WIN32_PE_INUSE } GdkWin32PalEntryState; +typedef enum +{ + GDK_DRAG_PROTO_NONE = 0, + GDK_DRAG_PROTO_WIN32_DROPFILES, + GDK_DRAG_PROTO_OLE2, + GDK_DRAG_PROTO_LOCAL, +} GdkDragProtocol; + GType _gdk_gc_win32_get_type (void); gulong _gdk_win32_get_next_tick (gulong suggested_tick); diff --git a/gdk/win32/gdkwin32dnd-private.h b/gdk/win32/gdkwin32dnd-private.h index 4f8f872ed7..1492313322 100644 --- a/gdk/win32/gdkwin32dnd-private.h +++ b/gdk/win32/gdkwin32dnd-private.h @@ -39,6 +39,7 @@ struct _GdkWin32DragContextUtilityData struct _GdkWin32DragContext { GdkDragContext context; + GdkDragProtocol protocol; GdkSurface *ipc_window; GdkSurface *drag_surface; GdkCursor *cursor; @@ -66,6 +67,7 @@ struct _GdkWin32DragContextClass struct _GdkWin32DropContext { GdkDragContext context; + GdkDragProtocol protocol; GdkDragAction actions; GdkDragAction current_action;