1------------------------------------------------------------------------------
2--                                                                          --
3--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
4--                     Copyright (C) 2000-2015, AdaCore                     --
5--                                                                          --
6-- This library is free software;  you can redistribute it and/or modify it --
7-- under terms of the  GNU General Public License  as published by the Free --
8-- Software  Foundation;  either version 3,  or (at your  option) any later --
9-- version. This library is distributed in the hope that it will be useful, --
10-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
11-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
12--                                                                          --
13-- As a special exception under Section 7 of GPL version 3, you are granted --
14-- additional permissions described in the GCC Runtime Library Exception,   --
15-- version 3.1, as published by the Free Software Foundation.               --
16--                                                                          --
17-- You should have received a copy of the GNU General Public License and    --
18-- a copy of the GCC Runtime Library Exception along with this program;     --
19-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
20-- <http://www.gnu.org/licenses/>.                                          --
21--                                                                          --
22------------------------------------------------------------------------------
23
24pragma Ada_2005;
25
26pragma Warnings (Off, "*is already use-visible*");
27with Cairo;                   use Cairo;
28with Cairo.Region;            use Cairo.Region;
29with Gdk;                     use Gdk;
30with Gdk.Color;               use Gdk.Color;
31with Gdk.Device;              use Gdk.Device;
32with Gdk.Display;             use Gdk.Display;
33with Gdk.Event;               use Gdk.Event;
34with Gdk.Frame_Clock;         use Gdk.Frame_Clock;
35with Gdk.RGBA;                use Gdk.RGBA;
36with Gdk.Rectangle;           use Gdk.Rectangle;
37with Gdk.Screen;              use Gdk.Screen;
38with Gdk.Types;               use Gdk.Types;
39with Gdk.Visual;              use Gdk.Visual;
40with Glib;                    use Glib;
41with Glib.Generic_Properties; use Glib.Generic_Properties;
42with Glib.Glist;              use Glib.Glist;
43with Glib.Object;             use Glib.Object;
44with Glib.Properties;         use Glib.Properties;
45
46package Gdk.Window is
47
48   type Gdk_Window_Class is (
49      Input_Output,
50      Input_Only);
51   pragma Convention (C, Gdk_Window_Class);
52   --  Gdk_Input_Output windows are the standard kind of window you might
53   --  expect. Such windows receive events and are also displayed on screen.
54   --  Gdk_Input_Only windows are invisible; they are usually placed above
55   --  other windows in order to trap or filter the events. You can't draw on
56   --  Gdk_Input_Only windows.
57
58   type Gdk_Window_Edge is (
59      Window_Edge_North_West,
60      Window_Edge_North,
61      Window_Edge_North_East,
62      Window_Edge_West,
63      Window_Edge_East,
64      Window_Edge_South_West,
65      Window_Edge_South,
66      Window_Edge_South_East);
67   pragma Convention (C, Gdk_Window_Edge);
68   --  Determines a window edge or corner.
69
70   type Gdk_Window_Type is (
71      Window_Root,
72      Window_Toplevel,
73      Window_Child,
74      Window_Temp,
75      Window_Foreign,
76      Window_Offscreen,
77      Window_Subsurface);
78   pragma Convention (C, Gdk_Window_Type);
79   --  Describes the kind of window.
80
81   type Gdk_Window_Attributes_Type is mod 2 ** Integer'Size;
82   pragma Convention (C, Gdk_Window_Attributes_Type);
83   --  Used to indicate which fields in the Gdk_Window_Attr struct should be
84   --  honored. For example, if you filled in the "cursor" and "x" fields of
85   --  Gdk_Window_Attr, pass "Gdk_Wa_X | Gdk_Wa_Cursor" to gdk_window_new.
86   --  Fields in Gdk_Window_Attr not covered by a bit in this enum are
87   --  required; for example, the Width/Height, Wclass, and Window_Type fields
88   --  are required, they have no corresponding flag in
89   --  Gdk.Window.Gdk_Window_Attributes_Type.
90
91   Wa_Title : constant Gdk_Window_Attributes_Type := 2;
92   Wa_X : constant Gdk_Window_Attributes_Type := 4;
93   Wa_Y : constant Gdk_Window_Attributes_Type := 8;
94   Wa_Cursor : constant Gdk_Window_Attributes_Type := 16;
95   Wa_Visual : constant Gdk_Window_Attributes_Type := 32;
96   Wa_Wmclass : constant Gdk_Window_Attributes_Type := 64;
97   Wa_Noredir : constant Gdk_Window_Attributes_Type := 128;
98   Wa_Type_Hint : constant Gdk_Window_Attributes_Type := 256;
99
100   type Gdk_Window_Hints is mod 2 ** Integer'Size;
101   pragma Convention (C, Gdk_Window_Hints);
102   --  Used to indicate which fields of a Gdk.Window.Gdk_Geometry struct
103   --  should be paid attention to. Also, the presence/absence of Gdk_Hint_Pos,
104   --  Gdk_Hint_User_Pos, and Gdk_Hint_User_Size is significant, though they
105   --  don't directly refer to Gdk.Window.Gdk_Geometry fields.
106   --  Gdk_Hint_User_Pos will be set automatically by Gtk.Window.Gtk_Window if
107   --  you call Gtk.Window.Move. Gdk_Hint_User_Pos and Gdk_Hint_User_Size
108   --  should be set if the user specified a size/position using a --geometry
109   --  command-line argument; Gtk.Window.Parse_Geometry automatically sets
110   --  these flags.
111
112   Hint_Pos : constant Gdk_Window_Hints := 1;
113   Hint_Min_Size : constant Gdk_Window_Hints := 2;
114   Hint_Max_Size : constant Gdk_Window_Hints := 4;
115   Hint_Base_Size : constant Gdk_Window_Hints := 8;
116   Hint_Aspect : constant Gdk_Window_Hints := 16;
117   Hint_Resize_Inc : constant Gdk_Window_Hints := 32;
118   Hint_Win_Gravity : constant Gdk_Window_Hints := 64;
119   Hint_User_Pos : constant Gdk_Window_Hints := 128;
120   Hint_User_Size : constant Gdk_Window_Hints := 256;
121
122   type Gdk_Window_Type_Hint is (
123      Window_Type_Hint_Normal,
124      Window_Type_Hint_Dialog,
125      Window_Type_Hint_Menu,
126      Window_Type_Hint_Toolbar,
127      Window_Type_Hint_Splashscreen,
128      Window_Type_Hint_Utility,
129      Window_Type_Hint_Dock,
130      Window_Type_Hint_Desktop,
131      Window_Type_Hint_Dropdown_Menu,
132      Window_Type_Hint_Popup_Menu,
133      Window_Type_Hint_Tooltip,
134      Window_Type_Hint_Notification,
135      Window_Type_Hint_Combo,
136      Window_Type_Hint_Dnd);
137   pragma Convention (C, Gdk_Window_Type_Hint);
138   --  These are hints for the window manager that indicate what type of
139   --  function the window has. The window manager can use this when
140   --  determining decoration and behaviour of the window. The hint must be set
141   --  before mapping the window.
142   --
143   --  See the [Extended Window Manager
144   --  Hints](http://www.freedesktop.org/Standards/wm-spec) specification for
145   --  more details about window types.
146
147   type Gdk_WMDecoration is mod 2 ** Integer'Size;
148   pragma Convention (C, Gdk_WMDecoration);
149   --  These are hints originally defined by the Motif toolkit. The window
150   --  manager can use them when determining how to decorate the window. The
151   --  hint must be set before mapping the window.
152
153   Decor_All : constant Gdk_WMDecoration := 1;
154   Decor_Border : constant Gdk_WMDecoration := 2;
155   Decor_Resizeh : constant Gdk_WMDecoration := 4;
156   Decor_Title : constant Gdk_WMDecoration := 8;
157   Decor_Menu : constant Gdk_WMDecoration := 16;
158   Decor_Minimize : constant Gdk_WMDecoration := 32;
159   Decor_Maximize : constant Gdk_WMDecoration := 64;
160
161   type Gdk_WMFunction is mod 2 ** Integer'Size;
162   pragma Convention (C, Gdk_WMFunction);
163   --  These are hints originally defined by the Motif toolkit. The window
164   --  manager can use them when determining the functions to offer for the
165   --  window. The hint must be set before mapping the window.
166
167   Func_All : constant Gdk_WMFunction := 1;
168   Func_Resize : constant Gdk_WMFunction := 2;
169   Func_Move : constant Gdk_WMFunction := 4;
170   Func_Minimize : constant Gdk_WMFunction := 8;
171   Func_Maximize : constant Gdk_WMFunction := 16;
172   Func_Close : constant Gdk_WMFunction := 32;
173
174   type Gdk_Gravity is (
175      Gravity_North_West,
176      Gravity_North,
177      Gravity_North_East,
178      Gravity_West,
179      Gravity_Center,
180      Gravity_East,
181      Gravity_South_West,
182      Gravity_South,
183      Gravity_South_East,
184      Gravity_Static);
185   pragma Convention (C, Gdk_Gravity);
186   --  Defines the reference point of a window and the meaning of coordinates
187   --  passed to Gtk.Window.Move. See Gtk.Window.Move and the "implementation
188   --  notes" section of the [Extended Window Manager
189   --  Hints](http://www.freedesktop.org/Standards/wm-spec) specification for
190   --  more details.
191
192   for Gdk_Gravity use (
193      Gravity_North_West => 1,
194      Gravity_North => 2,
195      Gravity_North_East => 3,
196      Gravity_West => 4,
197      Gravity_Center => 5,
198      Gravity_East => 6,
199      Gravity_South_West => 7,
200      Gravity_South => 8,
201      Gravity_South_East => 9,
202      Gravity_Static => 10);
203
204   type Gdk_Fullscreen_Mode is (
205      On_Current_Monitor,
206      On_All_Monitors);
207   pragma Convention (C, Gdk_Fullscreen_Mode);
208   --  Indicates which monitor (in a multi-head setup) a window should span
209   --  over when in fullscreen mode.
210
211   type Gdk_Geometry is record
212      Min_Width : Gint := 0;
213      Min_Height : Gint := 0;
214      Max_Width : Gint := 0;
215      Max_Height : Gint := 0;
216      Base_Width : Gint := 0;
217      Base_Height : Gint := 0;
218      Width_Inc : Gint := 0;
219      Height_Inc : Gint := 0;
220      Min_Aspect : Gdouble;
221      Max_Aspect : Gdouble;
222      Win_Gravity : Gdk_Gravity;
223   end record;
224   pragma Convention (C, Gdk_Geometry);
225
226   function From_Object_Free (B : access Gdk_Geometry) return Gdk_Geometry;
227   pragma Inline (From_Object_Free);
228   --  The Gdk.Window.Gdk_Geometry struct gives the window manager information
229   --  about a window's geometry constraints. Normally you would set these on
230   --  the GTK+ level using Gtk.Window.Set_Geometry_Hints.
231   --  Gtk.Window.Gtk_Window then sets the hints on the Gdk.Gdk_Window it
232   --  creates.
233   --
234   --  Gdk.Window.Set_Geometry_Hints expects the hints to be fully valid
235   --  already and simply passes them to the window manager; in contrast,
236   --  Gtk.Window.Set_Geometry_Hints performs some interpretation. For example,
237   --  Gtk.Window.Gtk_Window will apply the hints to the geometry widget
238   --  instead of the toplevel window, if you set a geometry widget. Also, the
239   --  Min_Width/Min_Height/Max_Width/Max_Height fields may be set to -1, and
240   --  Gtk.Window.Gtk_Window will substitute the size request of the window or
241   --  geometry widget. If the minimum size hint is not provided,
242   --  Gtk.Window.Gtk_Window will use its requisition as the minimum size. If
243   --  the minimum size is provided and a geometry widget is set,
244   --  Gtk.Window.Gtk_Window will take the minimum size as the minimum size of
245   --  the geometry widget rather than the entire window. The base size is
246   --  treated similarly.
247   --
248   --  The canonical use-case for Gtk.Window.Set_Geometry_Hints is to get a
249   --  terminal widget to resize properly. Here, the terminal text area should
250   --  be the geometry widget; Gtk.Window.Gtk_Window will then automatically
251   --  set the base size to the size of other widgets in the terminal window,
252   --  such as the menubar and scrollbar. Then, the Width_Inc and Height_Inc
253   --  fields should be set to the size of one character in the terminal.
254   --  Finally, the base size should be set to the size of one character. The
255   --  net effect is that the minimum size of the terminal will have a 1x1
256   --  character terminal area, and only terminal sizes on the "character grid"
257   --  will be allowed.
258   --
259   --  Here's an example of how the terminal example would be implemented,
260   --  assuming a terminal area widget called "terminal" and a toplevel window
261   --  "toplevel":
262   --
263   --  |[<!-- language="C" --> GdkGeometry hints;
264   --
265   --  hints.base_width = terminal->char_width; hints.base_height =
266   --  terminal->char_height; hints.min_width = terminal->char_width;
267   --  hints.min_height = terminal->char_height; hints.width_inc =
268   --  terminal->char_width; hints.height_inc = terminal->char_height;
269   --
270   --  gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), GTK_WIDGET
271   --  (terminal), &hints, GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE |
272   --  GDK_HINT_BASE_SIZE); ]|
273   --
274   --  The other useful fields are the Min_Aspect and Max_Aspect fields; these
275   --  contain a width/height ratio as a floating point number. If a geometry
276   --  widget is set, the aspect applies to the geometry widget rather than the
277   --  entire window. The most common use of these hints is probably to set
278   --  Min_Aspect and Max_Aspect to the same value, thus forcing the window to
279   --  keep a constant aspect ratio.
280
281   function Convert (R : Gdk.Gdk_Window) return System.Address;
282   function Convert (R : System.Address) return Gdk.Gdk_Window;
283   package Gdk_Window_List is new Generic_List (Gdk.Gdk_Window);
284
285   ---------------
286   -- Callbacks --
287   ---------------
288
289   type Gdk_Window_Child_Func is access function (Window : Gdk.Gdk_Window) return Boolean;
290   --  A function of this type is passed to
291   --  Gdk.Window.Invalidate_Maybe_Recurse. It gets called for each child of
292   --  the window to determine whether to recursively invalidate it or now.
293   --  "window": a Gdk.Gdk_Window
294
295   type Gdk_Window_Invalidate_Handler_Func is access procedure
296     (Window : Gdk.Gdk_Window;
297      Region : Cairo.Region.Cairo_Region);
298   --  Whenever some area of the window is invalidated (directly in the window
299   --  or in a child window) this gets called with Region in the coordinate
300   --  space of Window. You can use Region to just keep track of the dirty
301   --  region, or you can actually change Region in case you are doing display
302   --  tricks like showing a child in multiple places.
303   --  Since: gtk+ 3.10
304   --  "window": a Gdk.Gdk_Window
305   --  "region": a cairo_region_t
306
307   pragma Convention (C, Gdk_Window_Invalidate_Handler_Func);
308
309   ----------------------------
310   -- Enumeration Properties --
311   ----------------------------
312
313   package Gdk_Window_Class_Properties is
314      new Generic_Internal_Discrete_Property (Gdk_Window_Class);
315   type Property_Gdk_Window_Class is new Gdk_Window_Class_Properties.Property;
316
317   package Gdk_Window_Edge_Properties is
318      new Generic_Internal_Discrete_Property (Gdk_Window_Edge);
319   type Property_Gdk_Window_Edge is new Gdk_Window_Edge_Properties.Property;
320
321   package Gdk_Window_Type_Properties is
322      new Generic_Internal_Discrete_Property (Gdk_Window_Type);
323   type Property_Gdk_Window_Type is new Gdk_Window_Type_Properties.Property;
324
325   package Gdk_Window_Attributes_Type_Properties is
326      new Generic_Internal_Discrete_Property (Gdk_Window_Attributes_Type);
327   type Property_Gdk_Window_Attributes_Type is new Gdk_Window_Attributes_Type_Properties.Property;
328
329   package Gdk_Window_Hints_Properties is
330      new Generic_Internal_Discrete_Property (Gdk_Window_Hints);
331   type Property_Gdk_Window_Hints is new Gdk_Window_Hints_Properties.Property;
332
333   package Gdk_Window_Type_Hint_Properties is
334      new Generic_Internal_Discrete_Property (Gdk_Window_Type_Hint);
335   type Property_Gdk_Window_Type_Hint is new Gdk_Window_Type_Hint_Properties.Property;
336
337   package Gdk_WMDecoration_Properties is
338      new Generic_Internal_Discrete_Property (Gdk_WMDecoration);
339   type Property_Gdk_WMDecoration is new Gdk_WMDecoration_Properties.Property;
340
341   package Gdk_WMFunction_Properties is
342      new Generic_Internal_Discrete_Property (Gdk_WMFunction);
343   type Property_Gdk_WMFunction is new Gdk_WMFunction_Properties.Property;
344
345   package Gdk_Gravity_Properties is
346      new Generic_Internal_Discrete_Property (Gdk_Gravity);
347   type Property_Gdk_Gravity is new Gdk_Gravity_Properties.Property;
348
349   package Gdk_Fullscreen_Mode_Properties is
350      new Generic_Internal_Discrete_Property (Gdk_Fullscreen_Mode);
351   type Property_Gdk_Fullscreen_Mode is new Gdk_Fullscreen_Mode_Properties.Property;
352
353   ------------------
354   -- Constructors --
355   ------------------
356
357   procedure Gdk_New
358      (Self            : out Gdk_Window;
359       Parent          : Gdk.Gdk_Window;
360       Attributes      : Gdk.Gdk_Window_Attr;
361       Attributes_Mask : Gdk_Window_Attributes_Type);
362   --  Creates a new Gdk.Gdk_Window using the attributes from Attributes. See
363   --  Gdk_Window_Attr and Gdk.Window.Gdk_Window_Attributes_Type for more
364   --  details. Note: to use this on displays other than the default display,
365   --  Parent must be specified.
366   --  "parent": a Gdk.Gdk_Window, or null to create the window as a child of
367   --  the default root window for the default display.
368   --  "attributes": attributes of the new window
369   --  "attributes_mask": mask indicating which fields in Attributes are valid
370
371   function Gdk_Window_New
372      (Parent          : Gdk.Gdk_Window;
373       Attributes      : Gdk.Gdk_Window_Attr;
374       Attributes_Mask : Gdk_Window_Attributes_Type) return Gdk_Window;
375   --  Creates a new Gdk.Gdk_Window using the attributes from Attributes. See
376   --  Gdk_Window_Attr and Gdk.Window.Gdk_Window_Attributes_Type for more
377   --  details. Note: to use this on displays other than the default display,
378   --  Parent must be specified.
379   --  "parent": a Gdk.Gdk_Window, or null to create the window as a child of
380   --  the default root window for the default display.
381   --  "attributes": attributes of the new window
382   --  "attributes_mask": mask indicating which fields in Attributes are valid
383
384   function Get_Type return Glib.GType;
385   pragma Import (C, Get_Type, "gdk_window_get_type");
386
387   -------------
388   -- Methods --
389   -------------
390
391   procedure Beep (Self : Gdk.Gdk_Window);
392   pragma Import (C, Beep, "gdk_window_beep");
393   --  Emits a short beep associated to Window in the appropriate display, if
394   --  supported. Otherwise, emits a short beep on the display just as
395   --  Gdk.Display.Beep.
396   --  Since: gtk+ 2.12
397
398   procedure Begin_Move_Drag
399      (Self      : Gdk.Gdk_Window;
400       Button    : Gint;
401       Root_X    : Gint;
402       Root_Y    : Gint;
403       Timestamp : Guint32);
404   pragma Import (C, Begin_Move_Drag, "gdk_window_begin_move_drag");
405   --  Begins a window move operation (for a toplevel window).
406   --  This function assumes that the drag is controlled by the client pointer
407   --  device, use Gdk.Window.Begin_Move_Drag_For_Device to begin a drag with a
408   --  different device.
409   --  "button": the button being used to drag, or 0 for a keyboard-initiated
410   --  drag
411   --  "root_x": root window X coordinate of mouse click that began the drag
412   --  "root_y": root window Y coordinate of mouse click that began the drag
413   --  "timestamp": timestamp of mouse click that began the drag
414
415   procedure Begin_Move_Drag_For_Device
416      (Self      : Gdk.Gdk_Window;
417       Device    : not null access Gdk.Device.Gdk_Device_Record'Class;
418       Button    : Gint;
419       Root_X    : Gint;
420       Root_Y    : Gint;
421       Timestamp : Guint32);
422   --  Begins a window move operation (for a toplevel window). You might use
423   --  this function to implement a "window move grip," for example. The
424   --  function works best with window managers that support the [Extended
425   --  Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) but
426   --  has a fallback implementation for other window managers.
427   --  Since: gtk+ 3.4
428   --  "device": the device used for the operation
429   --  "button": the button being used to drag, or 0 for a keyboard-initiated
430   --  drag
431   --  "root_x": root window X coordinate of mouse click that began the drag
432   --  "root_y": root window Y coordinate of mouse click that began the drag
433   --  "timestamp": timestamp of mouse click that began the drag
434
435   procedure Begin_Paint_Rect
436      (Self      : Gdk.Gdk_Window;
437       Rectangle : Gdk.Rectangle.Gdk_Rectangle);
438   pragma Import (C, Begin_Paint_Rect, "gdk_window_begin_paint_rect");
439   --  A convenience wrapper around Gdk.Window.Begin_Paint_Region which
440   --  creates a rectangular region for you. See Gdk.Window.Begin_Paint_Region
441   --  for details.
442   --  "rectangle": rectangle you intend to draw to
443
444   procedure Begin_Paint_Region
445      (Self   : Gdk.Gdk_Window;
446       Region : Cairo.Region.Cairo_Region);
447   pragma Import (C, Begin_Paint_Region, "gdk_window_begin_paint_region");
448   --  Indicates that you are beginning the process of redrawing Region. A
449   --  backing store (offscreen buffer) large enough to contain Region will be
450   --  created. The backing store will be initialized with the background color
451   --  or background surface for Window. Then, all drawing operations performed
452   --  on Window will be diverted to the backing store. When you call
453   --  Gdk.Window.End_Paint, the backing store will be copied to Window, making
454   --  it visible onscreen. Only the part of Window contained in Region will be
455   --  modified; that is, drawing operations are clipped to Region.
456   --  The net result of all this is to remove flicker, because the user sees
457   --  the finished product appear all at once when you call
458   --  Gdk.Window.End_Paint. If you draw to Window directly without calling
459   --  Gdk.Window.Begin_Paint_Region, the user may see flicker as individual
460   --  drawing operations are performed in sequence. The clipping and
461   --  background-initializing features of Gdk.Window.Begin_Paint_Region are
462   --  conveniences for the programmer, so you can avoid doing that work
463   --  yourself.
464   --  When using GTK+, the widget system automatically places calls to
465   --  Gdk.Window.Begin_Paint_Region and Gdk.Window.End_Paint around emissions
466   --  of the expose_event signal. That is, if you're writing an expose event
467   --  handler, you can assume that the exposed area in
468   --  Gdk.Event.Gdk_Event_Expose has already been cleared to the window
469   --  background, is already set as the clip region, and already has a backing
470   --  store. Therefore in most cases, application code need not call
471   --  Gdk.Window.Begin_Paint_Region. (You can disable the automatic calls
472   --  around expose events on a widget-by-widget basis by calling
473   --  Gtk.Widget.Set_Double_Buffered.)
474   --  If you call this function multiple times before calling the matching
475   --  Gdk.Window.End_Paint, the backing stores are pushed onto a stack.
476   --  Gdk.Window.End_Paint copies the topmost backing store onscreen,
477   --  subtracts the topmost region from all other regions in the stack, and
478   --  pops the stack. All drawing operations affect only the topmost backing
479   --  store in the stack. One matching call to Gdk.Window.End_Paint is
480   --  required for each call to Gdk.Window.Begin_Paint_Region.
481   --  "region": region you intend to draw to
482
483   procedure Begin_Resize_Drag
484      (Self      : Gdk.Gdk_Window;
485       Edge      : Gdk_Window_Edge;
486       Button    : Gint;
487       Root_X    : Gint;
488       Root_Y    : Gint;
489       Timestamp : Guint32);
490   pragma Import (C, Begin_Resize_Drag, "gdk_window_begin_resize_drag");
491   --  Begins a window resize operation (for a toplevel window).
492   --  This function assumes that the drag is controlled by the client pointer
493   --  device, use Gdk.Window.Begin_Resize_Drag_For_Device to begin a drag with
494   --  a different device.
495   --  "edge": the edge or corner from which the drag is started
496   --  "button": the button being used to drag, or 0 for a keyboard-initiated
497   --  drag
498   --  "root_x": root window X coordinate of mouse click that began the drag
499   --  "root_y": root window Y coordinate of mouse click that began the drag
500   --  "timestamp": timestamp of mouse click that began the drag (use
501   --  Gdk.Event.Get_Time)
502
503   procedure Begin_Resize_Drag_For_Device
504      (Self      : Gdk.Gdk_Window;
505       Edge      : Gdk_Window_Edge;
506       Device    : not null access Gdk.Device.Gdk_Device_Record'Class;
507       Button    : Gint;
508       Root_X    : Gint;
509       Root_Y    : Gint;
510       Timestamp : Guint32);
511   --  Begins a window resize operation (for a toplevel window). You might use
512   --  this function to implement a "window resize grip," for example; in fact
513   --  Gtk.Status_Bar.Gtk_Status_Bar uses it. The function works best with
514   --  window managers that support the [Extended Window Manager
515   --  Hints](http://www.freedesktop.org/Standards/wm-spec) but has a fallback
516   --  implementation for other window managers.
517   --  Since: gtk+ 3.4
518   --  "edge": the edge or corner from which the drag is started
519   --  "device": the device used for the operation
520   --  "button": the button being used to drag, or 0 for a keyboard-initiated
521   --  drag
522   --  "root_x": root window X coordinate of mouse click that began the drag
523   --  "root_y": root window Y coordinate of mouse click that began the drag
524   --  "timestamp": timestamp of mouse click that began the drag (use
525   --  Gdk.Event.Get_Time)
526
527   procedure Configure_Finished (Self : Gdk.Gdk_Window);
528   pragma Import (C, Configure_Finished, "gdk_window_configure_finished");
529   pragma Obsolescent (Configure_Finished);
530   --  Does nothing, present only for compatiblity.
531   --  Since: gtk+ 2.6
532   --  Deprecated since 3.8, 1
533
534   procedure Coords_From_Parent
535      (Self     : Gdk.Gdk_Window;
536       Parent_X : Gdouble;
537       Parent_Y : Gdouble;
538       X        : out Gdouble;
539       Y        : out Gdouble);
540   pragma Import (C, Coords_From_Parent, "gdk_window_coords_from_parent");
541   --  Transforms window coordinates from a parent window to a child window,
542   --  where the parent window is the normal parent as returned by
543   --  Gdk.Window.Get_Parent for normal windows, and the window's embedder as
544   --  returned by gdk_offscreen_window_get_embedder for offscreen windows.
545   --  For normal windows, calling this function is equivalent to subtracting
546   --  the return values of Gdk.Window.Get_Position from the parent
547   --  coordinates. For offscreen windows however (which can be arbitrarily
548   --  transformed), this function calls the GdkWindow::from-embedder: signal
549   --  to translate the coordinates.
550   --  You should always use this function when writing generic code that
551   --  walks down a window hierarchy.
552   --  See also: Gdk.Window.Coords_To_Parent
553   --  Since: gtk+ 2.22
554   --  "parent_x": X coordinate in parent's coordinate system
555   --  "parent_y": Y coordinate in parent's coordinate system
556   --  "x": return location for X coordinate in child's coordinate system
557   --  "y": return location for Y coordinate in child's coordinate system
558
559   procedure Coords_To_Parent
560      (Self     : Gdk.Gdk_Window;
561       X        : Gdouble;
562       Y        : Gdouble;
563       Parent_X : out Gdouble;
564       Parent_Y : out Gdouble);
565   pragma Import (C, Coords_To_Parent, "gdk_window_coords_to_parent");
566   --  Transforms window coordinates from a child window to its parent window,
567   --  where the parent window is the normal parent as returned by
568   --  Gdk.Window.Get_Parent for normal windows, and the window's embedder as
569   --  returned by gdk_offscreen_window_get_embedder for offscreen windows.
570   --  For normal windows, calling this function is equivalent to adding the
571   --  return values of Gdk.Window.Get_Position to the child coordinates. For
572   --  offscreen windows however (which can be arbitrarily transformed), this
573   --  function calls the GdkWindow::to-embedder: signal to translate the
574   --  coordinates.
575   --  You should always use this function when writing generic code that
576   --  walks up a window hierarchy.
577   --  See also: Gdk.Window.Coords_From_Parent
578   --  Since: gtk+ 2.22
579   --  "x": X coordinate in child's coordinate system
580   --  "y": Y coordinate in child's coordinate system
581   --  "parent_x": return location for X coordinate in parent's coordinate
582   --  system, or null
583   --  "parent_y": return location for Y coordinate in parent's coordinate
584   --  system, or null
585
586   function Create_Similar_Image_Surface
587      (Self   : Gdk.Gdk_Window;
588       Format : Cairo.Cairo_Format;
589       Width  : Gint;
590       Height : Gint;
591       Scale  : Gint) return Cairo.Cairo_Surface;
592   pragma Import (C, Create_Similar_Image_Surface, "gdk_window_create_similar_image_surface");
593   --  Create a new image surface that is efficient to draw on the given
594   --  Window.
595   --  Initially the surface contents are all 0 (transparent if contents have
596   --  transparency, black otherwise.)
597   --  Since: gtk+ 3.10
598   --  "format": the format for the new surface
599   --  "width": width of the new surface
600   --  "height": height of the new surface
601   --  "scale": the scale of the new surface, or 0 to use same as Window
602
603   function Create_Similar_Surface
604      (Self    : Gdk.Gdk_Window;
605       Content : Cairo.Cairo_Content;
606       Width   : Gint;
607       Height  : Gint) return Cairo.Cairo_Surface;
608   pragma Import (C, Create_Similar_Surface, "gdk_window_create_similar_surface");
609   --  Create a new surface that is as compatible as possible with the given
610   --  Window. For example the new surface will have the same fallback
611   --  resolution and font options as Window. Generally, the new surface will
612   --  also use the same backend as Window, unless that is not possible for
613   --  some reason. The type of the returned surface may be examined with
614   --  cairo_surface_get_type.
615   --  Initially the surface contents are all 0 (transparent if contents have
616   --  transparency, black otherwise.)
617   --  Since: gtk+ 2.22
618   --  "content": the content for the new surface
619   --  "width": width of the new surface
620   --  "height": height of the new surface
621
622   procedure Deiconify (Self : Gdk.Gdk_Window);
623   pragma Import (C, Deiconify, "gdk_window_deiconify");
624   --  Attempt to deiconify (unminimize) Window. On X11 the window manager may
625   --  choose to ignore the request to deiconify. When using GTK+, use
626   --  Gtk.Window.Deiconify instead of the Gdk.Gdk_Window variant. Or better
627   --  yet, you probably want to use Gtk.Window.Present, which raises the
628   --  window, focuses it, unminimizes it, and puts it on the current desktop.
629
630   procedure Destroy (Self : Gdk.Gdk_Window);
631   pragma Import (C, Destroy, "gdk_window_destroy");
632   --  Destroys the window system resources associated with Window and
633   --  decrements Window's reference count. The window system resources for all
634   --  children of Window are also destroyed, but the children's reference
635   --  counts are not decremented.
636   --  Note that a window will not be destroyed automatically when its
637   --  reference count reaches zero. You must call this function yourself
638   --  before that happens.
639
640   procedure Destroy_Notify (Self : Gdk.Gdk_Window);
641   pragma Import (C, Destroy_Notify, "gdk_window_destroy_notify");
642
643   procedure Enable_Synchronized_Configure (Self : Gdk.Gdk_Window);
644   pragma Import (C, Enable_Synchronized_Configure, "gdk_window_enable_synchronized_configure");
645   pragma Obsolescent (Enable_Synchronized_Configure);
646   --  Does nothing, present only for compatiblity.
647   --  Since: gtk+ 2.6
648   --  Deprecated since 3.8, 1
649
650   procedure End_Paint (Self : Gdk.Gdk_Window);
651   pragma Import (C, End_Paint, "gdk_window_end_paint");
652   --  Indicates that the backing store created by the most recent call to
653   --  Gdk.Window.Begin_Paint_Region should be copied onscreen and deleted,
654   --  leaving the next-most-recent backing store or no backing store at all as
655   --  the active paint region. See Gdk.Window.Begin_Paint_Region for full
656   --  details. It is an error to call this function without a matching
657   --  Gdk.Window.Begin_Paint_Region first.
658
659   function Ensure_Native (Self : Gdk.Gdk_Window) return Boolean;
660   --  Tries to ensure that there is a window-system native window for this
661   --  GdkWindow. This may fail in some situations, returning False.
662   --  Offscreen window and children of them can never have native windows.
663   --  Some backends may not support native child windows.
664   --  Since: gtk+ 2.18
665
666   procedure Flush (Self : Gdk.Gdk_Window);
667   pragma Import (C, Flush, "gdk_window_flush");
668   pragma Obsolescent (Flush);
669   --  This function does nothing.
670   --  Since: gtk+ 2.18
671   --  Deprecated since 3.14, 1
672
673   procedure Focus (Self : Gdk.Gdk_Window; Timestamp : Guint32);
674   pragma Import (C, Focus, "gdk_window_focus");
675   --  Sets keyboard focus to Window. In most cases, Gtk.Window.Present should
676   --  be used on a Gtk.Window.Gtk_Window, rather than calling this function.
677   --  "timestamp": timestamp of the event triggering the window focus
678
679   procedure Freeze_Toplevel_Updates_Libgtk_Only (Self : Gdk.Gdk_Window);
680   pragma Import (C, Freeze_Toplevel_Updates_Libgtk_Only, "gdk_window_freeze_toplevel_updates_libgtk_only");
681   --  Temporarily freezes a window and all its descendants such that it won't
682   --  receive expose events. The window will begin receiving expose events
683   --  again when Gdk.Window.Thaw_Toplevel_Updates_Libgtk_Only is called. If
684   --  Gdk.Window.Freeze_Toplevel_Updates_Libgtk_Only has been called more than
685   --  once, Gdk.Window.Thaw_Toplevel_Updates_Libgtk_Only must be called an
686   --  equal number of times to begin processing exposes.
687   --  This function is not part of the GDK public API and is only for use by
688   --  GTK+.
689
690   procedure Freeze_Updates (Self : Gdk.Gdk_Window);
691   pragma Import (C, Freeze_Updates, "gdk_window_freeze_updates");
692   --  Temporarily freezes a window such that it won't receive expose events.
693   --  The window will begin receiving expose events again when
694   --  Gdk.Window.Thaw_Updates is called. If Gdk.Window.Freeze_Updates has been
695   --  called more than once, Gdk.Window.Thaw_Updates must be called an equal
696   --  number of times to begin processing exposes.
697
698   procedure Fullscreen (Self : Gdk.Gdk_Window);
699   pragma Import (C, Fullscreen, "gdk_window_fullscreen");
700   --  Moves the window into fullscreen mode. This means the window covers the
701   --  entire screen and is above any panels or task bars.
702   --  If the window was already fullscreen, then this function does nothing.
703   --  On X11, asks the window manager to put Window in a fullscreen state, if
704   --  the window manager supports this operation. Not all window managers
705   --  support this, and some deliberately ignore it or don't have a concept of
706   --  "fullscreen"; so you can't rely on the fullscreenification actually
707   --  happening. But it will happen with most standard window managers, and
708   --  GDK makes a best effort to get it to happen.
709   --  Since: gtk+ 2.2
710
711   procedure Geometry_Changed (Self : Gdk.Gdk_Window);
712   pragma Import (C, Geometry_Changed, "gdk_window_geometry_changed");
713   --  This function informs GDK that the geometry of an embedded offscreen
714   --  window has changed. This is necessary for GDK to keep track of which
715   --  offscreen window the pointer is in.
716   --  Since: gtk+ 2.18
717
718   function Get_Accept_Focus (Self : Gdk.Gdk_Window) return Boolean;
719   --  Determines whether or not the desktop environment shuld be hinted that
720   --  the window does not want to receive input focus.
721   --  Since: gtk+ 2.22
722
723   procedure Set_Accept_Focus
724      (Self         : Gdk.Gdk_Window;
725       Accept_Focus : Boolean);
726   --  Setting Accept_Focus to False hints the desktop environment that the
727   --  window doesn't want to receive input focus.
728   --  On X, it is the responsibility of the window manager to interpret this
729   --  hint. ICCCM-compliant window manager usually respect it.
730   --  Since: gtk+ 2.4
731   --  "accept_focus": True if the window should receive input focus
732
733   function Get_Background_Pattern
734      (Self : Gdk.Gdk_Window) return Cairo.Cairo_Pattern;
735   pragma Import (C, Get_Background_Pattern, "gdk_window_get_background_pattern");
736   --  Gets the pattern used to clear the background on Window. If Window does
737   --  not have its own background and reuses the parent's, null is returned
738   --  and you'll have to query it yourself.
739   --  Since: gtk+ 2.22
740
741   procedure Set_Background_Pattern
742      (Self    : Gdk.Gdk_Window;
743       Pattern : Cairo.Cairo_Pattern);
744   pragma Import (C, Set_Background_Pattern, "gdk_window_set_background_pattern");
745   --  Sets the background of Window.
746   --  A background of null means that the window will inherit its background
747   --  from its parent window.
748   --  The windowing system will normally fill a window with its background
749   --  when the window is obscured then exposed.
750   --  "pattern": a pattern to use, or null
751
752   function Get_Children
753      (Self : Gdk.Gdk_Window) return Gdk_Window_List.Glist;
754   --  Gets the list of children of Window known to GDK. This function only
755   --  returns children created via GDK, so for example it's useless when used
756   --  with the root window; it only returns windows an application created
757   --  itself.
758   --  The returned list must be freed, but the elements in the list need not
759   --  be.
760
761   function Get_Clip_Region
762      (Self : Gdk.Gdk_Window) return Cairo.Region.Cairo_Region;
763   pragma Import (C, Get_Clip_Region, "gdk_window_get_clip_region");
764   --  Computes the region of a window that potentially can be written to by
765   --  drawing primitives. This region may not take into account other factors
766   --  such as if the window is obscured by other windows, but no area outside
767   --  of this region will be affected by drawing primitives.
768
769   function Get_Composited (Self : Gdk.Gdk_Window) return Boolean;
770   --  Determines whether Window is composited.
771   --  See Gdk.Window.Set_Composited.
772   --  Since: gtk+ 2.22
773
774   procedure Set_Composited (Self : Gdk.Gdk_Window; Composited : Boolean);
775   --  Sets a Gdk.Gdk_Window as composited, or unsets it. Composited windows
776   --  do not automatically have their contents drawn to the screen. Drawing is
777   --  redirected to an offscreen buffer and an expose event is emitted on the
778   --  parent of the composited window. It is the responsibility of the
779   --  parent's expose handler to manually merge the off-screen content onto
780   --  the screen in whatever way it sees fit.
781   --  It only makes sense for child windows to be composited; see
782   --  Gdk.Window.Set_Opacity if you need translucent toplevel windows.
783   --  An additional effect of this call is that the area of this window is no
784   --  longer clipped from regions marked for invalidation on its parent. Draws
785   --  done on the parent window are also no longer clipped by the child.
786   --  This call is only supported on some systems (currently, only X11 with
787   --  new enough Xcomposite and Xdamage extensions). You must call
788   --  Gdk.Display.Supports_Composite to check if setting a window as
789   --  composited is supported before attempting to do so.
790   --  Since: gtk+ 2.12
791   --  "composited": True to set the window as composited
792
793   function Get_Cursor (Self : Gdk.Gdk_Window) return Gdk.Gdk_Cursor;
794   pragma Import (C, Get_Cursor, "gdk_window_get_cursor");
795   --  Retrieves a Gdk.Gdk_Cursor pointer for the cursor currently set on the
796   --  specified Gdk.Gdk_Window, or null. If the return value is null then
797   --  there is no custom cursor set on the specified window, and it is using
798   --  the cursor for its parent window.
799   --  Since: gtk+ 2.18
800
801   procedure Set_Cursor (Self : Gdk.Gdk_Window; Cursor : Gdk.Gdk_Cursor);
802   pragma Import (C, Set_Cursor, "gdk_window_set_cursor");
803   --  Sets the default mouse pointer for a Gdk.Gdk_Window. Use
804   --  gdk_cursor_new_for_display or gdk_cursor_new_from_pixbuf to create the
805   --  cursor. To make the cursor invisible, use Gdk.Blank_Cursor. Passing null
806   --  for the Cursor argument to Gdk.Window.Set_Cursor means that Window will
807   --  use the cursor of its parent window. Most windows should use this
808   --  default.
809   --  "cursor": a cursor
810
811   procedure Get_Decorations
812      (Self            : Gdk.Gdk_Window;
813       Decorations     : out Gdk_WMDecoration;
814       Has_Decorations : out Boolean);
815   --  Returns the decorations set on the GdkWindow with
816   --  Gdk.Window.Set_Decorations.
817   --  "decorations": The window decorations will be written here
818
819   procedure Set_Decorations
820      (Self        : Gdk.Gdk_Window;
821       Decorations : Gdk_WMDecoration);
822   pragma Import (C, Set_Decorations, "gdk_window_set_decorations");
823   --  "Decorations" are the features the window manager adds to a toplevel
824   --  Gdk.Gdk_Window. This function sets the traditional Motif window manager
825   --  hints that tell the window manager which decorations you would like your
826   --  window to have. Usually you should use Gtk.Window.Set_Decorated on a
827   --  Gtk.Window.Gtk_Window instead of using the GDK function directly.
828   --  The Decorations argument is the logical OR of the fields in the
829   --  Gdk.Window.Gdk_WMDecoration enumeration. If GDK_DECOR_ALL is included in
830   --  the mask, the other bits indicate which decorations should be turned
831   --  off. If GDK_DECOR_ALL is not included, then the other bits indicate
832   --  which decorations should be turned on.
833   --  Most window managers honor a decorations hint of 0 to disable all
834   --  decorations, but very few honor all possible combinations of bits.
835   --  "decorations": decoration hint mask
836
837   function Get_Device_Cursor
838      (Self   : Gdk.Gdk_Window;
839       Device : not null access Gdk.Device.Gdk_Device_Record'Class)
840       return Gdk.Gdk_Cursor;
841   --  Retrieves a Gdk.Gdk_Cursor pointer for the Device currently set on the
842   --  specified Gdk.Gdk_Window, or null. If the return value is null then
843   --  there is no custom cursor set on the specified window, and it is using
844   --  the cursor for its parent window.
845   --  Since: gtk+ 3.0
846   --  "device": a master, pointer Gdk.Device.Gdk_Device.
847
848   procedure Set_Device_Cursor
849      (Self   : Gdk.Gdk_Window;
850       Device : not null access Gdk.Device.Gdk_Device_Record'Class;
851       Cursor : Gdk.Gdk_Cursor);
852   --  Sets a specific Gdk.Gdk_Cursor for a given device when it gets inside
853   --  Window. Use gdk_cursor_new_for_display or gdk_cursor_new_from_pixbuf to
854   --  create the cursor. To make the cursor invisible, use Gdk.Blank_Cursor.
855   --  Passing null for the Cursor argument to Gdk.Window.Set_Cursor means that
856   --  Window will use the cursor of its parent window. Most windows should use
857   --  this default.
858   --  Since: gtk+ 3.0
859   --  "device": a master, pointer Gdk.Device.Gdk_Device
860   --  "cursor": a Gdk.Gdk_Cursor
861
862   function Get_Device_Events
863      (Self   : Gdk.Gdk_Window;
864       Device : not null access Gdk.Device.Gdk_Device_Record'Class)
865       return Gdk.Event.Gdk_Event_Mask;
866   --  Returns the event mask for Window corresponding to an specific device.
867   --  Since: gtk+ 3.0
868   --  "device": a Gdk.Device.Gdk_Device.
869
870   procedure Set_Device_Events
871      (Self       : Gdk.Gdk_Window;
872       Device     : not null access Gdk.Device.Gdk_Device_Record'Class;
873       Event_Mask : Gdk.Event.Gdk_Event_Mask);
874   --  Sets the event mask for a given device (Normally a floating device, not
875   --  attached to any visible pointer) to Window. For example, an event mask
876   --  including GDK_BUTTON_PRESS_MASK means the window should report button
877   --  press events. The event mask is the bitwise OR of values from the
878   --  Gdk.Event.Gdk_Event_Mask enumeration.
879   --  Since: gtk+ 3.0
880   --  "device": Gdk.Device.Gdk_Device to enable events for.
881   --  "event_mask": event mask for Window
882
883   procedure Get_Device_Position
884      (Self   : Gdk.Gdk_Window;
885       Device : not null access Gdk.Device.Gdk_Device_Record'Class;
886       X      : out Gint;
887       Y      : out Gint;
888       Mask   : out Gdk.Types.Gdk_Modifier_Type;
889       Window : out Gdk.Gdk_Window);
890   --  Obtains the current device position and modifier state. The position is
891   --  given in coordinates relative to the upper left corner of Window.
892   --  Use Gdk.Window.Get_Device_Position_Double if you need subpixel
893   --  precision.
894   --  Since: gtk+ 3.0
895   --  "device": pointer Gdk.Device.Gdk_Device to query to.
896   --  "x": return location for the X coordinate of Device, or null.
897   --  "y": return location for the Y coordinate of Device, or null.
898   --  "mask": return location for the modifier mask, or null.
899
900   function Get_Device_Position_Double
901      (Self   : Gdk.Gdk_Window;
902       Device : not null access Gdk.Device.Gdk_Device_Record'Class;
903       X      : access Gdouble;
904       Y      : access Gdouble;
905       Mask   : access Gdk.Types.Gdk_Modifier_Type) return Gdk.Gdk_Window;
906   --  Obtains the current device position in doubles and modifier state. The
907   --  position is given in coordinates relative to the upper left corner of
908   --  Window.
909   --  Since: gtk+ 3.10
910   --  "device": pointer Gdk.Device.Gdk_Device to query to.
911   --  "x": return location for the X coordinate of Device, or null.
912   --  "y": return location for the Y coordinate of Device, or null.
913   --  "mask": return location for the modifier mask, or null.
914
915   function Get_Display
916      (Self : Gdk.Gdk_Window) return Gdk.Display.Gdk_Display;
917   --  Gets the Gdk.Display.Gdk_Display associated with a Gdk.Gdk_Window.
918   --  Since: gtk+ 2.24
919
920   function Get_Effective_Parent
921      (Self : Gdk.Gdk_Window) return Gdk.Gdk_Window;
922   pragma Import (C, Get_Effective_Parent, "gdk_window_get_effective_parent");
923   --  Obtains the parent of Window, as known to GDK. Works like
924   --  Gdk.Window.Get_Parent for normal windows, but returns the window's
925   --  embedder for offscreen windows.
926   --  See also: gdk_offscreen_window_get_embedder
927   --  Since: gtk+ 2.22
928
929   function Get_Effective_Toplevel
930      (Self : Gdk.Gdk_Window) return Gdk.Gdk_Window;
931   pragma Import (C, Get_Effective_Toplevel, "gdk_window_get_effective_toplevel");
932   --  Gets the toplevel window that's an ancestor of Window.
933   --  Works like Gdk.Window.Get_Toplevel, but treats an offscreen window's
934   --  embedder as its parent, using Gdk.Window.Get_Effective_Parent.
935   --  See also: gdk_offscreen_window_get_embedder
936   --  Since: gtk+ 2.22
937
938   function Get_Event_Compression (Self : Gdk.Gdk_Window) return Boolean;
939   --  Get the current event compression setting for this window.
940   --  Since: gtk+ 3.12
941
942   procedure Set_Event_Compression
943      (Self              : Gdk.Gdk_Window;
944       Event_Compression : Boolean);
945   --  Determines whether or not extra unprocessed motion events in the event
946   --  queue can be discarded. If True only the most recent event will be
947   --  delivered.
948   --  Some types of applications, e.g. paint programs, need to see all motion
949   --  events and will benefit from turning off event compression.
950   --  By default, event compression is enabled.
951   --  Since: gtk+ 3.12
952   --  "event_compression": True if motion events should be compressed
953
954   function Get_Events
955      (Self : Gdk.Gdk_Window) return Gdk.Event.Gdk_Event_Mask;
956   pragma Import (C, Get_Events, "gdk_window_get_events");
957   --  Gets the event mask for Window for all master input devices. See
958   --  Gdk.Window.Set_Events.
959
960   procedure Set_Events
961      (Self       : Gdk.Gdk_Window;
962       Event_Mask : Gdk.Event.Gdk_Event_Mask);
963   pragma Import (C, Set_Events, "gdk_window_set_events");
964   --  The event mask for a window determines which events will be reported
965   --  for that window from all master input devices. For example, an event
966   --  mask including GDK_BUTTON_PRESS_MASK means the window should report
967   --  button press events. The event mask is the bitwise OR of values from the
968   --  Gdk.Event.Gdk_Event_Mask enumeration.
969   --  "event_mask": event mask for Window
970
971   function Get_Focus_On_Map (Self : Gdk.Gdk_Window) return Boolean;
972   --  Determines whether or not the desktop environment should be hinted that
973   --  the window does not want to receive input focus when it is mapped.
974   --  Since: gtk+ 2.22
975
976   procedure Set_Focus_On_Map
977      (Self         : Gdk.Gdk_Window;
978       Focus_On_Map : Boolean);
979   --  Setting Focus_On_Map to False hints the desktop environment that the
980   --  window doesn't want to receive input focus when it is mapped.
981   --  focus_on_map should be turned off for windows that aren't triggered
982   --  interactively (such as popups from network activity).
983   --  On X, it is the responsibility of the window manager to interpret this
984   --  hint. Window managers following the freedesktop.org window manager
985   --  extension specification should respect it.
986   --  Since: gtk+ 2.6
987   --  "focus_on_map": True if the window should receive input focus when
988   --  mapped
989
990   function Get_Frame_Clock
991      (Self : Gdk.Gdk_Window) return Gdk.Frame_Clock.Gdk_Frame_Clock;
992   --  Gets the frame clock for the window. The frame clock for a window never
993   --  changes unless the window is reparented to a new toplevel window.
994   --  Since: gtk+ 3.8
995
996   procedure Get_Frame_Extents
997      (Self : Gdk.Gdk_Window;
998       Rect : out Gdk.Rectangle.Gdk_Rectangle);
999   pragma Import (C, Get_Frame_Extents, "gdk_window_get_frame_extents");
1000   --  Obtains the bounding box of the window, including window manager
1001   --  titlebar/borders if any. The frame position is given in root window
1002   --  coordinates. To get the position of the window itself (rather than the
1003   --  frame) in root window coordinates, use Gdk.Window.Get_Origin.
1004   --  "rect": rectangle to fill with bounding box of the window frame
1005
1006   function Get_Fullscreen_Mode
1007      (Self : Gdk.Gdk_Window) return Gdk_Fullscreen_Mode;
1008   pragma Import (C, Get_Fullscreen_Mode, "gdk_window_get_fullscreen_mode");
1009   --  Obtains the Gdk.Window.Gdk_Fullscreen_Mode of the Window.
1010   --  Since: gtk+ 3.8
1011
1012   procedure Set_Fullscreen_Mode
1013      (Self : Gdk.Gdk_Window;
1014       Mode : Gdk_Fullscreen_Mode);
1015   pragma Import (C, Set_Fullscreen_Mode, "gdk_window_set_fullscreen_mode");
1016   --  Specifies whether the Window should span over all monitors (in a
1017   --  multi-head setup) or only the current monitor when in fullscreen mode.
1018   --  The Mode argument is from the Gdk.Window.Gdk_Fullscreen_Mode
1019   --  enumeration. If GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the
1020   --  fullscreen Window will span over all monitors from the
1021   --  Gdk.Screen.Gdk_Screen.
1022   --  On X11, searches through the list of monitors from the
1023   --  Gdk.Screen.Gdk_Screen the ones which delimit the 4 edges of the entire
1024   --  Gdk.Screen.Gdk_Screen and will ask the window manager to span the Window
1025   --  over these monitors.
1026   --  If the XINERAMA extension is not available or not usable, this function
1027   --  has no effect.
1028   --  Not all window managers support this, so you can't rely on the
1029   --  fullscreen window to span over the multiple monitors when
1030   --  GDK_FULLSCREEN_ON_ALL_MONITORS is specified.
1031   --  Since: gtk+ 3.8
1032   --  "mode": fullscreen mode
1033
1034   procedure Get_Geometry
1035      (Self   : Gdk.Gdk_Window;
1036       X      : out Gint;
1037       Y      : out Gint;
1038       Width  : out Gint;
1039       Height : out Gint);
1040   pragma Import (C, Get_Geometry, "gdk_window_get_geometry");
1041   --  Any of the return location arguments to this function may be null, if
1042   --  you aren't interested in getting the value of that field.
1043   --  The X and Y coordinates returned are relative to the parent window of
1044   --  Window, which for toplevels usually means relative to the window
1045   --  decorations (titlebar, etc.) rather than relative to the root window
1046   --  (screen-size background window).
1047   --  On the X11 platform, the geometry is obtained from the X server, so
1048   --  reflects the latest position of Window; this may be out-of-sync with the
1049   --  position of Window delivered in the most-recently-processed
1050   --  Gdk.Event.Gdk_Event_Configure. Gdk.Window.Get_Position in contrast gets
1051   --  the position from the most recent configure event.
1052   --  Note: If Window is not a toplevel, it is much better to call
1053   --  Gdk.Window.Get_Position, Gdk.Window.Get_Width and Gdk.Window.Get_Height
1054   --  instead, because it avoids the roundtrip to the X server and because
1055   --  these functions support the full 32-bit coordinate space, whereas
1056   --  Gdk.Window.Get_Geometry is restricted to the 16-bit coordinates of X11.
1057   --  "x": return location for X coordinate of window (relative to its
1058   --  parent)
1059   --  "y": return location for Y coordinate of window (relative to its
1060   --  parent)
1061   --  "width": return location for width of window
1062   --  "height": return location for height of window
1063
1064   function Get_Group (Self : Gdk.Gdk_Window) return Gdk.Gdk_Window;
1065   pragma Import (C, Get_Group, "gdk_window_get_group");
1066   --  Returns the group leader window for Window. See Gdk.Window.Set_Group.
1067   --  Since: gtk+ 2.4
1068
1069   procedure Set_Group (Self : Gdk.Gdk_Window; Leader : Gdk.Gdk_Window);
1070   pragma Import (C, Set_Group, "gdk_window_set_group");
1071   --  Sets the group leader window for Window. By default, GDK sets the group
1072   --  leader for all toplevel windows to a global window implicitly created by
1073   --  GDK. With this function you can override this default.
1074   --  The group leader window allows the window manager to distinguish all
1075   --  windows that belong to a single application. It may for example allow
1076   --  users to minimize/unminimize all windows belonging to an application at
1077   --  once. You should only set a non-default group window if your application
1078   --  pretends to be multiple applications.
1079   --  "leader": group leader window, or null to restore the default group
1080   --  leader window
1081
1082   function Get_Height (Self : Gdk.Gdk_Window) return Gint;
1083   pragma Import (C, Get_Height, "gdk_window_get_height");
1084   --  Returns the height of the given Window.
1085   --  On the X11 platform the returned size is the size reported in the
1086   --  most-recently-processed configure event, rather than the current size on
1087   --  the X server.
1088   --  Since: gtk+ 2.24
1089
1090   function Get_Modal_Hint (Self : Gdk.Gdk_Window) return Boolean;
1091   --  Determines whether or not the window manager is hinted that Window has
1092   --  modal behaviour.
1093   --  Since: gtk+ 2.22
1094
1095   procedure Set_Modal_Hint (Self : Gdk.Gdk_Window; Modal : Boolean);
1096   --  The application can use this hint to tell the window manager that a
1097   --  certain window has modal behaviour. The window manager can use this
1098   --  information to handle modal windows in a special way.
1099   --  You should only use this on windows for which you have previously
1100   --  called Gdk.Window.Set_Transient_For
1101   --  "modal": True if the window is modal, False otherwise.
1102
1103   procedure Get_Origin (Self : Gdk.Gdk_Window; X : out Gint; Y : out Gint);
1104   pragma Import (C, Get_Origin, "gdk_window_get_origin");
1105   --  Obtains the position of a window in root window coordinates. (Compare
1106   --  with Gdk.Window.Get_Position and Gdk.Window.Get_Geometry which return
1107   --  the position of a window relative to its parent window.)
1108   --  "x": return location for X coordinate
1109   --  "y": return location for Y coordinate
1110
1111   function Get_Parent (Self : Gdk.Gdk_Window) return Gdk.Gdk_Window;
1112   pragma Import (C, Get_Parent, "gdk_window_get_parent");
1113   --  Obtains the parent of Window, as known to GDK. Does not query the X
1114   --  server; thus this returns the parent as passed to gdk_window_new, not
1115   --  the actual parent. This should never matter unless you're using Xlib
1116   --  calls mixed with GDK calls on the X11 platform. It may also matter for
1117   --  toplevel windows, because the window manager may choose to reparent
1118   --  them.
1119   --  Note that you should use Gdk.Window.Get_Effective_Parent when writing
1120   --  generic code that walks up a window hierarchy, because
1121   --  Gdk.Window.Get_Parent will most likely not do what you expect if there
1122   --  are offscreen windows in the hierarchy.
1123
1124   procedure Get_Pointer
1125      (Self   : Gdk.Gdk_Window;
1126       X      : out Gint;
1127       Y      : out Gint;
1128       Mask   : out Gdk.Types.Gdk_Modifier_Type;
1129       Window : out Gdk.Gdk_Window);
1130   pragma Obsolescent (Get_Pointer);
1131   --  Obtains the current pointer position and modifier state. The position
1132   --  is given in coordinates relative to the upper left corner of Window.
1133   --  Deprecated since 3.0, 1
1134   --  "x": return location for X coordinate of pointer or null to not return
1135   --  the X coordinate
1136   --  "y": return location for Y coordinate of pointer or null to not return
1137   --  the Y coordinate
1138   --  "mask": return location for modifier mask or null to not return the
1139   --  modifier mask
1140
1141   procedure Get_Position
1142      (Self : Gdk.Gdk_Window;
1143       X    : out Gint;
1144       Y    : out Gint);
1145   pragma Import (C, Get_Position, "gdk_window_get_position");
1146   --  Obtains the position of the window as reported in the
1147   --  most-recently-processed Gdk.Event.Gdk_Event_Configure. Contrast with
1148   --  Gdk.Window.Get_Geometry which queries the X server for the current
1149   --  window position, regardless of which events have been received or
1150   --  processed.
1151   --  The position coordinates are relative to the window's parent window.
1152   --  "x": X coordinate of window
1153   --  "y": Y coordinate of window
1154
1155   procedure Get_Root_Coords
1156      (Self   : Gdk.Gdk_Window;
1157       X      : Gint;
1158       Y      : Gint;
1159       Root_X : out Gint;
1160       Root_Y : out Gint);
1161   pragma Import (C, Get_Root_Coords, "gdk_window_get_root_coords");
1162   --  Obtains the position of a window position in root window coordinates.
1163   --  This is similar to Gdk.Window.Get_Origin but allows you go pass in any
1164   --  position in the window, not just the origin.
1165   --  Since: gtk+ 2.18
1166   --  "x": X coordinate in window
1167   --  "y": Y coordinate in window
1168   --  "root_x": return location for X coordinate
1169   --  "root_y": return location for Y coordinate
1170
1171   procedure Get_Root_Origin
1172      (Self : Gdk.Gdk_Window;
1173       X    : out Gint;
1174       Y    : out Gint);
1175   pragma Import (C, Get_Root_Origin, "gdk_window_get_root_origin");
1176   --  Obtains the top-left corner of the window manager frame in root window
1177   --  coordinates.
1178   --  "x": return location for X position of window frame
1179   --  "y": return location for Y position of window frame
1180
1181   function Get_Scale_Factor (Self : Gdk.Gdk_Window) return Gint;
1182   pragma Import (C, Get_Scale_Factor, "gdk_window_get_scale_factor");
1183   --  Returns the internal scale factor that maps from window coordiantes to
1184   --  the actual device pixels. On traditional systems this is 1, but on very
1185   --  high density outputs this can be a higher value (often 2).
1186   --  A higher value means that drawing is automatically scaled up to a
1187   --  higher resolution, so any code doing drawing will automatically look
1188   --  nicer. However, if you are supplying pixel-based data the scale value
1189   --  can be used to determine whether to use a pixel resource with higher
1190   --  resolution data.
1191   --  The scale of a window may change during runtime, if this happens a
1192   --  configure event will be sent to the toplevel window.
1193   --  Since: gtk+ 3.10
1194
1195   function Get_Screen (Self : Gdk.Gdk_Window) return Gdk.Screen.Gdk_Screen;
1196   --  Gets the Gdk.Screen.Gdk_Screen associated with a Gdk.Gdk_Window.
1197   --  Since: gtk+ 2.24
1198
1199   function Get_Source_Events
1200      (Self   : Gdk.Gdk_Window;
1201       Source : Gdk_Input_Source) return Gdk.Event.Gdk_Event_Mask;
1202   pragma Import (C, Get_Source_Events, "gdk_window_get_source_events");
1203   --  Returns the event mask for Window corresponding to the device class
1204   --  specified by Source.
1205   --  "source": a Gdk_Input_Source to define the source class.
1206
1207   procedure Set_Source_Events
1208      (Self       : Gdk.Gdk_Window;
1209       Source     : Gdk_Input_Source;
1210       Event_Mask : Gdk.Event.Gdk_Event_Mask);
1211   pragma Import (C, Set_Source_Events, "gdk_window_set_source_events");
1212   --  Sets the event mask for any floating device (i.e. not attached to any
1213   --  visible pointer) that has the source defined as Source. This event mask
1214   --  will be applied both to currently existing, newly added devices after
1215   --  this call, and devices being attached/detached.
1216   --  Since: gtk+ 3.0
1217   --  "source": a Gdk_Input_Source to define the source class.
1218   --  "event_mask": event mask for Window
1219
1220   function Get_State
1221      (Self : Gdk.Gdk_Window) return Gdk.Event.Gdk_Window_State;
1222   pragma Import (C, Get_State, "gdk_window_get_state");
1223   --  Gets the bitwise OR of the currently active window state flags, from
1224   --  the Gdk.Event.Gdk_Window_State enumeration.
1225
1226   function Get_Support_Multidevice (Self : Gdk.Gdk_Window) return Boolean;
1227   --  Returns True if the window is aware of the existence of multiple
1228   --  devices.
1229   --  Since: gtk+ 3.0
1230
1231   procedure Set_Support_Multidevice
1232      (Self                : Gdk.Gdk_Window;
1233       Support_Multidevice : Boolean);
1234   --  This function will enable multidevice features in Window.
1235   --  Multidevice aware windows will need to handle properly multiple, per
1236   --  device enter/leave events, device grabs and grab ownerships.
1237   --  Since: gtk+ 3.0
1238   --  "support_multidevice": True to enable multidevice support in Window.
1239
1240   function Get_Toplevel (Self : Gdk.Gdk_Window) return Gdk.Gdk_Window;
1241   pragma Import (C, Get_Toplevel, "gdk_window_get_toplevel");
1242   --  Gets the toplevel window that's an ancestor of Window.
1243   --  Any window type but Gdk.Window_Child is considered a toplevel window,
1244   --  as is a Gdk.Window_Child window that has a root window as parent.
1245   --  Note that you should use Gdk.Window.Get_Effective_Toplevel when you
1246   --  want to get to a window's toplevel as seen on screen, because
1247   --  Gdk.Window.Get_Toplevel will most likely not do what you expect if there
1248   --  are offscreen windows in the hierarchy.
1249
1250   function Get_Type_Hint
1251      (Self : Gdk.Gdk_Window) return Gdk_Window_Type_Hint;
1252   pragma Import (C, Get_Type_Hint, "gdk_window_get_type_hint");
1253   --  This function returns the type hint set for a window.
1254   --  Since: gtk+ 2.10
1255
1256   procedure Set_Type_Hint
1257      (Self : Gdk.Gdk_Window;
1258       Hint : Gdk_Window_Type_Hint);
1259   pragma Import (C, Set_Type_Hint, "gdk_window_set_type_hint");
1260   --  The application can use this call to provide a hint to the window
1261   --  manager about the functionality of a window. The window manager can use
1262   --  this information when determining the decoration and behaviour of the
1263   --  window.
1264   --  The hint must be set before the window is mapped.
1265   --  "hint": A hint of the function this window will have
1266
1267   function Get_Update_Area
1268      (Self : Gdk.Gdk_Window) return Cairo.Region.Cairo_Region;
1269   pragma Import (C, Get_Update_Area, "gdk_window_get_update_area");
1270   --  Transfers ownership of the update area from Window to the caller of the
1271   --  function. That is, after calling this function, Window will no longer
1272   --  have an invalid/dirty region; the update area is removed from Window and
1273   --  handed to you. If a window has no update area,
1274   --  Gdk.Window.Get_Update_Area returns null. You are responsible for calling
1275   --  cairo_region_destroy on the returned region if it's non-null.
1276
1277   function Get_Visible_Region
1278      (Self : Gdk.Gdk_Window) return Cairo.Region.Cairo_Region;
1279   pragma Import (C, Get_Visible_Region, "gdk_window_get_visible_region");
1280   --  Computes the region of the Window that is potentially visible. This
1281   --  does not necessarily take into account if the window is obscured by
1282   --  other windows, but no area outside of this region is visible.
1283
1284   function Get_Visual (Self : Gdk.Gdk_Window) return Gdk.Visual.Gdk_Visual;
1285   pragma Import (C, Get_Visual, "gdk_window_get_visual");
1286   --  Gets the Gdk.Visual.Gdk_Visual describing the pixel format of Window.
1287   --  Since: gtk+ 2.24
1288
1289   function Get_Width (Self : Gdk.Gdk_Window) return Gint;
1290   pragma Import (C, Get_Width, "gdk_window_get_width");
1291   --  Returns the width of the given Window.
1292   --  On the X11 platform the returned size is the size reported in the
1293   --  most-recently-processed configure event, rather than the current size on
1294   --  the X server.
1295   --  Since: gtk+ 2.24
1296
1297   function Get_Window_Type (Self : Gdk.Gdk_Window) return Gdk_Window_Type;
1298   pragma Import (C, Get_Window_Type, "gdk_window_get_window_type");
1299   --  Gets the type of the window. See Gdk.Window.Gdk_Window_Type.
1300
1301   function Has_Native (Self : Gdk.Gdk_Window) return Boolean;
1302   --  Checks whether the window has a native window or not. Note that you can
1303   --  use Gdk.Window.Ensure_Native if a native window is needed.
1304   --  Since: gtk+ 2.22
1305
1306   procedure Hide (Self : Gdk.Gdk_Window);
1307   pragma Import (C, Hide, "gdk_window_hide");
1308   --  For toplevel windows, withdraws them, so they will no longer be known
1309   --  to the window manager; for all windows, unmaps them, so they won't be
1310   --  displayed. Normally done automatically as part of Gtk.Widget.Hide.
1311
1312   procedure Iconify (Self : Gdk.Gdk_Window);
1313   pragma Import (C, Iconify, "gdk_window_iconify");
1314   --  Asks to iconify (minimize) Window. The window manager may choose to
1315   --  ignore the request, but normally will honor it. Using Gtk.Window.Iconify
1316   --  is preferred, if you have a Gtk.Window.Gtk_Window widget.
1317   --  This function only makes sense when Window is a toplevel window.
1318
1319   procedure Input_Shape_Combine_Region
1320      (Self         : Gdk.Gdk_Window;
1321       Shape_Region : Cairo.Region.Cairo_Region;
1322       Offset_X     : Gint;
1323       Offset_Y     : Gint);
1324   pragma Import (C, Input_Shape_Combine_Region, "gdk_window_input_shape_combine_region");
1325   --  Like Gdk.Window.Shape_Combine_Region, but the shape applies only to
1326   --  event handling. Mouse events which happen while the pointer position
1327   --  corresponds to an unset bit in the mask will be passed on the window
1328   --  below Window.
1329   --  An input shape is typically used with RGBA windows. The alpha channel
1330   --  of the window defines which pixels are invisible and allows for nicely
1331   --  antialiased borders, and the input shape controls where the window is
1332   --  "clickable".
1333   --  On the X11 platform, this requires version 1.1 of the shape extension.
1334   --  On the Win32 platform, this functionality is not present and the
1335   --  function does nothing.
1336   --  Since: gtk+ 2.10
1337   --  "shape_region": region of window to be non-transparent
1338   --  "offset_x": X position of Shape_Region in Window coordinates
1339   --  "offset_y": Y position of Shape_Region in Window coordinates
1340
1341   procedure Invalidate_Maybe_Recurse
1342      (Self       : Gdk.Gdk_Window;
1343       Region     : Cairo.Region.Cairo_Region;
1344       Child_Func : Gdk_Window_Child_Func);
1345   --  Adds Region to the update area for Window. The update area is the
1346   --  region that needs to be redrawn, or "dirty region." The call
1347   --  Gdk.Window.Process_Updates sends one or more expose events to the
1348   --  window, which together cover the entire update area. An application
1349   --  would normally redraw the contents of Window in response to those expose
1350   --  events.
1351   --  GDK will call Gdk.Window.Process_All_Updates on your behalf whenever
1352   --  your program returns to the main loop and becomes idle, so normally
1353   --  there's no need to do that manually, you just need to invalidate regions
1354   --  that you know should be redrawn.
1355   --  The Child_Func parameter controls whether the region of each child
1356   --  window that intersects Region will also be invalidated. Only children
1357   --  for which Child_Func returns TRUE will have the area invalidated.
1358   --  "region": a cairo_region_t
1359   --  "child_func": function to use to decide if to recurse to a child, null
1360   --  means never recurse.
1361
1362   generic
1363      type User_Data_Type (<>) is private;
1364      with procedure Destroy (Data : in out User_Data_Type) is null;
1365   package Invalidate_Maybe_Recurse_User_Data is
1366
1367      type Gdk_Window_Child_Func is access function
1368        (Window    : Gdk.Gdk_Window;
1369         User_Data : User_Data_Type) return Boolean;
1370      --  A function of this type is passed to
1371      --  Gdk.Window.Invalidate_Maybe_Recurse. It gets called for each child of
1372      --  the window to determine whether to recursively invalidate it or now.
1373      --  "window": a Gdk.Gdk_Window
1374      --  "user_data": user data
1375
1376      procedure Invalidate_Maybe_Recurse
1377         (Self       : Gdk.Gdk_Window;
1378          Region     : Cairo.Region.Cairo_Region;
1379          Child_Func : Gdk_Window_Child_Func;
1380          User_Data  : User_Data_Type);
1381      --  Adds Region to the update area for Window. The update area is the
1382      --  region that needs to be redrawn, or "dirty region." The call
1383      --  Gdk.Window.Process_Updates sends one or more expose events to the
1384      --  window, which together cover the entire update area. An application
1385      --  would normally redraw the contents of Window in response to those
1386      --  expose events.
1387      --  GDK will call Gdk.Window.Process_All_Updates on your behalf whenever
1388      --  your program returns to the main loop and becomes idle, so normally
1389      --  there's no need to do that manually, you just need to invalidate
1390      --  regions that you know should be redrawn.
1391      --  The Child_Func parameter controls whether the region of each child
1392      --  window that intersects Region will also be invalidated. Only children
1393      --  for which Child_Func returns TRUE will have the area invalidated.
1394      --  "region": a cairo_region_t
1395      --  "child_func": function to use to decide if to recurse to a child,
1396      --  null means never recurse.
1397      --  "user_data": data passed to Child_Func
1398
1399   end Invalidate_Maybe_Recurse_User_Data;
1400
1401   procedure Invalidate_Rect
1402      (Self                : Gdk.Gdk_Window;
1403       Rect                : Gdk.Rectangle.Gdk_Rectangle;
1404       Invalidate_Children : Boolean);
1405   --  A convenience wrapper around Gdk.Window.Invalidate_Region which
1406   --  invalidates a rectangular region. See Gdk.Window.Invalidate_Region for
1407   --  details.
1408   --  "rect": rectangle to invalidate or null to invalidate the whole window
1409   --  "invalidate_children": whether to also invalidate child windows
1410
1411   procedure Invalidate_Region
1412      (Self                : Gdk.Gdk_Window;
1413       Region              : Cairo.Region.Cairo_Region;
1414       Invalidate_Children : Boolean);
1415   --  Adds Region to the update area for Window. The update area is the
1416   --  region that needs to be redrawn, or "dirty region." The call
1417   --  Gdk.Window.Process_Updates sends one or more expose events to the
1418   --  window, which together cover the entire update area. An application
1419   --  would normally redraw the contents of Window in response to those expose
1420   --  events.
1421   --  GDK will call Gdk.Window.Process_All_Updates on your behalf whenever
1422   --  your program returns to the main loop and becomes idle, so normally
1423   --  there's no need to do that manually, you just need to invalidate regions
1424   --  that you know should be redrawn.
1425   --  The Invalidate_Children parameter controls whether the region of each
1426   --  child window that intersects Region will also be invalidated. If False,
1427   --  then the update area for child windows will remain unaffected. See
1428   --  gdk_window_invalidate_maybe_recurse if you need fine grained control
1429   --  over which children are invalidated.
1430   --  "region": a cairo_region_t
1431   --  "invalidate_children": True to also invalidate child windows
1432
1433   function Is_Destroyed (Self : Gdk.Gdk_Window) return Boolean;
1434   --  Check to see if a window is destroyed..
1435   --  Since: gtk+ 2.18
1436
1437   function Is_Input_Only (Self : Gdk.Gdk_Window) return Boolean;
1438   --  Determines whether or not the window is an input only window.
1439   --  Since: gtk+ 2.22
1440
1441   function Is_Shaped (Self : Gdk.Gdk_Window) return Boolean;
1442   --  Determines whether or not the window is shaped.
1443   --  Since: gtk+ 2.22
1444
1445   function Is_Viewable (Self : Gdk.Gdk_Window) return Boolean;
1446   --  Check if the window and all ancestors of the window are mapped. (This
1447   --  is not necessarily "viewable" in the X sense, since we only check as far
1448   --  as we have GDK window parents, not to the root window.)
1449
1450   function Is_Visible (Self : Gdk.Gdk_Window) return Boolean;
1451   --  Checks whether the window has been mapped (with Gdk.Window.Show or
1452   --  Gdk.Window.Show_Unraised).
1453
1454   procedure Lower (Self : Gdk.Gdk_Window);
1455   pragma Import (C, Lower, "gdk_window_lower");
1456   --  Lowers Window to the bottom of the Z-order (stacking order), so that
1457   --  other windows with the same parent window appear above Window. This is
1458   --  true whether or not the other windows are visible.
1459   --  If Window is a toplevel, the window manager may choose to deny the
1460   --  request to move the window in the Z-order, Gdk.Window.Lower only
1461   --  requests the restack, does not guarantee it.
1462   --  Note that Gdk.Window.Show raises the window again, so don't call this
1463   --  function before Gdk.Window.Show. (Try Gdk.Window.Show_Unraised.)
1464
1465   procedure Maximize (Self : Gdk.Gdk_Window);
1466   pragma Import (C, Maximize, "gdk_window_maximize");
1467   --  Maximizes the window. If the window was already maximized, then this
1468   --  function does nothing.
1469   --  On X11, asks the window manager to maximize Window, if the window
1470   --  manager supports this operation. Not all window managers support this,
1471   --  and some deliberately ignore it or don't have a concept of "maximized";
1472   --  so you can't rely on the maximization actually happening. But it will
1473   --  happen with most standard window managers, and GDK makes a best effort
1474   --  to get it to happen.
1475   --  On Windows, reliably maximizes the window.
1476
1477   procedure Merge_Child_Input_Shapes (Self : Gdk.Gdk_Window);
1478   pragma Import (C, Merge_Child_Input_Shapes, "gdk_window_merge_child_input_shapes");
1479   --  Merges the input shape masks for any child windows into the input shape
1480   --  mask for Window. i.e. the union of all input masks for Window and its
1481   --  children will become the new input mask for Window. See
1482   --  Gdk.Window.Input_Shape_Combine_Region.
1483   --  This function is distinct from Gdk.Window.Set_Child_Input_Shapes
1484   --  because it includes Window's input shape mask in the set of shapes to be
1485   --  merged.
1486   --  Since: gtk+ 2.10
1487
1488   procedure Merge_Child_Shapes (Self : Gdk.Gdk_Window);
1489   pragma Import (C, Merge_Child_Shapes, "gdk_window_merge_child_shapes");
1490   --  Merges the shape masks for any child windows into the shape mask for
1491   --  Window. i.e. the union of all masks for Window and its children will
1492   --  become the new mask for Window. See Gdk.Window.Shape_Combine_Region.
1493   --  This function is distinct from Gdk.Window.Set_Child_Shapes because it
1494   --  includes Window's shape mask in the set of shapes to be merged.
1495
1496   procedure Move (Self : Gdk.Gdk_Window; X : Gint; Y : Gint);
1497   pragma Import (C, Move, "gdk_window_move");
1498   --  Repositions a window relative to its parent window. For toplevel
1499   --  windows, window managers may ignore or modify the move; you should
1500   --  probably use Gtk.Window.Move on a Gtk.Window.Gtk_Window widget anyway,
1501   --  instead of using GDK functions. For child windows, the move will
1502   --  reliably succeed.
1503   --  If you're also planning to resize the window, use
1504   --  Gdk.Window.Move_Resize to both move and resize simultaneously, for a
1505   --  nicer visual effect.
1506   --  "x": X coordinate relative to window's parent
1507   --  "y": Y coordinate relative to window's parent
1508
1509   procedure Move_Region
1510      (Self   : Gdk.Gdk_Window;
1511       Region : Cairo.Region.Cairo_Region;
1512       Dx     : Gint;
1513       Dy     : Gint);
1514   pragma Import (C, Move_Region, "gdk_window_move_region");
1515   --  Move the part of Window indicated by Region by Dy pixels in the Y
1516   --  direction and Dx pixels in the X direction. The portions of Region that
1517   --  not covered by the new position of Region are invalidated.
1518   --  Child windows are not moved.
1519   --  Since: gtk+ 2.8
1520   --  "region": The cairo_region_t to move
1521   --  "dx": Amount to move in the X direction
1522   --  "dy": Amount to move in the Y direction
1523
1524   procedure Move_Resize
1525      (Self   : Gdk.Gdk_Window;
1526       X      : Gint;
1527       Y      : Gint;
1528       Width  : Gint;
1529       Height : Gint);
1530   pragma Import (C, Move_Resize, "gdk_window_move_resize");
1531   --  Equivalent to calling Gdk.Window.Move and Gdk.Window.Resize, except
1532   --  that both operations are performed at once, avoiding strange visual
1533   --  effects. (i.e. the user may be able to see the window first move, then
1534   --  resize, if you don't use Gdk.Window.Move_Resize.)
1535   --  "x": new X position relative to window's parent
1536   --  "y": new Y position relative to window's parent
1537   --  "width": new width
1538   --  "height": new height
1539
1540   function Peek_Children
1541      (Self : Gdk.Gdk_Window) return Gdk_Window_List.Glist;
1542   --  Like Gdk.Window.Get_Children, but does not copy the list of children,
1543   --  so the list does not need to be freed.
1544
1545   procedure Process_Updates
1546      (Self            : Gdk.Gdk_Window;
1547       Update_Children : Boolean);
1548   --  Sends one or more expose events to Window. The areas in each expose
1549   --  event will cover the entire update area for the window (see
1550   --  Gdk.Window.Invalidate_Region for details). Normally GDK calls
1551   --  Gdk.Window.Process_All_Updates on your behalf, so there's no need to
1552   --  call this function unless you want to force expose events to be
1553   --  delivered immediately and synchronously (vs. the usual case, where GDK
1554   --  delivers them in an idle handler). Occasionally this is useful to
1555   --  produce nicer scrolling behavior, for example.
1556   --  "update_children": whether to also process updates for child windows
1557
1558   procedure Gdk_Raise (Self : Gdk.Gdk_Window);
1559   pragma Import (C, Gdk_Raise, "gdk_window_raise");
1560   --  Raises Window to the top of the Z-order (stacking order), so that other
1561   --  windows with the same parent window appear below Window. This is true
1562   --  whether or not the windows are visible.
1563   --  If Window is a toplevel, the window manager may choose to deny the
1564   --  request to move the window in the Z-order, Gdk.Window.Gdk_Raise only
1565   --  requests the restack, does not guarantee it.
1566
1567   procedure Register_Dnd (Self : Gdk.Gdk_Window);
1568   pragma Import (C, Register_Dnd, "gdk_window_register_dnd");
1569   --  Registers a window as a potential drop destination.
1570
1571   procedure Reparent
1572      (Self       : Gdk.Gdk_Window;
1573       New_Parent : Gdk.Gdk_Window;
1574       X          : Gint;
1575       Y          : Gint);
1576   pragma Import (C, Reparent, "gdk_window_reparent");
1577   --  Reparents Window into the given New_Parent. The window being reparented
1578   --  will be unmapped as a side effect.
1579   --  "new_parent": new parent to move Window into
1580   --  "x": X location inside the new parent
1581   --  "y": Y location inside the new parent
1582
1583   procedure Resize (Self : Gdk.Gdk_Window; Width : Gint; Height : Gint);
1584   pragma Import (C, Resize, "gdk_window_resize");
1585   --  Resizes Window; for toplevel windows, asks the window manager to resize
1586   --  the window. The window manager may not allow the resize. When using
1587   --  GTK+, use Gtk.Window.Resize instead of this low-level GDK function.
1588   --  Windows may not be resized below 1x1.
1589   --  If you're also planning to move the window, use Gdk.Window.Move_Resize
1590   --  to both move and resize simultaneously, for a nicer visual effect.
1591   --  "width": new width of the window
1592   --  "height": new height of the window
1593
1594   procedure Restack
1595      (Self    : Gdk.Gdk_Window;
1596       Sibling : Gdk.Gdk_Window;
1597       Above   : Boolean);
1598   --  Changes the position of Window in the Z-order (stacking order), so that
1599   --  it is above Sibling (if Above is True) or below Sibling (if Above is
1600   --  False).
1601   --  If Sibling is null, then this either raises (if Above is True) or
1602   --  lowers the window.
1603   --  If Window is a toplevel, the window manager may choose to deny the
1604   --  request to move the window in the Z-order, Gdk.Window.Restack only
1605   --  requests the restack, does not guarantee it.
1606   --  Since: gtk+ 2.18
1607   --  "sibling": a Gdk.Gdk_Window that is a sibling of Window, or null
1608   --  "above": a boolean
1609
1610   procedure Scroll (Self : Gdk.Gdk_Window; Dx : Gint; Dy : Gint);
1611   pragma Import (C, Scroll, "gdk_window_scroll");
1612   --  Scroll the contents of Window, both pixels and children, by the given
1613   --  amount. Window itself does not move. Portions of the window that the
1614   --  scroll operation brings in from offscreen areas are invalidated. The
1615   --  invalidated region may be bigger than what would strictly be necessary.
1616   --  For X11, a minimum area will be invalidated if the window has no
1617   --  subwindows, or if the edges of the window's parent do not extend beyond
1618   --  the edges of the window. In other cases, a multi-step process is used to
1619   --  scroll the window which may produce temporary visual artifacts and
1620   --  unnecessary invalidations.
1621   --  "dx": Amount to scroll in the X direction
1622   --  "dy": Amount to scroll in the Y direction
1623
1624   procedure Set_Background
1625      (Self  : Gdk.Gdk_Window;
1626       Color : Gdk.Color.Gdk_Color);
1627   pragma Import (C, Set_Background, "gdk_window_set_background");
1628   pragma Obsolescent (Set_Background);
1629   --  Sets the background color of Window. (However, when using GTK+, set the
1630   --  background of a widget with Gtk.Widget.Modify_Bg - if you're an
1631   --  application - or Gtk.Style.Set_Background - if you're implementing a
1632   --  custom widget.)
1633   --  See also Gdk.Window.Set_Background_Pattern.
1634   --  Deprecated since 3.4, 1
1635   --  "color": a Gdk.Color.Gdk_Color
1636
1637   procedure Set_Background_Rgba
1638      (Self : Gdk.Gdk_Window;
1639       Rgba : Gdk.RGBA.Gdk_RGBA);
1640   pragma Import (C, Set_Background_Rgba, "gdk_window_set_background_rgba");
1641   --  Sets the background color of Window.
1642   --  See also Gdk.Window.Set_Background_Pattern.
1643   --  "rgba": a Gdk.RGBA.Gdk_RGBA color
1644
1645   procedure Set_Child_Input_Shapes (Self : Gdk.Gdk_Window);
1646   pragma Import (C, Set_Child_Input_Shapes, "gdk_window_set_child_input_shapes");
1647   --  Sets the input shape mask of Window to the union of input shape masks
1648   --  for all children of Window, ignoring the input shape mask of Window
1649   --  itself. Contrast with Gdk.Window.Merge_Child_Input_Shapes which includes
1650   --  the input shape mask of Window in the masks to be merged.
1651   --  Since: gtk+ 2.10
1652
1653   procedure Set_Child_Shapes (Self : Gdk.Gdk_Window);
1654   pragma Import (C, Set_Child_Shapes, "gdk_window_set_child_shapes");
1655   --  Sets the shape mask of Window to the union of shape masks for all
1656   --  children of Window, ignoring the shape mask of Window itself. Contrast
1657   --  with Gdk.Window.Merge_Child_Shapes which includes the shape mask of
1658   --  Window in the masks to be merged.
1659
1660   procedure Set_Functions
1661      (Self      : Gdk.Gdk_Window;
1662       Functions : Gdk_WMFunction);
1663   pragma Import (C, Set_Functions, "gdk_window_set_functions");
1664   --  Sets hints about the window management functions to make available via
1665   --  buttons on the window frame.
1666   --  On the X backend, this function sets the traditional Motif window
1667   --  manager hint for this purpose. However, few window managers do anything
1668   --  reliable or interesting with this hint. Many ignore it entirely.
1669   --  The Functions argument is the logical OR of values from the
1670   --  Gdk.Window.Gdk_WMFunction enumeration. If the bitmask includes
1671   --  GDK_FUNC_ALL, then the other bits indicate which functions to disable;
1672   --  if it doesn't include GDK_FUNC_ALL, it indicates which functions to
1673   --  enable.
1674   --  "functions": bitmask of operations to allow on Window
1675
1676   procedure Set_Geometry_Hints
1677      (Self      : Gdk.Gdk_Window;
1678       Geometry  : Gdk_Geometry;
1679       Geom_Mask : Gdk_Window_Hints);
1680   pragma Import (C, Set_Geometry_Hints, "gdk_window_set_geometry_hints");
1681   --  Sets the geometry hints for Window. Hints flagged in Geom_Mask are set,
1682   --  hints not flagged in Geom_Mask are unset. To unset all hints, use a
1683   --  Geom_Mask of 0 and a Geometry of null.
1684   --  This function provides hints to the windowing system about acceptable
1685   --  sizes for a toplevel window. The purpose of this is to constrain user
1686   --  resizing, but the windowing system will typically (but is not required
1687   --  to) also constrain the current size of the window to the provided values
1688   --  and constrain programatic resizing via Gdk.Window.Resize or
1689   --  Gdk.Window.Move_Resize.
1690   --  Note that on X11, this effect has no effect on windows of type
1691   --  Gdk.Window_Temp or windows where override redirect has been turned on
1692   --  via Gdk.Window.Set_Override_Redirect since these windows are not
1693   --  resizable by the user.
1694   --  Since you can't count on the windowing system doing the constraints for
1695   --  programmatic resizes, you should generally call
1696   --  Gdk.Window.Constrain_Size yourself to determine appropriate sizes.
1697   --  "geometry": geometry hints
1698   --  "geom_mask": bitmask indicating fields of Geometry to pay attention to
1699
1700   procedure Set_Icon_Name (Self : Gdk.Gdk_Window; Name : UTF8_String := "");
1701   --  Windows may have a name used while minimized, distinct from the name
1702   --  they display in their titlebar. Most of the time this is a bad idea from
1703   --  a user interface standpoint. But you can set such a name with this
1704   --  function, if you like.
1705   --  After calling this with a non-null Name, calls to Gdk.Window.Set_Title
1706   --  will not update the icon title.
1707   --  Using null for Name unsets the icon title; further calls to
1708   --  Gdk.Window.Set_Title will again update the icon title as well.
1709   --  "name": name of window while iconified (minimized)
1710
1711   procedure Set_Invalidate_Handler
1712      (Self    : Gdk.Gdk_Window;
1713       Handler : Gdk_Window_Invalidate_Handler_Func);
1714   --  Registers an invalidate handler for a specific window. This will get
1715   --  called whenever a region in the window or its children is invalidated.
1716   --  This can be used to record the invalidated region, which is useful if
1717   --  you are keeping an offscreen copy of some region and want to keep it up
1718   --  to date. You can also modify the invalidated region in case you're doing
1719   --  some effect where e.g. a child widget appears in multiple places.
1720   --  Since: gtk+ 3.10
1721   --  "handler": a Gdk_Window_Invalidate_Handler_Func callback function
1722
1723   procedure Set_Keep_Above (Self : Gdk.Gdk_Window; Setting : Boolean);
1724   --  Set if Window must be kept above other windows. If the window was
1725   --  already above, then this function does nothing.
1726   --  On X11, asks the window manager to keep Window above, if the window
1727   --  manager supports this operation. Not all window managers support this,
1728   --  and some deliberately ignore it or don't have a concept of "keep above";
1729   --  so you can't rely on the window being kept above. But it will happen
1730   --  with most standard window managers, and GDK makes a best effort to get
1731   --  it to happen.
1732   --  Since: gtk+ 2.4
1733   --  "setting": whether to keep Window above other windows
1734
1735   procedure Set_Keep_Below (Self : Gdk.Gdk_Window; Setting : Boolean);
1736   --  Set if Window must be kept below other windows. If the window was
1737   --  already below, then this function does nothing.
1738   --  On X11, asks the window manager to keep Window below, if the window
1739   --  manager supports this operation. Not all window managers support this,
1740   --  and some deliberately ignore it or don't have a concept of "keep below";
1741   --  so you can't rely on the window being kept below. But it will happen
1742   --  with most standard window managers, and GDK makes a best effort to get
1743   --  it to happen.
1744   --  Since: gtk+ 2.4
1745   --  "setting": whether to keep Window below other windows
1746
1747   procedure Set_Opacity (Self : Gdk.Gdk_Window; Opacity : Gdouble);
1748   pragma Import (C, Set_Opacity, "gdk_window_set_opacity");
1749   --  Set Window to render as partially transparent, with opacity 0 being
1750   --  fully transparent and 1 fully opaque. (Values of the opacity parameter
1751   --  are clamped to the [0,1] range.)
1752   --  For toplevel windows this depends on support from the windowing system
1753   --  that may not always be there. For instance, On X11, this works only on X
1754   --  screens with a compositing manager running.
1755   --  For child windows this function only works for non-native windows.
1756   --  For setting up per-pixel alpha topelevels, see
1757   --  Gdk.Screen.Get_Rgba_Visual, and for non-toplevels, see
1758   --  Gdk.Window.Set_Composited.
1759   --  Support for non-toplevel windows was added in 3.8.
1760   --  Since: gtk+ 2.12
1761   --  "opacity": opacity
1762
1763   procedure Set_Opaque_Region
1764      (Self   : Gdk.Gdk_Window;
1765       Region : Cairo.Region.Cairo_Region);
1766   pragma Import (C, Set_Opaque_Region, "gdk_window_set_opaque_region");
1767   --  For optimizization purposes, compositing window managers may like to
1768   --  not draw obscured regions of windows, or turn off blending during for
1769   --  these regions. With RGB windows with no transparency, this is just the
1770   --  shape of the window, but with ARGB32 windows, the compositor does not
1771   --  know what regions of the window are transparent or not.
1772   --  This function only works for toplevel windows.
1773   --  GTK+ will automatically update this property automatically if the
1774   --  Window background is opaque, as we know where the opaque regions are. If
1775   --  your window background is not opaque, please update this property in
1776   --  your Gtk.Widget.Gtk_Widget::style-updated handler.
1777   --  Since: gtk+ 3.10
1778   --  "region": a region
1779
1780   procedure Set_Override_Redirect
1781      (Self              : Gdk.Gdk_Window;
1782       Override_Redirect : Boolean);
1783   --  An override redirect window is not under the control of the window
1784   --  manager. This means it won't have a titlebar, won't be minimizable, etc.
1785   --  - it will be entirely under the control of the application. The window
1786   --  manager can't see the override redirect window at all.
1787   --  Override redirect should only be used for short-lived temporary
1788   --  windows, such as popup menus. Gtk.Menu.Gtk_Menu uses an override
1789   --  redirect window in its implementation, for example.
1790   --  "override_redirect": True if window should be override redirect
1791
1792   procedure Set_Role (Self : Gdk.Gdk_Window; Role : UTF8_String);
1793   --  When using GTK+, typically you should use Gtk.Window.Set_Role instead
1794   --  of this low-level function.
1795   --  The window manager and session manager use a window's role to
1796   --  distinguish it from other kinds of window in the same application. When
1797   --  an application is restarted after being saved in a previous session, all
1798   --  windows with the same title and role are treated as interchangeable. So
1799   --  if you have two windows with the same title that should be distinguished
1800   --  for session management purposes, you should set the role on those
1801   --  windows. It doesn't matter what string you use for the role, as long as
1802   --  you have a different role for each non-interchangeable kind of window.
1803   --  "role": a string indicating its role
1804
1805   procedure Set_Shadow_Width
1806      (Self   : Gdk.Gdk_Window;
1807       Left   : Gint;
1808       Right  : Gint;
1809       Top    : Gint;
1810       Bottom : Gint);
1811   pragma Import (C, Set_Shadow_Width, "gdk_window_set_shadow_width");
1812   --  Newer GTK+ windows using client-side decorations use extra geometry
1813   --  around their frames for effects like shadows and invisible borders.
1814   --  Window managers that want to maximize windows or snap to edges need to
1815   --  know where the extents of the actual frame lie, so that users don't feel
1816   --  like windows are snapping against random invisible edges.
1817   --  Note that this property is automatically updated by GTK+, so this
1818   --  function should only be used by applications which do not use GTK+ to
1819   --  create toplevel windows.
1820   --  Since: gtk+ 3.12
1821   --  "left": The left extent
1822   --  "right": The right extent
1823   --  "top": The top extent
1824   --  "bottom": The bottom extent
1825
1826   procedure Set_Skip_Pager_Hint
1827      (Self        : Gdk.Gdk_Window;
1828       Skips_Pager : Boolean);
1829   --  Toggles whether a window should appear in a pager (workspace switcher,
1830   --  or other desktop utility program that displays a small thumbnail
1831   --  representation of the windows on the desktop). If a window's semantic
1832   --  type as specified with Gdk.Window.Set_Type_Hint already fully describes
1833   --  the window, this function should not be called in addition, instead you
1834   --  should allow the window to be treated according to standard policy for
1835   --  its semantic type.
1836   --  Since: gtk+ 2.2
1837   --  "skips_pager": True to skip the pager
1838
1839   procedure Set_Skip_Taskbar_Hint
1840      (Self          : Gdk.Gdk_Window;
1841       Skips_Taskbar : Boolean);
1842   --  Toggles whether a window should appear in a task list or window list.
1843   --  If a window's semantic type as specified with Gdk.Window.Set_Type_Hint
1844   --  already fully describes the window, this function should not be called
1845   --  in addition, instead you should allow the window to be treated according
1846   --  to standard policy for its semantic type.
1847   --  Since: gtk+ 2.2
1848   --  "skips_taskbar": True to skip the taskbar
1849
1850   procedure Set_Startup_Id
1851      (Self       : Gdk.Gdk_Window;
1852       Startup_Id : UTF8_String);
1853   --  When using GTK+, typically you should use Gtk.Window.Set_Startup_Id
1854   --  instead of this low-level function.
1855   --  Since: gtk+ 2.12
1856   --  "startup_id": a string with startup-notification identifier
1857
1858   function Set_Static_Gravities
1859      (Self       : Gdk.Gdk_Window;
1860       Use_Static : Boolean) return Boolean;
1861   --  Set the bit gravity of the given window to static, and flag it so all
1862   --  children get static subwindow gravity. This is used if you are
1863   --  implementing scary features that involve deep knowledge of the windowing
1864   --  system. Don't worry about it unless you have to.
1865   --  "use_static": True to turn on static gravity
1866
1867   procedure Set_Title (Self : Gdk.Gdk_Window; Title : UTF8_String);
1868   --  Sets the title of a toplevel window, to be displayed in the titlebar.
1869   --  If you haven't explicitly set the icon name for the window (using
1870   --  Gdk.Window.Set_Icon_Name), the icon name will be set to Title as well.
1871   --  Title must be in UTF-8 encoding (as with all user-readable strings in
1872   --  GDK/GTK+). Title may not be null.
1873   --  "title": title of Window
1874
1875   procedure Set_Transient_For
1876      (Self   : Gdk.Gdk_Window;
1877       Parent : Gdk.Gdk_Window);
1878   pragma Import (C, Set_Transient_For, "gdk_window_set_transient_for");
1879   --  Indicates to the window manager that Window is a transient dialog
1880   --  associated with the application window Parent. This allows the window
1881   --  manager to do things like center Window on Parent and keep Window above
1882   --  Parent.
1883   --  See Gtk.Window.Set_Transient_For if you're using Gtk.Window.Gtk_Window
1884   --  or Gtk.Dialog.Gtk_Dialog.
1885   --  "parent": another toplevel Gdk.Gdk_Window
1886
1887   procedure Set_Urgency_Hint (Self : Gdk.Gdk_Window; Urgent : Boolean);
1888   --  Toggles whether a window needs the user's urgent attention.
1889   --  Since: gtk+ 2.8
1890   --  "urgent": True if the window is urgent
1891
1892   procedure Set_User_Data
1893      (Self      : Gdk.Gdk_Window;
1894       User_Data : System.Address);
1895   pragma Import (C, Set_User_Data, "gdk_window_set_user_data");
1896   --  For most purposes this function is deprecated in favor of
1897   --  g_object_set_data. However, for historical reasons GTK+ stores the
1898   --  Gtk.Widget.Gtk_Widget that owns a Gdk.Gdk_Window as user data on the
1899   --  Gdk.Gdk_Window. So, custom widget implementations should use this
1900   --  function for that. If GTK+ receives an event for a Gdk.Gdk_Window, and
1901   --  the user data for the window is non-null, GTK+ will assume the user data
1902   --  is a Gtk.Widget.Gtk_Widget, and forward the event to that widget.
1903   --  "user_data": user data
1904
1905   procedure Shape_Combine_Region
1906      (Self         : Gdk.Gdk_Window;
1907       Shape_Region : Cairo.Region.Cairo_Region;
1908       Offset_X     : Gint;
1909       Offset_Y     : Gint);
1910   pragma Import (C, Shape_Combine_Region, "gdk_window_shape_combine_region");
1911   --  Makes pixels in Window outside Shape_Region be transparent, so that the
1912   --  window may be nonrectangular.
1913   --  If Shape_Region is null, the shape will be unset, so the whole window
1914   --  will be opaque again. Offset_X and Offset_Y are ignored if Shape_Region
1915   --  is null.
1916   --  On the X11 platform, this uses an X server extension which is widely
1917   --  available on most common platforms, but not available on very old X
1918   --  servers, and occasionally the implementation will be buggy. On servers
1919   --  without the shape extension, this function will do nothing.
1920   --  This function works on both toplevel and child windows.
1921   --  "shape_region": region of window to be non-transparent
1922   --  "offset_x": X position of Shape_Region in Window coordinates
1923   --  "offset_y": Y position of Shape_Region in Window coordinates
1924
1925   procedure Show (Self : Gdk.Gdk_Window);
1926   pragma Import (C, Show, "gdk_window_show");
1927   --  Like Gdk.Window.Show_Unraised, but also raises the window to the top of
1928   --  the window stack (moves the window to the front of the Z-order).
1929   --  This function maps a window so it's visible onscreen. Its opposite is
1930   --  Gdk.Window.Hide.
1931   --  When implementing a Gtk.Widget.Gtk_Widget, you should call this
1932   --  function on the widget's Gdk.Gdk_Window as part of the "map" method.
1933
1934   procedure Show_Unraised (Self : Gdk.Gdk_Window);
1935   pragma Import (C, Show_Unraised, "gdk_window_show_unraised");
1936   --  Shows a Gdk.Gdk_Window onscreen, but does not modify its stacking
1937   --  order. In contrast, Gdk.Window.Show will raise the window to the top of
1938   --  the window stack.
1939   --  On the X11 platform, in Xlib terms, this function calls XMapWindow (it
1940   --  also updates some internal GDK state, which means that you can't really
1941   --  use XMapWindow directly on a GDK window).
1942
1943   function Show_Window_Menu
1944      (Self  : Gdk.Gdk_Window;
1945       Event : Gdk.Event.Gdk_Event) return Boolean;
1946   --  Asks the windowing system to show the window menu. The window menu is
1947   --  the menu shown when right-clicking the titlebar on traditional windows
1948   --  managed by the window manager. This is useful for windows using
1949   --  client-side decorations, activating it with a right-click on the window
1950   --  decorations.
1951   --  Since: gtk+ 3.14
1952   --  "event": a Gdk.Event.Gdk_Event to show the menu for
1953
1954   procedure Stick (Self : Gdk.Gdk_Window);
1955   pragma Import (C, Stick, "gdk_window_stick");
1956   --  "Pins" a window such that it's on all workspaces and does not scroll
1957   --  with viewports, for window managers that have scrollable viewports.
1958   --  (When using Gtk.Window.Gtk_Window, Gtk.Window.Stick may be more useful.)
1959   --  On the X11 platform, this function depends on window manager support,
1960   --  so may have no effect with many window managers. However, GDK will do
1961   --  the best it can to convince the window manager to stick the window. For
1962   --  window managers that don't support this operation, there's nothing you
1963   --  can do to force it to happen.
1964
1965   procedure Thaw_Toplevel_Updates_Libgtk_Only (Self : Gdk.Gdk_Window);
1966   pragma Import (C, Thaw_Toplevel_Updates_Libgtk_Only, "gdk_window_thaw_toplevel_updates_libgtk_only");
1967   --  Thaws a window frozen with
1968   --  Gdk.Window.Freeze_Toplevel_Updates_Libgtk_Only.
1969   --  This function is not part of the GDK public API and is only for use by
1970   --  GTK+.
1971
1972   procedure Thaw_Updates (Self : Gdk.Gdk_Window);
1973   pragma Import (C, Thaw_Updates, "gdk_window_thaw_updates");
1974   --  Thaws a window frozen with Gdk.Window.Freeze_Updates.
1975
1976   procedure Unfullscreen (Self : Gdk.Gdk_Window);
1977   pragma Import (C, Unfullscreen, "gdk_window_unfullscreen");
1978   --  Moves the window out of fullscreen mode. If the window was not
1979   --  fullscreen, does nothing.
1980   --  On X11, asks the window manager to move Window out of the fullscreen
1981   --  state, if the window manager supports this operation. Not all window
1982   --  managers support this, and some deliberately ignore it or don't have a
1983   --  concept of "fullscreen"; so you can't rely on the unfullscreenification
1984   --  actually happening. But it will happen with most standard window
1985   --  managers, and GDK makes a best effort to get it to happen.
1986   --  Since: gtk+ 2.2
1987
1988   procedure Unmaximize (Self : Gdk.Gdk_Window);
1989   pragma Import (C, Unmaximize, "gdk_window_unmaximize");
1990   --  Unmaximizes the window. If the window wasn't maximized, then this
1991   --  function does nothing.
1992   --  On X11, asks the window manager to unmaximize Window, if the window
1993   --  manager supports this operation. Not all window managers support this,
1994   --  and some deliberately ignore it or don't have a concept of "maximized";
1995   --  so you can't rely on the unmaximization actually happening. But it will
1996   --  happen with most standard window managers, and GDK makes a best effort
1997   --  to get it to happen.
1998   --  On Windows, reliably unmaximizes the window.
1999
2000   procedure Unstick (Self : Gdk.Gdk_Window);
2001   pragma Import (C, Unstick, "gdk_window_unstick");
2002   --  Reverse operation for Gdk.Window.Stick; see Gdk.Window.Stick, and
2003   --  Gtk.Window.Unstick.
2004
2005   procedure Withdraw (Self : Gdk.Gdk_Window);
2006   pragma Import (C, Withdraw, "gdk_window_withdraw");
2007   --  Withdraws a window (unmaps it and asks the window manager to forget
2008   --  about it). This function is not really useful as Gdk.Window.Hide
2009   --  automatically withdraws toplevel windows before hiding them.
2010
2011   ----------------------
2012   -- GtkAda additions --
2013   ----------------------
2014
2015   function Get_User_Data (Window : Gdk_Window) return Glib.Object.GObject;
2016   --  Return the widget to which events are reported when they happen on
2017   --  Window. This is the widget that was set through the call to
2018   --  Set_User_data.
2019
2020   procedure Set_User_Data
2021     (Window : Gdk_Window;
2022      Widget : access Glib.Object.GObject_Record'Class);
2023   --  Sets a special field in the window.
2024   --  All the events reported by the Xserver (or the Windows server) for
2025   --  Window will be redirected to Widget through the standard signals
2026   --  "expose_event", "button_press_event", ...
2027   --  You almost always need to call this function after creating a new
2028   --  Gdk_Window yourself, or you won't be able to handle the events.
2029
2030   procedure Ref (Window : Gdk_Window);
2031   procedure Unref (Window : Gdk_Window);
2032   pragma Import (C, Ref, "g_object_ref");
2033   pragma Import (C, Unref, "g_object_unref");
2034
2035   ---------------
2036   -- Functions --
2037   ---------------
2038
2039   procedure At_Pointer
2040      (Win_X  : out Gint;
2041       Win_Y  : out Gint;
2042       Window : out Gdk.Gdk_Window);
2043   pragma Obsolescent (At_Pointer);
2044   --  Obtains the window underneath the mouse pointer, returning the location
2045   --  of that window in Win_X, Win_Y. Returns null if the window under the
2046   --  mouse pointer is not known to GDK (if the window belongs to another
2047   --  application and a Gdk.Gdk_Window hasn't been created for it with
2048   --  gdk_window_foreign_new)
2049   --  NOTE: For multihead-aware widgets or applications use
2050   --  gdk_display_get_window_at_pointer instead.
2051   --  Deprecated since 3.0, 1
2052   --  "win_x": return location for origin of the window under the pointer
2053   --  "win_y": return location for origin of the window under the pointer
2054
2055   procedure Constrain_Size
2056      (Geometry   : Gdk_Geometry;
2057       Flags      : Gdk_Window_Hints;
2058       Width      : Gint;
2059       Height     : Gint;
2060       New_Width  : out Gint;
2061       New_Height : out Gint);
2062   pragma Import (C, Constrain_Size, "gdk_window_constrain_size");
2063   --  Constrains a desired width and height according to a set of geometry
2064   --  hints (such as minimum and maximum size).
2065   --  "geometry": a Gdk.Window.Gdk_Geometry structure
2066   --  "flags": a mask indicating what portions of Geometry are set
2067   --  "width": desired width of window
2068   --  "height": desired height of the window
2069   --  "new_width": location to store resulting width
2070   --  "new_height": location to store resulting height
2071
2072   procedure Process_All_Updates;
2073   pragma Import (C, Process_All_Updates, "gdk_window_process_all_updates");
2074   --  Calls Gdk.Window.Process_Updates for all windows (see Gdk.Gdk_Window)
2075   --  in the application.
2076
2077   procedure Set_Debug_Updates (Setting : Boolean);
2078   --  With update debugging enabled, calls to Gdk.Window.Invalidate_Region
2079   --  clear the invalidated region of the screen to a noticeable color, and
2080   --  GDK pauses for a short time before sending exposes to windows during
2081   --  Gdk.Window.Process_Updates. The net effect is that you can see the
2082   --  invalid region for each window and watch redraws as they occur. This
2083   --  allows you to diagnose inefficiencies in your application.
2084   --  In essence, because the GDK rendering model prevents all flicker, if
2085   --  you are redrawing the same region 400 times you may never notice, aside
2086   --  from noticing a speed problem. Enabling update debugging causes GTK to
2087   --  flicker slowly and noticeably, so you can see exactly what's being
2088   --  redrawn when, in what order.
2089   --  The --gtk-debug=updates command line option passed to GTK+ programs
2090   --  enables this debug option at application startup time. That's usually
2091   --  more useful than calling Gdk.Window.Set_Debug_Updates yourself, though
2092   --  you might want to use this function to enable updates sometime after
2093   --  application startup time.
2094   --  "setting": True to turn on update debugging
2095
2096   ----------------
2097   -- Properties --
2098   ----------------
2099   --  The following properties are defined for this widget. See
2100   --  Glib.Properties for more information on properties)
2101
2102   Cursor_Property : constant Glib.Properties.Property_Boxed;
2103   --  Type: Cursor
2104   --  The mouse pointer for a Gdk.Gdk_Window. See Gdk.Window.Set_Cursor and
2105   --  Gdk.Window.Get_Cursor for details.
2106
2107   -------------
2108   -- Signals --
2109   -------------
2110
2111   Signal_Create_Surface : constant Glib.Signal_Name := "create-surface";
2112   --  The ::create-surface signal is emitted when an offscreen window needs
2113   --  its surface (re)created, which happens either when the window is first
2114   --  drawn to, or when the window is being resized. The first signal handler
2115   --  that returns a non-null surface will stop any further signal emission,
2116   --  and its surface will be used.
2117   --
2118   --  Note that it is not possible to access the window's previous surface
2119   --  from within any callback of this signal. Calling
2120   --  gdk_offscreen_window_get_surface will lead to a crash.
2121   --    function Handler
2122   --       (Self   : Gdk_Window;
2123   --        Width  : Gint;
2124   --        Height : Gint) return Cairo.Cairo_Surface
2125   --
2126   --  Callback parameters:
2127   --    --  "width": the width of the offscreen surface to create
2128   --    --  "height": the height of the offscreen surface to create
2129   --    --  Returns the newly created cairo_surface_t for the offscreen window
2130
2131   Signal_From_Embedder : constant Glib.Signal_Name := "from-embedder";
2132   --  The ::from-embedder signal is emitted to translate coordinates in the
2133   --  embedder of an offscreen window to the offscreen window.
2134   --
2135   --  See also Gdk.Gdk_Window::to-embedder.
2136   --    procedure Handler
2137   --       (Self        : Gdk_Window;
2138   --        Embedder_X  : Gdouble;
2139   --        Embedder_Y  : Gdouble;
2140   --        Offscreen_X : out System.Address;
2141   --        Offscreen_Y : out System.Address)
2142   --
2143   --  Callback parameters:
2144   --    --  "embedder_x": x coordinate in the embedder window
2145   --    --  "embedder_y": y coordinate in the embedder window
2146   --    --  "offscreen_x": return location for the x coordinate in the offscreen
2147   --    --  window
2148   --    --  "offscreen_y": return location for the y coordinate in the offscreen
2149   --    --  window
2150
2151   Signal_Pick_Embedded_Child : constant Glib.Signal_Name := "pick-embedded-child";
2152   --  The ::pick-embedded-child signal is emitted to find an embedded child
2153   --  at the given position.
2154   --    function Handler
2155   --       (Self : Gdk_Window;
2156   --        X    : Gdouble;
2157   --        Y    : Gdouble) return Gtk.Window.Gtk_Window
2158   --
2159   --  Callback parameters:
2160   --    --  "x": x coordinate in the window
2161   --    --  "y": y coordinate in the window
2162   --    --  Returns the Gdk.Gdk_Window of the
2163   --     embedded child at X, Y, or null
2164
2165   Signal_To_Embedder : constant Glib.Signal_Name := "to-embedder";
2166   --  The ::to-embedder signal is emitted to translate coordinates in an
2167   --  offscreen window to its embedder.
2168   --
2169   --  See also Gdk.Gdk_Window::from-embedder.
2170   --    procedure Handler
2171   --       (Self        : Gdk_Window;
2172   --        Offscreen_X : Gdouble;
2173   --        Offscreen_Y : Gdouble;
2174   --        Embedder_X  : out System.Address;
2175   --        Embedder_Y  : out System.Address)
2176   --
2177   --  Callback parameters:
2178   --    --  "offscreen_x": x coordinate in the offscreen window
2179   --    --  "offscreen_y": y coordinate in the offscreen window
2180   --    --  "embedder_x": return location for the x coordinate in the embedder
2181   --    --  window
2182   --    --  "embedder_y": return location for the y coordinate in the embedder
2183   --    --  window
2184
2185private
2186   Cursor_Property : constant Glib.Properties.Property_Boxed :=
2187     Glib.Properties.Build ("cursor");
2188end Gdk.Window;
2189