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