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