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