gdkwindow.h 45.9 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GDK - The GIMP Drawing Kit
2
3
4
5
6
7
8
9
10
11
12
13
14
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17
18
19
20
21
 */

/*
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23
24
 */

25
26
27
#ifndef __GDK_WINDOW_H__
#define __GDK_WINDOW_H__

28
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29
30
31
#error "Only <gdk/gdk.h> can be included directly."
#endif

32
#include <gdk/gdkversionmacros.h>
Owen Taylor's avatar
Started    
Owen Taylor committed
33
#include <gdk/gdktypes.h>
Emmanuele Bassi's avatar
Emmanuele Bassi committed
34
#include <gdk/gdkdrawingcontext.h>
35
#include <gdk/gdkevents.h>
Owen W. Taylor's avatar
Owen W. Taylor committed
36
#include <gdk/gdkframeclock.h>
Owen Taylor's avatar
Started    
Owen Taylor committed
37

38
G_BEGIN_DECLS
Owen Taylor's avatar
Started    
Owen Taylor committed
39

40
41
42
typedef struct _GdkGeometry          GdkGeometry;
typedef struct _GdkWindowAttr        GdkWindowAttr;
typedef struct _GdkWindowRedirect    GdkWindowRedirect;
Owen Taylor's avatar
Started    
Owen Taylor committed
43

44
/**
45
 * GdkWindowWindowClass:
46
47
48
49
50
51
 * @GDK_INPUT_OUTPUT: window for graphics and events
 * @GDK_INPUT_ONLY: window for events only
 *
 * @GDK_INPUT_OUTPUT windows are the standard kind of window you might expect.
 * Such windows receive events and are also displayed on screen.
 * @GDK_INPUT_ONLY windows are invisible; they are usually placed above other
52
 * windows in order to trap or filter the events. You can’t draw on
53
 * @GDK_INPUT_ONLY windows.
Owen Taylor's avatar
Started    
Owen Taylor committed
54
55
56
 */
typedef enum
{
57
58
  GDK_INPUT_OUTPUT, /*< nick=input-output >*/
  GDK_INPUT_ONLY    /*< nick=input-only >*/
59
} GdkWindowWindowClass;
Owen Taylor's avatar
Started    
Owen Taylor committed
60

61
62
63
64
65
66
67
68
69
70
/**
 * GdkWindowType:
 * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire
 *  screen, and is created by the window system
 * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
 * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry)
 * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement
 *  #GtkMenu)
 * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
 * @GDK_WINDOW_OFFSCREEN: offscreen window (see
71
 *  [Offscreen Windows][OFFSCREEN-WINDOWS]). Since 2.18
72
73
74
 * @GDK_WINDOW_SUBSURFACE: subsurface-based window; This window is visually
 *  tied to a toplevel, and is moved/stacked with it. Currently this window
 *  type is only implemented in Wayland. Since 3.14
75
76
 *
 * Describes the kind of window.
77
78
79
80
81
82
83
 */
typedef enum
{
  GDK_WINDOW_ROOT,
  GDK_WINDOW_TOPLEVEL,
  GDK_WINDOW_CHILD,
  GDK_WINDOW_TEMP,
84
  GDK_WINDOW_FOREIGN,
85
86
  GDK_WINDOW_OFFSCREEN,
  GDK_WINDOW_SUBSURFACE
87
} GdkWindowType;
Owen Taylor's avatar
Started    
Owen Taylor committed
88

89
90
91
92
93
94
95
96
97
98
99
100
/**
 * GdkWindowAttributesType:
 * @GDK_WA_TITLE: Honor the title field
 * @GDK_WA_X: Honor the X coordinate field
 * @GDK_WA_Y: Honor the Y coordinate field
 * @GDK_WA_CURSOR: Honor the cursor field
 * @GDK_WA_VISUAL: Honor the visual field
 * @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
 * @GDK_WA_NOREDIR: Honor the override_redirect field
 * @GDK_WA_TYPE_HINT: Honor the type_hint field
 *
 * Used to indicate which fields in the #GdkWindowAttr struct should be honored.
William Jon McCann's avatar
William Jon McCann committed
101
102
 * For example, if you filled in the “cursor” and “x” fields of #GdkWindowAttr,
 * pass “@GDK_WA_X | @GDK_WA_CURSOR” to gdk_window_new(). Fields in
103
104
105
 * #GdkWindowAttr not covered by a bit in this enum are required; for example,
 * the @width/@height, @wclass, and @window_type fields are required, they have
 * no corresponding flag in #GdkWindowAttributesType.
Owen Taylor's avatar
Started    
Owen Taylor committed
106
107
108
 */
typedef enum
{
Cody Russell's avatar
Cody Russell committed
109
110
111
112
  GDK_WA_TITLE	   = 1 << 1,
  GDK_WA_X	   = 1 << 2,
  GDK_WA_Y	   = 1 << 3,
  GDK_WA_CURSOR	   = 1 << 4,
113
114
115
116
  GDK_WA_VISUAL	   = 1 << 5,
  GDK_WA_WMCLASS   = 1 << 6,
  GDK_WA_NOREDIR   = 1 << 7,
  GDK_WA_TYPE_HINT = 1 << 8
Owen Taylor's avatar
Started    
Owen Taylor committed
117
118
119
120
} GdkWindowAttributesType;

/* Size restriction enumeration.
 */
121
122
123
124
125
126
127
128
129
/**
 * GdkWindowHints:
 * @GDK_HINT_POS: indicates that the program has positioned the window
 * @GDK_HINT_MIN_SIZE: min size fields are set
 * @GDK_HINT_MAX_SIZE: max size fields are set
 * @GDK_HINT_BASE_SIZE: base size fields are set
 * @GDK_HINT_ASPECT: aspect ratio fields are set
 * @GDK_HINT_RESIZE_INC: resize increment fields are set
 * @GDK_HINT_WIN_GRAVITY: window gravity field is set
130
 * @GDK_HINT_USER_POS: indicates that the window’s position was explicitly set
131
 *  by the user
132
 * @GDK_HINT_USER_SIZE: indicates that the window’s size was explicitly set by
133
134
135
136
137
138
139
140
141
142
143
 *  the user
 *
 * Used to indicate which fields of a #GdkGeometry struct should be paid
 * attention to. Also, the presence/absence of @GDK_HINT_POS,
 * @GDK_HINT_USER_POS, and @GDK_HINT_USER_SIZE is significant, though they don't
 * directly refer to #GdkGeometry fields. @GDK_HINT_USER_POS will be set
 * automatically by #GtkWindow if you call gtk_window_move().
 * @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE should be set if the user
 * specified a size/position using a --geometry command-line argument;
 * gtk_window_parse_geometry() automatically sets these flags.
 */
