~ubuntu-branches/ubuntu/trusty/gtk+2.0/trusty-updates

« back to all changes in this revision

Viewing changes to .pc/fix_gdk_event_apply_filters.patch/gdk/gdkinternals.h

  • Committer: Package Import Robot
  • Author(s): Vlad Orlov
  • Date: 2015-07-28 10:17:14 UTC
  • Revision ID: package-import@ubuntu.com-20150728101714-rd9msqcb0etcfpsr
Tags: 2.24.23-0ubuntu1.3
* fix_gdk_event_apply_filters.patch: new patch. Makes gdk_event_apply_filters
  function safe against changes in the filter list, prevents weird crashes in
  various apps. (LP: #1351890)
* gdk-Fix-GdkWindowFilter-internal-refcounting.patch,
  gdkwindow-Fix-event-unref-iteration.patch: new patches. Fix refcounting
  errors after fix_gdk_event_apply_filters.patch, prevent crashes in some
  applications like Spotify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
};
 
173
 
 
174
/* Tracks information about the pointer grab on this display */
 
175
typedef struct
 
176
{
 
177
  GdkWindow *window;
 
178
  GdkWindow *native_window;
 
179
  gulong serial_start;
 
180
  gulong serial_end; /* exclusive, i.e. not active on serial_end */
 
181
  gboolean owner_events;
 
182
  guint event_mask;
 
183
  gboolean implicit;
 
184
  guint32 time;
 
185
 
 
186
  gboolean activated;
 
187
  gboolean implicit_ungrab;
 
188
} GdkPointerGrabInfo;
 
189
 
 
190
typedef struct _GdkInputWindow GdkInputWindow;
 
191
 
 
192
/* Private version of GdkWindowObject. The initial part of this strucuture
 
193
   is public for historical reasons. Don't change that part */
 
194
typedef struct _GdkWindowPaint             GdkWindowPaint;
 
195
 
 
196
struct _GdkWindowObject
 
197
{
 
198
  /* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */
 
199
  GdkDrawable parent_instance;
 
200
 
 
201
  GdkDrawable *impl; /* window-system-specific delegate object */  
 
202
  
 
203
  GdkWindowObject *parent;
 
204
 
 
205
  gpointer user_data;
 
206
 
 
207
  gint x;
 
208
  gint y;
 
209
  
 
210
  gint extension_events;
 
211
 
 
212
  GList *filters;
 
213
  GList *children;
 
214
 
 
215
  GdkColor bg_color;
 
216
  GdkPixmap *bg_pixmap;
 
217
  
 
218
  GSList *paint_stack;
 
219
  
 
220
  GdkRegion *update_area;
 
221
  guint update_freeze_count;
 
222
  
 
223
  guint8 window_type;
 
224
  guint8 depth;
 
225
  guint8 resize_count;
 
226
 
 
227
  GdkWindowState state;
 
228
  
 
229
  guint guffaw_gravity : 1;
 
230
  guint input_only : 1;
 
231
  guint modal_hint : 1;
 
232
  guint composited : 1;
 
233
  
 
234
  guint destroyed : 2;
 
235
 
 
236
  guint accept_focus : 1;
 
237
  guint focus_on_map : 1;
 
238
  guint shaped : 1;
 
239
  
 
240
  GdkEventMask event_mask;
 
241
 
 
242
  guint update_and_descendants_freeze_count;
 
243
 
 
244
  GdkWindowRedirect *redirect;
 
245
 
 
246
  /* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */
 
247
  
 
248
  /* The GdkWindowObject that has the impl, ref:ed if another window.
 
249
   * This ref is required to keep the wrapper of the impl window alive
 
250
   * for as long as any GdkWindow references the impl. */
 
251
  GdkWindowObject *impl_window; 
 
252
  int abs_x, abs_y; /* Absolute offset in impl */
 
253
  gint width, height;
 
254
  guint32 clip_tag;
 
255
  GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */
 
256
  GdkRegion *clip_region_with_children; /* Clip region in window coords */
 
257
  GdkCursor *cursor;
 
258
  gint8 toplevel_window_type;
 
259
  guint synthesize_crossing_event_queued : 1;
 
260
  guint effective_visibility : 2;
 
261
  guint visibility : 2; /* The visibility wrt the toplevel (i.e. based on clip_region) */
 
262
  guint native_visibility : 2; /* the native visibility of a impl windows */
 
263
  guint viewable : 1; /* mapped and all parents mapped */
 
264
  guint applied_shape : 1;
 
265
 
 
266
  guint num_offscreen_children;
 
267
  GdkWindowPaint *implicit_paint;
 
268
  GdkInputWindow *input_window; /* only set for impl windows */
 
269
 
 
270
  GList *outstanding_moves;
 
271
 
 
272
  GdkRegion *shape;
 
273
  GdkRegion *input_shape;
 
274
  
 
275
  cairo_surface_t *cairo_surface;
 
276
  guint outstanding_surfaces; /* only set on impl window */
 
277
 
 
278
  cairo_pattern_t *background;
 
279
};
 
