1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  GtkStyleProperties provides the storage for style information that is used 
  26. --  by Gtk.Style_Context.Gtk_Style_Context and other 
  27. --  Gtk.Style_Provider.Gtk_Style_Provider implementations. 
  28. -- 
  29. --  Before style properties can be stored in GtkStyleProperties, they must be 
  30. --  registered with gtk_style_properties_register_property. 
  31. -- 
  32. --  Unless you are writing a Gtk.Style_Provider.Gtk_Style_Provider 
  33. --  implementation, you are unlikely to use this API directly, as 
  34. --  gtk_style_context_get and its variants are the preferred way to access 
  35. --  styling information from widget implementations and theming engine 
  36. --  implementations should use the APIs provided by 
  37. --  Gtk.Theming_Engine.Gtk_Theming_Engine instead. 
  38. -- 
  39. --  </description> 
  40. pragma Ada_2005; 
  41.  
  42. pragma Warnings (Off, "*is already use-visible*"); 
  43. with Glib;               use Glib; 
  44. with Glib.Object;        use Glib.Object; 
  45. with Glib.Types;         use Glib.Types; 
  46. with Glib.Values;        use Glib.Values; 
  47. with Gtk.Enums;          use Gtk.Enums; 
  48. with Gtk.Style_Provider; use Gtk.Style_Provider; 
  49. with Gtk.Symbolic_Color; use Gtk.Symbolic_Color; 
  50. with Gtk.Widget;         use Gtk.Widget; 
  51.  
  52. package Gtk.Style_Properties is 
  53.  
  54.    type Gtk_Style_Properties_Record is new GObject_Record with null record; 
  55.    type Gtk_Style_Properties is access all Gtk_Style_Properties_Record'Class; 
  56.  
  57.    ------------------ 
  58.    -- Constructors -- 
  59.    ------------------ 
  60.  
  61.    procedure Gtk_New (Self : out Gtk_Style_Properties); 
  62.    procedure Initialize 
  63.       (Self : not null access Gtk_Style_Properties_Record'Class); 
  64.    --  Returns a newly created Gtk.Style_Properties.Gtk_Style_Properties 
  65.  
  66.    function Gtk_Style_Properties_New return Gtk_Style_Properties; 
  67.    --  Returns a newly created Gtk.Style_Properties.Gtk_Style_Properties 
  68.  
  69.    function Get_Type return Glib.GType; 
  70.    pragma Import (C, Get_Type, "gtk_style_properties_get_type"); 
  71.  
  72.    ------------- 
  73.    -- Methods -- 
  74.    ------------- 
  75.  
  76.    procedure Clear (Self : not null access Gtk_Style_Properties_Record); 
  77.    --  Clears all style information from Props. 
  78.  
  79.    procedure Get_Property 
  80.       (Self     : not null access Gtk_Style_Properties_Record; 
  81.        Property : UTF8_String; 
  82.        State    : Gtk.Enums.Gtk_State_Flags; 
  83.        Value    : out Glib.Values.GValue; 
  84.        Exists   : out Boolean); 
  85.    --  Gets a style property from Props for the given state. When done with 
  86.    --  Value, g_value_unset needs to be called to free any allocated memory. 
  87.    --  Since: gtk+ 3.0 
  88.    --  "property": style property name 
  89.    --  "state": state to retrieve the property value for 
  90.    --  "value": return location for the style property value. 
  91.  
  92.    procedure Set_Property 
  93.       (Self     : not null access Gtk_Style_Properties_Record; 
  94.        Property : UTF8_String; 
  95.        State    : Gtk.Enums.Gtk_State_Flags; 
  96.        Value    : in out Glib.Values.GValue); 
  97.    --  Sets a styling property in Props. 
  98.    --  Since: gtk+ 3.0 
  99.    --  "property": styling property to set 
  100.    --  "state": state to set the value for 
  101.    --  "value": new value for the property 
  102.  
  103.    function Lookup_Color 
  104.       (Self : not null access Gtk_Style_Properties_Record; 
  105.        Name : UTF8_String) return Gtk.Symbolic_Color.Gtk_Symbolic_Color; 
  106.    pragma Obsolescent (Lookup_Color); 
  107.    --  Returns the symbolic color that is mapped to Name. 
  108.    --  Since: gtk+ 3.0 
  109.    --  Deprecated since 3.8, Gtk.Symbolic_Color.Gtk_Symbolic_Color is 
  110.    --  deprecated. 
  111.    --  "name": color name to lookup 
  112.  
  113.    procedure Map_Color 
  114.       (Self  : not null access Gtk_Style_Properties_Record; 
  115.        Name  : UTF8_String; 
  116.        Color : Gtk.Symbolic_Color.Gtk_Symbolic_Color); 
  117.    pragma Obsolescent (Map_Color); 
  118.    --  Maps Color so it can be referenced by Name. See 
  119.    --  Gtk.Style_Properties.Lookup_Color 
  120.    --  Since: gtk+ 3.0 
  121.    --  Deprecated since 3.8, Gtk.Symbolic_Color.Gtk_Symbolic_Color is 
  122.    --  deprecated. 
  123.    --  "name": color name 
  124.    --  "color": Gtk.Symbolic_Color.Gtk_Symbolic_Color to map Name to 
  125.  
  126.    procedure Merge 
  127.       (Self           : not null access Gtk_Style_Properties_Record; 
  128.        Props_To_Merge : not null access Gtk_Style_Properties_Record'Class; 
  129.        Replace        : Boolean); 
  130.    --  Merges into Props all the style information contained in 
  131.    --  Props_To_Merge. If Replace is True, the values will be overwritten, if 
  132.    --  it is False, the older values will prevail. 
  133.    --  Since: gtk+ 3.0 
  134.    --  "props_to_merge": a second Gtk.Style_Properties.Gtk_Style_Properties 
  135.    --  "replace": whether to replace values or not 
  136.  
  137.    procedure Unset_Property 
  138.       (Self     : not null access Gtk_Style_Properties_Record; 
  139.        Property : UTF8_String; 
  140.        State    : Gtk.Enums.Gtk_State_Flags); 
  141.    --  Unsets a style property in Props. 
  142.    --  Since: gtk+ 3.0 
  143.    --  "property": property to unset 
  144.    --  "state": state to unset 
  145.  
  146.    --------------------------------------------- 
  147.    -- Inherited subprograms (from interfaces) -- 
  148.    --------------------------------------------- 
  149.  
  150.    procedure Get_Style_Property 
  151.       (Self  : not null access Gtk_Style_Properties_Record; 
  152.        Path  : Gtk.Widget.Gtk_Widget_Path; 
  153.        State : Gtk.Enums.Gtk_State_Flags; 
  154.        Pspec : in out Glib.Param_Spec; 
  155.        Value : out Glib.Values.GValue; 
  156.        Found : out Boolean); 
  157.  
  158.    ---------------- 
  159.    -- Interfaces -- 
  160.    ---------------- 
  161.    --  This class implements several interfaces. See Glib.Types 
  162.    -- 
  163.    --  - "StyleProvider" 
  164.  
  165.    package Implements_Gtk_Style_Provider is new Glib.Types.Implements 
  166.      (Gtk.Style_Provider.Gtk_Style_Provider, Gtk_Style_Properties_Record, Gtk_Style_Properties); 
  167.    function "+" 
  168.      (Widget : access Gtk_Style_Properties_Record'Class) 
  169.    return Gtk.Style_Provider.Gtk_Style_Provider 
  170.    renames Implements_Gtk_Style_Provider.To_Interface; 
  171.    function "-" 
  172.      (Interf : Gtk.Style_Provider.Gtk_Style_Provider) 
  173.    return Gtk_Style_Properties 
  174.    renames Implements_Gtk_Style_Provider.To_Object; 
  175.  
  176. end Gtk.Style_Properties;