#include <stdlib.h>
#include <string.h>
-#include "gdkconfig.h"
-
-#include "gdk/gdkkeysyms.h"
+#include "gdk/gdk.h"
#include "gtkdnd.h"
#include "gtkiconfactory.h"
#include "gtkicontheme.h"
-#include "gtkimage.h"
+#include "gtkimageprivate.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkplug.h"
#include "gtkintl.h"
#include "gtkquartz.h"
#include "gdk/quartz/gdkquartz.h"
+#include "gtkselectionprivate.h"
typedef struct _GtkDragSourceSite GtkDragSourceSite;
typedef struct _GtkDragSourceInfo GtkDragSourceInfo;
selection_data.data = NULL;
selection_data.length = -1;
selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
+ selection_data.display = gdk_display_get_default ();
if (gtk_target_list_find (info->target_list,
selection_data.target,
{
gtk_drag_finish (context,
(selection_data->length >= 0),
- (context->action == GDK_ACTION_MOVE),
+ (gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
time);
}
}
{
int width = gtk_widget_get_allocated_width (widget);
int height = gtk_widget_get_allocated_height (widget);
+ GtkStyleContext *context = gtk_widget_get_style_context (widget);
+
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_DND);
+
+ gtk_render_frame (context, cr, 0, 0, width, height);
- gtk_paint_shadow (gtk_widget_get_style (widget), cr,
- GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- widget, "dnd",
- 0, 0, width, height);
+ gtk_style_context_restore (context);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
cairo_set_line_width (cr, 1.0);
if (site->track_motion || site->flags & GTK_DEST_DEFAULT_MOTION)
{
- if (context->suggested_action & site->actions)
- action = context->suggested_action;
+ if (gdk_drag_context_get_suggested_action (context) & site->actions)
+ action = gdk_drag_context_get_suggested_action (context);
if (action && gtk_drag_dest_find_target (widget, context, NULL))
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), GDK_NONE);
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_NONE);
- g_return_val_if_fail (!context->is_source, GDK_NONE);
dragging_info = gdk_quartz_drag_context_get_dragging_info_libgtk_only (context);
pasteboard = [dragging_info draggingPasteboard];
{
GtkDragSourceInfo *info;
GdkDragContext *context;
+ GdkDevice *pointer;
NSWindow *nswindow;
- context = gdk_drag_begin (NULL, NULL);
- context->is_source = TRUE;
+ context = gdk_drag_begin (gtk_widget_get_window (widget), NULL);
info = gtk_drag_get_source_info (context, TRUE);
g_idle_add_full (G_PRIORITY_HIGH_IDLE, gtk_drag_begin_idle, context, NULL);
- gdk_pointer_ungrab (0);
+ pointer = gdk_drag_context_get_device (info->context);
+ gdk_device_ungrab (pointer, 0);
return context;
}
gint hot_y)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
g_return_if_fail (GTK_IS_WIDGET (widget));
g_warning ("gtk_drag_set_icon_widget is not supported on Mac OS X");
if (stock_id)
{
pixbuf = gtk_widget_render_icon_pixbuf (info->widget, stock_id,
- GTK_ICON_SIZE_DND, NULL);
+ GTK_ICON_SIZE_DND);
if (!pixbuf)
{
gint hot_y)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
set_icon_stock_pixbuf (context, NULL, pixbuf, hot_x, hot_y);
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
g_return_if_fail (stock_id != NULL);
set_icon_stock_pixbuf (context, stock_id, NULL, hot_x, hot_y);
double x_offset, y_offset;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
g_return_if_fail (surface != NULL);
_gtk_cairo_surface_extents (surface, &extents);
gint width, height, icon_size;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
g_return_if_fail (icon_name != NULL);
- screen = gdk_window_get_screen (context->source_window);
+ screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
g_return_if_fail (screen != NULL);
settings = gtk_settings_get_for_screen (screen);
gtk_drag_set_icon_default (GdkDragContext *context)
{
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (context->is_source);
gtk_drag_set_icon_stock (context, GTK_STOCK_DND, -2, -2);
}