280
 
 
281
#define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type)
 
282
#define GDK_WINDOW_DESTROYED(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->destroyed)
 
283
 
 
284
extern GdkEventFunc   _gdk_event_func;    /* Callback for events */
 
285
extern gpointer       _gdk_event_data;
 
286
extern GDestroyNotify _gdk_event_notify;
 
287
 
 
288
extern GSList    *_gdk_displays;
 
289
extern gchar     *_gdk_display_name;
 
290
extern gint       _gdk_screen_number;
 
291
extern gchar     *_gdk_display_arg_name;
 
292
 
 
293
void      _gdk_events_queue  (GdkDisplay *display);
 
294
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
 
295
 
 
296
GList* _gdk_event_queue_find_first   (GdkDisplay *display);
 
297
void   _gdk_event_queue_remove_link  (GdkDisplay *display,
 
298
                                      GList      *node);
 
299
GList* _gdk_event_queue_prepend      (GdkDisplay *display,
 
300
                                      GdkEvent   *event);
 
301
GList* _gdk_event_queue_append       (GdkDisplay *display,
 
302
                                      GdkEvent   *event);
 
303
GList* _gdk_event_queue_insert_after (GdkDisplay *display,
 
304
                                      GdkEvent   *after_event,
 
305
                                      GdkEvent   *event);
 
306
GList* _gdk_event_queue_insert_before(GdkDisplay *display,
 
307
                                      GdkEvent   *after_event,
 
308
                                      GdkEvent   *event);
 
309
void   _gdk_event_button_generate    (GdkDisplay *display,
 
310
                                      GdkEvent   *event);
 
311
 
 
312
void _gdk_windowing_event_data_copy (const GdkEvent *src,
 
313
                                     GdkEvent       *dst);
 
314
void _gdk_windowing_event_data_free (GdkEvent       *event);
 
315
 
 
316
void gdk_synthesize_window_state (GdkWindow     *window,
 
317
                                  GdkWindowState unset_flags,
 
318
                                  GdkWindowState set_flags);
 
319
 
 
320
#define GDK_SCRATCH_IMAGE_WIDTH 256
 
321
#define GDK_SCRATCH_IMAGE_HEIGHT 64
 
322
 
 
323
GdkImage* _gdk_image_new_for_depth (GdkScreen    *screen,
 
324
                                    GdkImageType  type,
 
325
                                    GdkVisual    *visual,
 
326
                                    gint          width,
 
327
                                    gint          height,
 
328
                                    gint          depth);
 
329
GdkImage *_gdk_image_get_scratch (GdkScreen *screen,
 
330
                                  gint       width,
 
331
                                  gint       height,
 
332
                                  gint       depth,
 
333
                                  gint      *x,
 
334
                                  gint      *y);
 
335
 
 
336
GdkImage *_gdk_drawable_copy_to_image (GdkDrawable  *drawable,
 
337
                                       GdkImage     *image,
 
338
                                       gint          src_x,
 
339
                                       gint          src_y,
 
340
                                       gint          dest_x,
 
341
                                       gint          dest_y,
 
342
                                       gint          width,
 
343
                                       gint          height);
 