Owen Taylor's avatar
Started    
Owen Taylor committed
144
145
typedef enum
{
Owen Taylor's avatar
Owen Taylor committed
146
147
148
149
150
151
  GDK_HINT_POS	       = 1 << 0,
  GDK_HINT_MIN_SIZE    = 1 << 1,
  GDK_HINT_MAX_SIZE    = 1 << 2,
  GDK_HINT_BASE_SIZE   = 1 << 3,
  GDK_HINT_ASPECT      = 1 << 4,
  GDK_HINT_RESIZE_INC  = 1 << 5,
Havoc Pennington's avatar
Havoc Pennington committed
152
153
154
  GDK_HINT_WIN_GRAVITY = 1 << 6,
  GDK_HINT_USER_POS    = 1 << 7,
  GDK_HINT_USER_SIZE   = 1 << 8
Owen Taylor's avatar
Started    
Owen Taylor committed
155
156
157
158
159
160
161
} GdkWindowHints;

/* The next two enumeration values current match the
 * Motif constants. If this is changed, the implementation
 * of gdk_window_set_decorations/gdk_window_set_functions
 * will need to change as well.
 */
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**
 * GdkWMDecoration:
 * @GDK_DECOR_ALL: all decorations should be applied.
 * @GDK_DECOR_BORDER: a frame should be drawn around the window.
 * @GDK_DECOR_RESIZEH: the frame should have resize handles.
 * @GDK_DECOR_TITLE: a titlebar should be placed above the window.
 * @GDK_DECOR_MENU: a button for opening a menu should be included.
 * @GDK_DECOR_MINIMIZE: a minimize button should be included.
 * @GDK_DECOR_MAXIMIZE: a maximize button should be included.
 *
 * These are hints originally defined by the Motif toolkit.
 * The window manager can use them when determining how to decorate
 * the window. The hint must be set before mapping the window.
 */
Owen Taylor's avatar
Started    
Owen Taylor committed
176
177
178
179
180
181
182
183
184
185
186
typedef enum
{
  GDK_DECOR_ALL		= 1 << 0,
  GDK_DECOR_BORDER	= 1 << 1,
  GDK_DECOR_RESIZEH	= 1 << 2,
  GDK_DECOR_TITLE	= 1 << 3,
  GDK_DECOR_MENU	= 1 << 4,
  GDK_DECOR_MINIMIZE	= 1 << 5,
  GDK_DECOR_MAXIMIZE	= 1 << 6
} GdkWMDecoration;

187
188
189
190
191
192
193
194
195
196
197
198
199
/**
 * GdkWMFunction:
 * @GDK_FUNC_ALL: all functions should be offered.
 * @GDK_FUNC_RESIZE: the window should be resizable.
 * @GDK_FUNC_MOVE: the window should be movable.
 * @GDK_FUNC_MINIMIZE: the window should be minimizable.
 * @GDK_FUNC_MAXIMIZE: the window should be maximizable.
 * @GDK_FUNC_CLOSE: the window should be closable.
 *
 * These are hints originally defined by the Motif toolkit. The window manager
 * can use them when determining the functions to offer for the window. The
 * hint must be set before mapping the window.
 */
Owen Taylor's avatar
Started    
Owen Taylor committed
200
201
202
203
204
205
206
207
208
209
typedef enum
{
  GDK_FUNC_ALL		= 1 << 0,
  GDK_FUNC_RESIZE	= 1 << 1,
  GDK_FUNC_MOVE		= 1 << 2,
  GDK_FUNC_MINIMIZE	= 1 << 3,
  GDK_FUNC_MAXIMIZE	= 1 << 4,
  GDK_FUNC_CLOSE	= 1 << 5
} GdkWMFunction;

Owen Taylor's avatar
Owen Taylor committed
210
211
212
213
/* Currently, these are the same values numerically as in the
 * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints()
 * will need fixing.
 */
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/**
 * GdkGravity:
 * @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner.
 * @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge.
 * @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner.
 * @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge.
 * @GDK_GRAVITY_CENTER: the reference point is at the center of the window.
 * @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge.
 * @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner.
 * @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge.
 * @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner.
 * @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the
 *  window itself, ignoring window manager decorations.
 *
 * Defines the reference point of a window and the meaning of coordinates
 * passed to gtk_window_move(). See gtk_window_move() and the "implementation
 * notes" section of the
231
232
 * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
 * specification for more details.
233
 */
Owen Taylor's avatar
Owen Taylor committed
234
235
236
237
238
239
240
241
242
243
244
typedef enum
{
  GDK_GRAVITY_NORTH_WEST = 1,
  GDK_GRAVITY_NORTH,
  GDK_GRAVITY_NORTH_EAST,
  GDK_GRAVITY_WEST,
  GDK_GRAVITY_CENTER,
  GDK_GRAVITY_EAST,
  GDK_GRAVITY_SOUTH_WEST,
  GDK_GRAVITY_SOUTH,
  GDK_GRAVITY_SOUTH_EAST,
245
  GDK_GRAVITY_STATIC
Owen Taylor's avatar
Owen Taylor committed
246
247
} GdkGravity;

248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/**
 * GdkAnchorHints:
 * @GDK_ANCHOR_FLIP_X: allow flipping anchors horizontally
 * @GDK_ANCHOR_FLIP_Y: allow flipping anchors vertically
 * @GDK_ANCHOR_SLIDE_X: allow sliding window horizontally
 * @GDK_ANCHOR_SLIDE_Y: allow sliding window vertically
 * @GDK_ANCHOR_RESIZE_X: allow resizing window horizontally
 * @GDK_ANCHOR_RESIZE_Y: allow resizing window vertically
 * @GDK_ANCHOR_FLIP: allow flipping anchors on both axes
 * @GDK_ANCHOR_SLIDE: allow sliding window on both axes
 * @GDK_ANCHOR_RESIZE: allow resizing window on both axes
 *
 * Positioning hints for aligning a window relative to a rectangle.
 *
 * These hints determine how the window should be positioned in the case that
 * the window would fall off-screen if placed in its ideal position.
 *
 * For example, %GDK_ANCHOR_FLIP_X will replace %GDK_GRAVITY_NORTH_WEST with
 * %GDK_GRAVITY_NORTH_EAST and vice versa if the window extends beyond the left
 * or right edges of the monitor.
 *
 * If %GDK_ANCHOR_SLIDE_X is set, the window can be shifted horizontally to fit
 * on-screen. If %GDK_ANCHOR_RESIZE_X is set, the window can be shrunken
 * horizontally to fit.
 *
 * In general, when multiple flags are set, flipping should take precedence over
 * sliding, which should take precedence over resizing.
 *
 * Since: 3.22
 * Stability: Unstable
 */
