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