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