1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  5. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  6. --                                                                          -- 
  7. -- This library is free software;  you can redistribute it and/or modify it -- 
  8. -- under terms of the  GNU General Public License  as published by the Free -- 
  9. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  10. -- version. This library is distributed in the hope that it will be useful, -- 
  11. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  12. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  13. --                                                                          -- 
  14. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  15. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  16. -- version 3.1, as published by the Free Software Foundation.               -- 
  17. --                                                                          -- 
  18. -- You should have received a copy of the GNU General Public License and    -- 
  19. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  20. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  21. -- <http://www.gnu.org/licenses/>.                                          -- 
  22. --                                                                          -- 
  23. ------------------------------------------------------------------------------ 
  24.  
  25. --  <group>Gdk, the low-level API</group> 
  26.  
  27. with Gdk.Event; 
  28. with Gdk.Visual; 
  29. with Gdk.Window; 
  30. with Glib; 
  31.  
  32. package Gdk.Window_Attr is 
  33.  
  34.    subtype Gdk_Window_Attr is Gdk.Gdk_Window_Attr; 
  35.    Null_Window_Attr : constant Gdk_Window_Attr; 
  36.    --  This record describes the initial attributes for a window. Most of 
  37.    --  them can be changed later on, but it is more efficient to set them 
  38.    --  right from the start. 
  39.    --  You usually need to do the following when initializing such a 
  40.    --  structure: 
  41.    --      Window_Attr.Visual := Get_Visual (Window); 
  42.    --      Window_Attr.Colormap := Get_Colormap (Window); 
  43.    --      Window_Attr.Event_Mask := Get_Events (Window) or Exposure_Mask; 
  44.  
  45.    procedure Gdk_New 
  46.      (Window_Attr       : out Gdk_Window_Attr; 
  47.       Title             : Glib.UTF8_String := ""; 
  48.       Event_Mask        : Gdk.Event.Gdk_Event_Mask := 0; 
  49.       X, Y              : Glib.Gint := 0; 
  50.       Width             : Glib.Gint := 0; 
  51.       Height            : Glib.Gint := 0; 
  52.       Wclass            : Gdk.Window.Gdk_Window_Class := 
  53.         Gdk.Window.Input_Output; 
  54.       Visual            : Gdk.Visual.Gdk_Visual := null; 
  55.       Window_Type       : Gdk.Window.Gdk_Window_Type := 
  56.         Gdk.Window.Window_Root; 
  57.       Cursor            : Gdk.Gdk_Cursor := null; 
  58.       Wmclass_Name      : String := ""; 
  59.       Wmclass_Class     : String := ""; 
  60.       Override_Redirect : Boolean := True); 
  61.    --  Creates a new Gdk_Window_Attr structure. 
  62.    --  It is your responsability to free the visual, colormap, cursor,... field 
  63.    --  when they are no longer needed. 
  64.  
  65.    procedure Destroy (Window_Attr : in out Gdk_Window_Attr); 
  66.  
  67.    procedure Set_Title 
  68.      (Window_Attr : Gdk_Window_Attr; 
  69.       Title       : Glib.UTF8_String); 
  70.  
  71.    function Get_Title (Window_Attr : Gdk_Window_Attr) return Glib.UTF8_String; 
  72.  
  73.    procedure Set_Event_Mask 
  74.      (Window_Attr : Gdk_Window_Attr; 
  75.       Event_Mask  : Gdk.Event.Gdk_Event_Mask); 
  76.  
  77.    function Get_Event_Mask 
  78.      (Window_Attr : Gdk_Window_Attr) return Gdk.Event.Gdk_Event_Mask; 
  79.  
  80.    procedure Set_X 
  81.      (Window_Attr : Gdk_Window_Attr; 
  82.       X           : Glib.Gint); 
  83.  
  84.    function Get_X (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  85.  
  86.    procedure Set_Y 
  87.      (Window_Attr : Gdk_Window_Attr; 
  88.       Y           : Glib.Gint); 
  89.  
  90.    function Get_Y (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  91.  
  92.    procedure Set_Width 
  93.      (Window_Attr : Gdk_Window_Attr; 
  94.       Width       : Glib.Gint); 
  95.  
  96.    function Get_Width (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  97.  
  98.    procedure Set_Height 
  99.      (Window_Attr : Gdk_Window_Attr; 
  100.       Height      : Glib.Gint); 
  101.  
  102.    function Get_Height (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  103.  
  104.    procedure Set_Window_Class 
  105.      (Window_Attr : Gdk_Window_Attr; 
  106.       Wclass      : Gdk.Window.Gdk_Window_Class); 
  107.  
  108.    function Get_Window_Class 
  109.      (Window_Attr : Gdk_Window_Attr) return Gdk.Window.Gdk_Window_Class; 
  110.  
  111.    procedure Set_Visual 
  112.      (Window_Attr : Gdk_Window_Attr; 
  113.       Visual      : Gdk.Visual.Gdk_Visual); 
  114.  
  115.    function Get_Visual 
  116.      (Window_Attr : Gdk_Window_Attr) return Gdk.Visual.Gdk_Visual; 
  117.  
  118.    procedure Set_Window_Type 
  119.      (Window_Attr : Gdk_Window_Attr; 
  120.       Window_Type : Gdk.Window.Gdk_Window_Type); 
  121.  
  122.    function Get_Window_Type 
  123.      (Window_Attr : Gdk_Window_Attr) return Gdk.Window.Gdk_Window_Type; 
  124.  
  125.    procedure Set_Cursor 
  126.      (Window_Attr : Gdk_Window_Attr; 
  127.       Cursor      : Gdk.Gdk_Cursor); 
  128.  
  129.    function Get_Cursor 
  130.      (Window_Attr : Gdk_Window_Attr) 
  131.       return Gdk.Gdk_Cursor; 
  132.  
  133.    procedure Set_Wmclass_Name 
  134.      (Window_Attr  : Gdk_Window_Attr; 
  135.       Wmclass_Name : String); 
  136.  
  137.    function Get_Wmclass_Name (Window_Attr : Gdk_Window_Attr) return String; 
  138.  
  139.    procedure Set_Wmclass_Class 
  140.      (Window_Attr   : Gdk_Window_Attr; 
  141.       Wmclass_Class : String); 
  142.  
  143.    function Get_Wmclass_Class (Window_Attr : Gdk_Window_Attr) return String; 
  144.  
  145.    procedure Set_Override_Redirect 
  146.      (Window_Attr       : Gdk_Window_Attr; 
  147.       Override_Redirect : Boolean); 
  148.    function Get_Override_Redirect 
  149.      (Window_Attr : Gdk_Window_Attr) return Boolean; 
  150.    --  An override redirect window is not under the control of the window 
  151.    --  manager. This means it won't have a titlebar, won't be minimizable, etc. 
  152.    --  It will be entirely under the control of the application. The window 
  153.    --  manager can't see the override redirect window at all. 
  154.    -- 
  155.    --  Override redirect should only be used for short-lived temporary windows, 
  156.    --  such as popup menus. #GtkMenu uses an override redirect window in its 
  157.    --  implementation, for example 
  158.  
  159. private 
  160.    Null_Window_Attr : constant Gdk_Window_Attr := null; 
  161.    pragma Import (C, Get_Cursor, "ada_gdk_window_attr_get_cursor"); 
  162.    pragma Import (C, Get_Event_Mask, "ada_gdk_window_attr_get_event_mask"); 
  163.    pragma Import (C, Get_Height, "ada_gdk_window_attr_get_height"); 
  164.    pragma Import (C, Get_Visual, "ada_gdk_window_attr_get_visual"); 
  165.    pragma Import (C, Get_Width, "ada_gdk_window_attr_get_width"); 
  166.    pragma Import (C, Get_Window_Class, "ada_gdk_window_attr_get_wclass"); 
  167.    pragma Import (C, Get_Window_Type, "ada_gdk_window_attr_get_window_type"); 
  168.    pragma Import (C, Get_X, "ada_gdk_window_attr_get_x"); 
  169.    pragma Import (C, Get_Y, "ada_gdk_window_attr_get_y"); 
  170.    pragma Import (C, Set_Cursor, "ada_gdk_window_attr_set_cursor"); 
  171.    pragma Import (C, Set_Event_Mask, "ada_gdk_window_attr_set_event_mask"); 
  172.    pragma Import (C, Set_Height, "ada_gdk_window_attr_set_height"); 
  173.    pragma Import (C, Set_Visual, "ada_gdk_window_attr_set_visual"); 
  174.    pragma Import (C, Set_Width, "ada_gdk_window_attr_set_width"); 
  175.    pragma Import (C, Set_Window_Class, "ada_gdk_window_attr_set_wclass"); 
  176.    pragma Import (C, Set_Window_Type, "ada_gdk_window_attr_set_window_type"); 
  177.    pragma Import (C, Set_X, "ada_gdk_window_attr_set_x"); 
  178.    pragma Import (C, Set_Y, "ada_gdk_window_attr_set_y"); 
  179. end Gdk.Window_Attr;