#include <gio/gio.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkwindow.h>
+#include <gdk/gdkwindowimpl.h>
#include <gdk/gdkprivate.h>
-#ifdef USE_MEDIALIB
-#include <gdk/gdkmedialib.h>
-#endif
G_BEGIN_DECLS
guint ref_count;
};
+typedef enum {
+ GDK_EVENT_FILTER_REMOVED = 1 << 0
+} GdkEventFilterFlags;
+
struct _GdkEventFilter {
GdkFilterFunc function;
gpointer data;
+ GdkEventFilterFlags flags;
+ guint ref_count;
};
struct _GdkClientFilter {
GDK_DEBUG_XIM = 1 << 3,
GDK_DEBUG_NOGRABS = 1 << 4,
GDK_DEBUG_COLORMAP = 1 << 5,
- GDK_DEBUG_GDKRGB = 1 << 6,
- GDK_DEBUG_GC = 1 << 7,
- GDK_DEBUG_PIXMAP = 1 << 8,
- GDK_DEBUG_IMAGE = 1 << 9,
- GDK_DEBUG_INPUT = 1 <<10,
- GDK_DEBUG_CURSOR = 1 <<11,
- GDK_DEBUG_MULTIHEAD = 1 <<12,
- GDK_DEBUG_XINERAMA = 1 <<13,
- GDK_DEBUG_DRAW = 1 <<14,
- GDK_DEBUG_EVENTLOOP = 1 <<15
+ GDK_DEBUG_INPUT = 1 << 6,
+ GDK_DEBUG_CURSOR = 1 << 7,
+ GDK_DEBUG_MULTIHEAD = 1 << 8,
+ GDK_DEBUG_XINERAMA = 1 << 9,
+ GDK_DEBUG_DRAW = 1 <<10,
+ GDK_DEBUG_EVENTLOOP = 1 <<11
} GdkDebugFlag;
-#ifndef GDK_DISABLE_DEPRECATED
-
-typedef struct _GdkFontPrivate GdkFontPrivate;
-
-struct _GdkFontPrivate
-{
- GdkFont font;
- guint ref_count;
-};
-
-#endif /* GDK_DISABLE_DEPRECATED */
-
extern GList *_gdk_default_filters;
extern GdkWindow *_gdk_parent_root;
-extern gint _gdk_error_code;
-extern gint _gdk_error_warnings;
extern guint _gdk_debug_flags;
+extern gboolean _gdk_native_windows;
#ifdef G_ENABLE_DEBUG
guint flags;
GdkScreen *screen;
gpointer windowing_data;
+ GdkDevice *device;
+ GdkDevice *source_device;
};
-extern GdkEventFunc _gdk_event_func; /* Callback for events */
-extern gpointer _gdk_event_data;
-extern GDestroyNotify _gdk_event_notify;
+/* Tracks information about the pointer grab on this display */
+typedef struct
+{
+ GdkWindow *window;
+ GdkWindow *native_window;
+ gulong serial_start;
+ gulong serial_end; /* exclusive, i.e. not active on serial_end */
+ gboolean owner_events;
+ guint event_mask;
+ gboolean implicit;
+ guint32 time;
+ GdkGrabOwnership ownership;
+
+ guint activated : 1;
+ guint implicit_ungrab : 1;
+} GdkDeviceGrabInfo;
+
+typedef struct _GdkWindowPaint GdkWindowPaint;
+
+typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
+ GdkDevice *device,
+ GdkPointerWindowInfo *device_info,
+ gpointer user_data);
+
+struct _GdkWindow
+{
+ GObject parent_instance;
+
+ GdkWindowImpl *impl; /* window-system-specific delegate object */
+
+ GdkWindow *parent;
+ GdkVisual *visual;
+
+ gpointer user_data;
+
+ gint x;
+ gint y;
+
+ gint extension_events;
+
+ GList *filters;
+ GList *children;
+
+ cairo_pattern_t *background;
+
+ GSList *paint_stack;
+
+ cairo_region_t *update_area;
+ guint update_freeze_count;
+
+ guint8 window_type;
+ guint8 depth;
+ guint8 resize_count;
+
+ GdkWindowState state;
+
+ guint guffaw_gravity : 1;
+ guint input_only : 1;
+ guint modal_hint : 1;
+ guint composited : 1;
+
+ guint destroyed : 2;
+
+ guint accept_focus : 1;
+ guint focus_on_map : 1;
+ guint shaped : 1;
+ guint support_multidevice : 1;
+
+ GdkEventMask event_mask;
+
+ guint update_and_descendants_freeze_count;
+
+ /* The GdkWindow that has the impl, ref:ed if another window.
+ * This ref is required to keep the wrapper of the impl window alive
+ * for as long as any GdkWindow references the impl. */
+ GdkWindow *impl_window;
+ int abs_x, abs_y; /* Absolute offset in impl */
+ gint width, height;
+ guint32 clip_tag;
+ cairo_region_t *clip_region; /* Clip region (wrt toplevel) in window coords */
+ cairo_region_t *clip_region_with_children; /* Clip region in window coords */
+ GdkCursor *cursor;
+ GHashTable *device_cursor;
+ gint8 toplevel_window_type;
+ guint synthesize_crossing_event_queued : 1;
+ guint effective_visibility : 2;
+ guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
+ guint native_visibility : 2; /* the native visibility of a impl windows */
+ guint viewable : 1; /* mapped and all parents mapped */
+ guint applied_shape : 1;
+
+ guint num_offscreen_children;
+ GdkWindowPaint *implicit_paint;
+
+ GList *outstanding_moves;
+
+ cairo_region_t *shape;
+ cairo_region_t *input_shape;
+
+ cairo_surface_t *cairo_surface;
+
+ GList *devices_inside;
+ GHashTable *device_events;
+
+ GHashTable *source_event_masks;
+ gulong device_added_handler_id;
+ gulong device_changed_handler_id;
+};
+
+#define GDK_WINDOW_TYPE(d) (((GDK_WINDOW (d)))->window_type)
+#define GDK_WINDOW_DESTROYED(d) (GDK_WINDOW (d)->destroyed)
extern GSList *_gdk_displays;
extern gchar *_gdk_display_name;
extern gint _gdk_screen_number;
extern gchar *_gdk_display_arg_name;
+extern gboolean _gdk_disable_multidevice;
void _gdk_events_queue (GdkDisplay *display);
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
-GList* _gdk_event_queue_find_first (GdkDisplay *display);
-void _gdk_event_queue_remove_link (GdkDisplay *display,
- GList *node);
-GList* _gdk_event_queue_prepend (GdkDisplay *display,
- GdkEvent *event);
-GList* _gdk_event_queue_append (GdkDisplay *display,
- GdkEvent *event);
-void _gdk_event_button_generate (GdkDisplay *display,
- GdkEvent *event);
+void _gdk_event_filter_unref (GdkWindow *window,
+ GdkEventFilter *filter);
+
+void _gdk_event_emit (GdkEvent *event);
+GList* _gdk_event_queue_find_first (GdkDisplay *display);
+void _gdk_event_queue_remove_link (GdkDisplay *display,
+ GList *node);
+GList* _gdk_event_queue_prepend (GdkDisplay *display,
+ GdkEvent *event);
+GList* _gdk_event_queue_append (GdkDisplay *display,
+ GdkEvent *event);
+GList* _gdk_event_queue_insert_after (GdkDisplay *display,
+ GdkEvent *after_event,
+ GdkEvent *event);
+GList* _gdk_event_queue_insert_before(GdkDisplay *display,
+ GdkEvent *after_event,
+ GdkEvent *event);
+void _gdk_event_button_generate (GdkDisplay *display,
+ GdkEvent *event);
void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst);
GdkWindowState unset_flags,
GdkWindowState set_flags);
-#define GDK_SCRATCH_IMAGE_WIDTH 256
-#define GDK_SCRATCH_IMAGE_HEIGHT 64
-
-GdkImage* _gdk_image_new_for_depth (GdkScreen *screen,
- GdkImageType type,
- GdkVisual *visual,
- gint width,
- gint height,
- gint depth);
-GdkImage *_gdk_image_get_scratch (GdkScreen *screen,
- gint width,
- gint height,
- gint depth,
- gint *x,
- gint *y);
-
-GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
- GdkImage *image,
- gint src_x,
- gint src_y,
- gint dest_x,
- gint dest_y,
- gint width,
- gint height);
-
-cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
-
-/* GC caching */
-GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
- gboolean graphics_exposures);
-
-void _gdk_gc_update_context (GdkGC *gc,
- cairo_t *cr,
- const GdkColor *override_foreground,
- GdkBitmap *override_stipple,
- gboolean gc_changed);
+GdkDeviceManager * _gdk_device_manager_new (GdkDisplay *display);
+
+gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
+ GdkRectangle *extents);
/*************************************
* Interfaces used by windowing code *
*************************************/
-GdkWindow *_gdk_window_new (GdkWindow *window,
- GdkWindowAttr *attributes,
- gint attributes_mask);
-void _gdk_window_destroy (GdkWindow *window,
- gboolean foreign_destroy);
-void _gdk_window_clear_update_area (GdkWindow *window);
+cairo_surface_t *
+ _gdk_window_ref_cairo_surface (GdkWindow *window);
-void _gdk_screen_close (GdkScreen *screen);
+void _gdk_window_impl_new (GdkWindow *window,
+ GdkWindow *real_parent,
+ GdkScreen *screen,
+ GdkEventMask event_mask,
+ GdkWindowAttr *attributes,
+ gint attributes_mask);
+void _gdk_window_destroy (GdkWindow *window,
+ gboolean foreign_destroy);
+void _gdk_window_clear_update_area (GdkWindow *window);
+void _gdk_window_update_size (GdkWindow *window);
+gboolean _gdk_window_update_viewable (GdkWindow *window);
-const char *_gdk_get_sm_client_id (void);
+void _gdk_window_process_updates_recurse (GdkWindow *window,
+ cairo_region_t *expose_region);
-void _gdk_gc_init (GdkGC *gc,
- GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
+void _gdk_screen_close (GdkScreen *screen);
-GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
-GdkFill _gdk_gc_get_fill (GdkGC *gc);
-GdkPixmap *_gdk_gc_get_tile (GdkGC *gc);
-GdkBitmap *_gdk_gc_get_stipple (GdkGC *gc);
-guint32 _gdk_gc_get_fg_pixel (GdkGC *gc);
-guint32 _gdk_gc_get_bg_pixel (GdkGC *gc);
+const char *_gdk_get_sm_client_id (void);
/*****************************************
* Interfaces provided by windowing code *
*****************************************/
/* Font/string functions implemented in module-specific code */
-gint _gdk_font_strlen (GdkFont *font, const char *str);
-void _gdk_font_destroy (GdkFont *font);
-
-void _gdk_colormap_real_destroy (GdkColormap *colormap);
void _gdk_cursor_destroy (GdkCursor *cursor);
gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
gint screen_number);
+gulong _gdk_windowing_window_get_next_serial (GdkDisplay *display);
void _gdk_windowing_window_get_offsets (GdkWindow *window,
gint *x_offset,
gint *y_offset);
-void _gdk_windowing_get_pointer (GdkDisplay *display,
+
+void _gdk_windowing_get_device_state (GdkDisplay *display,
+ GdkDevice *device,
GdkScreen **screen,
gint *x,
gint *y,
GdkModifierType *mask);
-GdkWindow* _gdk_windowing_window_get_pointer (GdkDisplay *display,
- GdkWindow *window,
- gint *x,
- gint *y,
- GdkModifierType *mask);
-GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
- gint *win_x,
- gint *win_y);
-
-/* Return the number of bits-per-pixel for images of the specified depth. */
-gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
- gint depth);
-
-void _gdk_window_reparent (GdkWindow *window,
- GdkWindow *new_parent,
- gint x,
- gint y);
-
-#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
-
-/* Called before processing updates for a window. This gives the windowing
- * layer a chance to save the region for later use in avoiding duplicate
- * exposes. The return value indicates whether the function has a saved
- * the region; if the result is TRUE, then the windowing layer is responsible
- * for destroying the region later.
- */
-gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
- GdkRegion *area);
+GdkWindow* _gdk_windowing_window_at_device_position (GdkDisplay *display,
+ GdkDevice *device,
+ gint *win_x,
+ gint *win_y,
+ GdkModifierType *mask,
+ gboolean get_toplevel);
+GdkGrabStatus _gdk_windowing_device_grab (GdkDevice *device,
+ GdkWindow *window,
+ GdkWindow *native,
+ gboolean owner_events,
+ GdkEventMask event_mask,
+ GdkWindow *confine_to,
+ GdkCursor *cursor,
+ guint32 time);
+void _gdk_windowing_got_event (GdkDisplay *display,
+ GList *event_link,
+ GdkEvent *event,
+ gulong serial);
+
+void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
+ cairo_region_t *expose_region);
+void _gdk_windowing_before_process_all_updates (void);
+void _gdk_windowing_after_process_all_updates (void);
+
+
+#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
-/* Called to do the windowing system specific part of gdk_window_destroy(),
- *
- * window: The window being destroyed
- * recursing: If TRUE, then this is being called because a parent
- * was destroyed. This generally means that the call to the windowing system
- * to destroy the window can be omitted, since it will be destroyed as a result
- * of the parent being destroyed. Unless @foreign_destroy
- *
- * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
- * agency. The window has already been destroyed and no windowing
- * system calls should be made. (This may never happen for some
- * windowing systems.)
- */
-void _gdk_windowing_window_destroy (GdkWindow *window,
- gboolean recursing,
- gboolean foreign_destroy);
/* Called when gdk_window_destroy() is called on a foreign window
* or an ancestor of the foreign window. It should generally reparent
GTypeInterface g_iface;
void (* begin_paint_region) (GdkPaintable *paintable,
- const GdkRegion *region);
+ GdkWindow *window,
+ const cairo_region_t *region);
void (* end_paint) (GdkPaintable *paintable);
-
- void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
- const GdkRegion *region,
- gboolean (*child_func) (GdkWindow *, gpointer),
- gpointer user_data);
- void (* process_updates) (GdkPaintable *paintable,
- gboolean update_children);
};
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
-/* Implementation types */
-GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
-GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
-
-
-/**
- * _gdk_windowing_gc_set_clip_region:
- * @gc: a #GdkGC
- * @region: the new clip region
- *
- * Do any window-system specific processing necessary
- * for a change in clip region. Since the clip origin
- * will likely change before the GC is used with the
- * new clip, frequently this function will only set a flag and
- * do the real processing later.
- *
- * When this function is called, _gdk_gc_get_clip_region
- * will already return the new region.
- **/
-void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const GdkRegion *region);
-
-/**
- * _gdk_windowing_gc_copy:
- * @dst_gc: a #GdkGC from the GDK backend
- * @src_gc: a #GdkGC from the GDK backend
- *
- * Copies backend specific state from @src_gc to @dst_gc.
- * This is called before the generic state is copied, so
- * the old generic state is still available from @dst_gc
- **/
-void _gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc);
-
-/* Queries the current foreground color of a GdkGC */
-void _gdk_windowing_gc_get_foreground (GdkGC *gc,
- GdkColor *color);
-/* Queries the current background color of a GdkGC */
-void _gdk_windowing_gc_get_background (GdkGC *gc,
- GdkColor *color);
-
struct GdkAppLaunchContextPrivate
{
GdkDisplay *display;
void _gdk_windowing_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id);
+void _gdk_display_device_grab_update (GdkDisplay *display,
+ GdkDevice *device,
+ GdkDevice *source_device,
+ gulong current_serial);
+GdkDeviceGrabInfo *_gdk_display_get_last_device_grab (GdkDisplay *display,
+ GdkDevice *device);
+GdkDeviceGrabInfo *_gdk_display_add_device_grab (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow *window,
+ GdkWindow *native_window,
+ GdkGrabOwnership grab_ownership,
+ gboolean owner_events,
+ GdkEventMask event_mask,
+ unsigned long serial_start,
+ guint32 time,
+ gboolean implicit);
+GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display,
+ GdkDevice *device,
+ gulong serial);
+gboolean _gdk_display_end_device_grab (GdkDisplay *display,
+ GdkDevice *device,
+ gulong serial,
+ GdkWindow *if_child,
+ gboolean implicit);
+gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
+ GdkDevice *device,
+ gulong serial);
+void _gdk_display_enable_motion_hints (GdkDisplay *display,
+ GdkDevice *device);
+
+GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
+ GdkDevice *device);
+
+void _gdk_display_pointer_info_foreach (GdkDisplay *display,
+ GdkDisplayPointerInfoForeach func,
+ gpointer user_data);
+
+void _gdk_window_invalidate_for_expose (GdkWindow *window,
+ cairo_region_t *region);
+
+GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
+ int x, int y);
+GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
+ double x, double y,
+ double *found_x,
+ double *found_y);
+
+void _gdk_window_add_damage (GdkWindow *toplevel,
+ cairo_region_t *damaged_region);
+
+GdkEvent * _gdk_make_event (GdkWindow *window,
+ GdkEventType type,
+ GdkEvent *event_in_queue,
+ gboolean before_event);
+gboolean _gdk_window_event_parent_of (GdkWindow *parent,
+ GdkWindow *child);
+
+void _gdk_synthesize_crossing_events (GdkDisplay *display,
+ GdkWindow *src,
+ GdkWindow *dest,
+ GdkDevice *device,
+ GdkDevice *source_device,
+ GdkCrossingMode mode,
+ gint toplevel_x,
+ gint toplevel_y,
+ GdkModifierType mask,
+ guint32 time_,
+ GdkEvent *event_in_queue,
+ gulong serial,
+ gboolean non_linear);
+void _gdk_display_set_window_under_pointer (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow *window);
+
+
+void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
+
+cairo_region_t *_gdk_window_calculate_full_clip_region (GdkWindow *window,
+ GdkWindow *base_window,
+ gboolean do_children,
+ gint *base_x_offset,
+ gint *base_y_offset);
+gboolean _gdk_window_has_impl (GdkWindow *window);
+GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
+
+/*****************************
+ * offscreen window routines *
+ *****************************/
+GType gdk_offscreen_window_get_type (void);
+void _gdk_offscreen_window_new (GdkWindow *window,
+ GdkWindowAttr *attributes,
+ gint attributes_mask);
+cairo_surface_t * _gdk_offscreen_window_create_surface (GdkWindow *window,
+ gint width,
+ gint height);
+
/************************************
* Initialization and exit routines *
************************************/
-void _gdk_image_exit (void);
void _gdk_windowing_exit (void);
G_END_DECLS