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