344
 
 
345
cairo_surface_t *_gdk_drawable_ref_cairo_surface (GdkDrawable *drawable);
 
346
 
 
347
GdkDrawable *_gdk_drawable_get_source_drawable (GdkDrawable *drawable);
 
348
cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
 
349
                                                      int width,
 
350
                                                      int height);
 
351
 
 
352
/* GC caching */
 
353
GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
 
354
                                     gboolean     graphics_exposures);
 
355
GdkGC *_gdk_drawable_get_subwindow_scratch_gc (GdkDrawable *drawable);
 
356
 
 
357
void _gdk_gc_update_context (GdkGC          *gc,
 
358
                             cairo_t        *cr,
 
359
                             const GdkColor *override_foreground,
 
360
                             GdkBitmap      *override_stipple,
 
361
                             gboolean        gc_changed,
 
362
                             GdkDrawable    *target_drawable);
 
363
 
 
364
/*************************************
 
365
 * Interfaces used by windowing code *
 
366
 *************************************/
 
367
 
 
368
GdkPixmap *_gdk_pixmap_new               (GdkDrawable    *drawable,
 
369
                                          gint            width,
 
370
                                          gint            height,
 
371
                                          gint            depth);
 
372
GdkPixmap *_gdk_pixmap_create_from_data  (GdkDrawable    *drawable,
 
373
                                          const gchar    *data,
 
374
                                          gint            width,
 
375
                                          gint            height,
 
376
                                          gint            depth,
 
377
                                          const GdkColor *fg,
 
378
                                          const GdkColor *bg);
 
379
GdkPixmap *_gdk_bitmap_create_from_data  (GdkDrawable    *drawable,
 
380
                                          const gchar    *data,
 
381
                                          gint            width,
 
382
                                          gint            height);
 
383
 
 
384
void       _gdk_window_impl_new          (GdkWindow      *window,
 
385
                                          GdkWindow      *real_parent,
 
386
                                          GdkScreen      *screen,
 
387
                                          GdkVisual      *visual,
 
388
                                          GdkEventMask    event_mask,
 
389
                                          GdkWindowAttr  *attributes,
 
390
                                          gint            attributes_mask);
 
391
void       _gdk_window_destroy           (GdkWindow      *window,
 
392
                                          gboolean        foreign_destroy);
 
393
void       _gdk_window_clear_update_area (GdkWindow      *window);
 
394
void       _gdk_window_update_size       (GdkWindow      *window);
 
395
gboolean   _gdk_window_update_viewable   (GdkWindow      *window);
 
396
 
 
397
void       _gdk_window_process_updates_recurse (GdkWindow *window,
 
398
                                                GdkRegion *expose_region);
 
399
 
 
400
void       _gdk_screen_close             (GdkScreen      *screen);
 
401
 
 
402
const char *_gdk_get_sm_client_id (void);
 
403
 
 
404
void _gdk_gc_init (GdkGC           *gc,
 
405
                   GdkDrawable     *drawable,
 
406
                   GdkGCValues     *values,
 
407
                   GdkGCValuesMask  values_mask);
 
408
 
 
409
GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
 
410
GdkBitmap *_gdk_gc_get_clip_mask   (GdkGC *gc);
 
411
gboolean   _gdk_gc_get_exposures   (GdkGC *gc);
 
412
GdkFill    _gdk_gc_get_fill        (GdkGC *gc);
 
413
GdkPixmap *_gdk_gc_get_tile        (GdkGC *gc);
 
414
GdkBitmap *_gdk_gc_get_stipple     (GdkGC *gc);
 
415
guint32    _gdk_gc_get_fg_pixel    (GdkGC *gc);
 
416
guint32    _gdk_gc_get_bg_pixel    (GdkGC *gc);
 
417
void      _gdk_gc_add_drawable_clip     (GdkGC     *gc,
 
418
                                         guint32    region_tag,
 
419
                                         GdkRegion *region,
 
420
                                         int        offset_x,
 
421
                                         int        offset_y);
 
422
void      _gdk_gc_remove_drawable_clip  (GdkGC     *gc);
 