typedef enum
{
  GDK_ANCHOR_FLIP_X   = 1 << 0,
  GDK_ANCHOR_FLIP_Y   = 1 << 1,
  GDK_ANCHOR_SLIDE_X  = 1 << 2,
  GDK_ANCHOR_SLIDE_Y  = 1 << 3,
  GDK_ANCHOR_RESIZE_X = 1 << 4,
  GDK_ANCHOR_RESIZE_Y = 1 << 5,
  GDK_ANCHOR_FLIP     = GDK_ANCHOR_FLIP_X | GDK_ANCHOR_FLIP_Y,
  GDK_ANCHOR_SLIDE    = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y,
  GDK_ANCHOR_RESIZE   = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y
} GdkAnchorHints;
Owen Taylor's avatar
Owen Taylor committed
291

292
293
294
295
296
297
298
299
300
301
302
303
304
/**
 * GdkWindowEdge:
 * @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner.
 * @GDK_WINDOW_EDGE_NORTH: the top edge.
 * @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner.
 * @GDK_WINDOW_EDGE_WEST: the left edge.
 * @GDK_WINDOW_EDGE_EAST: the right edge.
 * @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner.
 * @GDK_WINDOW_EDGE_SOUTH: the lower edge.
 * @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner.
 *
 * Determines a window edge or corner.
 */
Owen Taylor's avatar
Owen Taylor committed
305
306
307
308
309
310
311
312
313
314
315
316
typedef enum
{
  GDK_WINDOW_EDGE_NORTH_WEST,
  GDK_WINDOW_EDGE_NORTH,
  GDK_WINDOW_EDGE_NORTH_EAST,
  GDK_WINDOW_EDGE_WEST,
  GDK_WINDOW_EDGE_EAST,
  GDK_WINDOW_EDGE_SOUTH_WEST,
  GDK_WINDOW_EDGE_SOUTH,
  GDK_WINDOW_EDGE_SOUTH_EAST  
} GdkWindowEdge;

317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
/**
 * GdkFullscreenMode:
 * @GDK_FULLSCREEN_ON_CURRENT_MONITOR: Fullscreen on current monitor only.
 * @GDK_FULLSCREEN_ON_ALL_MONITORS: Span across all monitors when fullscreen.
 *
 * Indicates which monitor (in a multi-head setup) a window should span over
 * when in fullscreen mode.
 *
 * Since: 3.8
 **/
typedef enum
{
  GDK_FULLSCREEN_ON_CURRENT_MONITOR,
  GDK_FULLSCREEN_ON_ALL_MONITORS
} GdkFullscreenMode;

333
334
335
336
337
338
339
340
341
342
343
344
345
/**
 * GdkWindowAttr:
 * @title: title of the window (for toplevel windows)
 * @event_mask: event mask (see gdk_window_set_events())
 * @x: X coordinate relative to parent window (see gdk_window_move())
 * @y: Y coordinate relative to parent window (see gdk_window_move())
 * @width: width of window
 * @height: height of window
 * @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
 *  window that receives events)
 * @visual: #GdkVisual for window
 * @window_type: type of window
 * @cursor: cursor for the window (see gdk_window_set_cursor())
346
347
 * @wmclass_name: don’t use (see gtk_window_set_wmclass())
 * @wmclass_class: don’t use (see gtk_window_set_wmclass())
348
349
350
351
352
 * @override_redirect: %TRUE to bypass the window manager
 * @type_hint: a hint of the function of the window
 *
 * Attributes to use for a newly-created window.
 */
Owen Taylor's avatar
Started    
Owen Taylor committed
353
354
355
356
struct _GdkWindowAttr
{
  gchar *title;
  gint event_mask;
357
358
359
  gint x, y;
  gint width;
  gint height;
360
  GdkWindowWindowClass wclass;
Owen Taylor's avatar
Started    
Owen Taylor committed
361
  GdkVisual *visual;
362
  GdkWindowType window_type;
Owen Taylor's avatar
Started    
Owen Taylor committed
363
364
365
366
  GdkCursor *cursor;
  gchar *wmclass_name;
  gchar *wmclass_class;
  gboolean override_redirect;
Cody Russell's avatar
Cody Russell committed
367
  GdkWindowTypeHint type_hint;
Owen Taylor's avatar
Started    
Owen Taylor committed
368
369
};

370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
/**
 * GdkGeometry:
 * @min_width: minimum width of window (or -1 to use requisition, with
 *  #GtkWindow only)
 * @min_height: minimum height of window (or -1 to use requisition, with
 *  #GtkWindow only)
 * @max_width: maximum width of window (or -1 to use requisition, with
 *  #GtkWindow only)
 * @max_height: maximum height of window (or -1 to use requisition, with
 *  #GtkWindow only)
 * @base_width: allowed window widths are @base_width + @width_inc * N where N
 *  is any integer (-1 allowed with #GtkWindow)
 * @base_height: allowed window widths are @base_height + @height_inc * N where
 *  N is any integer (-1 allowed with #GtkWindow)
 * @width_inc: width resize increment
 * @height_inc: height resize increment
 * @min_aspect: minimum width/height ratio
 * @max_aspect: maximum width/height ratio
 * @win_gravity: window gravity, see gtk_window_set_gravity()
 *
 * The #GdkGeometry struct gives the window manager information about
391
 * a window’s geometry constraints. Normally you would set these on
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
 * the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
 * then sets the hints on the #GdkWindow it creates.
 *
 * gdk_window_set_geometry_hints() expects the hints to be fully valid already
 * and simply passes them to the window manager; in contrast,
 * gtk_window_set_geometry_hints() performs some interpretation. For example,
 * #GtkWindow will apply the hints to the geometry widget instead of the
 * toplevel window, if you set a geometry widget. Also, the
 * @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
 * #GtkWindow will substitute the size request of the window or geometry widget.
 * If the minimum size hint is not provided, #GtkWindow will use its requisition
 * as the minimum size. If the minimum size is provided and a geometry widget is
 * set, #GtkWindow will take the minimum size as the minimum size of the
 * geometry widget rather than the entire window. The base size is treated
 * similarly.
 *
 * The canonical use-case for gtk_window_set_geometry_hints() is to get a
 * terminal widget to resize properly. Here, the terminal text area should be
 * the geometry widget; #GtkWindow will then automatically set the base size to
 * the size of other widgets in the terminal window, such as the menubar and
 * scrollbar. Then, the @width_inc and @height_inc fields should be set to the
 * size of one character in the terminal. Finally, the base size should be set
 * to the size of one character. The net effect is that the minimum size of the
 * terminal will have a 1x1 character terminal area, and only terminal sizes on
William Jon McCann's avatar
William Jon McCann committed
416
 * the “character grid” will be allowed.
417
 *
418
 * Here’s an example of how the terminal example would be implemented, assuming
William Jon McCann's avatar
William Jon McCann committed
419
 * a terminal area widget called “terminal” and a toplevel window “toplevel”:
420
 *
421
 * |[<!-- language="C" -->
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
 * 	GdkGeometry hints;
 *
 * 	hints.base_width = terminal->char_width;
 *         hints.base_height = terminal->char_height;
 *         hints.min_width = terminal->char_width;
 *         hints.min_height = terminal->char_height;
 *         hints.width_inc = terminal->char_width;
 *         hints.height_inc = terminal->char_height;
 *
 *  gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
 *                                 GTK_WIDGET (terminal),
 *                                 &hints,
 *                                 GDK_HINT_RESIZE_INC |
 *                                 GDK_HINT_MIN_SIZE |
 *                                 GDK_HINT_BASE_SIZE);
437
 * ]|
438
439
440
441
442
443
444
445
 *
 * The other useful fields are the @min_aspect and @max_aspect fields; these
 * contain a width/height ratio as a floating point number. If a geometry widget
 * is set, the aspect applies to the geometry widget rather than the entire
 * window. The most common use of these hints is probably to set @min_aspect and
 * @max_aspect to the same value, thus forcing the window to keep a constant
 * aspect ratio.
 */
