1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26 
27 /* Uninstalled header defining types and functions internal to GDK */
28 
29 #ifndef __GDK_INTERNALS_H__
30 #define __GDK_INTERNALS_H__
31 
32 #include <gio/gio.h>
33 #include <gdk/gdktypes.h>
34 #include <gdk/gdkwindow.h>
35 #include <gdk/gdkprivate.h>
36 #ifdef USE_MEDIALIB
37 #include <gdk/gdkmedialib.h>
38 #endif
39 
40 G_BEGIN_DECLS
41 
42 /**********************
43  * General Facilities *
44  **********************/
45 
46 /* Debugging support */
47 
48 typedef struct _GdkColorInfo           GdkColorInfo;
49 typedef struct _GdkEventFilter	       GdkEventFilter;
50 typedef struct _GdkClientFilter	       GdkClientFilter;
51 
52 typedef enum {
53   GDK_COLOR_WRITEABLE = 1 << 0
54 } GdkColorInfoFlags;
55 
56 struct _GdkColorInfo
57 {
58   GdkColorInfoFlags flags;
59   guint ref_count;
60 };
61 
62 typedef enum {
63   GDK_EVENT_FILTER_REMOVED = 1 << 0
64 } GdkEventFilterFlags;
65 
66 struct _GdkEventFilter {
67   GdkFilterFunc function;
68   gpointer data;
69   GdkEventFilterFlags flags;
70   guint ref_count;
71 };
72 
73 struct _GdkClientFilter {
74   GdkAtom       type;
75   GdkFilterFunc function;
76   gpointer      data;
77 };
78 
79 typedef enum {
80   GDK_DEBUG_MISC          = 1 << 0,
81   GDK_DEBUG_EVENTS        = 1 << 1,
82   GDK_DEBUG_DND           = 1 << 2,
83   GDK_DEBUG_XIM           = 1 << 3,
84   GDK_DEBUG_NOGRABS       = 1 << 4,
85   GDK_DEBUG_COLORMAP	  = 1 << 5,
86   GDK_DEBUG_GDKRGB	  = 1 << 6,
87   GDK_DEBUG_GC		  = 1 << 7,
88   GDK_DEBUG_PIXMAP	  = 1 << 8,
89   GDK_DEBUG_IMAGE	  = 1 << 9,
90   GDK_DEBUG_INPUT	  = 1 <<10,
91   GDK_DEBUG_CURSOR	  = 1 <<11,
92   GDK_DEBUG_MULTIHEAD	  = 1 <<12,
93   GDK_DEBUG_XINERAMA	  = 1 <<13,
94   GDK_DEBUG_DRAW	  = 1 <<14,
95   GDK_DEBUG_EVENTLOOP     = 1 <<15
96 } GdkDebugFlag;
97 
98 #ifndef GDK_DISABLE_DEPRECATED
99 
100 typedef struct _GdkFontPrivate	       GdkFontPrivate;
101 
102 struct _GdkFontPrivate
103 {
104   GdkFont font;
105   guint ref_count;
106 };
107 
108 #endif /* GDK_DISABLE_DEPRECATED */
109 
110 extern GList            *_gdk_default_filters;
111 extern GdkWindow  	*_gdk_parent_root;
112 extern gint		 _gdk_error_code;
113 extern gint		 _gdk_error_warnings;
114 
115 extern guint _gdk_debug_flags;
116 extern gboolean _gdk_native_windows;
117 
118 #ifdef G_ENABLE_DEBUG
119 
120 #define GDK_NOTE(type,action)		     G_STMT_START { \
121     if (_gdk_debug_flags & GDK_DEBUG_##type)		    \
122        { action; };			     } G_STMT_END
123 
124 #else /* !G_ENABLE_DEBUG */
125 
126 #define GDK_NOTE(type,action)
127 
128 #endif /* G_ENABLE_DEBUG */
129 
130 /* Arg parsing */
131 
132 typedef enum
133 {
134   GDK_ARG_STRING,
135   GDK_ARG_INT,
136   GDK_ARG_BOOL,
137   GDK_ARG_NOBOOL,
138   GDK_ARG_CALLBACK
139 } GdkArgType;
140 
141 typedef struct _GdkArgContext GdkArgContext;
142 typedef struct _GdkArgDesc GdkArgDesc;
143 
144 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
145 
146 struct _GdkArgContext
147 {
148   GPtrArray *tables;
149   gpointer cb_data;
150 };
151 
152 struct _GdkArgDesc
153 {
154   const char *name;
155   GdkArgType type;
156   gpointer location;
157   GdkArgFunc callback;
158 };
159 
160 /* Event handling */
161 
162 typedef struct _GdkEventPrivate GdkEventPrivate;
163 
164 typedef enum
165 {
166   /* Following flag is set for events on the event queue during
167    * translation and cleared afterwards.
168    */
169   GDK_EVENT_PENDING = 1 << 0
170 } GdkEventFlags;
171 
172 struct _GdkEventPrivate
173 {
174   GdkEvent   event;
175   guint      flags;
176   GdkScreen *screen;
177   gpointer   windowing_data;
178 };
179 
180 /* Tracks information about the pointer grab on this display */
181 typedef struct
182 {
183   GdkWindow *window;
184   GdkWindow *native_window;
185   gulong serial_start;
186   gulong serial_end; /* exclusive, i.e. not active on serial_end */
187   gboolean owner_events;
188   guint event_mask;
189   gboolean implicit;
190   guint32 time;
191 
192   gboolean activated;
193   gboolean implicit_ungrab;
194 } GdkPointerGrabInfo;
195 
196 typedef struct _GdkInputWindow GdkInputWindow;
197 
198 /* Private version of GdkWindowObject. The initial part of this strucuture
199    is public for historical reasons. Don't change that part */
200 typedef struct _GdkWindowPaint             GdkWindowPaint;
201 
202 struct _GdkWindowObject
203 {
204   /* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */
205   GdkDrawable parent_instance;
206 
207   GdkDrawable *impl; /* window-system-specific delegate object */
208 
209   GdkWindowObject *parent;
210 
211   gpointer user_data;
212 
213   gint x;
214   gint y;
215 
216   gint extension_events;
217 
218   GList *filters;
219   GList *children;
220 
221   GdkColor bg_color;
222   GdkPixmap *bg_pixmap;
223 
224   GSList *paint_stack;
225 
226   GdkRegion *update_area;
227   guint update_freeze_count;
228 
229   guint8 window_type;
230   guint8 depth;
231   guint8 resize_count;
232 
233   GdkWindowState state;
234 
235   guint guffaw_gravity : 1;
236   guint input_only : 1;
237   guint modal_hint : 1;
238   guint composited : 1;
239 
240   guint destroyed : 2;
241 
242   guint accept_focus : 1;
243   guint focus_on_map : 1;
244   guint shaped : 1;
245 
246   GdkEventMask event_mask;
247 
248   guint update_and_descendants_freeze_count;
249 
250   GdkWindowRedirect *redirect;
251 
252   /* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */
253 
254   /* The GdkWindowObject that has the impl, ref:ed if another window.
255    * This ref is required to keep the wrapper of the impl window alive
256    * for as long as any GdkWindow references the impl. */
257   GdkWindowObject *impl_window;
258   int abs_x, abs_y; /* Absolute offset in impl */
259   gint width, height;
260   guint32 clip_tag;
261   GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */
262   GdkRegion *clip_region_with_children; /* Clip region in window coords */
263   GdkCursor *cursor;
264   gint8 toplevel_window_type;
265   guint synthesize_crossing_event_queued : 1;
266   guint effective_visibility : 2;
267   guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
268   guint native_visibility : 2; /* the native visibility of a impl windows */
269   guint viewable : 1; /* mapped and all parents mapped */
270   guint applied_shape : 1;
271 
272   guint num_offscreen_children;
273   GdkWindowPaint *implicit_paint;
274   GdkInputWindow *input_window; /* only set for impl windows */
275 
276   GList *outstanding_moves;
277 
278   GdkRegion *shape;
279   GdkRegion *input_shape;
280 
281   cairo_surface_t *cairo_surface;
282   guint outstanding_surfaces; /* only set on impl window */
283 
284   cairo_pattern_t *background;
285 };
286 
287 #define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
288 #define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
289 
290 extern GdkEventFunc   _gdk_event_func;    /* Callback for events */
291 extern gpointer       _gdk_event_data;
292 extern GDestroyNotify _gdk_event_notify;
293 
294 extern GSList    *_gdk_displays;
295 extern gchar     *_gdk_display_name;
296 extern gint       _gdk_screen_number;
297 extern gchar     *_gdk_display_arg_name;
298 
299 void      _gdk_events_queue  (GdkDisplay *display);
300 GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
301 
302 void _gdk_event_filter_unref        (GdkWindow      *window,
303 				     GdkEventFilter *filter);
304 
305 GList* _gdk_event_queue_find_first   (GdkDisplay *display);
306 void   _gdk_event_queue_remove_link  (GdkDisplay *display,
307 				      GList      *node);
308 GList* _gdk_event_queue_prepend      (GdkDisplay *display,
309 				      GdkEvent   *event);
310 GList* _gdk_event_queue_append       (GdkDisplay *display,
311 				      GdkEvent   *event);
312 GList* _gdk_event_queue_insert_after (GdkDisplay *display,
313                                       GdkEvent   *after_event,
314                                       GdkEvent   *event);
315 GList* _gdk_event_queue_insert_before(GdkDisplay *display,
316                                       GdkEvent   *after_event,
317                                       GdkEvent   *event);
318 void   _gdk_event_button_generate    (GdkDisplay *display,
319 				      GdkEvent   *event);
320 
321 void _gdk_windowing_event_data_copy (const GdkEvent *src,
322                                      GdkEvent       *dst);
323 void _gdk_windowing_event_data_free (GdkEvent       *event);
324 
325 void gdk_synthesize_window_state (GdkWindow     *window,
326                                   GdkWindowState unset_flags,
327                                   GdkWindowState set_flags);
328 
329 #define GDK_SCRATCH_IMAGE_WIDTH 256
330 #define GDK_SCRATCH_IMAGE_HEIGHT 64
331 
332 GdkImage* _gdk_image_new_for_depth (GdkScreen    *screen,
333 				    GdkImageType  type,
334 				    GdkVisual    *visual,
335 				    gint          width,
336 				    gint          height,
337 				    gint          depth);
338 GdkImage *_gdk_image_get_scratch (GdkScreen *screen,
339 				  gint	     width,
340 				  gint	     height,
341 				  gint	     depth,
342 				  gint	    *x,
343 				  gint	    *y);
344 
345 GdkImage *_gdk_drawable_copy_to_image (GdkDrawable  *drawable,
346 				       GdkImage     *image,
347 				       gint          src_x,
348 				       gint          src_y,
349 				       gint          dest_x,
350 				       gint          dest_y,
351 				       gint          width,
352 				       gint          height);
353 
354 cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
355 
356 GdkDrawable *_gdk_drawable_get_source_drawable (GdkDrawable *drawable);
357 cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
358 						      int width,
359 						      int height);
360 
361 /* GC caching */
362 GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
363 				     gboolean     graphics_exposures);
364 GdkGC *_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable);
365 
366 void _gdk_gc_update_context (GdkGC          *gc,
367 			     cairo_t        *cr,
368 			     const GdkColor *override_foreground,
369 			     GdkBitmap      *override_stipple,
370 			     gboolean        gc_changed,
371 			     GdkDrawable    *target_drawable);
372 
373 /*************************************
374  * Interfaces used by windowing code *
375  *************************************/
376 
377 GdkPixmap *_gdk_pixmap_new               (GdkDrawable    *drawable,
378                                           gint            width,
379                                           gint            height,
380                                           gint            depth);
381 GdkPixmap *_gdk_pixmap_create_from_data  (GdkDrawable    *drawable,
382                                           const gchar    *data,
383                                           gint            width,
384                                           gint            height,
385                                           gint            depth,
386                                           const GdkColor *fg,
387                                           const GdkColor *bg);
388 GdkPixmap *_gdk_bitmap_create_from_data  (GdkDrawable    *drawable,
389                                           const gchar    *data,
390                                           gint            width,
391                                           gint            height);
392 
393 void       _gdk_window_impl_new          (GdkWindow      *window,
394 					  GdkWindow      *real_parent,
395 					  GdkScreen      *screen,
396 					  GdkVisual      *visual,
397 					  GdkEventMask    event_mask,
398                                           GdkWindowAttr  *attributes,
399                                           gint            attributes_mask);
400 void       _gdk_window_destroy           (GdkWindow      *window,
401                                           gboolean        foreign_destroy);
402 void       _gdk_window_clear_update_area (GdkWindow      *window);
403 void       _gdk_window_update_size       (GdkWindow      *window);
404 gboolean   _gdk_window_update_viewable   (GdkWindow      *window);
405 
406 void       _gdk_window_process_updates_recurse (GdkWindow *window,
407                                                 GdkRegion *expose_region);
408 
409 void       _gdk_screen_close             (GdkScreen      *screen);
410 
411 const char *_gdk_get_sm_client_id (void);
412 
413 void _gdk_gc_init (GdkGC           *gc,
414 		   GdkDrawable     *drawable,
415 		   GdkGCValues     *values,
416 		   GdkGCValuesMask  values_mask);
417 
418 GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
419 GdkBitmap *_gdk_gc_get_clip_mask   (GdkGC *gc);
420 gboolean   _gdk_gc_get_exposures   (GdkGC *gc);
421 GdkFill    _gdk_gc_get_fill        (GdkGC *gc);
422 GdkPixmap *_gdk_gc_get_tile        (GdkGC *gc);
423 GdkBitmap *_gdk_gc_get_stipple     (GdkGC *gc);
424 guint32    _gdk_gc_get_fg_pixel    (GdkGC *gc);
425 guint32    _gdk_gc_get_bg_pixel    (GdkGC *gc);
426 void      _gdk_gc_add_drawable_clip     (GdkGC     *gc,
427 					 guint32    region_tag,
428 					 GdkRegion *region,
429 					 int        offset_x,
430 					 int        offset_y);
431 void      _gdk_gc_remove_drawable_clip  (GdkGC     *gc);
432 void       _gdk_gc_set_clip_region_internal (GdkGC     *gc,
433 					     GdkRegion *region,
434 					     gboolean reset_origin);
435 GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
436 
437 GdkDrawable *_gdk_drawable_begin_direct_draw (GdkDrawable *drawable,
438 					      GdkGC *gc,
439 					      gpointer *priv_data,
440 					      gint *x_offset_out,
441 					      gint *y_offset_out);
442 void         _gdk_drawable_end_direct_draw (gpointer priv_data);
443 
444 
445 /*****************************************
446  * Interfaces provided by windowing code *
447  *****************************************/
448 
449 /* Font/string functions implemented in module-specific code */
450 gint _gdk_font_strlen (GdkFont *font, const char *str);
451 void _gdk_font_destroy (GdkFont *font);
452 
453 void _gdk_colormap_real_destroy (GdkColormap *colormap);
454 
455 void _gdk_cursor_destroy (GdkCursor *cursor);
456 
457 void     _gdk_windowing_init                    (void);
458 
459 extern const GOptionEntry _gdk_windowing_args[];
460 void     _gdk_windowing_set_default_display     (GdkDisplay *display);
461 
462 gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
463 					        gint         screen_number);
464 
465 gulong   _gdk_windowing_window_get_next_serial  (GdkDisplay *display);
466 void     _gdk_windowing_window_get_offsets      (GdkWindow  *window,
467 						 gint       *x_offset,
468 						 gint       *y_offset);
469 GdkRegion *_gdk_windowing_window_get_shape      (GdkWindow  *window);
470 GdkRegion *_gdk_windowing_window_get_input_shape(GdkWindow  *window);
471 GdkRegion *_gdk_windowing_get_shape_for_mask    (GdkBitmap *mask);
472 void     _gdk_windowing_window_beep             (GdkWindow *window);
473 
474 
475 void       _gdk_windowing_get_pointer        (GdkDisplay       *display,
476 					      GdkScreen       **screen,
477 					      gint             *x,
478 					      gint             *y,
479 					      GdkModifierType  *mask);
480 GdkWindow* _gdk_windowing_window_at_pointer  (GdkDisplay       *display,
481 					      gint             *win_x,
482 					      gint             *win_y,
483 					      GdkModifierType  *mask,
484 					      gboolean          get_toplevel);
485 GdkGrabStatus _gdk_windowing_pointer_grab    (GdkWindow        *window,
486 					      GdkWindow        *native,
487 					      gboolean          owner_events,
488 					      GdkEventMask      event_mask,
489 					      GdkWindow        *confine_to,
490 					      GdkCursor        *cursor,
491 					      guint32           time);
492 void _gdk_windowing_got_event                (GdkDisplay       *display,
493 					      GList            *event_link,
494 					      GdkEvent         *event,
495 					      gulong            serial);
496 
497 void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
498                                                     GdkRegion *expose_region);
499 void _gdk_windowing_before_process_all_updates     (void);
500 void _gdk_windowing_after_process_all_updates      (void);
501 
502 /* Return the number of bits-per-pixel for images of the specified depth. */
503 gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
504 					gint        depth);
505 
506 
507 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
508 
509 
510 /* Called when gdk_window_destroy() is called on a foreign window
511  * or an ancestor of the foreign window. It should generally reparent
512  * the window out of it's current heirarchy, hide it, and then
513  * send a message to the owner requesting that the window be destroyed.
514  */
515 void _gdk_windowing_window_destroy_foreign (GdkWindow *window);
516 
517 void _gdk_windowing_display_set_sm_client_id (GdkDisplay  *display,
518 					      const gchar *sm_client_id);
519 
520 void _gdk_windowing_window_set_composited (GdkWindow *window,
521 					   gboolean composited);
522 
523 #define GDK_TYPE_PAINTABLE            (_gdk_paintable_get_type ())
524 #define GDK_PAINTABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
525 #define GDK_IS_PAINTABLE(obj)	      (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
526 #define GDK_PAINTABLE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
527 
528 typedef struct _GdkPaintable        GdkPaintable;
529 typedef struct _GdkPaintableIface   GdkPaintableIface;
530 
531 struct _GdkPaintableIface
532 {
533   GTypeInterface g_iface;
534 
535   void (* begin_paint_region)       (GdkPaintable    *paintable,
536                                      GdkWindow       *window,
537                                      const GdkRegion *region);
538   void (* end_paint)                (GdkPaintable    *paintable);
539 };
540 
541 GType _gdk_paintable_get_type (void) G_GNUC_CONST;
542 
543 /* Implementation types */
544 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
545 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
546 
547 
548 /**
549  * _gdk_windowing_gc_set_clip_region:
550  * @gc: a #GdkGC
551  * @region: the new clip region
552  * @reset_origin: if TRUE, reset the clip_x/y_origin values to 0
553  *
554  * Do any window-system specific processing necessary
555  * for a change in clip region. Since the clip origin
556  * will likely change before the GC is used with the
557  * new clip, frequently this function will only set a flag and
558  * do the real processing later.
559  *
560  * When this function is called, _gdk_gc_get_clip_region
561  * will already return the new region.
562  **/
563 void _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
564 					const GdkRegion *region,
565 					gboolean reset_origin);
566 
567 /**
568  * _gdk_windowing_gc_copy:
569  * @dst_gc: a #GdkGC from the GDK backend
570  * @src_gc: a #GdkGC from the GDK backend
571  *
572  * Copies backend specific state from @src_gc to @dst_gc.
573  * This is called before the generic state is copied, so
574  * the old generic state is still available from @dst_gc
575  **/
576 void _gdk_windowing_gc_copy (GdkGC *dst_gc,
577 			     GdkGC *src_gc);
578 
579 /* Queries the current foreground color of a GdkGC */
580 void _gdk_windowing_gc_get_foreground (GdkGC    *gc,
581 				       GdkColor *color);
582 /* Queries the current background color of a GdkGC */
583 void _gdk_windowing_gc_get_background (GdkGC    *gc,
584 				       GdkColor *color);
585 
586 struct GdkAppLaunchContextPrivate
587 {
588   GdkDisplay *display;
589   GdkScreen *screen;
590   gint workspace;
591   guint32 timestamp;
592   GIcon *icon;
593   char *icon_name;
594 };
595 
596 char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
597 					    GAppInfo          *info,
598 					    GList             *files);
599 void  _gdk_windowing_launch_failed         (GAppLaunchContext *context,
600 				            const char        *startup_notify_id);
601 
602 GdkPointerGrabInfo *_gdk_display_get_active_pointer_grab (GdkDisplay *display);
603 void _gdk_display_pointer_grab_update                    (GdkDisplay *display,
604 							  gulong current_serial);
605 GdkPointerGrabInfo *_gdk_display_get_last_pointer_grab (GdkDisplay *display);
606 GdkPointerGrabInfo *_gdk_display_add_pointer_grab  (GdkDisplay *display,
607 						    GdkWindow *window,
608 						    GdkWindow *native_window,
609 						    gboolean owner_events,
610 						    GdkEventMask event_mask,
611 						    unsigned long serial_start,
612 						    guint32 time,
613 						    gboolean implicit);
614 GdkPointerGrabInfo * _gdk_display_has_pointer_grab (GdkDisplay *display,
615 						    gulong serial);
616 gboolean _gdk_display_end_pointer_grab (GdkDisplay *display,
617 					gulong serial,
618 					GdkWindow *if_child,
619 					gboolean implicit);
620 void _gdk_display_set_has_keyboard_grab (GdkDisplay *display,
621 					 GdkWindow *window,
622 					 GdkWindow *native_window,
623 					 gboolean owner_events,
624 					 unsigned long serial,
625 					 guint32 time);
626 void _gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
627 					   gboolean implicit);
628 void _gdk_display_enable_motion_hints     (GdkDisplay *display);
629 
630 
631 void _gdk_window_invalidate_for_expose (GdkWindow       *window,
632 					GdkRegion       *region);
633 
634 void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
635 					    int width,
636 					    int height);
637 
638 cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
639 						       int width,
640 						       int height);
641 GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
642 				       int x, int y);
643 GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
644 					    double x, double y,
645 					    double *found_x,
646 					    double *found_y);
647 
648 void _gdk_window_add_damage (GdkWindow *toplevel,
649 			     GdkRegion *damaged_region);
650 
651 GdkEvent * _gdk_make_event (GdkWindow    *window,
652 			    GdkEventType  type,
653 			    GdkEvent     *event_in_queue,
654 			    gboolean      before_event);
655 gboolean _gdk_window_event_parent_of (GdkWindow *parent,
656                                       GdkWindow *child);
657 
658 void _gdk_synthesize_crossing_events (GdkDisplay                 *display,
659 				      GdkWindow                  *src,
660 				      GdkWindow                  *dest,
661 				      GdkCrossingMode             mode,
662 				      gint                        toplevel_x,
663 				      gint                        toplevel_y,
664 				      GdkModifierType             mask,
665 				      guint32                     time_,
666 				      GdkEvent                   *event_in_queue,
667 				      gulong                      serial,
668 				      gboolean                    non_linear);
669 void _gdk_display_set_window_under_pointer (GdkDisplay *display,
670 					    GdkWindow *window);
671 
672 
673 void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
674 
675 GdkRegion *_gdk_window_calculate_full_clip_region    (GdkWindow     *window,
676                                                       GdkWindow     *base_window,
677                                                       gboolean       do_children,
678                                                       gint          *base_x_offset,
679                                                       gint          *base_y_offset);
680 gboolean    _gdk_window_has_impl (GdkWindow *window);
681 GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
682 GdkWindow *_gdk_window_get_input_window_for_event (GdkWindow *native_window,
683 						   GdkEventType event_type,
684 						   GdkModifierType mask,
685 						   int x, int y,
686 						   gulong serial);
687 GdkRegion  *_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects, int n_rects);
688 
689 /*****************************
690  * offscreen window routines *
691  *****************************/
692 typedef struct _GdkOffscreenWindow      GdkOffscreenWindow;
693 #define GDK_TYPE_OFFSCREEN_WINDOW            (gdk_offscreen_window_get_type())
694 #define GDK_OFFSCREEN_WINDOW(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindow))
695 #define GDK_IS_OFFSCREEN_WINDOW(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_OFFSCREEN_WINDOW))
696 GType gdk_offscreen_window_get_type (void);
697 GdkDrawable * _gdk_offscreen_window_get_real_drawable (GdkOffscreenWindow *window);
698 void       _gdk_offscreen_window_new                 (GdkWindow     *window,
699 						      GdkScreen     *screen,
700 						      GdkVisual     *visual,
701 						      GdkWindowAttr *attributes,
702 						      gint           attributes_mask);
703 
704 
705 /************************************
706  * Initialization and exit routines *
707  ************************************/
708 
709 void _gdk_image_exit  (void);
710 void _gdk_windowing_exit (void);
711 
712 G_END_DECLS
713 
714 #endif /* __GDK_INTERNALS_H__ */
715