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/gdk.h | |
parent | 7dbb5755a4cafc45108ec66ac89dfc1f11639494 (diff) | |
download | gtk+-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/gdk.h')
-rw-r--r-- | gdk/gdk.h | 129 |
1 files changed, 73 insertions, 56 deletions
@@ -40,8 +40,9 @@ GdkEvent *gdk_event_get (void); GdkEvent *gdk_event_get_graphics_expose (GdkWindow *window); void gdk_event_put (GdkEvent *event); -GdkEvent *gdk_event_copy (GdkEvent *event); -void gdk_event_free (GdkEvent *event); +GdkEvent *gdk_event_copy (GdkEvent *event); +void gdk_event_free (GdkEvent *event); +guint32 gdk_event_get_time (GdkEvent *event); void gdk_set_show_events (gint show_events); void gdk_set_use_xshm (gint use_xshm); @@ -196,51 +197,61 @@ void gdk_window_shape_combine_mask (GdkWindow *window, gint offset_x, gint offset_y); -/* - * Drag & Drop - * Algorithm (drop source): - * A window being dragged will be sent a GDK_DRAG_BEGIN message. - * It will then do gdk_dnd_drag_addwindow() for any other windows that are to be - * dragged. - * When we get a DROP_ENTER incoming, we send it on to the window in question. - * That window needs to use gdk_dnd_drop_enter_reply() to indicate the state of - * things (it must call that even if it's not going to accept the drop) - * - * These two turn on/off drag or drop, and if enabling it also - * sets the list of types supported. The list of types passed in - * should be in order of decreasing preference. - */ -void gdk_window_dnd_drag_set (GdkWindow *window, - guint8 drag_enable, - gchar **typelist, - guint numtypes); - -/* - *XXX todo: add a GDK_DROP_ENTER which can look at actual data - */ -void gdk_window_dnd_drop_set (GdkWindow *window, - guint8 drop_enable, - gchar **typelist, - guint numtypes, - guint8 destructive_op); - -/* - * This is used by the GDK_DRAG_BEGIN handler. An example of usage would be a - * file manager where multiple icons were selected and the drag began. - * The icon that the drag actually began on would gdk_dnd_drag_addwindow - * for all the other icons that were being dragged... +/* + * The following function adds a global filter for all client + * messages of type message_type */ -void gdk_dnd_drag_addwindow (GdkWindow *window); -void gdk_window_dnd_data_set (GdkWindow *window, - GdkEvent *event, - gpointer data, - gulong data_numbytes); -void gdk_dnd_set_drag_cursors(GdkCursor *default_cursor, - GdkCursor *goahead_cursor); -void gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin, - GdkPoint *default_hotspot, - GdkWindow *goahead_pixmapwin, - GdkPoint *goahead_hotspot); +void gdk_add_client_message_filter (GdkAtom message_type, + GdkFilterFunc func, + gpointer data); + +/* Drag and Drop */ + +GdkDragContext * gdk_drag_context_new (void); +void gdk_drag_context_ref (GdkDragContext *context); +void gdk_drag_context_unref (GdkDragContext *context); + +/* Destination side */ + +void gdk_drag_status (GdkDragContext *context, + GdkDragAction action, + guint32 time); +void gdk_drop_reply (GdkDragContext *context, + gboolean ok, + guint32 time); +void gdk_drop_finish (GdkDragContext *context, + gboolean success, + guint32 time); +GdkAtom gdk_drag_get_selection (GdkDragContext *context); + +/* Source side */ + +GdkDragContext * gdk_drag_begin (GdkWindow *window, + GList *targets, + GdkDragAction actions); +gboolean gdk_drag_get_protocol (guint32 xid, + GdkDragProtocol *protocol); +void gdk_drag_find_window (GdkDragContext *context, + GdkWindow *drag_window, + gint x_root, + gint y_root, + GdkWindow **dest_window, + GdkDragProtocol *protocol); +gboolean gdk_drag_motion (GdkDragContext *context, + GdkWindow *dest_window, + GdkDragProtocol protocol, + gint x_root, + gint y_root, + GdkDragAction action, + guint32 time); +void gdk_drag_drop (GdkDragContext *context, + guint32 time); +void gdk_drag_abort (GdkDragContext *context, + guint32 time); + +GdkAtom gdk_drag_get_selection (GdkDragContext *context); + +/* GdkWindow */ void gdk_window_set_hints (GdkWindow *window, gint x, @@ -309,6 +320,8 @@ void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions); GList * gdk_window_get_toplevels (void); +void gdk_window_register_dnd (GdkWindow *window); + void gdk_drawable_set_data (GdkDrawable *drawable, const gchar *key, gpointer data, @@ -477,14 +490,24 @@ gboolean gdk_colormap_alloc_color (GdkColormap *colormap, void gdk_colormap_free_colors (GdkColormap *colormap, GdkColor *colors, gint ncolors); - -void gdk_colors_store (GdkColormap *colormap, - GdkColor *colors, - gint ncolors); +GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap); + GdkColor *gdk_color_copy (GdkColor *color); void gdk_color_free (GdkColor *color); +gint gdk_color_parse (const gchar *spec, + GdkColor *color); +guint gdk_color_hash (const GdkColor *colora, + const GdkColor *colorb); +gint gdk_color_equal (const GdkColor *colora, + const GdkColor *colorb); + + +/* The following functions are deprecated */ +void gdk_colors_store (GdkColormap *colormap, + GdkColor *colors, + gint ncolors); gint gdk_colors_alloc (GdkColormap *colormap, gint contiguous, gulong *planes, @@ -499,16 +522,10 @@ gint gdk_color_white (GdkColormap *colormap, GdkColor *color); gint gdk_color_black (GdkColormap *colormap, GdkColor *color); -gint gdk_color_parse (const gchar *spec, - GdkColor *color); gint gdk_color_alloc (GdkColormap *colormap, GdkColor *color); gint gdk_color_change (GdkColormap *colormap, GdkColor *color); -guint gdk_color_hash (const GdkColor *colora, - const GdkColor *colorb); -gint gdk_color_equal (const GdkColor *colora, - const GdkColor *colorb); /* Fonts |