quartz: fix up GdkDragContext conversion

This commit is contained in:
Kristian Rietveld 2010-12-22 13:31:58 +01:00
parent 8cb301762a
commit 71404825c3
3 changed files with 19 additions and 24 deletions

View File

@ -27,6 +27,7 @@ libgdk_quartz_la_SOURCES = \
gdkdisplay-quartz.c \ gdkdisplay-quartz.c \
gdkdisplaymanager-quartz.c \ gdkdisplaymanager-quartz.c \
gdkdnd-quartz.c \ gdkdnd-quartz.c \
gdkdnd-quartz.h \
gdkevents-quartz.c \ gdkevents-quartz.c \
gdkeventloop-quartz.c \ gdkeventloop-quartz.c \
gdkgeometry-quartz.c \ gdkgeometry-quartz.c \

View File

@ -19,12 +19,10 @@
*/ */
#include "gdkdnd.h" #include "gdkdnd.h"
#include "gdkdnd-quartz.h"
#include "gdkprivate-quartz.h" #include "gdkprivate-quartz.h"
typedef struct _GdkDragContext GdkDragContextQuartz; G_DEFINE_TYPE (GdkQuartzDragContext, gdk_quartz_drag_context, GDK_TYPE_DRAG_CONTEXT)
typedef struct _GdkDragContextClass GdkDragContextQuartzClass;
G_DEFINE_TYPE (GdkDragContextQuartz, gdk_quartz_drag_context, GDK_TYPE_DRAG_CONTEXT)
GdkDragContext *_gdk_quartz_drag_source_context = NULL; GdkDragContext *_gdk_quartz_drag_source_context = NULL;
@ -40,15 +38,18 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
GdkDevice *device, GdkDevice *device,
GList *targets) GList *targets)
{ {
GdkDragContext *context;
g_assert (_gdk_quartz_drag_source_context == NULL); g_assert (_gdk_quartz_drag_source_context == NULL);
/* Create fake context */ /* Create fake context */
_gdk_quartz_drag_source_context = g_object_new (gdk_quartz_drag_context_get_type (), NULL); _gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
NULL);
_gdk_quartz_drag_source_context->is_source = TRUE; _gdk_quartz_drag_source_context->is_source = TRUE;
gdk_drag_context_set_device (_gdk_quartz_drag_source_context, device); gdk_drag_context_set_device (context, device);
return _gdk_quartz_drag_source_context; return context;
} }
static gboolean static gboolean
@ -65,25 +66,26 @@ gdk_quartz_drag_context_drag_motion (GdkDragContext *context,
return FALSE; return FALSE;
} }
guint32 GdkNativeWindow
_gdk_quartz_display_get_drag_get_protocol (GdkDisplay *display, _gdk_quartz_display_get_drag_get_protocol (GdkDisplay *display,
guint32 xid, GdkNativeWindow *xid,
GdkDragProtocol *protocol) GdkDragProtocol *protocol,
guint version)
{ {
/* FIXME: Implement */ /* FIXME: Implement */
return 0; return 0;
} }
static void static GdkWindow *
gdk_quartz_drag_context_find_window (GdkDragContext *context, gdk_quartz_drag_context_find_window (GdkDragContext *context,
GdkWindow *drag_window, GdkWindow *drag_window,
GdkScreen *screen, GdkScreen *screen,
gint x_root, gint x_root,
gint y_root, gint y_root,
GdkWindow **dest_window,
GdkDragProtocol *protocol) GdkDragProtocol *protocol)
{ {
/* FIXME: Implement */ /* FIXME: Implement */
return NULL;
} }
static void static void
@ -144,14 +146,14 @@ gdk_quartz_drag_context_drop_status (GdkDragContext *context)
return FALSE; return FALSE;
} }
void id
gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context) gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
{ {
return GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info; return GDK_QUARTZ_DRAG_CONTEXT (context)->dragging_info;
} }
static void static void
gdk_quartz_drag_context_init (GdkDragContextQuartz *context) gdk_quartz_drag_context_init (GdkQuartzDragContext *context)
{ {
} }

View File

@ -26,6 +26,7 @@
#include <gdk/gdkprivate.h> #include <gdk/gdkprivate.h>
#include <gdk/quartz/gdkwindow-quartz.h> #include <gdk/quartz/gdkwindow-quartz.h>
#include <gdk/quartz/gdkdnd-quartz.h>
#include <gdk/quartz/gdkquartz.h> #include <gdk/quartz/gdkquartz.h>
#include <gdk/gdk.h> #include <gdk/gdk.h>
@ -34,22 +35,13 @@
#include "config.h" #include "config.h"
#define GDK_DRAG_CONTEXT_PRIVATE(context) ((GdkDragContextPrivate *) GDK_DRAG_CONTEXT (context)->windowing_data)
typedef struct _GdkCursorPrivate GdkCursorPrivate; typedef struct _GdkCursorPrivate GdkCursorPrivate;
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
struct _GdkVisualClass struct _GdkVisualClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
}; };
struct _GdkDragContextPrivate
{
id <NSDraggingInfo> dragging_info;
GdkDevice *device;
};
extern GdkDisplay *_gdk_display; extern GdkDisplay *_gdk_display;
extern GdkScreen *_gdk_screen; extern GdkScreen *_gdk_screen;
extern GdkWindow *_gdk_root; extern GdkWindow *_gdk_root;