gtkdnd-quartz: use accessors and add missing include
This commit is contained in:
parent
7979be1430
commit
44d9fb2d71
@ -43,6 +43,7 @@
|
||||
#include "gtkintl.h"
|
||||
#include "gtkquartz.h"
|
||||
#include "gdk/quartz/gdkquartz.h"
|
||||
#include "gtkselectionprivate.h"
|
||||
|
||||
typedef struct _GtkDragSourceSite GtkDragSourceSite;
|
||||
typedef struct _GtkDragSourceInfo GtkDragSourceInfo;
|
||||
@ -229,7 +230,7 @@ gtk_drag_get_data (GtkWidget *widget,
|
||||
{
|
||||
gtk_drag_finish (context,
|
||||
(selection_data->length >= 0),
|
||||
(context->action == GDK_ACTION_MOVE),
|
||||
(gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
|
||||
time);
|
||||
}
|
||||
}
|
||||
@ -807,8 +808,8 @@ gtk_drag_dest_motion (GtkWidget *widget,
|
||||
|
||||
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))
|
||||
{
|
||||
@ -1001,7 +1002,6 @@ gtk_drag_dest_find_target (GtkWidget *widget,
|
||||
|
||||
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];
|
||||
@ -1110,7 +1110,6 @@ gtk_drag_begin_internal (GtkWidget *widget,
|
||||
NSWindow *nswindow;
|
||||
|
||||
context = gdk_drag_begin (NULL, NULL);
|
||||
context->is_source = TRUE;
|
||||
|
||||
info = gtk_drag_get_source_info (context, TRUE);
|
||||
|
||||
@ -1545,7 +1544,6 @@ gtk_drag_set_icon_widget (GdkDragContext *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");
|
||||
@ -1565,7 +1563,7 @@ set_icon_stock_pixbuf (GdkDragContext *context,
|
||||
if (stock_id)
|
||||
{
|
||||
pixbuf = gtk_widget_render_icon_pixbuf (info->widget, stock_id,
|
||||
GTK_ICON_SIZE_DND, NULL);
|
||||
GTK_ICON_SIZE_DND);
|
||||
|
||||
if (!pixbuf)
|
||||
{
|
||||
@ -1600,7 +1598,6 @@ gtk_drag_set_icon_pixbuf (GdkDragContext *context,
|
||||
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);
|
||||
@ -1624,7 +1621,6 @@ gtk_drag_set_icon_stock (GdkDragContext *context,
|
||||
{
|
||||
|
||||
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);
|
||||
@ -1692,7 +1688,6 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
|
||||
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);
|
||||
@ -1734,10 +1729,9 @@ gtk_drag_set_icon_name (GdkDragContext *context,
|
||||
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);
|
||||
@ -1770,7 +1764,6 @@ void
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user