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-2010 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. --  <description> 
  31. --  This package contains various functions to draw widget parts on the screen. 
  32. --  Whenever possible, you should use these functions instead of directly 
  33. --  the ones from Gdk.Drawable, since this package will properly take into 
  34. --  account the user's theme and color choice. 
  35. -- 
  36. --  Consider also using directly the function Gtk.Widget.Modify_Font, 
  37. --  Gtk.Widget.Modify_Background,... rather than use the lower level Gtk_Style 
  38. --  object. 
  39. -- 
  40. --  See Gtk.RC to learn how styles can be defined in external configuration 
  41. --  files by the end-user of your application. 
  42. --  </description> 
  43. --  <c_version>2.8.17</c_version> 
  44. --  <group>Configuration and Themes</group> 
  45.  
  46. with Glib.Object; 
  47. with Glib.Values; 
  48. with Gdk.Color;        use Gdk.Color; 
  49. with Gdk.Font;         use Gdk.Font; 
  50. with Gdk.GC; 
  51. with Gdk.Pixmap; 
  52. with Gdk.Rectangle; 
  53. with Gdk.Types; 
  54. with Gdk.Window; 
  55. with Gtk.Enums;        use Gtk.Enums; 
  56. with Gtk.Object; 
  57. with Pango.Font; 
  58. with Pango.Layout; 
  59. with Interfaces.C.Strings; 
  60.  
  61. package Gtk.Style is 
  62.  
  63.    ------------ 
  64.    -- Styles -- 
  65.    ------------ 
  66.  
  67.    type Gtk_Style_Record is new Glib.Object.GObject_Record with null record; 
  68.    type Gtk_Style is access all Gtk_Style_Record'Class; 
  69.  
  70.    Null_Style : constant Gtk_Style := null; 
  71.  
  72.    type Gtk_Rc_Property_Parser is access function 
  73.      (Pspec     : Glib.Param_Spec; 
  74.       Rc_String : Interfaces.C.Strings.chars_ptr; 
  75.       Value     : access Glib.Values.GValue) return Gboolean; 
  76.    pragma Convention (C, Gtk_Rc_Property_Parser); 
  77.    --  A function used to parse a string into the value of a property. 
  78.    --  Pspec is the property that is being parsed, Rc_String is the value as 
  79.    --  read in a gtk configuration file (any string, really), and Value should 
  80.    --  be set to the value read. 
  81.    --  See also Gtk.Settings 
  82.  
  83.    procedure Gtk_New (Style : out Gtk_Style); 
  84.    procedure Initialize (Style : access Gtk_Style_Record'Class); 
  85.    --  Creates or initializes a new style 
  86.  
  87.    function Get_Type return Gtk.Gtk_Type; 
  88.    --  Return the internal value associated with a Gtk_Style. 
  89.  
  90.    function Copy (Source : Gtk_Style) return Gtk_Style; 
  91.    --  Copy a Gtk_Style 
  92.  
  93.    function Attach 
  94.      (Style  : Gtk_Style; Window : Gdk.Window.Gdk_Window) return Gtk_Style; 
  95.    procedure Detach (Style : Gtk_Style); 
  96.    --  Attaches a style to a window; this process allocates the colors and 
  97.    --  creates the GC's for the style - it specializes it to a particular 
  98.    --  visual and colormap. The process may involve the creation of a new style 
  99.    --  if the style has already been attached to a window with a different 
  100.    --  style and colormap. 
  101.    --  It returns either Style or a newly allocated style. If a new one is 
  102.    --  created, the parameter will be Unref once, and the new one Ref once. 
  103.  
  104.    procedure Set_Background 
  105.      (Style      : Gtk_Style; 
  106.       Window     : Gdk.Window.Gdk_Window; 
  107.       State_Type : Gtk_State_Type); 
  108.    --  Set the background color of Window to the background color specified 
  109.    --  by Style. 
  110.  
  111.    procedure Apply_Default_Background 
  112.      (Style      : access Gtk_Style_Record; 
  113.       Window     : Gdk.Window.Gdk_Window; 
  114.       Set_Bg     : Boolean; 
  115.       State_Type : Gtk_State_Type; 
  116.       Area       : Gdk.Rectangle.Gdk_Rectangle; 
  117.       X          : Gint; 
  118.       Y          : Gint; 
  119.       Width      : Gint; 
  120.       Height     : Gint); 
  121.    --  Applies the default background from style to the given area in Window 
  122.  
  123.    ----------------- 
  124.    --  Properties -- 
  125.    ----------------- 
  126.    --  The style contains a number of properties. Each of these can be set to 
  127.    --  multiple values simulatenously, that will be applied depending on the 
  128.    --  widget's current state (highlighted, active, inactive,...) 
  129.  
  130.    procedure Set_Background 
  131.      (Style      : Gtk_Style; 
  132.       State_Type : Enums.Gtk_State_Type; 
  133.       Color      : Gdk.Color.Gdk_Color); 
  134.    procedure Set_Bg 
  135.      (Style      : Gtk_Style; 
  136.       State_Type : Enums.Gtk_State_Type; 
  137.       Color      : Gdk.Color.Gdk_Color) renames Set_Background; 
  138.    function Get_Background 
  139.      (Style      : Gtk_Style; 
  140.       State_Type : Enums.Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  141.    function Get_Bg 
  142.      (Style      : Gtk_Style; 
  143.       State_Type : Gtk_State_Type) return Gdk_Color renames Get_Background; 
  144.    --  Set or get the background color that this style uses in the given state 
  145.  
  146.    procedure Set_Background_GC 
  147.      (Style      : Gtk_Style; 
  148.       State_Type : Enums.Gtk_State_Type; 
  149.       GC         : Gdk.GC.Gdk_GC); 
  150.    procedure Set_Background 
  151.      (Style      : Gtk_Style; 
  152.       State_Type : Enums.Gtk_State_Type; 
  153.       GC         : Gdk_GC) renames Set_Background_GC; 
  154.    procedure Set_Bg 
  155.      (Style      : Gtk_Style; 
  156.       State_Type : Enums.Gtk_State_Type; 
  157.       GC         : Gdk.GC.Gdk_GC) renames Set_Background_GC; 
  158.    procedure Set_Bg_GC 
  159.      (Style      : Gtk_Style; 
  160.       State_Type : Enums.Gtk_State_Type; 
  161.       GC         : Gdk.GC.Gdk_GC) renames Set_Background_GC; 
  162.    function Get_Background_GC 
  163.      (Style      : Gtk_Style; 
  164.       State_Type : Enums.Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  165.    function Get_Bg 
  166.      (Style      : Gtk_Style; 
  167.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Background_GC; 
  168.    function Get_Background 
  169.      (Style      : Gtk_Style; 
  170.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Background_GC; 
  171.    function Get_Bg_GC 
  172.      (Style      : Gtk_Style; 
  173.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Background_GC; 
  174.    --  Set or get the graphic context that the style is using for the 
  175.    --  background 
  176.  
  177.    procedure Set_Foreground 
  178.      (Style      : Gtk_Style; 
  179.       State_Type : Enums.Gtk_State_Type; 
  180.       Color      : Gdk.Color.Gdk_Color); 
  181.    procedure Set_Fg 
  182.      (Style      : Gtk_Style; 
  183.       State_Type : Enums.Gtk_State_Type; 
  184.       Color      : Gdk.Color.Gdk_Color) renames Set_Foreground; 
  185.    function Get_Foreground 
  186.      (Style      : Gtk_Style; 
  187.       State_Type : Enums.Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  188.    function Get_Fg 
  189.      (Style      : Gtk_Style; 
  190.       State_Type : Gtk_State_Type) return Gdk_Color renames Get_Foreground; 
  191.    --  Set or get the foreground color that the style is using 
  192.  
  193.    procedure Set_Foreground_GC 
  194.      (Style      : Gtk_Style; 
  195.       State_Type : Enums.Gtk_State_Type; 
  196.       GC         : Gdk.GC.Gdk_GC); 
  197.    procedure Set_Fg_GC 
  198.      (Style      : Gtk_Style; 
  199.       State_Type : Enums.Gtk_State_Type; 
  200.       GC         : Gdk.GC.Gdk_GC) renames Set_Foreground_GC; 
  201.    procedure Set_Foreground 
  202.      (Style      : Gtk_Style; 
  203.       State_Type : Enums.Gtk_State_Type; 
  204.       GC         : Gdk.GC.Gdk_GC) renames Set_Foreground_GC; 
  205.    procedure Set_Fg 
  206.      (Style      : Gtk_Style; 
  207.       State_Type : Enums.Gtk_State_Type; 
  208.       GC         : Gdk.GC.Gdk_GC) renames Set_Foreground_GC; 
  209.    function Get_Foreground_GC 
  210.      (Style      : Gtk_Style; 
  211.       State_Type : Enums.Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  212.    function Get_Foreground 
  213.      (Style      : Gtk_Style; 
  214.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Foreground_GC; 
  215.    function Get_Fg 
  216.      (Style      : Gtk_Style; 
  217.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Foreground_GC; 
  218.    function Get_Fg_GC 
  219.      (Style      : Gtk_Style; 
  220.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Foreground_GC; 
  221.    --  Set or get the graphic context used by this style for the foreground 
  222.  
  223.    procedure Set_Light 
  224.      (Style      : Gtk_Style; 
  225.       State_Type : Enums.Gtk_State_Type; 
  226.       Color      : Gdk.Color.Gdk_Color); 
  227.    function Get_Light 
  228.      (Style      : Gtk_Style; 
  229.       State_Type : Enums.Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  230.    procedure Set_Light_GC 
  231.      (Style      : Gtk_Style; 
  232.       State_Type : Enums.Gtk_State_Type; 
  233.       GC         : Gdk.GC.Gdk_GC); 
  234.    function Get_Light_GC 
  235.      (Style      : Gtk_Style; 
  236.       State_Type : Enums.Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  237.    procedure Set_Light 
  238.      (Style      : Gtk_Style; 
  239.       State_Type : Enums.Gtk_State_Type; 
  240.       GC         : Gdk.GC.Gdk_GC) renames Set_Light_GC; 
  241.    function Get_Light 
  242.      (Style      : Gtk_Style; 
  243.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Light_GC; 
  244.    --  Set or get the lighter color or graphic context that this style is 
  245.    --  using. This color is used to draw the shadows around rectangles for 
  246.    --  instance 
  247.  
  248.    procedure Set_Dark 
  249.      (Style      : Gtk_Style; 
  250.       State_Type : Gtk_State_Type; 
  251.       Color      : Gdk.Color.Gdk_Color); 
  252.    procedure Set_Dark_GC 
  253.      (Style      : Gtk_Style; 
  254.       State_Type : Gtk_State_Type; 
  255.       GC         : Gdk.GC.Gdk_GC); 
  256.    procedure Set_Dark 
  257.      (Style      : Gtk_Style; 
  258.       State_Type : Gtk_State_Type; 
  259.       GC         : Gdk.GC.Gdk_GC) renames Set_Dark_GC; 
  260.    function Get_Dark 
  261.      (Style      : Gtk_Style; 
  262.       State_Type : Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  263.    function Get_Dark_GC 
  264.      (Style      : Gtk_Style; 
  265.       State_Type : Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  266.    function Get_Dark 
  267.      (Style      : Gtk_Style; 
  268.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Dark_GC; 
  269.    --  Set or get the darker color or graphic context that this style is using. 
  270.    --  This color is used to draw the shadows around rectangles for instance. 
  271.  
  272.    procedure Set_Middle 
  273.      (Style      : Gtk_Style; 
  274.       State_Type : Gtk_State_Type; 
  275.       Color      : Gdk.Color.Gdk_Color); 
  276.    procedure Set_Mid 
  277.      (Style      : Gtk_Style; 
  278.       State_Type : Gtk_State_Type; 
  279.       Color      : Gdk.Color.Gdk_Color) renames Set_Middle; 
  280.    function Get_Middle 
  281.      (Style      : Gtk_Style; 
  282.       State_Type : Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  283.    function Get_Mid 
  284.      (Style      : Gtk_Style; 
  285.       State_Type : Gtk_State_Type) return Gdk_Color renames Get_Middle; 
  286.    procedure Set_Middle_GC 
  287.      (Style      : Gtk_Style; 
  288.       State_Type : Enums.Gtk_State_Type; 
  289.       GC         : Gdk.GC.Gdk_GC); 
  290.    function Get_Middle_GC 
  291.      (Style      : Gtk_Style; 
  292.       State_Type : Gtk_State_Type) return Gdk_GC; 
  293.    procedure Set_Middle 
  294.      (Style      : Gtk_Style; 
  295.       State_Type : Enums.Gtk_State_Type; 
  296.       GC         : Gdk_GC) renames Set_Middle_GC; 
  297.    function Get_Middle 
  298.      (Style      : Gtk_Style; 
  299.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Middle_GC; 
  300.    procedure Set_Mid_GC 
  301.      (Style      : Gtk_Style; 
  302.       State_Type : Enums.Gtk_State_Type; 
  303.       GC         : Gdk_GC) renames Set_Middle_GC; 
  304.    function Get_Mid_GC 
  305.      (Style      : Gtk_Style; 
  306.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Middle_GC; 
  307.    procedure Set_Mid 
  308.      (Style      : Gtk_Style; 
  309.       State_Type : Enums.Gtk_State_Type; 
  310.       GC         : Gdk.GC.Gdk_GC) renames Set_Middle_GC; 
  311.    function Get_Mid 
  312.      (Style      : Gtk_Style; 
  313.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Middle_GC; 
  314.    --  Set or get the middle color. This color should be between the light and 
  315.    --  dark colors set above. 
  316.  
  317.    procedure Set_Text 
  318.      (Style      : Gtk_Style; 
  319.       State_Type : Enums.Gtk_State_Type; 
  320.       Color      : Gdk.Color.Gdk_Color); 
  321.    function Get_Text 
  322.      (Style      : Gtk_Style; 
  323.       State_Type : Enums.Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  324.    procedure Set_Text_GC 
  325.      (Style      : Gtk_Style; 
  326.       State_Type : Enums.Gtk_State_Type; 
  327.       GC         : Gdk.GC.Gdk_GC); 
  328.    function Get_Text_GC 
  329.      (Style      : Gtk_Style; 
  330.       State_Type : Enums.Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  331.    procedure Set_Text 
  332.      (Style      : Gtk_Style; 
  333.       State_Type : Enums.Gtk_State_Type; 
  334.       GC         : Gdk.GC.Gdk_GC) renames Set_Text_GC; 
  335.    function Get_Text 
  336.      (Style      : Gtk_Style; 
  337.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Text_GC; 
  338.    --  Set or get the color to use when drawing text. 
  339.  
  340.    procedure Set_Base 
  341.      (Style      : Gtk_Style; 
  342.       State_Type : Enums.Gtk_State_Type; 
  343.       Color      : Gdk.Color.Gdk_Color); 
  344.    function Get_Base 
  345.      (Style      : Gtk_Style; 
  346.       State_Type : Enums.Gtk_State_Type) return Gdk.Color.Gdk_Color; 
  347.    procedure Set_Base_GC 
  348.      (Style      : Gtk_Style; 
  349.       State_Type : Enums.Gtk_State_Type; 
  350.       GC         : Gdk.GC.Gdk_GC); 
  351.    function Get_Base_GC 
  352.      (Style      : Gtk_Style; 
  353.       State_Type : Enums.Gtk_State_Type) return Gdk.GC.Gdk_GC; 
  354.    procedure Set_Base 
  355.      (Style      : Gtk_Style; 
  356.       State_Type : Enums.Gtk_State_Type; 
  357.       GC         : Gdk.GC.Gdk_GC) renames Set_Base_GC; 
  358.    function Get_Base 
  359.      (Style      : Gtk_Style; 
  360.       State_Type : Gtk_State_Type) return Gdk_GC renames Get_Base_GC; 
  361.    --  Set or get the base color 
  362.  
  363.    procedure Set_Black 
  364.      (Style : Gtk_Style; 
  365.       Color : Gdk.Color.Gdk_Color); 
  366.    function Get_Black (Style : Gtk_Style) return Gdk.Color.Gdk_Color; 
  367.    procedure Set_Black_GC (Style : Gtk_Style; GC : Gdk.GC.Gdk_GC); 
  368.    function Get_Black_GC (Style : Gtk_Style) return Gdk.GC.Gdk_GC; 
  369.    procedure Set_Black 
  370.      (Style : Gtk_Style; GC : Gdk.GC.Gdk_GC) renames Set_Black_GC; 
  371.    function Get_Black 
  372.      (Style : Gtk_Style) return Gdk.GC.Gdk_GC renames Get_Black_GC; 
  373.    --  Set or get the "black" color. It isn't necessarily black, although most 
  374.    --  themes will want to use black here. 
  375.  
  376.    procedure Set_White (Style : Gtk_Style; Color : Gdk.Color.Gdk_Color); 
  377.    function Get_White (Style : Gtk_Style) return Gdk.Color.Gdk_Color; 
  378.    procedure Set_White_GC (Style : Gtk_Style; GC : Gdk.GC.Gdk_GC); 
  379.    function Get_White_GC (Style : Gtk_Style) return Gdk.GC.Gdk_GC; 
  380.    procedure Set_White 
  381.      (Style : Gtk_Style; GC : Gdk.GC.Gdk_GC) renames Set_White_GC; 
  382.    function Get_White 
  383.      (Style : Gtk_Style) return Gdk.GC.Gdk_GC renames Get_White_GC; 
  384.    --  Set or get the "white" color. It isn't necessarily white, although most 
  385.    --  themes will want to use white here. 
  386.  
  387.    procedure Set_Font_Description 
  388.      (Style : Gtk_Style; Desc : Pango.Font.Pango_Font_Description); 
  389.    function Get_Font_Description 
  390.      (Style : Gtk_Style) return Pango.Font.Pango_Font_Description; 
  391.    --  Set or get the font to use for this style 
  392.  
  393.    --  <doc_ignore> 
  394.    function Get_Font (Style : Gtk_Style) return Gdk.Font.Gdk_Font; 
  395.    pragma Obsolescent ("Use Get_Font_Description");  --  Get_Font 
  396.    --  </doc_ignore> 
  397.  
  398.    procedure Set_Bg_Pixmap 
  399.      (Style      : Gtk_Style; 
  400.       State_Type : Enums.Gtk_State_Type; 
  401.       Pixmap     : Gdk.Pixmap.Gdk_Pixmap); 
  402.    function Get_Bg_Pixmap 
  403.      (Style      : Gtk_Style; 
  404.       State_Type : Enums.Gtk_State_Type) return Gdk.Pixmap.Gdk_Pixmap; 
  405.    --  Set or get the pixmap to use for background 
  406.  
  407.    function X_Thickness (Style : Gtk_Style) return Gint; 
  408.    --  Width of the vertical scrollbars and ranges when Style is applied. 
  409.    --  In fact, this thickness is used for a lot of widgets whose width 
  410.    --  does not depend on their content, such as rulers,... 
  411.  
  412.    function Y_Thickness (Style : Gtk_Style) return Gint; 
  413.    --  Height of the horizontal scrollbars and ranges when Style is applied. 
  414.  
  415.    -------------- 
  416.    -- Painting -- 
  417.    -------------- 
  418.    --  All the subprograms below have similar profiles. 
  419.    --  Area is always a clipping area. Drawing only takes place within that 
  420.    --  area, and pixels outside of it are not affected. 
  421.    --  Detail is a theme-specific detail string. This is generally provided by 
  422.    --  the application (or rather gtk+ itself) to indicate that the drawing 
  423.    --  should be slightly different, and Detail describes the exact contact. 
  424.    --  All drawings are done on Window. Widget is used to draw specific 
  425.    --  things depending on the widget type. 
  426.  
  427.    procedure Draw_Insertion_Cursor 
  428.      (Widget     : access Gtk.Object.Gtk_Object_Record'Class; 
  429.       Drawable   : Gdk_Drawable; 
  430.       Area       : Gdk.Rectangle.Gdk_Rectangle; 
  431.       Location   : Gdk.Rectangle.Gdk_Rectangle; 
  432.       Is_Primary : Boolean; 
  433.       Direction  : Gtk_Text_Direction; 
  434.       Draw_Arrow : Boolean); 
  435.    --  Draws a text caret on Drawable at Location. This is not a style function 
  436.    --  but merely a convenience function for drawing the standard cursor shape. 
  437.    --  Is_Primary indicates whether the cursor should be the primary cursor 
  438.    --  color. Direction is the text direction. Draw_Arrow should be true to 
  439.    --  draw a directional arrow on the cursor. Should be False unless the 
  440.    --  cursor is split. 
  441.  
  442.    procedure Paint_Handle 
  443.      (Style               : Gtk_Style; 
  444.       Window              : Gdk.Gdk_Window; 
  445.       State_Type          : Gtk.Enums.Gtk_State_Type; 
  446.       Shadow_Type         : Gtk.Enums.Gtk_Shadow_Type; 
  447.       Area                : Gdk.Rectangle.Gdk_Rectangle; 
  448.       Widget              : access Gtk.Object.Gtk_Object_Record'Class; 
  449.       Detail              : String := "paned"; 
  450.       X, Y, Width, Height : Gint; 
  451.       Orientation         : Gtk.Enums.Gtk_Orientation); 
  452.    --  Paint the handles as is done in the Gtk_Paned widget (ie a series of 
  453.    --  small dots in Window, that indicate that Window can be manipulated and 
  454.    --  resized. 
  455.    --  If Detail is "paned", only a few dots are painted in the middle of 
  456.    --  window (aligned either horizontally or vertically depending on 
  457.    --  Orientation). Any other value for Detail draws points on the whole 
  458.    --  length of Window. 
  459.    --  (X, Y, Width, Height) is the area in which the dots should be painted. 
  460.    --  For the whole window, use (0, 0, -1, -1). 
  461.    --  Only the area that intersect Area is drawn. 
  462.  
  463.    procedure Paint_Arrow 
  464.      (Style       : access Gtk_Style_Record; 
  465.       Window      : Gdk_Window; 
  466.       State_Type  : Gtk_State_Type; 
  467.       Shadow_Type : Gtk_Shadow_Type; 
  468.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  469.       Widget      : access Glib.Object.GObject_Record'Class; 
  470.       Detail      : String := ""; 
  471.       Arrow_Type  : Gtk_Arrow_Type; 
  472.       Fill        : Boolean; 
  473.       X           : Gint; 
  474.       Y           : Gint; 
  475.       Width       : Gint; 
  476.       Height      : Gint); 
  477.    --  Draws an arrow in the given rectangle on Window using the given 
  478.    --  parameters. Arrow_Type determines the direction of the arrow. 
  479.    --  The default theme engine only recognazied "menu_scroll_arrow_up" for 
  480.    --  Detail. 
  481.  
  482.    procedure Paint_Box 
  483.      (Style       : access Gtk_Style_Record; 
  484.       Window      : Gdk_Window; 
  485.       State_Type  : Gtk_State_Type; 
  486.       Shadow_Type : Gtk_Shadow_Type; 
  487.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  488.       Widget      : access Glib.Object.GObject_Record'Class; 
  489.       Detail      : String := ""; 
  490.       X           : Gint; 
  491.       Y           : Gint; 
  492.       Width       : Gint; 
  493.       Height      : Gint); 
  494.    --  Draws a box on Window with the given parameters. 
  495.    --  The default theme engine recognizes the following for Detail: 
  496.    --  "spinbutton_up", "spinbutton_down", "paned", "optionmenu" 
  497.  
  498.    procedure Paint_Box_Gap 
  499.      (Style       : access Gtk_Style_Record; 
  500.       Window      : Gdk_Window; 
  501.       State_Type  : Gtk_State_Type; 
  502.       Shadow_Type : Gtk_Shadow_Type; 
  503.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  504.       Widget      : access Glib.Object.GObject_Record'Class; 
  505.       Detail      : String := ""; 
  506.       X           : Gint; 
  507.       Y           : Gint; 
  508.       Width       : Gint; 
  509.       Height      : Gint; 
  510.       Gap_Side    : Gtk_Position_Type; 
  511.       Gap_X       : Gint; 
  512.       Gap_Width   : Gint); 
  513.    --  Draws a box in Window using the given style and state and shadow type, 
  514.    --  leaving a gap in one side. 
  515.  
  516.    procedure Paint_Check 
  517.      (Style       : access Gtk_Style_Record; 
  518.       Window      : Gdk_Window; 
  519.       State_Type  : Gtk_State_Type; 
  520.       Shadow_Type : Gtk_Shadow_Type; 
  521.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  522.       Widget      : access Glib.Object.GObject_Record'Class; 
  523.       Detail      : String := ""; 
  524.       X           : Gint; 
  525.       Y           : Gint; 
  526.       Width       : Gint; 
  527.       Height      : Gint); 
  528.    --  Draws a check button indicator in the given rectangle on Window with 
  529.    --  the given parameters. The default theme handles the following values for 
  530.    --  detail: "cellcheck", "check" 
  531.  
  532.    procedure Paint_Diamond 
  533.      (Style       : access Gtk_Style_Record; 
  534.       Window      : Gdk_Window; 
  535.       State_Type  : Gtk_State_Type; 
  536.       Shadow_Type : Gtk_Shadow_Type; 
  537.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  538.       Widget      : access Glib.Object.GObject_Record'Class; 
  539.       Detail      : String := ""; 
  540.       X           : Gint; 
  541.       Y           : Gint; 
  542.       Width       : Gint; 
  543.       Height      : Gint); 
  544.    --  Draws a diamond in the given rectangle on Window using the given 
  545.    --  parameters. 
  546.  
  547.    procedure Paint_Expander 
  548.      (Style          : access Gtk_Style_Record; 
  549.       Window         : Gdk_Window; 
  550.       State_Type     : Gtk_State_Type; 
  551.       Area           : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  552.       Widget         : access Glib.Object.GObject_Record'Class; 
  553.       Detail         : String := ""; 
  554.       X              : Gint; 
  555.       Y              : Gint; 
  556.       Expander_Style : Gtk_Expander_Style); 
  557.    --  Draws an expander as used in Gtk_Tree_View. X and Y specify the center 
  558.    --  the expander. The size of the expander is determined by the 
  559.    --  "expander-size" style property of Widget. (If widget is not specified or 
  560.    --  doesn't have an "expander-size" property, an unspecified default size 
  561.    --  will be used, since the caller doesn't have sufficient information to 
  562.    --  position the expander, this is likely not useful.) The expander is 
  563.    --  expander_size pixels tall in the collapsed position and expander_size 
  564.    --  pixels wide in the expanded position. 
  565.  
  566.    procedure Paint_Extension 
  567.      (Style       : access Gtk_Style_Record; 
  568.       Window      : Gdk_Window; 
  569.       State_Type  : Gtk_State_Type; 
  570.       Shadow_Type : Gtk_Shadow_Type; 
  571.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  572.       Widget      : access Glib.Object.GObject_Record'Class; 
  573.       Detail      : String := ""; 
  574.       X           : Gint; 
  575.       Y           : Gint; 
  576.       Width       : Gint; 
  577.       Height      : Gint; 
  578.       Gap_Side    : Gtk_Position_Type); 
  579.    --  Draws an extension, i.e. a notebook tab. 
  580.  
  581.    procedure Paint_Flat_Box 
  582.      (Style       : access Gtk_Style_Record; 
  583.       Window      : Gdk_Window; 
  584.       State_Type  : Gtk_State_Type; 
  585.       Shadow_Type : Gtk_Shadow_Type; 
  586.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  587.       Widget      : access Glib.Object.GObject_Record'Class; 
  588.       Detail      : String := ""; 
  589.       X           : Gint; 
  590.       Y           : Gint; 
  591.       Width       : Gint; 
  592.       Height      : Gint); 
  593.    --  Draws a flat box on Window with the given parameters. 
  594.  
  595.    procedure Paint_Focus 
  596.      (Style      : access Gtk_Style_Record; 
  597.       Window     : Gdk_Window; 
  598.       State_Type : Gtk_State_Type; 
  599.       Area       : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  600.       Widget     : access Glib.Object.GObject_Record'Class; 
  601.       Detail     : String := ""; 
  602.       X          : Gint; 
  603.       Y          : Gint; 
  604.       Width      : Gint; 
  605.       Height     : Gint); 
  606.    --  Draws a focus indicator around the given rectangle on Window using the 
  607.    --  given style. 
  608.  
  609.    procedure Paint_Hline 
  610.      (Style      : access Gtk_Style_Record; 
  611.       Window     : Gdk_Window; 
  612.       State_Type : Gtk_State_Type; 
  613.       Area       : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  614.       Widget     : access Glib.Object.GObject_Record'Class; 
  615.       Detail     : String := ""; 
  616.       X1         : Gint; 
  617.       X2         : Gint; 
  618.       Y          : Gint); 
  619.    --  Draws a horizontal line from (X1, Y) to (X2, Y) in Window 
  620.    --  using the given style and state. 
  621.  
  622.    procedure Paint_Layout 
  623.      (Style      : access Gtk_Style_Record; 
  624.       Window     : Gdk_Window; 
  625.       State_Type : Gtk_State_Type; 
  626.       Use_Text   : Boolean; 
  627.       Area       : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  628.       Widget     : access Glib.Object.GObject_Record'Class; 
  629.       Detail     : String := ""; 
  630.       X          : Gint; 
  631.       Y          : Gint; 
  632.       Layout     : Pango.Layout.Pango_Layout); 
  633.    --  Draws a layout on Window using the given parameters. 
  634.  
  635.    procedure Paint_Option 
  636.      (Style       : access Gtk_Style_Record; 
  637.       Window      : Gdk_Window; 
  638.       State_Type  : Gtk_State_Type; 
  639.       Shadow_Type : Gtk_Shadow_Type; 
  640.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  641.       Widget      : access Glib.Object.GObject_Record'Class; 
  642.       Detail      : String := ""; 
  643.       X           : Gint; 
  644.       Y           : Gint; 
  645.       Width       : Gint; 
  646.       Height      : Gint); 
  647.    --  Draws a radio button indicator in the given rectangle on Window with 
  648.    --  the given parameters. 
  649.  
  650.    procedure Paint_Polygon 
  651.      (Style       : access Gtk_Style_Record; 
  652.       Window      : Gdk_Window; 
  653.       State_Type  : Gtk_State_Type; 
  654.       Shadow_Type : Gtk_Shadow_Type; 
  655.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  656.       Widget      : access Glib.Object.GObject_Record'Class; 
  657.       Detail      : String := ""; 
  658.       Points      : Gdk.Types.Gdk_Point; 
  659.       Npoints     : Gint; 
  660.       Fill        : Boolean); 
  661.    --  Draws a polygon on Window with the given parameters. 
  662.  
  663.    procedure Paint_Resize_Grip 
  664.      (Style      : access Gtk_Style_Record; 
  665.       Window     : Gdk_Window; 
  666.       State_Type : Gtk_State_Type; 
  667.       Area       : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  668.       Widget     : access Glib.Object.GObject_Record'Class; 
  669.       Detail     : String := ""; 
  670.       Edge       : Gdk.Window.Gdk_Window_Edge; 
  671.       X          : Gint; 
  672.       Y          : Gint; 
  673.       Width      : Gint; 
  674.       Height     : Gint); 
  675.    --  Draws a resize grip in the given rectangle on Window using the given 
  676.    --  parameters. 
  677.  
  678.    procedure Paint_Shadow 
  679.      (Style       : access Gtk_Style_Record; 
  680.       Window      : Gdk_Window; 
  681.       State_Type  : Gtk_State_Type; 
  682.       Shadow_Type : Gtk_Shadow_Type; 
  683.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  684.       Widget      : access Glib.Object.GObject_Record'Class; 
  685.       Detail      : String := ""; 
  686.       X           : Gint; 
  687.       Y           : Gint; 
  688.       Width       : Gint; 
  689.       Height      : Gint); 
  690.    --  Draws a shadow around the given rectangle in Window using the given 
  691.    --  style and state and shadow type. 
  692.  
  693.    procedure Paint_Shadow_Gap 
  694.      (Style       : access Gtk_Style_Record; 
  695.       Window      : Gdk_Window; 
  696.       State_Type  : Gtk_State_Type; 
  697.       Shadow_Type : Gtk_Shadow_Type; 
  698.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  699.       Widget      : access Glib.Object.GObject_Record'Class; 
  700.       Detail      : String := ""; 
  701.       X           : Gint; 
  702.       Y           : Gint; 
  703.       Width       : Gint; 
  704.       Height      : Gint; 
  705.       Gap_Side    : Gtk_Position_Type; 
  706.       Gap_X       : Gint; 
  707.       Gap_Width   : Gint); 
  708.    --  Draws a shadow around the given rectangle in Window 
  709.    --  using the given style and state and shadow type, leaving a 
  710.    --  gap in one side. 
  711.  
  712.    procedure Paint_Slider 
  713.      (Style       : access Gtk_Style_Record; 
  714.       Window      : Gdk_Window; 
  715.       State_Type  : Gtk_State_Type; 
  716.       Shadow_Type : Gtk_Shadow_Type; 
  717.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  718.       Widget      : access Glib.Object.GObject_Record'Class; 
  719.       Detail      : String := ""; 
  720.       X           : Gint; 
  721.       Y           : Gint; 
  722.       Width       : Gint; 
  723.       Height      : Gint; 
  724.       Orientation : Gtk_Orientation); 
  725.    --  Draws a slider in the given rectangle on Window using the given style 
  726.    --  and orientation. 
  727.  
  728.    procedure Paint_Tab 
  729.      (Style       : access Gtk_Style_Record; 
  730.       Window      : Gdk_Window; 
  731.       State_Type  : Gtk_State_Type; 
  732.       Shadow_Type : Gtk_Shadow_Type; 
  733.       Area        : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  734.       Widget      : access Glib.Object.GObject_Record'Class; 
  735.       Detail      : String := ""; 
  736.       X           : Gint; 
  737.       Y           : Gint; 
  738.       Width       : Gint; 
  739.       Height      : Gint); 
  740.    --  Draws an option menu tab (i.e. the up and down pointing arrows) in the 
  741.    --  given rectangle on Window using the given parameters. 
  742.  
  743.    procedure Paint_Vline 
  744.      (Style      : access Gtk_Style_Record; 
  745.       Window     : Gdk_Window; 
  746.       State_Type : Gtk_State_Type; 
  747.       Area       : Gdk.Rectangle.Gdk_Rectangle := Gdk.Rectangle.Full_Area; 
  748.       Widget     : access Glib.Object.GObject_Record'Class; 
  749.       Detail     : String := ""; 
  750.       Y1         : Gint; 
  751.       Y2         : Gint; 
  752.       X          : Gint); 
  753.    --  Draws a vertical line from (X, Y1) to (X, Y2) in Window 
  754.    --  using the given style and state. 
  755.  
  756.    ------------- 
  757.    -- Drawing -- 
  758.    ------------- 
  759.    --  All these procedures are obsolescent, and have been replaced by the 
  760.    --  Paint_* versions below. 
  761.    --  <doc_ignore> 
  762.  
  763.    procedure Draw_Polygon 
  764.      (Style       : Gtk_Style; 
  765.       Window      : Gdk.Window.Gdk_Window; 
  766.       State_Type  : Enums.Gtk_State_Type; 
  767.       Shadow_Type : Enums.Gtk_Shadow_Type; 
  768.       Points      : Gdk.Types.Gdk_Points_Array; 
  769.       Fill        : Boolean); 
  770.    pragma Obsolescent ("Use Paint_Polygon");  --  Draw_Polygon 
  771.    --  Draws a polygon in Window 
  772.  
  773.    procedure Draw_Arrow 
  774.      (Style       : Gtk_Style; 
  775.       Window      : Gdk.Window.Gdk_Window; 
  776.       State_Type  : Enums.Gtk_State_Type; 
  777.       Shadow_Type : Enums.Gtk_Shadow_Type; 
  778.       Arrow_Type  : Enums.Gtk_Arrow_Type; 
  779.       Fill        : Boolean; 
  780.       X, Y        : Gint; 
  781.       Width       : Gint; 
  782.       Height      : Gint); 
  783.    pragma Obsolescent ("Use Pain_Arrow");  --  Draw_Arrow 
  784.    --  Draws an arrow in Window, within the given rectangle 
  785.  
  786.    procedure Draw_Shadow 
  787.      (Style       : access Gtk_Style_Record; 
  788.       Window      : Gdk_Window; 
  789.       State_Type  : Gtk_State_Type; 
  790.       Shadow_Type : Gtk_Shadow_Type; 
  791.       X           : Gint; 
  792.       Y           : Gint; 
  793.       Width       : Gint; 
  794.       Height      : Gint); 
  795.    pragma Obsolescent;  --  Draw_Shadow 
  796.    --  Draws a shadow around the given rectangle in @window 
  797.    --  using the given style and state and shadow type. 
  798.  
  799.  
  800.    procedure Draw_String 
  801.      (Style       : Gtk_Style; 
  802.       Window      : Gdk.Window.Gdk_Window; 
  803.       State_Type  : Enums.Gtk_State_Type; 
  804.       X, Y        : Gint; 
  805.       Str         : UTF8_String); 
  806.    pragma Obsolescent ("Use Paint_String");  --  Draw_String 
  807.    --  Draws a text on Window 
  808.  
  809.    --  </doc_ignore> 
  810.  
  811.    ------------- 
  812.    -- Borders -- 
  813.    ------------- 
  814.  
  815.    type Gtk_Border_Record is record 
  816.       Left   : Gint; 
  817.       Right  : Gint; 
  818.       Top    : Gint; 
  819.       Bottom : Gint; 
  820.    end record; 
  821.    pragma Convention (C, Gtk_Border_Record); 
  822.    type Gtk_Border is access all Gtk_Border_Record; 
  823.  
  824.    function Border_Copy (Border : access Gtk_Border_Record) return Gtk_Border; 
  825.    --  Copies a Gtk_Border structure. 
  826.  
  827.    procedure Border_Free (Border : access Gtk_Border_Record); 
  828.    --  Frees a Gtk_Border structure. 
  829.  
  830.    function Border_Get_Type return GType; 
  831.  
  832.    ------------- 
  833.    -- Signals -- 
  834.    ------------- 
  835.  
  836.    --  <signals> 
  837.    --  The following new signals are defined for this widget: 
  838.    -- 
  839.    --  - "realize" 
  840.    --    procedure Handler (Style : access Gtk_Style_Record'Class); 
  841.    --    Emitted when the style has been initialized for a particular colormap 
  842.    --    and depth. Connecting to this signal is probably seldom useful since 
  843.    --    most of the time applications and widgets only deal with styles that 
  844.    --    have been already realized. 
  845.    -- 
  846.    --  - "unrealize" 
  847.    --    procedure Handler (Style : access Gtk_Style_Record'Class); 
  848.    --    Emitted when the aspects of the style specific to a particular 
  849.    --    colormap and depth are being cleaned up. A connection to this signal 
  850.    --    can be useful if a widget wants to cache objects like a Gdk_GC as 
  851.    --    object data on Gtk_Style. This signal provides a convenient place to 
  852.    --    free such cached objects. 
  853.    -- 
  854.    --  </signals> 
  855.  
  856.    Signal_Realize   : constant Glib.Signal_Name := "realize"; 
  857.    Signal_Unrealize : constant Glib.Signal_Name := "unrealize"; 
  858.  
  859. private 
  860.    pragma Import (C, Get_Type, "gtk_style_get_type"); 
  861. end Gtk.Style; 
  862.  
  863. --  The following subprograms never had a binding, and are now obsolescent: 
  864. --  No binding: gtk_draw_box 
  865. --  No binding: gtk_draw_box_gap 
  866. --  No binding: gtk_draw_check 
  867. --  No binding: gtk_draw_diamond 
  868. --  No binding: gtk_draw_expander 
  869. --  No binding: gtk_draw_extension 
  870. --  No binding: gtk_draw_flat_box 
  871. --  No binding: gtk_draw_focus 
  872. --  No binding: gtk_draw_handle 
  873. --  No binding: gtk_draw_hline 
  874. --  No binding: gtk_draw_layout 
  875. --  No binding: gtk_draw_option 
  876. --  No binding: gtk_draw_resize_grip 
  877. --  No binding: gtk_draw_shadow_gap 
  878. --  No binding: gtk_draw_slider 
  879. --  No binding: gtk_draw_tab 
  880. --  No binding: gtk_draw_vline 
  881. --  No binding: gtk_paint_string 
  882. --  No binding: gtk_style_set_font 
  883.  
  884. --  These are obsolescent, and inherited anyway 
  885. --  No binding: gtk_style_ref 
  886. --  No binding: gtk_style_unref 
  887.  
  888. --  Binding is in gtk-icon_factory.ads 
  889. --  No binding: gtk_style_lookup_icon_set 
  890. --  No binding: gtk_style_render_icon