* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <config.h>
+#include "config.h"
#include <string.h> /* For memset() */
#include "gdk.h"
{
GdkInputFunction function;
GdkInputCondition condition;
- GdkDestroyNotify notify;
+ GDestroyNotify notify;
gpointer data;
};
return display->queued_tail;
}
+/**
+ * _gdk_event_queue_insert_after:
+ * @display: a #GdkDisplay
+ * @sibling: Append after this event.
+ * @event: Event to append.
+ *
+ * Appends an event after the specified event, or if it isn't in
+ * the queue, onto the tail of the event queue.
+ *
+ * Returns: the newly appended list node.
+ *
+ * Since: 2.16
+ */
+GList*
+_gdk_event_queue_insert_after (GdkDisplay *display,
+ GdkEvent *sibling,
+ GdkEvent *event)
+{
+ GList *prev = g_list_find (display->queued_events, sibling);
+ if (prev && prev->next)
+ {
+ display->queued_events = g_list_insert_before (display->queued_events, prev->next, event);
+ return prev->next;
+ }
+ else
+ return _gdk_event_queue_append (display, event);
+}
+
+/**
+ * _gdk_event_queue_insert_after:
+ * @display: a #GdkDisplay
+ * @sibling: Append after this event.
+ * @event: Event to append.
+ *
+ * Appends an event before the specified event, or if it isn't in
+ * the queue, onto the tail of the event queue.
+ *
+ * Returns: the newly appended list node.
+ *
+ * Since: 2.16
+ */
+GList*
+_gdk_event_queue_insert_before (GdkDisplay *display,
+ GdkEvent *sibling,
+ GdkEvent *event)
+{
+ GList *next = g_list_find (display->queued_events, sibling);
+ if (next)
+ {
+ display->queued_events = g_list_insert_before (display->queued_events, next, event);
+ return next->prev;
+ }
+ else
+ return _gdk_event_queue_append (display, event);
+}
+
+
/**
* _gdk_event_queue_remove_link:
* @display: a #GdkDisplay
case GDK_SETTING:
case GDK_OWNER_CHANGE:
case GDK_GRAB_BROKEN:
+ case GDK_EVENT_LAST:
/* return current time */
break;
}
case GDK_SETTING:
case GDK_OWNER_CHANGE:
case GDK_GRAB_BROKEN:
+ case GDK_EVENT_LAST:
/* no state field */
break;
}
void
gdk_event_request_motions (const GdkEventMotion *event)
{
+ GdkDisplay *display;
+
g_return_if_fail (event != NULL);
+
if (event->type == GDK_MOTION_NOTIFY && event->is_hint)
- gdk_device_get_state (event->device, event->window, NULL, NULL);
+ {
+ gdk_device_get_state (event->device, event->window, NULL, NULL);
+
+ display = gdk_drawable_get_display (event->window);
+ _gdk_display_enable_motion_hints (display);
+ }
}
/**
return TRUE;
}
+/**
+ * gdk_input_add_full:
+ * @source: a file descriptor.
+ * @condition: the condition.
+ * @function: the callback function.
+ * @data: callback data passed to @function.
+ * @destroy: callback function to call with @data when the input
+ * handler is removed.
+ *
+ * Establish a callback when a condition becomes true on
+ * a file descriptor.
+ *
+ * Returns: a tag that can later be used as an argument to
+ * gdk_input_remove().
+ *
+ * Deprecated: Use g_io_add_watch_full() on a #GIOChannel
+ */
gint
gdk_input_add_full (gint source,
GdkInputCondition condition,
GdkInputFunction function,
gpointer data,
- GdkDestroyNotify destroy)
+ GDestroyNotify destroy)
{
guint result;
GdkIOClosure *closure = g_new (GdkIOClosure, 1);
return result;
}
+/**
+ * gdk_input_add:
+ * @source: a file descriptor.
+ * @condition: the condition.
+ * @function: the callback function.
+ * @data: callback data passed to @function.
+ *
+ * Establish a callback when a condition becomes true on
+ * a file descriptor.
+ *
+ * Returns: a tag that can later be used as an argument to
+ * gdk_input_remove().
+ *
+ * Deprecated: Use g_io_add_watch() on a #GIOChannel
+ */
gint
gdk_input_add (gint source,
GdkInputCondition condition,
gint nclicks)
{
GdkEvent temp_event;
+ GdkEvent *event_copy;
+ GList *link;
g_return_if_fail (event != NULL);
temp_event = *event;
temp_event.type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
-
- gdk_display_put_event (display, &temp_event);
+
+ event_copy = gdk_event_copy (&temp_event);
+ link = _gdk_event_queue_append (display, event_copy);
}
void
((GdkWindowObject*) window)->state = temp_event.window_state.new_window_state;
+ if (temp_event.window_state.changed_mask & GDK_WINDOW_STATE_WITHDRAWN)
+ _gdk_window_update_viewable (window);
+
/* We only really send the event to toplevels, since
* all the window states don't apply to non-toplevels.
* Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag
* Obtains a desktop-wide setting, such as the double-click time,
* for the default screen. See gdk_screen_get_setting().
*
- * Returns : %TRUE if the setting existed and a value was stored
+ * Returns: %TRUE if the setting existed and a value was stored
* in @value, %FALSE otherwise.
**/
gboolean