diff options
author | Owen Taylor <otaylor@gtk.org> | 1998-10-18 22:51:24 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-10-18 22:51:24 +0000 |
commit | f7bcb456072dac59b1ce5bd5329282ba95a3b495 (patch) | |
tree | a9085af76de35b5c883776673b7a59521e52c043 /gdk/gdktypes.h | |
parent | 7dbb5755a4cafc45108ec66ac89dfc1f11639494 (diff) | |
download | gdk-pixbuf-f7bcb456072dac59b1ce5bd5329282ba95a3b495.tar.gz |
Added a modular client-message-filter mechanism, that is used for the DND
Sun Oct 18 18:16:39 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdk.c gdkprivate.h: Added a modular client-message-filter
mechanism, that is used for the DND messages.
Removed all the old DND code.
* gdk/gdkcolormap.c gdk/gdkcolormap.h: Add a function to
get the visual of a given colormap.
* gtk/gtkcolorsel.c: Conversion to new DND, drag
a color-swatch.
* gdk/gdk.h gdk/gdkdnd.c: The low-level
X oriented portions of drag and drop protocols.
Sending and receiving client messages, and navigating
window trees.
* gdk/gdkimage.c: added a gdk_flush() when destroying
SHM images to hopefully make it more likely that
X will gracefully handle the segment being destroyed.
* gdk/gdkprivate.h gtk/gtkdebug.h: Add new
DND debugging flags.
* gtk/gtkeditable.[ch]: Updates for the selection handling
changes.
* gtk/gtkselection.[ch]: Added GtkTargetList, a
refcounted data structure for keeping track of lists
of GdkAtom + information. Removed selection_handler_add
in favor of a "drag_data_get" signal.
* gtk/gtkdnd.[ch] gtk/gtk.h: New files - highlevel (event loop
dependent) parts of the DND protocols, display of drag icons,
drag-under highlighting, and the "default handlers".
* gtk/gtkinvisible.[ch]: New widget - InputOnly offscreen
windows that are used for reliable pointer grabs and
selection handling in the DND code.
* gtk/testdnd.c: New test program for new DND. (Old
DND tests in testgtk still need to be converted.)
* gtk/testselection.c: Use the new selection API.
* docs/dnd_internals: Start at describing how
all the new code works inside.
* docs/Changes-1.2.txt: New file describing source-incompatible
changes in GTK+-1.2.
Sat Oct 17 22:50:34 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkwindow.c (gdk_window_remove_filter): Free
the right list node.
* gdk/gdkwindow.c (gdk_window_init): Add gdk_root_parent
to the XID table so we can receive events on it.
Wed Oct 14 12:57:40 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c gdk/gdk.h (gdk_event_get_time): New function
to get the timestamp from a generic event.
Fri Oct 9 13:16:04 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_add_events): Added function
that safely adds additional events to a widget's event
mask, even if the widget has previously been realized.
(We can do this, but not remove events from the event
mask).
Fri Oct 2 17:35:35 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkproperty.c (gdk_property_get): Allow type == 0,
for AnyPropertyType.
Fri Oct 2 10:32:21 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdkproperty.c (gdk_atom_intern): Add client-local
hashing.
Thu Sep 24 20:33:54 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_send_clientmessage_toall): serial
isn't a timestamp.
Thu Sep 17 14:23:03 1998 Owen Taylor <otaylor@redhat.com>
* gdk/gdk.c (gdk_event_translate): Removed printing
of unknown window lookup warnings. (Made it
a GDK_NOTE) - they happen in many circumstances.
Diffstat (limited to 'gdk/gdktypes.h')
-rw-r--r-- | gdk/gdktypes.h | 193 |
1 files changed, 57 insertions, 136 deletions
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 67f9fb353..5970840e9 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -60,6 +60,7 @@ typedef struct _GdkFont GdkFont; typedef struct _GdkCursor GdkCursor; typedef struct _GdkColorContextDither GdkColorContextDither; typedef struct _GdkColorContext GdkColorContext; +typedef struct _GdkDragContext GdkDragContext; typedef struct _GdkEventAny GdkEventAny; typedef struct _GdkEventExpose GdkEventExpose; @@ -74,14 +75,12 @@ typedef struct _GdkEventConfigure GdkEventConfigure; typedef struct _GdkEventProperty GdkEventProperty; typedef struct _GdkEventSelection GdkEventSelection; typedef struct _GdkEventProximity GdkEventProximity; -typedef struct _GdkEventOther GdkEventOther; -typedef struct _GdkEventDragBegin GdkEventDragBegin; -typedef struct _GdkEventDragRequest GdkEventDragRequest; -typedef struct _GdkEventDropEnter GdkEventDropEnter; -typedef struct _GdkEventDropDataAvailable GdkEventDropDataAvailable; -typedef struct _GdkEventDropLeave GdkEventDropLeave; typedef struct _GdkEventClient GdkEventClient; + +typedef struct _GdkEventDND GdkEventDND; + typedef union _GdkEvent GdkEvent; + typedef struct _GdkDeviceKey GdkDeviceKey; typedef struct _GdkDeviceInfo GdkDeviceInfo; typedef struct _GdkTimeCoord GdkTimeCoord; @@ -380,15 +379,15 @@ typedef enum GDK_SELECTION_NOTIFY = 19, GDK_PROXIMITY_IN = 20, GDK_PROXIMITY_OUT = 21, - GDK_DRAG_BEGIN = 22, - GDK_DRAG_REQUEST = 23, - GDK_DROP_ENTER = 24, - GDK_DROP_LEAVE = 25, - GDK_DROP_DATA_AVAIL = 26, - GDK_CLIENT_EVENT = 27, - GDK_VISIBILITY_NOTIFY = 28, - GDK_NO_EXPOSE = 29, - GDK_OTHER_EVENT = 9999 /* Deprecated, use filters instead */ + GDK_DRAG_ENTER = 22, + GDK_DRAG_LEAVE = 23, + GDK_DRAG_MOTION = 24, + GDK_DRAG_STATUS = 25, + GDK_DROP_START = 26, + GDK_DROP_FINISHED = 27, + GDK_CLIENT_EVENT = 28, + GDK_VISIBILITY_NOTIFY = 29, + GDK_NO_EXPOSE = 30, } GdkEventType; /* Event masks. (Used to select what types of events a window @@ -539,24 +538,6 @@ typedef enum GDK_PROP_MODE_APPEND } GdkPropMode; -/* These definitions are for version 1 of the OffiX D&D protocol, - taken from <OffiX/DragAndDropTypes.h> */ -typedef enum -{ - GDK_DNDTYPE_NOTDND = -1, - GDK_DNDTYPE_UNKNOWN = 0, - GDK_DNDTYPE_RAWDATA = 1, - GDK_DNDTYPE_FILE = 2, - GDK_DNDTYPE_FILES = 3, - GDK_DNDTYPE_TEXT = 4, - GDK_DNDTYPE_DIR = 5, - GDK_DNDTYPE_LINK = 6, - GDK_DNDTYPE_EXE = 7, - GDK_DNDTYPE_URL = 8, - GDK_DNDTYPE_MIME = 9, - GDK_DNDTYPE_END = 10 -} GdkDndType; - /* Enums for XInput support */ typedef enum @@ -697,6 +678,22 @@ typedef enum GDK_OVERLAP_RECTANGLE_PART } GdkOverlapType; +typedef enum { + GDK_ACTION_DEFAULT = 1 << 0, + GDK_ACTION_COPY = 1 << 1, + GDK_ACTION_MOVE = 1 << 2, + GDK_ACTION_LINK = 1 << 3, + GDK_ACTION_PRIVATE = 1 << 4, + GDK_ACTION_ASK = 1 << 5 +} GdkDragAction; + +typedef enum { + GDK_DRAG_PROTO_MOTIF, + GDK_DRAG_PROTO_XDND, + GDK_DRAG_PROTO_ROOTWIN /* A root window with nobody claiming + * drags */ +} GdkDragProtocol; + /* The color type. * A color consists of red, green and blue values in the * range 0-65535 and a pixel value. The pixel value is highly @@ -938,6 +935,25 @@ struct _GdkTimeCoord gdouble ytilt; }; +/* Structure that holds information about a drag in progress. + * this is used on both source and destination sides. + */ +struct _GdkDragContext { + GdkDragProtocol protocol; + + gboolean is_source; + + GdkWindow *source_window; + GdkWindow *dest_window; + + GList *targets; + GdkDragAction actions; + GdkDragAction suggested_action; + GdkDragAction action; + + guint32 start_time; +}; + /* Event filtering */ typedef void GdkXEvent; /* Can be cast to XEvent */ @@ -1096,100 +1112,6 @@ struct _GdkEventProximity guint32 deviceid; }; -struct _GdkEventDragRequest -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 requestor; - union { - struct { - guint protocol_version:4; - guint sendreply:1; - guint willaccept:1; - guint delete_data:1; /* Do *not* delete if link is sent, only - if data is sent */ - guint senddata:1; - guint reserved:22; - } flags; - glong allflags; - } u; - guint8 isdrop; /* This gdk event can be generated by a couple of - X events - this lets the app know whether the - drop really occurred or we just set the data */ - - GdkPoint drop_coords; - gchar *data_type; - guint32 timestamp; -}; - -struct _GdkEventDragBegin -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - union { - struct { - guint protocol_version:4; - guint reserved:28; - } flags; - glong allflags; - } u; -}; - -struct _GdkEventDropEnter -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 requestor; - union { - struct { - guint protocol_version:4; - guint sendreply:1; - guint extended_typelist:1; - guint reserved:26; - } flags; - glong allflags; - } u; -}; - -struct _GdkEventDropLeave -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 requestor; - union { - struct { - guint protocol_version:4; - guint reserved:28; - } flags; - glong allflags; - } u; -}; - -struct _GdkEventDropDataAvailable -{ - GdkEventType type; - GdkWindow *window; - gint8 send_event; - guint32 requestor; - union { - struct { - guint protocol_version:4; - guint isdrop:1; - guint reserved:25; - } flags; - glong allflags; - } u; - gchar *data_type; /* MIME type */ - gulong data_numbytes; - gpointer data; - guint32 timestamp; - GdkPoint coords; -}; - struct _GdkEventClient { GdkEventType type; @@ -1204,12 +1126,16 @@ struct _GdkEventClient } data; }; -struct _GdkEventOther -{ +/* Event types for DND */ + +struct _GdkEventDND { GdkEventType type; GdkWindow *window; gint8 send_event; - GdkXEvent *xevent; + GdkDragContext *context; + + guint32 time; + gshort x_root, y_root; }; union _GdkEvent @@ -1228,13 +1154,8 @@ union _GdkEvent GdkEventProperty property; GdkEventSelection selection; GdkEventProximity proximity; - GdkEventDragBegin dragbegin; - GdkEventDragRequest dragrequest; - GdkEventDropEnter dropenter; - GdkEventDropLeave dropleave; - GdkEventDropDataAvailable dropdataavailable; GdkEventClient client; - GdkEventOther other; + GdkEventDND dnd; }; struct _GdkRegion |