1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000, E. Briot, J. Brobecker and A. Charlet  -- 
  5. --                Copyright (C) 2000-2011, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  A Gdk_Window is the physical window that appears on the screen. 
  26. --  This is the low-level structure known to the X server or to Win32. 
  27. --  All the widgets are internally associated with a specific Gdk_Window, 
  28. --  that holds attributes such as the window decoration, whether the window 
  29. --  can be interactively resized,... 
  30. -- 
  31. --  On some systems, the graphic server knows how to display non-rectangular 
  32. --  windows (this is part of the X extensions). 
  33. -- 
  34. --  If you simply want to create a simply window, you should instead look 
  35. --  at the functions provided in Gtk.Window and Gtk.Widget, which are higher 
  36. --  level than these. See also the function Gtk.Widget.Get_Window to get the 
  37. --  Gdk_Window associated with a widget. Be aware that some of them don't have 
  38. --  such windows! 
  39. -- 
  40. --  Scrolling can be implemented in several ways with GtkAda (toplevel 
  41. --  scrolling should be done with the Gtk_Scrolled_Window widget, but you 
  42. --  might want to handle scrolling yourself). See the function 
  43. --  Gdk.Event.Get_Graphics_Expose for more information. 
  44. --  <c_version>1.3.6</c_version> 
  45. --  <c_version>2.12</c_version> for some of the functions 
  46. --  <group>Gdk, the low-level API</group> 
  47.  
  48. with System; 
  49. with Glib; use Glib; 
  50. with Glib.Object; 
  51. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  52. pragma Elaborate_All (Glib.Generic_Properties); 
  53. with Glib.Glist; 
  54. pragma Elaborate_All (Glib.Glist); 
  55. with Cairo; 
  56. with Gdk; 
  57. with Gdk.Color; 
  58. with Gdk.Cursor; 
  59. with Gdk.Event; 
  60. with Gdk.Rectangle; 
  61. with Gdk.Types; 
  62. with Unchecked_Conversion; 
  63.  
  64. package Gdk.Window is 
  65.  
  66.    subtype Gdk_Window is Gdk.Gdk_Window; 
  67.  
  68.    Null_Window : constant Gdk_Window; 
  69.  
  70.    type Gdk_Window_Class is (Input_Output, Input_Only); 
  71.  
  72.    type Gdk_Window_Type is 
  73.      (Window_Root, 
  74.       --  there is only one root window and it is initialized at startup. 
  75.       --  Creating a window of type Window_Root is an error. 
  76.  
  77.       Window_Toplevel, 
  78.       --  Windows which interact with the window manager. 
  79.  
  80.       Window_Child, 
  81.       --  Windows which are children of some other type of window. 
  82.       --  (Any other type of window). Most windows are child windows. 
  83.  
  84.       Window_Dialog, 
  85.       --  A special kind of toplevel window which interacts with the window 
  86.       --  manager slightly differently than a regular toplevel window. 
  87.       --  Dialog windows should be used for any transient window. 
  88.  
  89.       Window_Temp, 
  90.       --  ??? 
  91.  
  92.       Window_Foreign 
  93.       --  A window that actually belongs to another application. 
  94.      ); 
  95.    --  Type of windows. 
  96.  
  97.    type Gdk_Window_Attributes_Type is mod 2 ** 32; 
  98.    Wa_Title    : constant Gdk_Window_Attributes_Type := 2 ** 1; 
  99.    Wa_X        : constant Gdk_Window_Attributes_Type := 2 ** 2; 
  100.    Wa_Y        : constant Gdk_Window_Attributes_Type := 2 ** 3; 
  101.    Wa_Cursor   : constant Gdk_Window_Attributes_Type := 2 ** 4; 
  102.    Wa_Colormap : constant Gdk_Window_Attributes_Type := 2 ** 5; 
  103.    Wa_Visual   : constant Gdk_Window_Attributes_Type := 2 ** 6; 
  104.    Wa_Wmclass  : constant Gdk_Window_Attributes_Type := 2 ** 7; 
  105.    Wa_Noredir  : constant Gdk_Window_Attributes_Type := 2 ** 8; 
  106.  
  107.    type Gdk_Window_Hints is mod 2 ** 32; 
  108.    --  Size restriction. 
  109.    Gdk_Hint_Pos        : constant Gdk_Window_Hints := 2 ** 0; 
  110.    Gdk_Hint_Min_Size   : constant Gdk_Window_Hints := 2 ** 1; 
  111.    Gdk_Hint_Max_Size   : constant Gdk_Window_Hints := 2 ** 2; 
  112.    Gdk_Hint_Base_Size  : constant Gdk_Window_Hints := 2 ** 3; 
  113.    Gdk_Hint_Aspect     : constant Gdk_Window_Hints := 2 ** 4; 
  114.    Gdk_Hint_Resize_Inc : constant Gdk_Window_Hints := 2 ** 5; 
  115.  
  116.    type Gdk_Window_Type_Hint is 
  117.      (Window_Type_Hint_Normal, 
  118.       --  Normal toplevel window 
  119.  
  120.       Window_Type_Hint_Dialog, 
  121.       --  Dialog window 
  122.  
  123.       Window_Type_Hint_Menu, 
  124.       --  Window used to implement a menu. 
  125.  
  126.       Window_Type_Hint_Toolbar 
  127.       --  Toolbar: Window used to implement toolbars. 
  128.      ); 
  129.    --  Hints for the window manager that indicate what type of function the 
  130.    --  window has. The window manager can use this when determining decoration 
  131.    --  and behaviour of the window. The hint must be set before mapping the 
  132.    --  window. 
  133.  
  134.    type Gdk_Wm_Decoration is mod 2 ** 32; 
  135.    Decor_All      : constant Gdk_Wm_Decoration := 2 ** 0; 
  136.    Decor_Border   : constant Gdk_Wm_Decoration := 2 ** 1; 
  137.    Decor_Resize_H : constant Gdk_Wm_Decoration := 2 ** 2; 
  138.    Decor_Title    : constant Gdk_Wm_Decoration := 2 ** 3; 
  139.    Decor_Menu     : constant Gdk_Wm_Decoration := 2 ** 4; 
  140.    Decor_Minimize : constant Gdk_Wm_Decoration := 2 ** 5; 
  141.    Decor_Maximize : constant Gdk_Wm_Decoration := 2 ** 6; 
  142.  
  143.    type Gdk_Wm_Function is mod 2 ** 32; 
  144.    Func_All      : constant Gdk_Wm_Function := 2 ** 0; 
  145.    Func_Resize   : constant Gdk_Wm_Function := 2 ** 1; 
  146.    Func_Move     : constant Gdk_Wm_Function := 2 ** 2; 
  147.    Func_Minimize : constant Gdk_Wm_Function := 2 ** 3; 
  148.    Func_Maximize : constant Gdk_Wm_Function := 2 ** 4; 
  149.    Func_Close    : constant Gdk_Wm_Function := 2 ** 5; 
  150.  
  151.    type Gdk_Gravity is 
  152.      (Gravity_North_West, 
  153.       Gravity_North, 
  154.       Gravity_North_East, 
  155.       Gravity_West, 
  156.       Gravity_Center, 
  157.       Gravity_East, 
  158.       Gravity_South_West, 
  159.       Gravity_South, 
  160.       Gravity_South_East, 
  161.       Gravity_Static); 
  162.  
  163.    type Gdk_Window_Edge is 
  164.      (Window_Edge_North_West, 
  165.       Window_Edge_North, 
  166.       Window_Edge_North_East, 
  167.       Window_Edge_West, 
  168.       Window_Edge_East, 
  169.       Window_Edge_South_West, 
  170.       Window_Edge_South, 
  171.       Window_Edge_South_East); 
  172.  
  173.    type Gdk_Geometry is record 
  174.       Min_Width   : Gint; 
  175.       Min_Height  : Gint; 
  176.       Max_Width   : Gint; 
  177.       Max_Height  : Gint; 
  178.       Base_Width  : Gint; 
  179.       Base_Height : Gint; 
  180.       Width_Inc   : Gint; 
  181.       Height_Inc  : Gint; 
  182.       Min_Aspect  : Gdouble; 
  183.       Max_Aspect  : Gdouble; 
  184.       Win_Gravity : Gdk_Gravity; 
  185.    end record; 
  186.  
  187.    procedure Gdk_New 
  188.      (Window          : out Gdk_Window; 
  189.       Parent          : Gdk_Window; 
  190.       Attributes      : Gdk_Window_Attr; 
  191.       Attributes_Mask : Gdk_Window_Attributes_Type); 
  192.    --  Creates a new gdk_window. 
  193.    --  There are few reasons for creating such windows yourself, and almost 
  194.    --  none if you are not creating a new widget. 
  195.    --  One nice thing with using such a window (rather than drawing directly on 
  196.    --  a gtk_widget is that you can get separate Events for this window 
  197.    --  (Expose, Button_Press, ...) without having do detect yourself where the 
  198.    --  event applied. 
  199.    --  Note that you should almost always call Set_User_Data on the newly 
  200.    --  created window, so that events are redirected to a specific widget. 
  201.    -- 
  202.    --  You cannot pass a null value for Attributes. 
  203.    -- 
  204.    --  Attributes_Mask indicates which fields are relevant in Attributes. Some 
  205.    --  of the fields are always taken into account, and thus do not have an 
  206.    --  associated mask. 
  207.    -- 
  208.    --  See the package Gdk.Window_Attr for more information on window 
  209.    --  attributes. 
  210.    -- 
  211.    --  Changing the background color of the window can be done through 
  212.    --  Gtk.Style.Set_Background 
  213.  
  214.    procedure Set_User_Data 
  215.      (Window : Gdk.Gdk_Window; 
  216.       Widget : access Glib.Object.GObject_Record'Class); 
  217.    --  Sets a special field in the window. 
  218.    --  All the events reported by the Xserver (or the Windows server) for 
  219.    --  Window will be redirected to Widget through the standard signals 
  220.    --  "expose_event", "button_press_event", ... 
  221.    --  You almost always need to call this function after creating a new 
  222.    --  Gdk_Window yourself, or you won't be able to handle the events. 
  223.  
  224.    function Get_User_Data 
  225.      (Window : Gdk.Gdk_Window) return Glib.Object.GObject; 
  226.    --  Return the widget to which events are reported when they happen on 
  227.    --  Window. This is the widget that was set through the call to 
  228.    --  Set_User_data. 
  229.  
  230.    function Get_Type return Glib.GType; 
  231.    --  Return the internal lue associated with Gdk_Window. 
  232.  
  233.    procedure Destroy (Window : in out Gdk_Window); 
  234.    --  Destroy a window and all its children. 
  235.  
  236.    type Gdk_Filter_Return is 
  237.      (Continue,  --  Event not handled, continue processing 
  238.       Translate, --  Translated event stored 
  239.       Remove);   --  Terminate processing, removing event 
  240.  
  241.    type Gdk_Filter_Func is access function 
  242.      (System_Event : C_Proxy; 
  243.       Event        : Gdk.Event.Gdk_Event; 
  244.       Data         : System.Address) return Gdk_Filter_Return; 
  245.    pragma Convention (C, Gdk_Filter_Func); 
  246.    --  A filter function, that will be called before the standard processing 
  247.    --  in gtk+. System_Event is the raw event from the system, 
  248.    -- 
  249.    --  Event hasn't been set when this function is set, and the function should 
  250.    --  set it to a meaningful value if it returns Translate. 
  251.    -- 
  252.    --  Data is the user_data that was passed with Add_Filter. 
  253.  
  254.    procedure Add_Filter 
  255.      (Window : Gdk.Gdk_Window; 
  256.       Filter : Gdk_Filter_Func; 
  257.       Data   : System.Address); 
  258.    --  Add an event filter to Window, allowing you to intercept events 
  259.    --  before they reach GDK. This is a low-level operation and makes it 
  260.    --  easy to break GDK and/or GTK+, so you have to know what you're 
  261.    --  doing. Pass null for Window to get all events for all windows, 
  262.    --  instead of events for a specific window. 
  263.    -- 
  264.    --  This can be used for a temporary keyboard grab, although you should 
  265.    --  consider using Gdk.Main.Keyboard_Grab instead. 
  266.  
  267.    procedure Remove_Filter 
  268.      (Window : Gdk.Gdk_Window; 
  269.       Filter : Gdk_Filter_Func; 
  270.       Data   : System.Address); 
  271.    --  Removing the filter that was previously associated with Filter and Data 
  272.  
  273.    function Get_Window_Type (Window : Gdk_Window) return Gdk_Window_Type; 
  274.  
  275.    procedure Window_At_Pointer 
  276.      (Win_X  : out Gint; 
  277.       Win_Y  : out Gint; 
  278.       Window : out Gdk_Window); 
  279.    --  Return the window and the coordinates corresponding to the current 
  280.    --  position of the cursor. 
  281.  
  282.    procedure Show (Window : Gdk_Window); 
  283.  
  284.    procedure Show_Unraised (Window : Gdk_Window); 
  285.    --  Show Window on screen, but does not modify its stacking order. In 
  286.    --  contrast, Show will raise the window to the top of the window stack. 
  287.  
  288.    procedure Hide (Window : Gdk_Window); 
  289.  
  290.    procedure Withdraw (Window : Gdk_Window); 
  291.  
  292.    procedure Move 
  293.      (Window : Gdk_Window; 
  294.       X      : Gint; 
  295.       Y      : Gint); 
  296.  
  297.    procedure Resize 
  298.      (Window : Gdk_Window; 
  299.       Width  : Gint; 
  300.       Height : Gint); 
  301.  
  302.    procedure Move_Resize 
  303.      (Window : Gdk_Window; 
  304.       X      : Gint; 
  305.       Y      : Gint; 
  306.       Width  : Gint; 
  307.       Height : Gint); 
  308.  
  309.    procedure Reparent 
  310.      (Window     : Gdk_Window; 
  311.       New_Parent : Gdk_Window; 
  312.       X          : Gint; 
  313.       Y          : Gint); 
  314.  
  315.    procedure Clear (Window : Gdk_Window); 
  316.  
  317.    procedure Clear_Area 
  318.      (Window : Gdk_Window; 
  319.       X      : Gint; 
  320.       Y      : Gint; 
  321.       Width  : Gint; 
  322.       Height : Gint); 
  323.    --  Does not generate an expose event. 
  324.  
  325.    procedure Clear_Area_E 
  326.      (Window : Gdk_Window; 
  327.       X      : Gint; 
  328.       Y      : Gint; 
  329.       Width  : Gint; 
  330.       Height : Gint); 
  331.    --  Same as Clear_Area, but generates an expose event. 
  332.  
  333.    procedure Copy_Area 
  334.      (Window        : Gdk_Window; 
  335.       Gc            : Gdk.Gdk_GC; 
  336.       X             : Gint; 
  337.       Y             : Gint; 
  338.       Source_Window : Gdk_Window; 
  339.       Source_X      : Gint; 
  340.       Source_Y      : Gint; 
  341.       Width         : Gint; 
  342.       Height        : Gint); 
  343.    --  Obsolete. Use Gdk.Drawable.Draw_Drawable instead. 
  344.  
  345.    function Create_Similar_Surface 
  346.      (Window  : Gdk_Window; 
  347.       Content : Cairo.Cairo_Content; 
  348.       Width   : Glib.Gint; 
  349.       Height  : Glib.Gint) return Cairo.Cairo_Surface; 
  350.    --  Same as Cairo.Surface.Create_Similar, using Windows as similar surface. 
  351.  
  352.    procedure Gdk_Raise (Window : Gdk_Window); 
  353.  
  354.    procedure Lower (Window : Gdk_Window); 
  355.  
  356.    procedure Focus (Window : Gdk_Window; Timestamp : Guint32); 
  357.  
  358.    procedure Set_Override_Redirect 
  359.      (Window            : Gdk_Window; 
  360.       Override_Redirect : Boolean := True); 
  361.  
  362.    procedure Scroll (Window : Gdk_Window; Dx, Dy : Gint); 
  363.  
  364.    procedure Shape_Combine_Mask 
  365.      (Window     : Gdk_Window; 
  366.       Shape_Mask : Gdk.Gdk_Bitmap; 
  367.       Offset_X   : Gint; 
  368.       Offset_Y   : Gint); 
  369.    --  Allow for making shaped (partially transparent) windows. 
  370.    --  This featureis  needed for Drag and Drop for example. 
  371.    --  Shape_Mask can be the mask from Gdk.Pixmap.Create_From_Xpm. 
  372.  
  373.    procedure Shape_Combine_Region 
  374.      (Window       : Gdk_Window; 
  375.       Shape_Region : Gdk.Gdk_Region; 
  376.       Offset_X     : Gint; 
  377.       Offset_Y     : Gint); 
  378.  
  379.    procedure Set_Child_Shapes (Window : Gdk_Window); 
  380.    --  Quickly take the shapes of all the child windows of a window and use 
  381.    --  their shapes as the shape mask for this window - useful for container 
  382.    --  windows that do not want to look like a big box. 
  383.  
  384.    procedure Merge_Child_Shapes (Window : Gdk_Window); 
  385.    --  Merge (ie add) child shapes to your own window's shape keeping its 
  386.    --  current shape and adding the child shapes to it. 
  387.  
  388.    function Is_Visible (Window : Gdk_Window) return Boolean; 
  389.  
  390.    function Is_Viewable (Window : Gdk_Window) return Boolean; 
  391.  
  392.    function Get_State (Window : Gdk_Window) return Gdk.Event.Gdk_Window_State; 
  393.    --  Return the current state of the Windows. 
  394.    --  See Gdk.Event.Gdk_Window_State for more details. 
  395.  
  396.    function Set_Static_Gravities 
  397.      (Window     : Gdk_Window; 
  398.       Use_Static : Boolean) return Boolean; 
  399.  
  400.    procedure Set_Hints 
  401.      (Window     : Gdk_Window; 
  402.       X          : Gint; 
  403.       Y          : Gint; 
  404.       Min_Width  : Gint; 
  405.       Min_Height : Gint; 
  406.       Max_Width  : Gint; 
  407.       Max_Height : Gint; 
  408.       Flags      : Gdk_Window_Hints); 
  409.  
  410.    procedure Set_Type_Hint 
  411.      (Window : Gdk_Window; 
  412.       Hint   : Gdk_Window_Type_Hint); 
  413.  
  414.    procedure Set_Modal_Hint 
  415.      (Window : Gdk_Window; 
  416.       Modal  : Boolean); 
  417.  
  418.    procedure Set_Geometry_Hints 
  419.      (Window   : Gdk_Window; 
  420.       Geometry : in out Gdk_Geometry; 
  421.       Flags    : Gdk_Window_Hints); 
  422.  
  423.    procedure Set_Title (Window : Gdk_Window; Title : UTF8_String); 
  424.  
  425.    procedure Set_Role (Window : Gdk_Window; Role : String); 
  426.  
  427.    procedure Set_Transient_For 
  428.      (Window : Gdk_Window; Leader : Gdk_Window); 
  429.  
  430.    procedure Set_Opacity (Window : Gdk_Window; Opacity : Gdouble); 
  431.    --  Request the windowing system to make Window partially transparent, with 
  432.    --  opacity 0.0 being fully transparent and 1.0 fully opaque (Values of the 
  433.    --  opacity parameter are clamped to the [0,1] range). 
  434.    -- 
  435.    --  On X11, this works only on X screens with a compositing manager running 
  436.    --  (see Gdk.Screen.Is_Composited) 
  437.    -- 
  438.    --  For setting up per-pixel alpha, see Gdk.Screen.Get_Rgba_Colormap 
  439.    --  For making non-toplevel windows translucent, see Set_Composited 
  440.    -- 
  441.    --  Since: gtk+ 2.12 
  442.  
  443.    procedure Set_Composited (Window : Gdk_Window; Composited : Boolean); 
  444.    --  Sets Window as composited, or unsets it. Composited windows do not 
  445.    --  automatically have their contents drawn to the screen. Drawing is 
  446.    --  redirected to an offscreen buffer and an expose event is emitted on the 
  447.    --  parent of the composited window. It is the responsibility of the 
  448.    --  parent's expose handler to manually merge the off-screen content onto 
  449.    --  the screen in whatever way it sees fit. 
  450.    -- 
  451.    --  It only makes sense for child windows to be composited; see Set_Opacity 
  452.    --  if you need translucent toplevel windows. 
  453.    -- 
  454.    --  An additional effect of this call is that the area of this window is no 
  455.    --  longer clipped from regions marked for invalidation on its parent. Draws 
  456.    --  done on the parent window are also no longer clipped by the child. 
  457.    -- 
  458.    --  This call is only supported on some systems (currently, only X11 with 
  459.    --  new enough Xcomposite and Xdamage extensions). You must call 
  460.    --  gdk_display_supports_composite() to check if setting a window as 
  461.    --  composited is supported before attempting to do so. 
  462.    -- 
  463.    --  Since: 2.12 
  464.  
  465.    procedure Set_Background 
  466.      (Window : Gdk_Window; Color : Gdk.Color.Gdk_Color); 
  467.  
  468.    procedure Set_Back_Pixmap 
  469.      (Window          : Gdk_Window; 
  470.       Pixmap          : Gdk.Gdk_Pixmap; 
  471.       Parent_Relative : Boolean); 
  472.  
  473.    procedure Set_Cursor 
  474.      (Window : Gdk_Window; Cursor : Gdk.Cursor.Gdk_Cursor); 
  475.    --  Note: the window must be realized first, ie have an associated X11/Win32 
  476.    --  window. 
  477.  
  478.    procedure Get_Geometry 
  479.      (Window : Gdk_Window; 
  480.       X      : out Gint; 
  481.       Y      : out Gint; 
  482.       Width  : out Gint; 
  483.       Height : out Gint; 
  484.       Depth  : out Gint); 
  485.    --  You can get the size of the root window (ie the size of the screen) 
  486.    --  simply by giving Null_Window as the first argument to this procedure. 
  487.  
  488.    procedure Get_Position 
  489.      (Window : Gdk_Window; 
  490.       X      : out Gint; 
  491.       Y      : out Gint); 
  492.  
  493.    procedure Get_Origin 
  494.      (Window  : Gdk_Window; 
  495.       X       : out Gint; 
  496.       Y       : out Gint; 
  497.       Success : out Boolean); 
  498.    --  Obtains the position of a window in root window coordinates. (Compare 
  499.    --  with Get_Position and Get_Geometry which return the position of a window 
  500.    --  relative to its parent window) 
  501.  
  502.    procedure Get_Desk_Relative_Origin 
  503.      (Window  : Gdk_Window; 
  504.       X       : out Gint; 
  505.       Y       : out Gint; 
  506.       Success : out Boolean); 
  507.  
  508.    procedure Get_Root_Origin 
  509.      (Window : Gdk_Window; 
  510.       X      : out Gint; 
  511.       Y      : out Gint); 
  512.    --  Obtains the top-left corner of the window manager frame in root window 
  513.    --  coordinates. 
  514.  
  515.    procedure Get_Frame_Extents 
  516.      (Window : Gdk_Window; 
  517.       Rect   : Gdk.Rectangle.Gdk_Rectangle); 
  518.  
  519.    procedure Get_Pointer 
  520.      (Window : Gdk_Window; 
  521.       X      : out Gint; 
  522.       Y      : out Gint; 
  523.       Mask   : out Gdk.Types.Gdk_Modifier_Type; 
  524.       Result : out Gdk_Window); 
  525.  
  526.    function Get_Parent (Window : Gdk_Window) return Gdk_Window; 
  527.  
  528.    function Get_Toplevel (Window : Gdk_Window) return Gdk_Window; 
  529.  
  530.    --  Gdk_Window_List 
  531.    -- 
  532.    function Convert is new Unchecked_Conversion (Gdk_Window, System.Address); 
  533.    function Convert is new Unchecked_Conversion (System.Address, Gdk_Window); 
  534.  
  535.    package Gdk_Window_List is new 
  536.      Glib.Glist.Generic_List (Gpointer => Gdk_Window); 
  537.  
  538.    function Get_Children (Window : Gdk_Window) return Gdk_Window_List.Glist; 
  539.  
  540.    function Peek_Children (Window : Gdk_Window) return Gdk_Window_List.Glist; 
  541.  
  542.    function Get_Events (Window : Gdk_Window) return Gdk.Event.Gdk_Event_Mask; 
  543.  
  544.    procedure Set_Events 
  545.      (Window : Gdk_Window; Event_Mask : Gdk.Event.Gdk_Event_Mask); 
  546.  
  547.    procedure Set_Icon 
  548.      (Window      : Gdk_Window; 
  549.       Icon_Window : Gdk_Window; 
  550.       Pixmap      : Gdk_Pixmap; 
  551.       Mask        : Gdk_Bitmap); 
  552.    --  Currently not supported under Windows 
  553.  
  554.    procedure Set_Icon_Name 
  555.      (Window : Gdk_Window; 
  556.       Name   : UTF8_String); 
  557.  
  558.    procedure Set_Group (Window : Gdk_Window; Leader : Gdk_Window); 
  559.    --  Sets the group leader window for window. By default, GDK sets the group 
  560.    --  leader for all toplevel windows to a global window implicitly created by 
  561.    --  GDK. With this function you can override this default. 
  562.    -- 
  563.    --  The group leader window allows the window manager to distinguish all 
  564.    --  windows that belong to a single application. It may for example allow 
  565.    --  users to minimize/unminimize all windows belonging to an application at 
  566.    --  once. You should only set a non-default group window if your application 
  567.    --  pretends to be multiple applications. 
  568.  
  569.    procedure Set_Decorations 
  570.      (Window      : Gdk_Window; 
  571.       Decorations : Gdk_Wm_Decoration); 
  572.  
  573.    procedure Get_Decorations 
  574.      (Window      : Gdk_Window; 
  575.       Decorations : out Gdk_Wm_Decoration; 
  576.       Success     : out Boolean); 
  577.  
  578.    procedure Set_Functions 
  579.      (Window    : Gdk_Window; 
  580.       Functions : Gdk_Wm_Function); 
  581.  
  582.    procedure Invalidate_Rect 
  583.      (Window              : Gdk_Window; 
  584.       Rectangle           : Gdk.Rectangle.Gdk_Rectangle; 
  585.       Invalidate_Children : Boolean); 
  586.  
  587.    function Get_Toplevels return Gdk_Window_List.Glist; 
  588.    --  The returned list must be freed by calling Gdk_Window_List.Free. 
  589.    --  Consider using Gtk.Window.List_Toplevels instead. 
  590.  
  591.    procedure Iconify (Window : Gdk_Window); 
  592.  
  593.    procedure Deiconify (Window : Gdk_Window); 
  594.  
  595.    procedure Stick (Window : Gdk_Window); 
  596.  
  597.    procedure Unstick (Window : Gdk_Window); 
  598.  
  599.    procedure Maximize (Window : Gdk_Window); 
  600.  
  601.    procedure Unmaximize (Window : Gdk_Window); 
  602.  
  603.    procedure Register_Dnd (Window : Gdk_Window); 
  604.  
  605.    function Get_Update_Area (Window : Gdk_Window) return Gdk_Region; 
  606.  
  607.    procedure Freeze_Updates (Window : Gdk_Window); 
  608.  
  609.    procedure Thaw_Updates (Window : Gdk_Window); 
  610.  
  611.    procedure Process_All_Updates; 
  612.  
  613.    procedure Process_Updates 
  614.      (Window : Gdk_Window; Update_Children : Boolean := True); 
  615.  
  616.    procedure Set_Debug_Updates (Setting : Boolean := True); 
  617.  
  618.    procedure Ref (Window : Gdk_Window); 
  619.    --  Increment the reference counter associated with window. 
  620.  
  621.    procedure Unref (Window : Gdk_Window); 
  622.    --  Decrement the reference counter associated with window. 
  623.  
  624.    function Get_Window_Id (Window : Gdk_Window) return System.Address; 
  625.    --  Return the target specific window id. 
  626.    --  Under Windows, this returns a HWND object. 
  627.    --  Under X, this returns a Window object. 
  628.  
  629.    pragma Convention (C, Gdk_Window_Type_Hint); 
  630.  
  631.    pragma Convention (C, Gdk_Gravity); 
  632.    for Gdk_Gravity use 
  633.      (Gravity_North_West => 1, 
  634.       Gravity_North      => 2, 
  635.       Gravity_North_East => 3, 
  636.       Gravity_West       => 4, 
  637.       Gravity_Center     => 5, 
  638.       Gravity_East       => 6, 
  639.       Gravity_South_West => 7, 
  640.       Gravity_South      => 8, 
  641.       Gravity_South_East => 9, 
  642.       Gravity_Static     => 10); 
  643.  
  644.    package Window_Type_Hint_Properties is new 
  645.      Generic_Internal_Discrete_Property (Gdk_Window_Type_Hint); 
  646.    package Gravity_Properties is new Generic_Internal_Discrete_Property 
  647.      (Gdk_Gravity); 
  648.  
  649.    type Property_Window_Type_Hint  is new Window_Type_Hint_Properties.Property; 
  650.    type Property_Gravity           is new Gravity_Properties.Property; 
  651.  
  652. private 
  653.  
  654.    Null_Window : constant Gdk_Window := null; 
  655.    pragma Import (C, Get_Type, "gdk_window_object_get_type"); 
  656.    pragma Import (C, Add_Filter, "gdk_window_add_filter"); 
  657.    pragma Import (C, Clear, "gdk_window_clear"); 
  658.    pragma Import (C, Clear_Area, "gdk_window_clear_area"); 
  659.    pragma Import (C, Clear_Area_E, "gdk_window_clear_area_e"); 
  660.    pragma Import (C, Focus, "gdk_window_focus"); 
  661.    pragma Import (C, Scroll, "gdk_window_scroll"); 
  662.    pragma Import (C, Shape_Combine_Mask, "gdk_window_shape_combine_mask"); 
  663.    pragma Import (C, Shape_Combine_Region, "gdk_window_shape_combine_region"); 
  664.    pragma Import (C, Get_State, "gdk_window_get_state"); 
  665.    pragma Import (C, Set_Type_Hint, "gdk_window_set_type_hint"); 
  666.    pragma Import (C, Get_Frame_Extents, "gdk_window_get_frame_extents"); 
  667.    pragma Import (C, Iconify, "gdk_window_iconify"); 
  668.    pragma Import (C, Deiconify, "gdk_window_deiconify"); 
  669.    pragma Import (C, Stick, "gdk_window_stick"); 
  670.    pragma Import (C, Unstick, "gdk_window_unstick"); 
  671.    pragma Import (C, Maximize, "gdk_window_maximize"); 
  672.    pragma Import (C, Unmaximize, "gdk_window_unmaximize"); 
  673.    pragma Import (C, Register_Dnd, "gdk_window_register_dnd"); 
  674.    pragma Import (C, Get_Update_Area, "gdk_window_get_update_area"); 
  675.    pragma Import (C, Freeze_Updates, "gdk_window_freeze_updates"); 
  676.    pragma Import (C, Thaw_Updates, "gdk_window_thaw_updates"); 
  677.    pragma Import (C, Process_All_Updates, "gdk_window_process_all_updates"); 
  678.    pragma Import (C, Get_Events, "gdk_window_get_events"); 
  679.    pragma Import (C, Get_Geometry, "gdk_window_get_geometry"); 
  680.    pragma Import (C, Get_Parent, "gdk_window_get_parent"); 
  681.    pragma Import (C, Get_Position, "gdk_window_get_position"); 
  682.    pragma Import (C, Get_Root_Origin, "gdk_window_get_root_origin"); 
  683.    pragma Import (C, Get_Toplevel, "gdk_window_get_toplevel"); 
  684.    pragma Import (C, Get_Window_Type, "gdk_window_get_window_type"); 
  685.    pragma Import (C, Hide, "gdk_window_hide"); 
  686.    pragma Import (C, Lower, "gdk_window_lower"); 
  687.    pragma Import (C, Merge_Child_Shapes, "gdk_window_merge_child_shapes"); 
  688.    pragma Import (C, Move, "gdk_window_move"); 
  689.    pragma Import (C, Move_Resize, "gdk_window_move_resize"); 
  690.    pragma Import (C, Gdk_Raise, "gdk_window_raise"); 
  691.    pragma Import (C, Ref, "gdk_drawable_ref"); 
  692.    pragma Import (C, Remove_Filter, "gdk_window_remove_filter"); 
  693.    pragma Import (C, Reparent, "gdk_window_reparent"); 
  694.    pragma Import (C, Resize, "gdk_window_resize"); 
  695.    pragma Import (C, Set_Child_Shapes, "gdk_window_set_child_shapes"); 
  696.    pragma Import (C, Set_Decorations, "gdk_window_set_decorations"); 
  697.    pragma Import (C, Set_Events, "gdk_window_set_events"); 
  698.    pragma Import (C, Set_Functions, "gdk_window_set_functions"); 
  699.    pragma Import (C, Set_Geometry_Hints, "gdk_window_set_geometry_hints"); 
  700.    pragma Import (C, Set_Group, "gdk_window_set_group"); 
  701.    pragma Import (C, Set_Hints, "gdk_window_set_hints"); 
  702.    pragma Import (C, Set_Transient_For, "gdk_window_set_transient_for"); 
  703.    pragma Import (C, Show, "gdk_window_show"); 
  704.    pragma Import (C, Show_Unraised, "gdk_window_show_unraised"); 
  705.    pragma Import (C, Unref, "gdk_drawable_unref"); 
  706.    pragma Import (C, Withdraw, "gdk_window_withdraw"); 
  707.    pragma Import (C, Set_Cursor, "gdk_window_set_cursor"); 
  708.    pragma Import (C, Set_Icon, "gdk_window_set_icon"); 
  709.    pragma Import (C, Get_Window_Id, "ada_gdk_get_window_id"); 
  710.    pragma Import (C, Set_Opacity, "gdk_window_set_opacity"); 
  711.    pragma Import 
  712.      (C, Create_Similar_Surface, "gdk_window_create_similar_surface"); 
  713.  
  714.    pragma Convention (C, Gdk_Window_Type); 
  715.  
  716.    pragma Convention (C, Gdk_Window_Class); 
  717.  
  718.    pragma Convention (C, Gdk_Window_Edge); 
  719.  
  720. end Gdk.Window; 
  721.  
  722. --  missing: 
  723. --  gdk_set_sm_client_id 
  724. --  gdk_window_begin_paint_rect 
  725. --  gdk_window_begin_paint_region 
  726. --  gdk_window_end_paint 
  727. --  gdk_window_begin_resize_drag 
  728. --  gdk_window_begin_move_drag 
  729. --  gdk_window_invalidate_region 
  730. --  gdk_window_constrain_size