423
void       _gdk_gc_set_clip_region_internal (GdkGC     *gc,
 
424
                                             GdkRegion *region,
 
425
                                             gboolean reset_origin);
 
426
GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
 
427
 
 
428
GdkDrawable *_gdk_drawable_begin_direct_draw (GdkDrawable *drawable,
 
429
                                              GdkGC *gc,
 
430
                                              gpointer *priv_data,
 
431
                                              gint *x_offset_out,
 
432
                                              gint *y_offset_out);
 
433
void         _gdk_drawable_end_direct_draw (gpointer priv_data);
 
434
 
 
435
 
 
436
/*****************************************
 
437
 * Interfaces provided by windowing code *
 
438
 *****************************************/
 
439
 
 
440
/* Font/string functions implemented in module-specific code */
 
441
gint _gdk_font_strlen (GdkFont *font, const char *str);
 
442
void _gdk_font_destroy (GdkFont *font);
 
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_pointer        (GdkDisplay       *display,
 
467
                                              GdkScreen       **screen,
 
468
                                              gint             *x,
 
469
                                              gint             *y,
 
470
                                              GdkModifierType  *mask);
 
471
GdkWindow* _gdk_windowing_window_at_pointer  (GdkDisplay       *display,
 
472
                                              gint             *win_x,
 
473
                                              gint             *win_y,
 
474
                                              GdkModifierType  *mask,
 
475
                                              gboolean          get_toplevel);
 
476
GdkGrabStatus _gdk_windowing_pointer_grab    (GdkWindow        *window,
 
477
                                              GdkWindow        *native,
 
478
                                              gboolean          owner_events,
 
479
                                              GdkEventMask      event_mask,
 
480
                                              GdkWindow        *confine_to,
 
481
                                              GdkCursor        *cursor,
 
482
                                              guint32           time);
 
483
void _gdk_windowing_got_event                (GdkDisplay       *display,
 
484
                                              GList            *event_link,
 
485
                                              GdkEvent         *event,
 
486
                                              gulong            serial);
 
487
 
 
488
void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
 
489
                                                    GdkRegion *expose_region);
 
490
void _gdk_windowing_before_process_all_updates     (void);
 
491
void _gdk_windowing_after_process_all_updates      (void);
 
492
 
 
493
/* Return the number of bits-per-pixel for images of the specified depth. */
 
494
gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
 
495
                                        gint        depth);
 
496
 
 
497
 
 
498
#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
 
499
 
 
500
 
 
501
/* Called when gdk_window_destroy() is called on a foreign window
 
502
 * or an ancestor of the foreign window. It should generally reparent
 
503
 * the window out of it's current heirarchy, hide it, and then
 
504
 * send a message to the owner requesting that the window be destroyed.
 
505
 */
 
506
void _gdk_windowing_window_destroy_foreign (GdkWindow *window);
 
507
 
 
508
void _gdk_windowing_display_set_sm_client_id (GdkDisplay  *display,
 
509
                                              const gchar *sm_client_id);
 
510
 
 
511
void _gdk_windowing_window_set_composited (GdkWindow *window,
 
512
                                           gboolean composited);
 
513
 
 
514
#define GDK_TYPE_PAINTABLE            (_gdk_paintable_get_type ())
 
515
#define GDK_PAINTABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
 
516
#define GDK_IS_PAINTABLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
 
517
#define GDK_PAINTABLE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
 
518
 
 
519
typedef struct _GdkPaintable        GdkPaintable;
 
520
typedef struct _GdkPaintableIface   GdkPaintableIface;
 
521
 
 
522
struct _GdkPaintableIface
 
523
{
 
524
  GTypeInterface g_iface;
 
525
  
 
526
  void (* begin_paint_region)       (GdkPaintable    *paintable,
 
527
                                     GdkWindow       *window,
 
528
                                     const GdkRegion *region);
 
529
  void (* end_paint)                (GdkPaintable    *paintable);
 
530
};
 
531
 
 
532
GType _gdk_paintable_get_type (void) G_GNUC_CONST;
 
533
 
 
534
/* Implementation types */
 
535
GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
 
536
GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
 