446
447
struct _GdkGeometry
{
Owen Taylor's avatar
Started    
Owen Taylor committed
448
449
450
451
452
453
454
455
456
457
  gint min_width;
  gint min_height;
  gint max_width;
  gint max_height;
  gint base_width;
  gint base_height;
  gint width_inc;
  gint height_inc;
  gdouble min_aspect;
  gdouble max_aspect;
Owen Taylor's avatar
Owen Taylor committed
458
  GdkGravity win_gravity;
Owen Taylor's avatar
Started    
Owen Taylor committed
459
460
};

461
typedef struct _GdkWindowClass GdkWindowClass;
462

463
#define GDK_TYPE_WINDOW              (gdk_window_get_type ())
464
#define GDK_WINDOW(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
465
#define GDK_WINDOW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
466
467
#define GDK_IS_WINDOW(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
#define GDK_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
468
#define GDK_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
469

470

471
struct _GdkWindowClass
472
{
473
  GObjectClass      parent_class;
474

475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
  GdkWindow       * (* pick_embedded_child) (GdkWindow *window,
                                             gdouble    x,
                                             gdouble    y);

  /*  the following 3 signals will only be emitted by offscreen windows */
  void              (* to_embedder)         (GdkWindow *window,
                                             gdouble    offscreen_x,
                                             gdouble    offscreen_y,
                                             gdouble   *embedder_x,
                                             gdouble   *embedder_y);
  void              (* from_embedder)       (GdkWindow *window,
                                             gdouble    embedder_x,
                                             gdouble    embedder_y,
                                             gdouble   *offscreen_x,
                                             gdouble   *offscreen_y);
  cairo_surface_t * (* create_surface)      (GdkWindow *window,
                                             gint       width,
                                             gint       height);

  /* Padding for future expansion */
  void (*_gdk_reserved1) (void);
  void (*_gdk_reserved2) (void);
  void (*_gdk_reserved3) (void);
  void (*_gdk_reserved4) (void);
  void (*_gdk_reserved5) (void);
  void (*_gdk_reserved6) (void);
  void (*_gdk_reserved7) (void);
  void (*_gdk_reserved8) (void);
503
504
};

Owen Taylor's avatar
Started    
Owen Taylor committed
505
506
/* Windows
 */
507
GDK_AVAILABLE_IN_ALL
508
GType         gdk_window_get_type              (void) G_GNUC_CONST;
509
GDK_AVAILABLE_IN_ALL
510
511
512
GdkWindow*    gdk_window_new                   (GdkWindow     *parent,
                                                GdkWindowAttr *attributes,
                                                gint           attributes_mask);
513
GDK_AVAILABLE_IN_ALL
514
void          gdk_window_destroy               (GdkWindow     *window);
515
GDK_AVAILABLE_IN_ALL
516
GdkWindowType gdk_window_get_window_type       (GdkWindow     *window);
517
GDK_AVAILABLE_IN_ALL
518
gboolean      gdk_window_is_destroyed          (GdkWindow     *window);
519

520
GDK_AVAILABLE_IN_ALL
521
GdkVisual *   gdk_window_get_visual            (GdkWindow     *window);
522
GDK_AVAILABLE_IN_ALL
523
GdkScreen *   gdk_window_get_screen            (GdkWindow     *window);
524
GDK_AVAILABLE_IN_ALL
525
GdkDisplay *  gdk_window_get_display           (GdkWindow     *window);
526
#ifndef GDK_MULTIDEVICE_SAFE
527
GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position)
528
GdkWindow*    gdk_window_at_pointer            (gint          *win_x,
529
                                                gint          *win_y);
530
#endif /* GDK_MULTIDEVICE_SAFE */
531
GDK_AVAILABLE_IN_ALL
532
void          gdk_window_show                  (GdkWindow     *window);
533
GDK_AVAILABLE_IN_ALL
534
void          gdk_window_hide                  (GdkWindow     *window);
535
GDK_AVAILABLE_IN_ALL
536
void          gdk_window_withdraw              (GdkWindow     *window);
537
GDK_AVAILABLE_IN_ALL
538
void          gdk_window_show_unraised         (GdkWindow     *window);
539
GDK_AVAILABLE_IN_ALL
540
541
542
void          gdk_window_move                  (GdkWindow     *window,
                                                gint           x,
                                                gint           y);
543
GDK_AVAILABLE_IN_ALL
544
545
546
void          gdk_window_resize                (GdkWindow     *window,
                                                gint           width,
                                                gint           height);
547
GDK_AVAILABLE_IN_ALL
548
549
550
551
552
void          gdk_window_move_resize           (GdkWindow     *window,
                                                gint           x,
                                                gint           y,
                                                gint           width,
                                                gint           height);
553
554
555
556
557
558
559
560
561

