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