537
 
 
538
 
 
539
/**
 
540
 * _gdk_windowing_gc_set_clip_region:
 
541
 * @gc: a #GdkGC
 
542
 * @region: the new clip region
 
543
 * @reset_origin: if TRUE, reset the clip_x/y_origin values to 0
 
544
 * 
 
545
 * Do any window-system specific processing necessary
 
546
 * for a change in clip region. Since the clip origin
 
547
 * will likely change before the GC is used with the
 
548
 * new clip, frequently this function will only set a flag and
 
549
 * do the real processing later.
 
550
 *
 
551
 * When this function is called, _gdk_gc_get_clip_region
 
552
 * will already return the new region.
 
553
 **/
 
554
void _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
 
555
                                        const GdkRegion *region,
 
556
                                        gboolean reset_origin);
 
557
 
 
558
/**
 
559
 * _gdk_windowing_gc_copy:
 
560
 * @dst_gc: a #GdkGC from the GDK backend
 
561
 * @src_gc: a #GdkGC from the GDK backend
 
562
 * 
 
563
 * Copies backend specific state from @src_gc to @dst_gc.
 
564
 * This is called before the generic state is copied, so
 
565
 * the old generic state is still available from @dst_gc
 
566
 **/
 
567
void _gdk_windowing_gc_copy (GdkGC *dst_gc,
 
568
                             GdkGC *src_gc);
 
569
     
 
570
/* Queries the current foreground color of a GdkGC */
 
571
void _gdk_windowing_gc_get_foreground (GdkGC    *gc,
 
572
                                       GdkColor *color);
 
573
/* Queries the current background color of a GdkGC */
 
574
void _gdk_windowing_gc_get_background (GdkGC    *gc,
 
575
                                       GdkColor *color);
 
576
 
 
577
struct GdkAppLaunchContextPrivate
 
578
{
 
579
  GdkDisplay *display;
 
580
  GdkScreen *screen;
 
581
  gint workspace;
 
582
  guint32 timestamp;
 
583
  GIcon *icon;
 
584
  char *icon_name;
 
585
};
 
586
 
 
587
char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
 
588
                                            GAppInfo          *info, 
 
589
                                            GList             *files);
 
590
void  _gdk_windowing_launch_failed         (GAppLaunchContext *context, 
 
591
                                            const char        *startup_notify_id);
 
592
 
 
593
GdkPointerGrabInfo *_gdk_display_get_active_pointer_grab (GdkDisplay *display);
 
594
void _gdk_display_pointer_grab_update                    (GdkDisplay *display,
 
595
                                                          gulong current_serial);
 
596
GdkPointerGrabInfo *_gdk_display_get_last_pointer_grab (GdkDisplay *display);
 
597
GdkPointerGrabInfo *_gdk_display_add_pointer_grab  (GdkDisplay *display,
 
598
                                                    GdkWindow *window,
 
599
                                                    GdkWindow *native_window,
 
600
                                                    gboolean owner_events,
 
601
                                                    GdkEventMask event_mask,
 
602
                                                    unsigned long serial_start,
 
603
                                                    guint32 time,
 
604
                                                    gboolean implicit);
 
605
GdkPointerGrabInfo * _gdk_display_has_pointer_grab (GdkDisplay *display,
 
606
                                                    gulong serial);
 
607
gboolean _gdk_display_end_pointer_grab (GdkDisplay *display,
 
608
                                        gulong serial,
 
609
                                        GdkWindow *if_child,
 
610
                                        gboolean implicit);
 
611
void _gdk_display_set_has_keyboard_grab (GdkDisplay *display,
 
612
                                         GdkWindow *window,
 
613
                                         GdkWindow *native_window,
 
614
                                         gboolean owner_events,
 
615
                                         unsigned long serial,
 
616
                                         guint32 time);
 
617
void _gdk_display_unset_has_keyboard_grab (GdkDisplay *display,
 
618
                                           gboolean implicit);
 
619
void _gdk_display_enable_motion_hints     (GdkDisplay *display);
 
620
 
 
621
 
 
622
void _gdk_window_invalidate_for_expose (GdkWindow       *window,
 
623
                                        GdkRegion       *region);
 