GDK_AVAILABLE_IN_3_24
void          gdk_window_move_to_rect          (GdkWindow          *window,
                                                const GdkRectangle *rect,
                                                GdkGravity          rect_anchor,
                                                GdkGravity          window_anchor,
                                                GdkAnchorHints      anchor_hints,
                                                gint                rect_anchor_dx,
                                                gint                rect_anchor_dy);
562
GDK_AVAILABLE_IN_ALL
563
564
565
566
void          gdk_window_reparent              (GdkWindow     *window,
                                                GdkWindow     *new_parent,
                                                gint           x,
                                                gint           y);
567
GDK_AVAILABLE_IN_ALL
568
void          gdk_window_raise                 (GdkWindow     *window);
569
GDK_AVAILABLE_IN_ALL
570
void          gdk_window_lower                 (GdkWindow     *window);
571
GDK_AVAILABLE_IN_ALL
Alexander Larsson's avatar
Alexander Larsson committed
572
573
574
void          gdk_window_restack               (GdkWindow     *window,
						GdkWindow     *sibling,
						gboolean       above);
575
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
576
577
void          gdk_window_focus                 (GdkWindow     *window,
                                                guint32        timestamp);
578
GDK_AVAILABLE_IN_ALL
579
580
void          gdk_window_set_user_data         (GdkWindow     *window,
                                                gpointer       user_data);
581
GDK_AVAILABLE_IN_ALL
582
583
void          gdk_window_set_override_redirect (GdkWindow     *window,
                                                gboolean       override_redirect);
584
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
585
gboolean      gdk_window_get_accept_focus      (GdkWindow     *window);
586
GDK_AVAILABLE_IN_ALL
587
588
void          gdk_window_set_accept_focus      (GdkWindow     *window,
					        gboolean       accept_focus);
589
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
590
gboolean      gdk_window_get_focus_on_map      (GdkWindow     *window);
591
GDK_AVAILABLE_IN_ALL
592
593
void          gdk_window_set_focus_on_map      (GdkWindow     *window,
					        gboolean       focus_on_map);
594
GDK_AVAILABLE_IN_ALL
595
596
597
void          gdk_window_add_filter            (GdkWindow     *window,
                                                GdkFilterFunc  function,
                                                gpointer       data);
598
GDK_AVAILABLE_IN_ALL
599
600
601
void          gdk_window_remove_filter         (GdkWindow     *window,
                                                GdkFilterFunc  function,
                                                gpointer       data);
602
GDK_AVAILABLE_IN_ALL
603
604
605
void          gdk_window_scroll                (GdkWindow     *window,
                                                gint           dx,
                                                gint           dy);
606
GDK_AVAILABLE_IN_ALL
607
void	      gdk_window_move_region           (GdkWindow       *window,
608
						const cairo_region_t *region,
609
610
						gint             dx,
						gint             dy);
611
GDK_AVAILABLE_IN_ALL
612
gboolean      gdk_window_ensure_native        (GdkWindow       *window);
Owen Taylor's avatar
Started    
Owen Taylor committed
613
614
615
616
617

/* 
 * This allows for making shaped (partially transparent) windows
 * - cool feature, needed for Drag and Drag for example.
 */
618
GDK_AVAILABLE_IN_ALL
619
void gdk_window_shape_combine_region (GdkWindow	      *window,
620
                                      const cairo_region_t *shape_region,
621
622
                                      gint	       offset_x,
                                      gint	       offset_y);
623

Owen Taylor's avatar
Started    
Owen Taylor committed
624
625
626
627
628
629
630
/*
 * This routine allows you to quickly take the shapes of all the child windows
 * of a window and use their shapes as the shape mask for this window - useful
 * for container windows that dont want to look like a big box
 * 
 * - Raster
 */
631
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
632
633
void gdk_window_set_child_shapes (GdkWindow *window);

634
GDK_DEPRECATED_IN_3_16
Matthias Clasen's avatar
Matthias Clasen committed
635
gboolean gdk_window_get_composited (GdkWindow *window);
636
GDK_DEPRECATED_IN_3_16
637
void gdk_window_set_composited   (GdkWindow *window,
638
                                  gboolean   composited);
639

Owen Taylor's avatar
Started    
Owen Taylor committed
640
641
/*
 * This routine allows you to merge (ie ADD) child shapes to your
642
 * own window’s shape keeping its current shape and ADDING the child
Owen Taylor's avatar
Started    
Owen Taylor committed
643
644
645
646
 * shapes to it.
 * 
 * - Raster
 */
647
GDK_AVAILABLE_IN_ALL
648
void gdk_window_merge_child_shapes         (GdkWindow       *window);
Owen Taylor's avatar
Started    
Owen Taylor committed
649

650
GDK_AVAILABLE_IN_ALL
651
void gdk_window_input_shape_combine_region (GdkWindow       *window,
652
                                            const cairo_region_t *shape_region,
653
654
                                            gint             offset_x,
                                            gint             offset_y);
655
GDK_AVAILABLE_IN_ALL
656
void gdk_window_set_child_input_shapes     (GdkWindow       *window);
657
GDK_AVAILABLE_IN_ALL
658
void gdk_window_merge_child_input_shapes   (GdkWindow       *window);
659
660


661
662
GDK_AVAILABLE_IN_3_18
void gdk_window_set_pass_through (GdkWindow *window,
Matthias Clasen's avatar
Matthias Clasen committed
663
                                  gboolean   pass_through);
664
665
666
GDK_AVAILABLE_IN_3_18
gboolean gdk_window_get_pass_through (GdkWindow *window);

Owen Taylor's avatar
Started    
Owen Taylor committed
667
/*
668
 * Check if a window has been shown, and whether all its
Owen Taylor's avatar
Started    
Owen Taylor committed
669
670
671
672
 * parents up to a toplevel have been shown, respectively.
 * Note that a window that is_viewable below is not necessarily
 * viewable in the X sense.
 */
673
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
674
gboolean gdk_window_is_visible     (GdkWindow *window);
675
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
676
gboolean gdk_window_is_viewable    (GdkWindow *window);
677
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
678
gboolean gdk_window_is_input_only  (GdkWindow *window);
679
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
680
gboolean gdk_window_is_shaped      (GdkWindow *window);
Owen Taylor's avatar
Started    
Owen Taylor committed
681

682
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
683
684
GdkWindowState gdk_window_get_state (GdkWindow *window);

Owen Taylor's avatar
Started    
Owen Taylor committed
685
686
687
/* Set static bit gravity on the parent, and static
 * window gravity on all children.
 */
