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-2003 ACT-Europe                 -- 
  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. --  <group>Gdk, the low-level API</group> 
  31.  
  32. with Gdk.Color; 
  33. with Gdk.Cursor; 
  34. with Gdk.Event; 
  35. with Gdk.Visual; 
  36. with Gdk.Window; 
  37. with Glib; 
  38.  
  39. package Gdk.Window_Attr is 
  40.  
  41.    subtype Gdk_Window_Attr is Gdk.Gdk_Window_Attr; 
  42.    Null_Window_Attr : constant Gdk_Window_Attr; 
  43.    --  This record describes the initial attributes for a window. Most of 
  44.    --  them can be changed later on, but it is more efficient to set them 
  45.    --  right from the start. 
  46.    --  You usually need to do the following when initializing such a 
  47.    --  structure: 
  48.    --      Window_Attr.Visual := Get_Visual (Window); 
  49.    --      Window_Attr.Colormap := Get_Colormap (Window); 
  50.    --      Window_Attr.Event_Mask := Get_Events (Window) or Exposure_Mask; 
  51.  
  52.    procedure Gdk_New 
  53.      (Window_Attr       : out Gdk_Window_Attr; 
  54.       Title             : Glib.UTF8_String := ""; 
  55.       Event_Mask        : Gdk.Event.Gdk_Event_Mask := 0; 
  56.       X, Y              : Glib.Gint := 0; 
  57.       Width             : Glib.Gint := 0; 
  58.       Height            : Glib.Gint := 0; 
  59.       Wclass            : Gdk.Window.Gdk_Window_Class := 
  60.         Gdk.Window.Input_Output; 
  61.       Visual            : Gdk.Visual.Gdk_Visual := null; 
  62.       Colormap          : Gdk.Color.Gdk_Colormap := null; 
  63.       Window_Type       : Gdk.Window.Gdk_Window_Type := 
  64.         Gdk.Window.Window_Root; 
  65.       Cursor            : Gdk.Cursor.Gdk_Cursor := null; 
  66.       Wmclass_Name      : String := ""; 
  67.       Wmclass_Class     : String := ""; 
  68.       Override_Redirect : Boolean := True); 
  69.    --  Creates a new Gdk_Window_Attr structure. 
  70.    --  It is your responsability to free the visual, colormap, cursor,... field 
  71.    --  when they are no longer needed. 
  72.  
  73.    procedure Destroy (Window_Attr : in out Gdk_Window_Attr); 
  74.  
  75.    procedure Set_Title 
  76.      (Window_Attr : Gdk_Window_Attr; 
  77.       Title       : Glib.UTF8_String); 
  78.  
  79.    function Get_Title (Window_Attr : Gdk_Window_Attr) return Glib.UTF8_String; 
  80.  
  81.    procedure Set_Event_Mask 
  82.      (Window_Attr : Gdk_Window_Attr; 
  83.       Event_Mask  : Gdk.Event.Gdk_Event_Mask); 
  84.  
  85.    function Get_Event_Mask 
  86.      (Window_Attr : Gdk_Window_Attr) return Gdk.Event.Gdk_Event_Mask; 
  87.  
  88.    procedure Set_X 
  89.      (Window_Attr : Gdk_Window_Attr; 
  90.       X           : Glib.Gint); 
  91.  
  92.    function Get_X (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  93.  
  94.    procedure Set_Y 
  95.      (Window_Attr : Gdk_Window_Attr; 
  96.       Y           : Glib.Gint); 
  97.  
  98.    function Get_Y (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  99.  
  100.    procedure Set_Width 
  101.      (Window_Attr : Gdk_Window_Attr; 
  102.       Width       : Glib.Gint); 
  103.  
  104.    function Get_Width (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  105.  
  106.    procedure Set_Height 
  107.      (Window_Attr : Gdk_Window_Attr; 
  108.       Height      : Glib.Gint); 
  109.  
  110.    function Get_Height (Window_Attr : Gdk_Window_Attr) return Glib.Gint; 
  111.  
  112.    procedure Set_Window_Class 
  113.      (Window_Attr : Gdk_Window_Attr; 
  114.       Wclass      : Gdk.Window.Gdk_Window_Class); 
  115.  
  116.    function Get_Window_Class 
  117.      (Window_Attr : Gdk_Window_Attr) return Gdk.Window.Gdk_Window_Class; 
  118.  
  119.    procedure Set_Visual 
  120.      (Window_Attr : Gdk_Window_Attr; 
  121.       Visual      : Gdk.Visual.Gdk_Visual); 
  122.  
  123.    function Get_Visual 
  124.      (Window_Attr : Gdk_Window_Attr) return Gdk.Visual.Gdk_Visual; 
  125.  
  126.    procedure Set_Colormap 
  127.      (Window_Attr : Gdk_Window_Attr; 
  128.       Colormap    : Gdk.Color.Gdk_Colormap); 
  129.  
  130.    function Get_Colormap 
  131.      (Window_Attr : Gdk_Window_Attr) return Gdk.Color.Gdk_Colormap; 
  132.  
  133.    procedure Set_Window_Type 
  134.      (Window_Attr : Gdk_Window_Attr; 
  135.       Window_Type : Gdk.Window.Gdk_Window_Type); 
  136.  
  137.    function Get_Window_Type 
  138.      (Window_Attr : Gdk_Window_Attr) return Gdk.Window.Gdk_Window_Type; 
  139.  
  140.    procedure Set_Cursor 
  141.      (Window_Attr : Gdk_Window_Attr; 
  142.       Cursor      : Gdk.Cursor.Gdk_Cursor); 
  143.  
  144.    function Get_Cursor 
  145.      (Window_Attr : Gdk_Window_Attr) 
  146.       return Gdk.Cursor.Gdk_Cursor; 
  147.  
  148.    procedure Set_Wmclass_Name 
  149.      (Window_Attr  : Gdk_Window_Attr; 
  150.       Wmclass_Name : String); 
  151.  
  152.    function Get_Wmclass_Name (Window_Attr : Gdk_Window_Attr) return String; 
  153.  
  154.    procedure Set_Wmclass_Class 
  155.      (Window_Attr   : Gdk_Window_Attr; 
  156.       Wmclass_Class : String); 
  157.  
  158.    function Get_Wmclass_Class (Window_Attr : Gdk_Window_Attr) return String; 
  159.  
  160.    procedure Set_Override_Redirect 
  161.      (Window_Attr       : Gdk_Window_Attr; 
  162.       Override_Redirect : Boolean); 
  163.  
  164.    function Get_Override_Redirect 
  165.      (Window_Attr : Gdk_Window_Attr) return Boolean; 
  166.  
  167. private 
  168.    Null_Window_Attr : constant Gdk_Window_Attr := null; 
  169.    pragma Import (C, Get_Colormap, "ada_gdk_window_attr_get_colormap"); 
  170.    pragma Import (C, Get_Cursor, "ada_gdk_window_attr_get_cursor"); 
  171.    pragma Import (C, Get_Event_Mask, "ada_gdk_window_attr_get_event_mask"); 
  172.    pragma Import (C, Get_Height, "ada_gdk_window_attr_get_height"); 
  173.    pragma Import (C, Get_Visual, "ada_gdk_window_attr_get_visual"); 
  174.    pragma Import (C, Get_Width, "ada_gdk_window_attr_get_width"); 
  175.    pragma Import (C, Get_Window_Class, "ada_gdk_window_attr_get_wclass"); 
  176.    pragma Import (C, Get_Window_Type, "ada_gdk_window_attr_get_window_type"); 
  177.    pragma Import (C, Get_X, "ada_gdk_window_attr_get_x"); 
  178.    pragma Import (C, Get_Y, "ada_gdk_window_attr_get_y"); 
  179.    pragma Import (C, Set_Colormap, "ada_gdk_window_attr_set_colormap"); 
  180.    pragma Import (C, Set_Cursor, "ada_gdk_window_attr_set_cursor"); 
  181.    pragma Import (C, Set_Event_Mask, "ada_gdk_window_attr_set_event_mask"); 
  182.    pragma Import (C, Set_Height, "ada_gdk_window_attr_set_height"); 
  183.    pragma Import (C, Set_Visual, "ada_gdk_window_attr_set_visual"); 
  184.    pragma Import (C, Set_Width, "ada_gdk_window_attr_set_width"); 
  185.    pragma Import (C, Set_Window_Class, "ada_gdk_window_attr_set_wclass"); 
  186.    pragma Import (C, Set_Window_Type, "ada_gdk_window_attr_set_window_type"); 
  187.    pragma Import (C, Set_X, "ada_gdk_window_attr_set_x"); 
  188.    pragma Import (C, Set_Y, "ada_gdk_window_attr_set_y"); 
  189. end Gdk.Window_Attr;