624
 
 
625
void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
 
626
                                            int width,
 
627
                                            int height);
 
628
 
 
629
cairo_surface_t * _gdk_windowing_create_cairo_surface (GdkDrawable *drawable,
 
630
                                                       int width,
 
631
                                                       int height);
 
632
GdkWindow * _gdk_window_find_child_at (GdkWindow *window,
 
633
                                       int x, int y);
 
634
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
 
635
                                            double x, double y,
 
636
                                            double *found_x,
 
637
                                            double *found_y);
 
638
 
 
639
void _gdk_window_add_damage (GdkWindow *toplevel,
 
640
                             GdkRegion *damaged_region);
 
641
 
 
642
GdkEvent * _gdk_make_event (GdkWindow    *window,
 
643
                            GdkEventType  type,
 
644
                            GdkEvent     *event_in_queue,
 
645
                            gboolean      before_event);
 
646
gboolean _gdk_window_event_parent_of (GdkWindow *parent,
 
647
                                      GdkWindow *child);
 
648
 
 
649
void _gdk_synthesize_crossing_events (GdkDisplay                 *display,
 
650
                                      GdkWindow                  *src,
 
651
                                      GdkWindow                  *dest,
 
652
                                      GdkCrossingMode             mode,
 
653
                                      gint                        toplevel_x,
 
654
                                      gint                        toplevel_y,
 
655
                                      GdkModifierType             mask,
 
656
                                      guint32                     time_,
 
657
                                      GdkEvent                   *event_in_queue,
 
658
                                      gulong                      serial,
 
659
                                      gboolean                    non_linear);
 
660
void _gdk_display_set_window_under_pointer (GdkDisplay *display,
 
661
                                            GdkWindow *window);
 
662
 
 
663
 
 
664
void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
 
665
 
 
666
GdkRegion *_gdk_window_calculate_full_clip_region    (GdkWindow     *window,
 
667
                                                      GdkWindow     *base_window,
 
668
                                                      gboolean       do_children,
 
669
                                                      gint          *base_x_offset,
 
670
                                                      gint          *base_y_offset);
 
671
gboolean    _gdk_window_has_impl (GdkWindow *window);
 
672
GdkWindow * _gdk_window_get_impl_window (GdkWindow *window);
 
673
GdkWindow *_gdk_window_get_input_window_for_event (GdkWindow *native_window,
 
674
                                                   GdkEventType event_type,
 
675
                                                   GdkModifierType mask,
 
676
                                                   int x, int y,
 
677
                                                   gulong serial);
 
678
GdkRegion  *_gdk_region_new_from_yxbanded_rects (GdkRectangle *rects, int n_rects);
 
679
 
 
680
/*****************************
 
681
 * offscreen window routines *
 
682
 *****************************/
 
683
typedef struct _GdkOffscreenWindow      GdkOffscreenWindow;
 
684
#define GDK_TYPE_OFFSCREEN_WINDOW            (gdk_offscreen_window_get_type())
 
685
#define GDK_OFFSCREEN_WINDOW(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_OFFSCREEN_WINDOW, GdkOffscreenWindow))
 
686
#define GDK_IS_OFFSCREEN_WINDOW(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_OFFSCREEN_WINDOW))
 
687
GType gdk_offscreen_window_get_type (void);
 
688
GdkDrawable * _gdk_offscreen_window_get_real_drawable (GdkOffscreenWindow *window);
 
689
void       _gdk_offscreen_window_new                 (GdkWindow     *window,
 
690
                                                      GdkScreen     *screen,
 
691
                                                      GdkVisual     *visual,
 
692
                                                      GdkWindowAttr *attributes,
 
693
                                                      gint           attributes_mask);
 
694
 
 
695
 
 
696
/************************************
 
697
 * Initialization and exit routines *
 
698
 ************************************/
 
699
 
 
700
void _gdk_image_exit  (void);
 
701
void _gdk_windowing_exit (void);
 
702
 
 
703
G_END_DECLS
 
704
 
 
705
#endif /* __GDK_INTERNALS_H__ */