688
GDK_DEPRECATED_IN_3_16
Owen Taylor's avatar
Started    
Owen Taylor committed
689
gboolean gdk_window_set_static_gravities (GdkWindow *window,
690
                                          gboolean   use_static);
691

Owen Taylor's avatar
Started    
Owen Taylor committed
692
693
/* GdkWindow */

694
695
696
697
698
699
700
701
702
703
704
705
706
707
/**
 * GdkWindowInvalidateHandlerFunc:
 * @window: a #GdkWindow
 * @region: a #cairo_region_t
 *
 * Whenever some area of the window is invalidated (directly in the
 * window or in a child window) this gets called with @region in
 * the coordinate space of @window. You can use @region to just
 * keep track of the dirty region, or you can actually change
 * @region in case you are doing display tricks like showing
 * a child in multiple places.
 *
 * Since: 3.10
 */
Matthias Clasen's avatar
Matthias Clasen committed
708
typedef void (*GdkWindowInvalidateHandlerFunc)  (GdkWindow      *window,
709
710
						 cairo_region_t *region);
GDK_AVAILABLE_IN_3_10
Matthias Clasen's avatar
Matthias Clasen committed
711
712
void gdk_window_set_invalidate_handler (GdkWindow                      *window,
					GdkWindowInvalidateHandlerFunc  handler);
713

714
GDK_AVAILABLE_IN_ALL
715
gboolean      gdk_window_has_native         (GdkWindow       *window);
716
GDK_AVAILABLE_IN_ALL
717
718
void              gdk_window_set_type_hint (GdkWindow        *window,
                                            GdkWindowTypeHint hint);
719
GDK_AVAILABLE_IN_ALL
720
721
GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow        *window);

722
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
723
gboolean      gdk_window_get_modal_hint   (GdkWindow       *window);
724
GDK_AVAILABLE_IN_ALL
725
726
727
void          gdk_window_set_modal_hint   (GdkWindow       *window,
                                           gboolean         modal);

728
GDK_AVAILABLE_IN_ALL
729
730
void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
                                       gboolean   skips_taskbar);
731
GDK_AVAILABLE_IN_ALL
732
733
void gdk_window_set_skip_pager_hint   (GdkWindow *window,
                                       gboolean   skips_pager);
734
GDK_AVAILABLE_IN_ALL
735
736
void gdk_window_set_urgency_hint      (GdkWindow *window,
				       gboolean   urgent);
737

738
GDK_AVAILABLE_IN_ALL
739
740
741
void          gdk_window_set_geometry_hints (GdkWindow          *window,
					     const GdkGeometry  *geometry,
					     GdkWindowHints      geom_mask);
Owen Taylor's avatar
Started    
Owen Taylor committed
742

743
GDK_AVAILABLE_IN_ALL
744
cairo_region_t *gdk_window_get_clip_region  (GdkWindow          *window);
745
GDK_AVAILABLE_IN_ALL
746
747
cairo_region_t *gdk_window_get_visible_region(GdkWindow         *window);

748

749
GDK_DEPRECATED_IN_3_22_FOR(gdk_window_begin_draw_frame)
750
751
void	      gdk_window_begin_paint_rect   (GdkWindow          *window,
					     const GdkRectangle *rectangle);
Matthias Clasen's avatar
Matthias Clasen committed
752
GDK_AVAILABLE_IN_3_16
753
754
void	      gdk_window_mark_paint_from_clip (GdkWindow          *window,
					       cairo_t            *cr);
755
GDK_DEPRECATED_IN_3_22_FOR(gdk_window_begin_draw_frame)
756
void	      gdk_window_begin_paint_region (GdkWindow          *window,
757
					     const cairo_region_t    *region);
758
GDK_DEPRECATED_IN_3_22_FOR(gdk_window_end_draw_frame)
759
void	      gdk_window_end_paint          (GdkWindow          *window);
760
761

GDK_AVAILABLE_IN_3_22
Emmanuele Bassi's avatar
Emmanuele Bassi committed
762
763
GdkDrawingContext *gdk_window_begin_draw_frame  (GdkWindow            *window,
                                                 const cairo_region_t *region);
764
765
GDK_AVAILABLE_IN_3_22
void          gdk_window_end_draw_frame    (GdkWindow            *window,
Emmanuele Bassi's avatar
Emmanuele Bassi committed
766
                                            GdkDrawingContext    *context);
767

768
GDK_DEPRECATED_IN_3_14
769
void	      gdk_window_flush             (GdkWindow          *window);
Owen Taylor's avatar
Started    
Owen Taylor committed
770

771
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
772
773
void	      gdk_window_set_title	   (GdkWindow	  *window,
					    const gchar	  *title);
774
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
775
776
void          gdk_window_set_role          (GdkWindow     *window,
					    const gchar   *role);
777
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
778
779
void          gdk_window_set_startup_id    (GdkWindow     *window,
					    const gchar   *startup_id);
780
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
781
782
void          gdk_window_set_transient_for (GdkWindow     *window,
					    GdkWindow     *parent);
783
GDK_DEPRECATED_IN_3_4
Owen Taylor's avatar
Started    
Owen Taylor committed
784
void	      gdk_window_set_background	 (GdkWindow	  *window,
785
					  const GdkColor  *color);
786
GDK_DEPRECATED_IN_3_22
Benjamin Otte's avatar
Benjamin Otte committed
787
788
void          gdk_window_set_background_rgba (GdkWindow     *window,
                                              const GdkRGBA *rgba);
789
GDK_DEPRECATED_IN_3_22
790
791
void	      gdk_window_set_background_pattern (GdkWindow	 *window,
                                                 cairo_pattern_t *pattern);
792
GDK_DEPRECATED_IN_3_22
793
794
cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow     *window);

795
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
796
797
void	      gdk_window_set_cursor	 (GdkWindow	  *window,
					  GdkCursor	  *cursor);
798
GDK_AVAILABLE_IN_ALL
Cody Russell's avatar
Cody Russell committed
799
GdkCursor    *gdk_window_get_cursor      (GdkWindow       *window);
800
GDK_AVAILABLE_IN_ALL
801
802
803
void	      gdk_window_set_device_cursor (GdkWindow	  *window,
                                            GdkDevice     *device,
                                            GdkCursor	  *cursor);
804
GDK_AVAILABLE_IN_ALL
805
806
GdkCursor    *gdk_window_get_device_cursor (GdkWindow     *window,
                                            GdkDevice     *device);
807
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
808
809
void	      gdk_window_get_user_data	 (GdkWindow	  *window,
					  gpointer	  *data);
