[gtk+/gdk-backend-quartz] gtkdnd-quartz: use accessors and add missing include
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend-quartz] gtkdnd-quartz: use accessors and add missing include
- Date: Wed, 22 Dec 2010 16:34:56 +0000 (UTC)
commit f97d67c60a969c5a542a2fb35e33d013918da563
Author: Kristian Rietveld <kris gtk org>
Date: Wed Dec 22 15:45:44 2010 +0100
gtkdnd-quartz: use accessors and add missing include
gtk/gtkdnd-quartz.c | 19 ++++++-------------
1 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 858f9c2..dddb663 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]