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. --  GtkSymbolicColor is a boxed type that represents a symbolic color. It is 
  26. --  the result of parsing a <link 
  27. --  linkend="gtkcssprovider-symbolic-colors">color expression</link>. To obtain 
  28. --  the color represented by a GtkSymbolicColor, it has to be resolved with 
  29. --  gtk_symbolic_color_resolve, which replaces all symbolic color references by 
  30. --  the colors they refer to (in a given context) and evaluates mix, shade and 
  31. --  other expressions, resulting in a Gdk.RGBA.Gdk_RGBA value. 
  32. -- 
  33. --  It is not normally necessary to deal directly with Gtk_Symbolic_Colors, 
  34. --  since they are mostly used behind the scenes by 
  35. --  Gtk.Style_Context.Gtk_Style_Context and Gtk.Css_Provider.Gtk_Css_Provider. 
  36. -- 
  37. --  Gtk.Symbolic_Color.Gtk_Symbolic_Color is deprecated. Symbolic colors are 
  38. --  considered an implementation detail of GTK+. 
  39. -- 
  40. --  </description> 
  41. pragma Ada_2005; 
  42.  
  43. pragma Warnings (Off, "*is already use-visible*"); 
  44. with Gdk.RGBA; use Gdk.RGBA; 
  45. with Glib;     use Glib; 
  46.  
  47. package Gtk.Symbolic_Color is 
  48.  
  49.    type Gtk_Symbolic_Color is new Glib.C_Boxed with null record; 
  50.    Null_Gtk_Symbolic_Color : constant Gtk_Symbolic_Color; 
  51.  
  52.    function From_Object (Object : System.Address) return Gtk_Symbolic_Color; 
  53.    function From_Object_Free (B : access Gtk_Symbolic_Color'Class) return Gtk_Symbolic_Color; 
  54.    pragma Inline (From_Object_Free, From_Object); 
  55.  
  56.    ------------------ 
  57.    -- Constructors -- 
  58.    ------------------ 
  59.  
  60.    procedure Gtk_New_Alpha 
  61.       (Self   : out Gtk_Symbolic_Color; 
  62.        Color  : Gtk_Symbolic_Color; 
  63.        Factor : Gdouble); 
  64.    --  Creates a symbolic color by modifying the relative alpha value of 
  65.    --  Color. A factor < 1.0 would resolve to a more transparent color, while > 
  66.    --  1.0 would resolve to a more opaque color. 
  67.    --  Since: gtk+ 3.0 
  68.    --  "color": another Gtk.Symbolic_Color.Gtk_Symbolic_Color 
  69.    --  "factor": factor to apply to Color alpha 
  70.  
  71.    function Gtk_Symbolic_Color_New_Alpha 
  72.       (Color  : Gtk_Symbolic_Color; 
  73.        Factor : Gdouble) return Gtk_Symbolic_Color; 
  74.    --  Creates a symbolic color by modifying the relative alpha value of 
  75.    --  Color. A factor < 1.0 would resolve to a more transparent color, while > 
  76.    --  1.0 would resolve to a more opaque color. 
  77.    --  Since: gtk+ 3.0 
  78.    --  "color": another Gtk.Symbolic_Color.Gtk_Symbolic_Color 
  79.    --  "factor": factor to apply to Color alpha 
  80.  
  81.    procedure Gtk_New_Literal 
  82.       (Self  : out Gtk_Symbolic_Color; 
  83.        Color : Gdk.RGBA.Gdk_RGBA); 
  84.    --  Creates a symbolic color pointing to a literal color. 
  85.    --  Since: gtk+ 3.0 
  86.    --  "color": a Gdk.RGBA.Gdk_RGBA 
  87.  
  88.    function Gtk_Symbolic_Color_New_Literal 
  89.       (Color : Gdk.RGBA.Gdk_RGBA) return Gtk_Symbolic_Color; 
  90.    --  Creates a symbolic color pointing to a literal color. 
  91.    --  Since: gtk+ 3.0 
  92.    --  "color": a Gdk.RGBA.Gdk_RGBA 
  93.  
  94.    procedure Gtk_New_Mix 
  95.       (Self   : out Gtk_Symbolic_Color; 
  96.        Color1 : Gtk_Symbolic_Color; 
  97.        Color2 : Gtk_Symbolic_Color; 
  98.        Factor : Gdouble); 
  99.    --  Creates a symbolic color defined as a mix of another two colors. a mix 
  100.    --  factor of 0 would resolve to Color1, while a factor of 1 would resolve 
  101.    --  to Color2. 
  102.    --  Since: gtk+ 3.0 
  103.    --  "color1": color to mix 
  104.    --  "color2": another color to mix 
  105.    --  "factor": mix factor 
  106.  
  107.    function Gtk_Symbolic_Color_New_Mix 
  108.       (Color1 : Gtk_Symbolic_Color; 
  109.        Color2 : Gtk_Symbolic_Color; 
  110.        Factor : Gdouble) return Gtk_Symbolic_Color; 
  111.    --  Creates a symbolic color defined as a mix of another two colors. a mix 
  112.    --  factor of 0 would resolve to Color1, while a factor of 1 would resolve 
  113.    --  to Color2. 
  114.    --  Since: gtk+ 3.0 
  115.    --  "color1": color to mix 
  116.    --  "color2": another color to mix 
  117.    --  "factor": mix factor 
  118.  
  119.    procedure Gtk_New_Name 
  120.       (Self : out Gtk_Symbolic_Color; 
  121.        Name : UTF8_String); 
  122.    --  Creates a symbolic color pointing to an unresolved named color. See 
  123.    --  Gtk.Style_Context.Lookup_Color and Gtk.Style_Properties.Lookup_Color. 
  124.    --  Since: gtk+ 3.0 
  125.    --  "name": color name 
  126.  
  127.    function Gtk_Symbolic_Color_New_Name 
  128.       (Name : UTF8_String) return Gtk_Symbolic_Color; 
  129.    --  Creates a symbolic color pointing to an unresolved named color. See 
  130.    --  Gtk.Style_Context.Lookup_Color and Gtk.Style_Properties.Lookup_Color. 
  131.    --  Since: gtk+ 3.0 
  132.    --  "name": color name 
  133.  
  134.    procedure Gtk_New_Shade 
  135.       (Self   : out Gtk_Symbolic_Color; 
  136.        Color  : Gtk_Symbolic_Color; 
  137.        Factor : Gdouble); 
  138.    --  Creates a symbolic color defined as a shade of another color. A factor 
  139.    --  > 1.0 would resolve to a brighter color, while < 1.0 would resolve to a 
  140.    --  darker color. 
  141.    --  Since: gtk+ 3.0 
  142.    --  "color": another Gtk.Symbolic_Color.Gtk_Symbolic_Color 
  143.    --  "factor": shading factor to apply to Color 
  144.  
  145.    function Gtk_Symbolic_Color_New_Shade 
  146.       (Color  : Gtk_Symbolic_Color; 
  147.        Factor : Gdouble) return Gtk_Symbolic_Color; 
  148.    --  Creates a symbolic color defined as a shade of another color. A factor 
  149.    --  > 1.0 would resolve to a brighter color, while < 1.0 would resolve to a 
  150.    --  darker color. 
  151.    --  Since: gtk+ 3.0 
  152.    --  "color": another Gtk.Symbolic_Color.Gtk_Symbolic_Color 
  153.    --  "factor": shading factor to apply to Color 
  154.  
  155.    procedure Gtk_New_Win32 
  156.       (Self        : out Gtk_Symbolic_Color; 
  157.        Theme_Class : UTF8_String; 
  158.        Id          : Gint); 
  159.    --  Creates a symbolic color based on the current win32 theme. 
  160.    --  Note that while this call is available on all platforms the actual 
  161.    --  value returned is not reliable on non-win32 platforms. 
  162.    --  Since: gtk+ 3.4 
  163.    --  "theme_class": The theme class to pull color from 
  164.    --  "id": The color id 
  165.  
  166.    function Gtk_Symbolic_Color_New_Win32 
  167.       (Theme_Class : UTF8_String; 
  168.        Id          : Gint) return Gtk_Symbolic_Color; 
  169.    --  Creates a symbolic color based on the current win32 theme. 
  170.    --  Note that while this call is available on all platforms the actual 
  171.    --  value returned is not reliable on non-win32 platforms. 
  172.    --  Since: gtk+ 3.4 
  173.    --  "theme_class": The theme class to pull color from 
  174.    --  "id": The color id 
  175.  
  176.    function Get_Type return Glib.GType; 
  177.    pragma Import (C, Get_Type, "gtk_symbolic_color_get_type"); 
  178.  
  179.    ------------- 
  180.    -- Methods -- 
  181.    ------------- 
  182.  
  183.    function Ref (Self : Gtk_Symbolic_Color) return Gtk_Symbolic_Color; 
  184.    pragma Obsolescent (Ref); 
  185.    --  Increases the reference count of Color 
  186.    --  Since: gtk+ 3.0 
  187.    --  Deprecated since 3.8, Gtk.Symbolic_Color.Gtk_Symbolic_Color is 
  188.    --  deprecated. 
  189.  
  190.    function To_String (Self : Gtk_Symbolic_Color) return UTF8_String; 
  191.    pragma Obsolescent (To_String); 
  192.    --  Converts the given Color to a string representation. This is useful 
  193.    --  both for debugging and for serialization of strings. The format of the 
  194.    --  string may change between different versions of GTK, but it is 
  195.    --  guaranteed that the GTK css parser is able to read the string and create 
  196.    --  the same symbolic color from it. 
  197.    --  Deprecated since 3.8, Gtk.Symbolic_Color.Gtk_Symbolic_Color is 
  198.    --  deprecated. 
  199.  
  200.    procedure Unref (Self : Gtk_Symbolic_Color); 
  201.    pragma Obsolescent (Unref); 
  202.    --  Decreases the reference count of Color, freeing its memory if the 
  203.    --  reference count reaches 0. 
  204.    --  Since: gtk+ 3.0 
  205.    --  Deprecated since 3.8, Gtk.Symbolic_Color.Gtk_Symbolic_Color is 
  206.    --  deprecated. 
  207.  
  208. private 
  209.  
  210.    Null_Gtk_Symbolic_Color : constant Gtk_Symbolic_Color := (Glib.C_Boxed with null record); 
  211.  
  212. end Gtk.Symbolic_Color;