810
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
811
812
813
814
void	      gdk_window_get_geometry	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y,
					  gint		  *width,
815
					  gint		  *height);
816
GDK_AVAILABLE_IN_ALL
817
int           gdk_window_get_width       (GdkWindow       *window);
818
GDK_AVAILABLE_IN_ALL
819
int           gdk_window_get_height      (GdkWindow       *window);
820
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
821
822
823
void	      gdk_window_get_position	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y);
824
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
825
826
827
gint	      gdk_window_get_origin	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y);
828
GDK_AVAILABLE_IN_ALL
829
void	      gdk_window_get_root_coords (GdkWindow	  *window,
830
831
832
833
					  gint             x,
					  gint             y,
					  gint		  *root_x,
					  gint		  *root_y);
834
GDK_AVAILABLE_IN_ALL
835
836
837
838
839
void       gdk_window_coords_to_parent   (GdkWindow       *window,
                                          gdouble          x,
                                          gdouble          y,
                                          gdouble         *parent_x,
                                          gdouble         *parent_y);
840
GDK_AVAILABLE_IN_ALL
841
842
843
844
845
void       gdk_window_coords_from_parent (GdkWindow       *window,
                                          gdouble          parent_x,
                                          gdouble          parent_y,
                                          gdouble         *x,
                                          gdouble         *y);
Matthias Clasen's avatar
Matthias Clasen committed
846

847
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
848
849
850
void	      gdk_window_get_root_origin (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y);
851
GDK_AVAILABLE_IN_ALL
852
853
void          gdk_window_get_frame_extents (GdkWindow     *window,
                                            GdkRectangle  *rect);
854

855
856
857
GDK_AVAILABLE_IN_3_10
gint          gdk_window_get_scale_factor  (GdkWindow     *window);

858
#ifndef GDK_MULTIDEVICE_SAFE
859
GDK_DEPRECATED_IN_3_0_FOR(gdk_window_get_device_position)
860
861
862
GdkWindow *   gdk_window_get_pointer     (GdkWindow       *window,
                                          gint            *x,
                                          gint            *y,
863
                                          GdkModifierType *mask);
864
#endif /* GDK_MULTIDEVICE_SAFE */
865
GDK_AVAILABLE_IN_ALL
866
867
868
869
870
GdkWindow *   gdk_window_get_device_position (GdkWindow       *window,
                                              GdkDevice       *device,
                                              gint            *x,
                                              gint            *y,
                                              GdkModifierType *mask);
871
872
873
874
875
876
GDK_AVAILABLE_IN_3_10
GdkWindow *   gdk_window_get_device_position_double (GdkWindow       *window,
                                                     GdkDevice       *device,
                                                     gdouble         *x,
                                                     gdouble         *y,
                                                     GdkModifierType *mask);
877
GDK_AVAILABLE_IN_ALL
878
GdkWindow *   gdk_window_get_parent      (GdkWindow       *window);
879
GDK_AVAILABLE_IN_ALL
880
881
GdkWindow *   gdk_window_get_toplevel    (GdkWindow       *window);

882
GDK_AVAILABLE_IN_ALL
883
GdkWindow *   gdk_window_get_effective_parent   (GdkWindow *window);
884
GDK_AVAILABLE_IN_ALL
885
886
GdkWindow *   gdk_window_get_effective_toplevel (GdkWindow *window);

887
GDK_AVAILABLE_IN_ALL
888
GList *	      gdk_window_get_children	 (GdkWindow	  *window);
889
GDK_AVAILABLE_IN_ALL
890
GList *       gdk_window_peek_children   (GdkWindow       *window);
891
892
GDK_AVAILABLE_IN_3_10
GList *       gdk_window_get_children_with_user_data (GdkWindow *window,
Matthias Clasen's avatar
Matthias Clasen committed
893
						      gpointer   user_data);
894

895
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
896
GdkEventMask  gdk_window_get_events	 (GdkWindow	  *window);
897
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
898
899
void	      gdk_window_set_events	 (GdkWindow	  *window,
					  GdkEventMask	   event_mask);
900
GDK_AVAILABLE_IN_ALL
901
902
903
void          gdk_window_set_device_events (GdkWindow    *window,
                                            GdkDevice    *device,
                                            GdkEventMask  event_mask);
904
GDK_AVAILABLE_IN_ALL
905
906
GdkEventMask  gdk_window_get_device_events (GdkWindow    *window,
                                            GdkDevice    *device);
Owen Taylor's avatar
Started    
Owen Taylor committed
907

908
GDK_AVAILABLE_IN_ALL
909
910
911
void          gdk_window_set_source_events (GdkWindow      *window,
                                            GdkInputSource  source,
                                            GdkEventMask    event_mask);
912
GDK_AVAILABLE_IN_ALL
913
914
915
GdkEventMask  gdk_window_get_source_events (GdkWindow      *window,
                                            GdkInputSource  source);

916
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
917
void          gdk_window_set_icon_list   (GdkWindow       *window,
918
					  GList           *pixbufs);
919
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
920
void	      gdk_window_set_icon_name	 (GdkWindow	  *window, 
Owen Taylor's avatar
Owen Taylor committed
921
					  const gchar	  *name);
922
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
923
924
void	      gdk_window_set_group	 (GdkWindow	  *window, 
					  GdkWindow	  *leader);
925
GDK_AVAILABLE_IN_ALL
926
GdkWindow*    gdk_window_get_group	 (GdkWindow	  *window);
927
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
928
929
void	      gdk_window_set_decorations (GdkWindow	  *window,
					  GdkWMDecoration  decorations);
930
GDK_AVAILABLE_IN_ALL
931
932
gboolean      gdk_window_get_decorations (GdkWindow       *window,
					  GdkWMDecoration *decorations);
933
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
934
935
void	      gdk_window_set_functions	 (GdkWindow	  *window,
					  GdkWMFunction	   functions);
Havoc Pennington's avatar
Havoc Pennington committed
936

937
GDK_AVAILABLE_IN_ALL
938
939
940
941
942
cairo_surface_t *
              gdk_window_create_similar_surface (GdkWindow *window,
                                          cairo_content_t  content,
                                          int              width,
                                          int              height);
943
944
945
946
947
948
949
GDK_AVAILABLE_IN_3_10
cairo_surface_t *
              gdk_window_create_similar_image_surface (GdkWindow *window,
						       cairo_format_t format,
						       int            width,
						       int            height,
						       int            scale);
950

