Reverted coding style "fixups"

Wed Feb 10 11:05:53 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c: Reverted coding style "fixups"
This commit is contained in:
Owen Taylor 1999-02-10 16:01:48 +00:00 committed by Owen Taylor
parent c9312d02a4
commit d8eb880d7d
8 changed files with 429 additions and 416 deletions

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -1,3 +1,7 @@
Wed Feb 10 11:05:53 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Reverted coding style "fixups"
Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com> Wed Feb 10 10:43:50 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group): * gdk/gdkwindow.c (gdk_window_set_icon, gdk_window_set_group):

View File

@ -36,15 +36,13 @@ typedef struct _GtkDragAnim GtkDragAnim;
typedef struct _GtkDragFindData GtkDragFindData; typedef struct _GtkDragFindData GtkDragFindData;
typedef enum typedef enum {
{
GTK_DRAG_STATUS_DRAG, GTK_DRAG_STATUS_DRAG,
GTK_DRAG_STATUS_WAIT, GTK_DRAG_STATUS_WAIT,
GTK_DRAG_STATUS_DROP GTK_DRAG_STATUS_DROP
} GtkDragStatus; } GtkDragStatus;
struct _GtkDragSourceSite struct _GtkDragSourceSite {
{
GdkModifierType start_button_mask; GdkModifierType start_button_mask;
GtkTargetList *target_list; /* Targets for drag data */ GtkTargetList *target_list; /* Targets for drag data */
GdkDragAction actions; /* Possible actions */ GdkDragAction actions; /* Possible actions */
@ -57,8 +55,7 @@ struct _GtkDragSourceSite
gint x, y; gint x, y;
}; };
struct _GtkDragSourceInfo struct _GtkDragSourceInfo {
{
GtkWidget *widget; GtkWidget *widget;
GtkTargetList *target_list; /* Targets for drag data */ GtkTargetList *target_list; /* Targets for drag data */
GdkDragAction possible_actions; /* Actions allowed by source */ GdkDragAction possible_actions; /* Actions allowed by source */
@ -82,8 +79,7 @@ struct _GtkDragSourceInfo
guint drop_timeout; /* Timeout for aborting drop */ guint drop_timeout; /* Timeout for aborting drop */
}; };
struct _GtkDragDestSite struct _GtkDragDestSite {
{
GtkDestDefaults flags; GtkDestDefaults flags;
GtkTargetList *target_list; GtkTargetList *target_list;
GdkDragAction actions; GdkDragAction actions;
@ -94,8 +90,7 @@ struct _GtkDragDestSite
gboolean have_drag : 1; gboolean have_drag : 1;
}; };
struct _GtkDragDestInfo struct _GtkDragDestInfo {
{
GtkWidget *widget; /* Widget in which drag is in */ GtkWidget *widget; /* Widget in which drag is in */
GdkDragContext *context; /* Drag context */ GdkDragContext *context; /* Drag context */
GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */ GtkDragSourceInfo *proxy_source; /* Set if this is a proxy drag */
@ -116,15 +111,13 @@ struct _GtkDragDestInfo
#define ANIM_MIN_STEPS 5 #define ANIM_MIN_STEPS 5
#define ANIM_MAX_STEPS 10 #define ANIM_MAX_STEPS 10
struct _GtkDragAnim struct _GtkDragAnim {
{
GtkDragSourceInfo *info; GtkDragSourceInfo *info;
gint step; gint step;
gint n_steps; gint n_steps;
}; };
struct _GtkDragFindData struct _GtkDragFindData {
{
gint x; gint x;
gint y; gint y;
GdkDragContext *context; GdkDragContext *context;
@ -138,8 +131,7 @@ struct _GtkDragFindData
/* Enumeration for some targets we handle internally */ /* Enumeration for some targets we handle internally */
enum enum {
{
TARGET_MOTIF_SUCCESS = 0x40000000, TARGET_MOTIF_SUCCESS = 0x40000000,
TARGET_MOTIF_FAILURE, TARGET_MOTIF_FAILURE,
TARGET_DELETE TARGET_DELETE
@ -159,8 +151,8 @@ static void gtk_drag_get_event_actions (GdkEvent *event,
GdkDragAction actions, GdkDragAction actions,
GdkDragAction *suggested_action, GdkDragAction *suggested_action,
GdkDragAction *possible_actions); GdkDragAction *possible_actions);
static GdkCursor* gtk_drag_get_cursor (GdkDragAction action); static GdkCursor * gtk_drag_get_cursor (GdkDragAction action);
static GtkWidget* gtk_drag_get_ipc_widget (void); static GtkWidget *gtk_drag_get_ipc_widget (void);
static void gtk_drag_release_ipc_widget (GtkWidget *widget); static void gtk_drag_release_ipc_widget (GtkWidget *widget);
static void gtk_drag_highlight_paint (GtkWidget *widget); static void gtk_drag_highlight_paint (GtkWidget *widget);
@ -234,70 +226,70 @@ static gint gtk_drag_abort_timeout (gpointer data);
#define action_ask_width 16 #define action_ask_width 16
#define action_ask_height 16 #define action_ask_height 16
static const gchar action_ask_bits[] = { static const char action_ask_bits[] = {
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xf8, 0xb6, 0xf7, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xf8, 0xb6, 0xf7,
0xd6, 0xec, 0x66, 0xdb, 0x66, 0xdb, 0x96, 0xec, 0x76, 0xf7, 0x76, 0xfb, 0xd6, 0xec, 0x66, 0xdb, 0x66, 0xdb, 0x96, 0xec, 0x76, 0xf7, 0x76, 0xfb,
0xf6, 0xfc, 0x72, 0xfb, 0x7a, 0xfb, 0xf8, 0xfc, }; 0xf6, 0xfc, 0x72, 0xfb, 0x7a, 0xfb, 0xf8, 0xfc, };
#define action_ask_mask_width 16 #define action_ask_mask_width 16
#define action_ask_mask_height 16 #define action_ask_mask_height 16
static const gchar action_ask_mask_bits[] = { static const char action_ask_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0xcf, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0xcf, 0x0f,
0xef, 0x1f, 0xff, 0x3c, 0xff, 0x3c, 0x6f, 0x1f, 0x8f, 0x0f, 0x8f, 0x07, 0xef, 0x1f, 0xff, 0x3c, 0xff, 0x3c, 0x6f, 0x1f, 0x8f, 0x0f, 0x8f, 0x07,
0x0f, 0x03, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x03, }; 0x0f, 0x03, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x03, };
#define action_copy_width 16 #define action_copy_width 16
#define action_copy_height 16 #define action_copy_height 16
static const gchar action_copy_bits[] = { static const char action_copy_bits[] = {
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xfb, 0x76, 0xfb, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x76, 0xfb, 0x76, 0xfb,
0x76, 0xfb, 0x06, 0x83, 0xf6, 0xbf, 0xf6, 0xbf, 0x06, 0x83, 0x76, 0xfb, 0x76, 0xfb, 0x06, 0x83, 0xf6, 0xbf, 0xf6, 0xbf, 0x06, 0x83, 0x76, 0xfb,
0x76, 0xfb, 0x72, 0xfb, 0x7a, 0xf8, 0xf8, 0xff, }; 0x76, 0xfb, 0x72, 0xfb, 0x7a, 0xf8, 0xf8, 0xff, };
#define action_copy_mask_width 16 #define action_copy_mask_width 16
#define action_copy_mask_height 16 #define action_copy_mask_height 16
static const gchar action_copy_mask_bits[] = { static const char action_copy_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0x8f, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x8f, 0x07, 0x8f, 0x07,
0x8f, 0x07, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x8f, 0x07, 0x8f, 0x07, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x8f, 0x07,
0x8f, 0x07, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x00, }; 0x8f, 0x07, 0x8f, 0x07, 0x87, 0x07, 0x07, 0x00, };
#define action_move_width 16 #define action_move_width 16
#define action_move_height 16 #define action_move_height 16
static const gchar action_move_bits[] = { static const char action_move_bits[] = {
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x96, 0xff, 0x26, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x96, 0xff, 0x26, 0xff,
0xc6, 0xf8, 0xd6, 0xe3, 0x96, 0x8f, 0xb6, 0xbf, 0x36, 0xc3, 0x76, 0xfb, 0xc6, 0xf8, 0xd6, 0xe3, 0x96, 0x8f, 0xb6, 0xbf, 0x36, 0xc3, 0x76, 0xfb,
0x76, 0xfa, 0xf2, 0xfa, 0xfa, 0xf8, 0xf8, 0xff, }; 0x76, 0xfa, 0xf2, 0xfa, 0xfa, 0xf8, 0xf8, 0xff, };
#define action_move_mask_width 16 #define action_move_mask_width 16
#define action_move_mask_height 16 #define action_move_mask_height 16
static const gchar action_move_mask_bits[] = { static const char action_move_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x6f, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x6f, 0x00, 0xff, 0x00,
0xff, 0x07, 0xef, 0x1f, 0xef, 0x7f, 0xcf, 0x7f, 0xcf, 0x3f, 0x8f, 0x07, 0xff, 0x07, 0xef, 0x1f, 0xef, 0x7f, 0xcf, 0x7f, 0xcf, 0x3f, 0x8f, 0x07,
0x8f, 0x07, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x00, }; 0x8f, 0x07, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x00, };
#define action_link_width 16 #define action_link_width 16
#define action_link_height 16 #define action_link_height 16
static const gchar action_link_bits[] = { static const char action_link_bits[] = {
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x36, 0xf8, 0xd6, 0xf7, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0x36, 0xf8, 0xd6, 0xf7,
0x66, 0xec, 0xa6, 0xe8, 0x26, 0xdf, 0xe6, 0xbd, 0xd6, 0xa7, 0xb6, 0xa8, 0x66, 0xec, 0xa6, 0xe8, 0x26, 0xdf, 0xe6, 0xbd, 0xd6, 0xa7, 0xb6, 0xa8,
0xb6, 0xb1, 0x72, 0xdf, 0xfa, 0xe0, 0xf8, 0xff, }; 0xb6, 0xb1, 0x72, 0xdf, 0xfa, 0xe0, 0xf8, 0xff, };
#define action_link_mask_width 16 #define action_link_mask_width 16
#define action_link_mask_height 16 #define action_link_mask_height 16
static const gchar action_link_mask_bits[] = { static const char action_link_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xcf, 0x07, 0xef, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xcf, 0x07, 0xef, 0x0f,
0xff, 0x1f, 0x7f, 0x1f, 0xff, 0x3f, 0xff, 0x7f, 0xef, 0x7f, 0xcf, 0x77, 0xff, 0x1f, 0x7f, 0x1f, 0xff, 0x3f, 0xff, 0x7f, 0xef, 0x7f, 0xcf, 0x77,
0xcf, 0x7f, 0x8f, 0x3f, 0x07, 0x1f, 0x07, 0x00, }; 0xcf, 0x7f, 0x8f, 0x3f, 0x07, 0x1f, 0x07, 0x00, };
#define action_none_width 16 #define action_none_width 16
#define action_none_height 16 #define action_none_height 16
static const gchar action_none_bits[] = { static const char action_none_bits[] = {
0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0xf6, 0xff, 0xf6, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0xfe, 0x1f, 0x06, 0xc0, 0xf6, 0xff, 0xf6, 0xff,
0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff, 0xf6, 0xff,
0xf6, 0xff, 0xf2, 0xff, 0xfa, 0xff, 0xf8, 0xff, }; 0xf6, 0xff, 0xf2, 0xff, 0xfa, 0xff, 0xf8, 0xff, };
#define action_none_mask_width 16 #define action_none_mask_width 16
#define action_none_mask_height 16 #define action_none_mask_height 16
static const gchar action_none_mask_bits[] = { static const char action_none_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x00, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x00, 0x0f, 0x00,
0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00,
0x0f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x07, 0x00, }; 0x0f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x07, 0x00, };
@ -305,11 +297,10 @@ static const gchar action_none_mask_bits[] = {
#define CURSOR_WIDTH 16 #define CURSOR_WIDTH 16
#define CURSOR_HEIGHT 16 #define CURSOR_HEIGHT 16
static struct static struct {
{
GdkDragAction action; GdkDragAction action;
const gchar *bits; const char *bits;
const gchar *mask; const char *mask;
GdkCursor *cursor; GdkCursor *cursor;
} drag_cursors[] = { } drag_cursors[] = {
{ GDK_ACTION_DEFAULT, 0 }, { GDK_ACTION_DEFAULT, 0 },
@ -320,47 +311,46 @@ static struct
{ 0 , action_none_bits, action_none_mask_bits, NULL }, { 0 , action_none_bits, action_none_mask_bits, NULL },
}; };
static const gint n_drag_cursors = sizeof (drag_cursors) / sizeof (drag_cursors[0]); static const gint n_drag_cursors = sizeof(drag_cursors) / sizeof(drag_cursors[0]);
/* XPM */ /* XPM */
static const gchar *drag_default_xpm[] = { static const char * drag_default_xpm[] = {
"32 32 3 1", "32 32 3 1",
" c None", " c None",
". c #000000", ". c #000000",
"+ c #FFFFFF", "+ c #FFFFFF",
" ", " ",
" ", " ",
" .. ", " .. ",
" ..+. ", " ..+. ",
" ..++.. ", " ..++.. ",
" ...++++. ", " ...++++. ",
" ...++++++.. ", " ...++++++.. ",
" ...+++++++++. ", " ...+++++++++. ",
" ...+++++++++++.. ", " ...+++++++++++.. ",
" ..+.++++++++++++.. ", " ..+.++++++++++++.. ",
" .++.++++++++++++.. ", " .++.++++++++++++.. ",
" .+++.++++++++++++.. ", " .+++.++++++++++++.. ",
" .++++.++++++++++++. ", " .++++.++++++++++++. ",
" .+++.+++++++++++++.. ", " .+++.+++++++++++++.. ",
" .++.+++++++++++++++.. ", " .++.+++++++++++++++.. ",
" .+.+++++++++++++++++.. ", " .+.+++++++++++++++++.. ",
" ..+++++++++++++++++++.. ", " ..+++++++++++++++++++.. ",
" ..++++++++++++++++++++. ", " ..++++++++++++++++++++. ",
" .++++++++++++++++++++.. ", " .++++++++++++++++++++.. ",
" ..+++++++++++++++++.. ", " ..+++++++++++++++++.. ",
" .++++++++++++++++.. ", " .++++++++++++++++.. ",
" ..+++++++++++++... ", " ..+++++++++++++... ",
" .++++++++++++.. ", " .++++++++++++.. ",
" ..+++++++++.. ", " ..+++++++++.. ",
" .++++++++.. ", " .++++++++.. ",
" ..++++++.. ", " ..++++++.. ",
" .+++++.. ", " .+++++.. ",
" .++.. ", " .++.. ",
" ... ", " ... ",
" .. ", " .. ",
" ", " ",
" ", " "};
};
/********************* /*********************
* Utility functions * * Utility functions *
@ -375,35 +365,34 @@ static const gchar *drag_default_xpm[] = {
* results: * results:
*************************************************************/ *************************************************************/
static GtkWidget* static GtkWidget *
gtk_drag_get_ipc_widget (void) gtk_drag_get_ipc_widget(void)
{ {
GtkWidget *result; GtkWidget *result;
if (drag_widgets) if (drag_widgets)
{ {
GSList *tmp = drag_widgets; GSList *tmp = drag_widgets;
result = drag_widgets->data; result = drag_widgets->data;
drag_widgets = drag_widgets->next; drag_widgets = drag_widgets->next;
g_slist_free_1 (tmp); g_slist_free_1 (tmp);
} }
else else
{ {
result = gtk_invisible_new (); result = gtk_invisible_new();
gtk_widget_show (result); gtk_widget_show (result);
} }
return result; return result;
} }
/**************************************************************** /*************************************************************
* gtk_drag_release_ipc_widget: * gtk_drag_release_ipc_widget:
* Releases widget retrieved with gtk_drag_get_ipc_widget () * Releases widget retrieved with gtk_drag_get_ipc_widget()
* arguments: * arguments:
* widget: the widget to release. * widget: the widget to release.
* results: * results:
****************************************************************/ *************************************************************/
static void static void
gtk_drag_release_ipc_widget (GtkWidget *widget) gtk_drag_release_ipc_widget (GtkWidget *widget)
@ -440,15 +429,15 @@ gtk_drag_get_event_actions (GdkEvent *event,
case GDK_KEY_RELEASE: case GDK_KEY_RELEASE:
state = event->key.state; state = event->key.state;
break; break;
case GDK_ENTER_NOTIFY: case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY: case GDK_LEAVE_NOTIFY:
state = event->crossing.state; state = event->crossing.state;
break; break;
default: default:
break; break;
} }
if ((button == 2 || button == 3) && (actions & GDK_ACTION_ASK)) if (((button == 2) || (button == 3)) && (actions & GDK_ACTION_ASK))
{ {
*suggested_action = GDK_ACTION_ASK; *suggested_action = GDK_ACTION_ASK;
*possible_actions = actions; *possible_actions = actions;
@ -500,7 +489,7 @@ gtk_drag_get_event_actions (GdkEvent *event,
return; return;
} }
static GdkCursor* static GdkCursor *
gtk_drag_get_cursor (GdkDragAction action) gtk_drag_get_cursor (GdkDragAction action)
{ {
gint i; gint i;
@ -560,7 +549,7 @@ gtk_drag_get_data (GtkWidget *widget,
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (context != NULL); g_return_if_fail (context != NULL);
selection_widget = gtk_drag_get_ipc_widget (); selection_widget = gtk_drag_get_ipc_widget();
gdk_drag_context_ref (context); gdk_drag_context_ref (context);
gtk_widget_ref (widget); gtk_widget_ref (widget);
@ -571,7 +560,7 @@ gtk_drag_get_data (GtkWidget *widget,
gtk_object_set_data (GTK_OBJECT (selection_widget), "drag-context", context); gtk_object_set_data (GTK_OBJECT (selection_widget), "drag-context", context);
gtk_selection_convert (selection_widget, gtk_selection_convert (selection_widget,
gdk_drag_get_selection (context), gdk_drag_get_selection(context),
target, target,
time); time);
} }
@ -588,7 +577,7 @@ gtk_drag_get_data (GtkWidget *widget,
* a different application. * a different application.
*************************************************************/ *************************************************************/
GtkWidget* GtkWidget *
gtk_drag_get_source_widget (GdkDragContext *context) gtk_drag_get_source_widget (GdkDragContext *context)
{ {
GSList *tmp_list; GSList *tmp_list;
@ -601,7 +590,6 @@ gtk_drag_get_source_widget (GdkDragContext *context)
if (ipc_widget->window == context->source_window) if (ipc_widget->window == context->source_window)
{ {
GtkDragSourceInfo *info; GtkDragSourceInfo *info;
info = gtk_object_get_data (GTK_OBJECT (ipc_widget), "gtk-info"); info = gtk_object_get_data (GTK_OBJECT (ipc_widget), "gtk-info");
return info ? info->widget : NULL; return info ? info->widget : NULL;
@ -641,14 +629,14 @@ gtk_drag_finish (GdkDragContext *context,
else if (context->protocol == GDK_DRAG_PROTO_MOTIF) else if (context->protocol == GDK_DRAG_PROTO_MOTIF)
{ {
target = gdk_atom_intern (success ? target = gdk_atom_intern (success ?
"XmTRANSFER_SUCCESS" : "XmTRANSFER_SUCCESS" :
"XmTRANSFER_FAILURE", "XmTRANSFER_FAILURE",
FALSE); FALSE);
} }
if (target != GDK_NONE) if (target != GDK_NONE)
{ {
GtkWidget *selection_widget = gtk_drag_get_ipc_widget (); GtkWidget *selection_widget = gtk_drag_get_ipc_widget();
gdk_drag_context_ref (context); gdk_drag_context_ref (context);
@ -658,7 +646,7 @@ gtk_drag_finish (GdkDragContext *context,
NULL); NULL);
gtk_selection_convert (selection_widget, gtk_selection_convert (selection_widget,
gdk_drag_get_selection (context), gdk_drag_get_selection(context),
target, target,
time); time);
} }
@ -764,7 +752,7 @@ gtk_drag_unhighlight (GtkWidget *widget)
gtk_signal_disconnect_by_func (GTK_OBJECT (widget), gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
GTK_SIGNAL_FUNC (gtk_drag_highlight_paint), GTK_SIGNAL_FUNC (gtk_drag_highlight_paint),
NULL); NULL);
gtk_signal_disconnect_by_func (GTK_OBJECT (widget), gtk_signal_disconnect_by_func (GTK_OBJECT (widget),
GTK_SIGNAL_FUNC (gtk_drag_highlight_expose), GTK_SIGNAL_FUNC (gtk_drag_highlight_expose),
NULL); NULL);
@ -944,52 +932,52 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
case GDK_DRAG_MOTION: case GDK_DRAG_MOTION:
case GDK_DROP_START: case GDK_DROP_START:
{ {
GtkDragFindData data; GtkDragFindData data;
gint tx, ty; gint tx, ty;
if (event->type == GDK_DROP_START) if (event->type == GDK_DROP_START)
info->dropped = TRUE; info->dropped = TRUE;
gdk_window_get_origin (toplevel->window, &tx, &ty); gdk_window_get_origin (toplevel->window, &tx, &ty);
data.x = event->dnd.x_root - tx; data.x = event->dnd.x_root - tx;
data.y = event->dnd.y_root - ty; data.y = event->dnd.y_root - ty;
data.context = context; data.context = context;
data.info = info; data.info = info;
data.found = FALSE; data.found = FALSE;
data.toplevel = TRUE; data.toplevel = TRUE;
data.callback = (event->type == GDK_DRAG_MOTION) ? data.callback = (event->type == GDK_DRAG_MOTION) ?
gtk_drag_dest_motion : gtk_drag_dest_drop; gtk_drag_dest_motion : gtk_drag_dest_drop;
data.time = event->dnd.time; data.time = event->dnd.time;
gtk_drag_find_widget (toplevel, &data); gtk_drag_find_widget (toplevel, &data);
/* We send a leave here so that the widget unhighlights /* We send a leave here so that the widget unhighlights
* properly * properly
*/ */
if (info->widget && if (info->widget &&
((event->type == GDK_DROP_START) || (!data.found))) ((event->type == GDK_DROP_START) || (!data.found)))
{ {
gtk_drag_dest_leave (info->widget, context, event->dnd.time); gtk_drag_dest_leave (info->widget, context, event->dnd.time);
info->widget = NULL; info->widget = NULL;
} }
/* Send a reply. /* Send a reply.
*/ */
if (event->type == GDK_DRAG_MOTION) if (event->type == GDK_DRAG_MOTION)
{ {
if (!data.found) if (!data.found)
gdk_drag_status (context, 0, event->dnd.time); gdk_drag_status (context, 0, event->dnd.time);
} }
else if (event->type == GDK_DROP_START) else if (event->type == GDK_DROP_START)
{ {
gdk_drop_reply (context, data.found, event->dnd.time); gdk_drop_reply (context, data.found, event->dnd.time);
if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !data.found) if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !data.found)
gtk_drag_finish (context, FALSE, FALSE, event->dnd.time); gtk_drag_finish (context, FALSE, FALSE, event->dnd.time);
} }
} }
break; break;
default: default:
g_assert_not_reached(); g_assert_not_reached();
@ -1243,8 +1231,7 @@ gtk_drag_find_widget (GtkWidget *widget,
} }
static void static void
gtk_drag_proxy_begin (GtkWidget *widget, gtk_drag_proxy_begin (GtkWidget *widget, GtkDragDestInfo *dest_info)
GtkDragDestInfo *dest_info)
{ {
GtkDragSourceInfo *source_info; GtkDragSourceInfo *source_info;
GList *tmp_list; GList *tmp_list;
@ -1553,7 +1540,7 @@ gtk_drag_dest_drop (GtkWidget *widget,
* results: * results:
*************************************************************/ *************************************************************/
GdkDragContext* GdkDragContext *
gtk_drag_begin (GtkWidget *widget, gtk_drag_begin (GtkWidget *widget,
GtkTargetList *target_list, GtkTargetList *target_list,
GdkDragAction actions, GdkDragAction actions,
@ -1673,11 +1660,11 @@ gtk_drag_begin (GtkWidget *widget,
*************************************************************/ *************************************************************/
void void
gtk_drag_source_set (GtkWidget *widget, gtk_drag_source_set (GtkWidget *widget,
GdkModifierType start_button_mask, GdkModifierType start_button_mask,
const GtkTargetEntry *targets, const GtkTargetEntry *targets,
gint n_targets, gint n_targets,
GdkDragAction actions) GdkDragAction actions)
{ {
GtkDragSourceSite *site; GtkDragSourceSite *site;
@ -1757,10 +1744,10 @@ gtk_drag_source_unset (GtkWidget *widget)
*************************************************************/ *************************************************************/
void void
gtk_drag_source_set_icon (GtkWidget *widget, gtk_drag_source_set_icon (GtkWidget *widget,
GdkColormap *colormap, GdkColormap *colormap,
GdkPixmap *pixmap, GdkPixmap *pixmap,
GdkBitmap *mask) GdkBitmap *mask)
{ {
GtkDragSourceSite *site; GtkDragSourceSite *site;
@ -1801,10 +1788,10 @@ gtk_drag_source_set_icon (GtkWidget *widget,
*************************************************************/ *************************************************************/
void void
gtk_drag_set_icon_widget (GdkDragContext *context, gtk_drag_set_icon_widget (GdkDragContext *context,
GtkWidget *widget, GtkWidget *widget,
gint hot_x, gint hot_x,
gint hot_y) gint hot_y)
{ {
GtkDragSourceInfo *info; GtkDragSourceInfo *info;
@ -1843,12 +1830,12 @@ gtk_drag_set_icon_widget (GdkDragContext *context,
*************************************************************/ *************************************************************/
void void
gtk_drag_set_icon_pixmap (GdkDragContext *context, gtk_drag_set_icon_pixmap (GdkDragContext *context,
GdkColormap *colormap, GdkColormap *colormap,
GdkPixmap *pixmap, GdkPixmap *pixmap,
GdkBitmap *mask, GdkBitmap *mask,
gint hot_x, gint hot_x,
gint hot_y) gint hot_y)
{ {
GtkWidget *window; GtkWidget *window;
gint width, height; gint width, height;
@ -1859,7 +1846,7 @@ gtk_drag_set_icon_pixmap (GdkDragContext *context,
gdk_window_get_size (pixmap, &width, &height); gdk_window_get_size (pixmap, &width, &height);
gtk_widget_push_visual (gdk_colormap_get_visual (colormap)); gtk_widget_push_visual (gdk_colormap_get_visual(colormap));
gtk_widget_push_colormap (colormap); gtk_widget_push_colormap (colormap);
window = gtk_window_new (GTK_WINDOW_POPUP); window = gtk_window_new (GTK_WINDOW_POPUP);
@ -1986,48 +1973,48 @@ gtk_drag_source_handle_event (GtkWidget *widget,
switch (event->type) switch (event->type)
{ {
case GDK_DRAG_STATUS: case GDK_DRAG_STATUS:
{ {
GdkCursor *cursor; GdkCursor *cursor;
if (info->proxy_dest) if (info->proxy_dest)
{ {
if (!event->dnd.send_event) if (!event->dnd.send_event)
{ {
if (info->proxy_dest->proxy_drop_wait) if (info->proxy_dest->proxy_drop_wait)
{ {
/* Aha - we can finally pass the MOTIF DROP on... */ /* Aha - we can finally pass the MOTIF DROP on... */
gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time); gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
} }
else else
{ {
gdk_drag_status (info->proxy_dest->context, gdk_drag_status (info->proxy_dest->context,
event->dnd.context->action, event->dnd.context->action,
event->dnd.time); event->dnd.time);
} }
} }
} }
else else
{ {
cursor = gtk_drag_get_cursor (event->dnd.context->action); cursor = gtk_drag_get_cursor (event->dnd.context->action);
if (info->cursor != cursor) if (info->cursor != cursor)
{ {
XChangeActivePointerGrab (GDK_WINDOW_XDISPLAY (widget->window), XChangeActivePointerGrab (GDK_WINDOW_XDISPLAY (widget->window),
PointerMotionMask | PointerMotionHintMask | ButtonReleaseMask, PointerMotionMask | PointerMotionHintMask | ButtonReleaseMask,
((GdkCursorPrivate *)cursor)->xcursor, ((GdkCursorPrivate *)cursor)->xcursor,
event->dnd.time); event->dnd.time);
info->cursor = cursor; info->cursor = cursor;
} }
if (info->last_event) if (info->last_event)
{ {
gtk_drag_motion_cb (info->widget, gtk_drag_motion_cb (info->widget,
(GdkEventMotion *)info->last_event, (GdkEventMotion *)info->last_event,
info); info);
info->last_event = NULL; info->last_event = NULL;
} }
} }
} }
break; break;
case GDK_DROP_FINISHED: case GDK_DROP_FINISHED:
gtk_drag_drop_finished (info, TRUE, event->dnd.time); gtk_drag_drop_finished (info, TRUE, event->dnd.time);
@ -2136,7 +2123,7 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
anim->n_steps = CLAMP (anim->n_steps, ANIM_MIN_STEPS, ANIM_MAX_STEPS); anim->n_steps = CLAMP (anim->n_steps, ANIM_MIN_STEPS, ANIM_MAX_STEPS);
if (info->icon_window) if (info->icon_window)
{ {
gtk_widget_show (info->icon_window); gtk_widget_show(info->icon_window);
gdk_window_raise (info->icon_window->window); gdk_window_raise (info->icon_window->window);
} }
@ -2157,7 +2144,6 @@ gtk_drag_source_release_selections (GtkDragSourceInfo *info,
while (tmp_list) while (tmp_list)
{ {
GdkAtom selection = GPOINTER_TO_UINT (tmp_list->data); GdkAtom selection = GPOINTER_TO_UINT (tmp_list->data);
if (gdk_selection_owner_get (selection) == info->ipc_widget->window) if (gdk_selection_owner_get (selection) == info->ipc_widget->window)
gtk_selection_owner_set (NULL, selection, time); gtk_selection_owner_set (NULL, selection, time);
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
@ -2176,8 +2162,7 @@ gtk_drag_source_release_selections (GtkDragSourceInfo *info,
*************************************************************/ *************************************************************/
static void static void
gtk_drag_drop (GtkDragSourceInfo *info, gtk_drag_drop (GtkDragSourceInfo *info, guint32 time)
guint32 time)
{ {
if (info->context->protocol == GDK_DRAG_PROTO_ROOTWIN) if (info->context->protocol == GDK_DRAG_PROTO_ROOTWIN)
{ {