951
GDK_AVAILABLE_IN_ALL
952
void          gdk_window_beep            (GdkWindow       *window);
953
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Owen Taylor committed
954
void          gdk_window_iconify         (GdkWindow       *window);
955
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
956
void          gdk_window_deiconify       (GdkWindow       *window);
957
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
958
void          gdk_window_stick           (GdkWindow       *window);
959
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
960
void          gdk_window_unstick         (GdkWindow       *window);
961
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
962
void          gdk_window_maximize        (GdkWindow       *window);
963
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
964
void          gdk_window_unmaximize      (GdkWindow       *window);
965
GDK_AVAILABLE_IN_ALL
966
void          gdk_window_fullscreen      (GdkWindow       *window);
967
968
969
GDK_AVAILABLE_IN_3_18
void          gdk_window_fullscreen_on_monitor (GdkWindow      *window,
                                                gint            monitor);
970
971
972
973
974
975
GDK_AVAILABLE_IN_3_8
void          gdk_window_set_fullscreen_mode (GdkWindow   *window,
                                          GdkFullscreenMode mode);
GDK_AVAILABLE_IN_3_8
GdkFullscreenMode
              gdk_window_get_fullscreen_mode (GdkWindow   *window);
976
GDK_AVAILABLE_IN_ALL
977
void          gdk_window_unfullscreen    (GdkWindow       *window);
978
GDK_AVAILABLE_IN_ALL
979
980
void          gdk_window_set_keep_above  (GdkWindow       *window,
                                          gboolean         setting);
981
GDK_AVAILABLE_IN_ALL
982
983
void          gdk_window_set_keep_below  (GdkWindow       *window,
                                          gboolean         setting);
984
GDK_AVAILABLE_IN_ALL
985
986
void          gdk_window_set_opacity     (GdkWindow       *window,
                                          gdouble          opacity);
987
GDK_AVAILABLE_IN_ALL
Owen Taylor's avatar
Started    
Owen Taylor committed
988
989
void          gdk_window_register_dnd    (GdkWindow       *window);

990
GDK_AVAILABLE_IN_ALL
991
992
GdkDragProtocol
              gdk_window_get_drag_protocol(GdkWindow      *window,
993
994
                                           GdkWindow     **target);

995
GDK_AVAILABLE_IN_ALL
996
997
998
999
1000
1001
void gdk_window_begin_resize_drag            (GdkWindow     *window,
                                              GdkWindowEdge  edge,
                                              gint           button,
                                              gint           root_x,
                                              gint           root_y,
                                              guint32        timestamp);
1002
GDK_AVAILABLE_IN_3_4
1003
1004
1005
1006
1007
1008
1009
void gdk_window_begin_resize_drag_for_device (GdkWindow     *window,
                                              GdkWindowEdge  edge,
                                              GdkDevice     *device,
                                              gint           button,
                                              gint           root_x,
                                              gint           root_y,
                                              guint32        timestamp);
1010
GDK_AVAILABLE_IN_ALL
1011
1012
1013
1014
1015
void gdk_window_begin_move_drag              (GdkWindow     *window,
                                              gint           button,
                                              gint           root_x,
                                              gint           root_y,
                                              guint32        timestamp);
1016
GDK_AVAILABLE_IN_3_4
1017
1018
1019
1020
1021
1022
void gdk_window_begin_move_drag_for_device   (GdkWindow     *window,
                                              GdkDevice     *device,
                                              gint           button,
                                              gint           root_x,
                                              gint           root_y,
                                              guint32        timestamp);
Owen Taylor's avatar
Owen Taylor committed
1023

1024
/* Interface for dirty-region queueing */
1025
GDK_AVAILABLE_IN_ALL
1026
1027
1028
void       gdk_window_invalidate_rect           (GdkWindow          *window,
					         const GdkRectangle *rect,
					         gboolean            invalidate_children);
1029
GDK_AVAILABLE_IN_ALL
1030
void       gdk_window_invalidate_region         (GdkWindow          *window,
1031
					         const cairo_region_t    *region,
1032
					         gboolean            invalidate_children);
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047

/**
 * GdkWindowChildFunc:
 * @window: a #GdkWindow
 * @user_data: user data
 *
 * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
 * It gets called for each child of the window to determine whether to
 * recursively invalidate it or now.
 *
 * Returns: %TRUE to invalidate @window recursively
 */
typedef gboolean (*GdkWindowChildFunc)          (GdkWindow *window,
                                                 gpointer   user_data);

1048
GDK_AVAILABLE_IN_ALL
1049
1050
1051
1052
void       gdk_window_invalidate_maybe_recurse  (GdkWindow            *window,
						 const cairo_region_t *region,
						 GdkWindowChildFunc    child_func,
						 gpointer              user_data);
1053
GDK_AVAILABLE_IN_ALL
1054
cairo_region_t *gdk_window_get_update_area      (GdkWindow            *window);
1055

1056
GDK_AVAILABLE_IN_ALL
1057
void       gdk_window_freeze_updates      (GdkWindow    *window);
1058
GDK_AVAILABLE_IN_ALL
1059
1060
void       gdk_window_thaw_updates        (GdkWindow    *window);

1061
GDK_DEPRECATED_IN_3_16
Kristian Rietveld's avatar
Kristian Rietveld committed
1062
void       gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
1063
GDK_DEPRECATED_IN_3_16
Kristian Rietveld's avatar
Kristian Rietveld committed
1064
1065
void       gdk_window_thaw_toplevel_updates_libgtk_only   (GdkWindow *window);

1066
GDK_DEPRECATED_IN_3_22
1067
void       gdk_window_process_all_updates (void);
1068
GDK_DEPRECATED_IN_3_22
1069
1070
1071
void       gdk_window_process_updates     (GdkWindow    *window,
					   gboolean      update_children);

Havoc Pennington's avatar
Havoc Pennington committed
1072
/* Enable/disable flicker, so you can tell if your code is inefficient. */
1073
GDK_DEPRECATED_IN_3_22
Havoc Pennington's avatar
Havoc Pennington committed
1074
void       gdk_window_set_debug_updates   (gboolean      setting);
1075

1076
GDK_AVAILABLE_IN_ALL
1077
1078
1079
1080
1081
1082
void       gdk_window_constrain_size      (GdkGeometry    *geometry,
                                           GdkWindowHints  flags,
                                           gint            width,
                                           gint            height,
                                           gint           *new_width,
                                           gint           *new_height);
Owen Taylor's avatar
Owen Taylor committed
1083

1084
GDK_DEPRECATED_IN_3_8
1085
void gdk_window_enable_synchronized_configure (GdkWindow *window);
1086
GDK_DEPRECATED_IN_3_8