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. --  Using Gtk.Text_Attributes.Gtk_Text_Attributes directly should rarely be 
  26. --  necessary. It's primarily useful with Gtk.Text_Iter.Get_Attributes. As with 
  27. --  most GTK+ structs, the fields in this struct should only be read, never 
  28. --  modified directly. 
  29. -- 
  30. --  </description> 
  31. pragma Ada_2005; 
  32.  
  33. pragma Warnings (Off, "*is already use-visible*"); 
  34. with Gdk.Color;  use Gdk.Color; 
  35. with Gdk.RGBA;   use Gdk.RGBA; 
  36. with Glib;       use Glib; 
  37. with Gtk.Enums;  use Gtk.Enums; 
  38. with Pango.Font; use Pango.Font; 
  39.  
  40. package Gtk.Text_Attributes is 
  41.  
  42.    type Gtk_Text_Appearance is record 
  43.       Bg_Color : Gdk.Color.Gdk_Color; 
  44.       Fg_Color : Gdk.Color.Gdk_Color; 
  45.       Rise : Gint; 
  46.       Underline : Guint; 
  47.       Strikethrough : Guint; 
  48.       Draw_Bg : Guint; 
  49.       Inside_Selection : Guint; 
  50.       Is_Text : Guint; 
  51.       Rgba : array_of_Gdk_RGBA (1 .. 2); 
  52.    end record; 
  53.    pragma Convention (C, Gtk_Text_Appearance); 
  54.  
  55.    function From_Object_Free (B : access Gtk_Text_Appearance) return Gtk_Text_Appearance; 
  56.    pragma Inline (From_Object_Free); 
  57.  
  58.  
  59.    type Gtk_Text_Attributes is record 
  60.       Refcount : Guint; 
  61.       Appearance : Gtk_Text_Appearance; 
  62.       Justification : Gtk.Enums.Gtk_Justification; 
  63.       Direction : Gtk.Enums.Gtk_Text_Direction; 
  64.       Font : Pango.Font.Pango_Font_Description; 
  65.       Font_Scale : Gdouble; 
  66.       Left_Margin : Gint; 
  67.       Right_Margin : Gint; 
  68.       Indent : Gint; 
  69.       Pixels_Above_Lines : Gint; 
  70.       Pixels_Below_Lines : Gint; 
  71.       Pixels_Inside_Wrap : Gint; 
  72.       Tabs : System.Address; 
  73.       Wrap_Mode : Gtk.Enums.Gtk_Wrap_Mode; 
  74.       Language : System.Address; 
  75.       Pg_Bg_Color : Gdk.Color.Gdk_Color; 
  76.       Invisible : Guint; 
  77.       Bg_Full_Height : Guint; 
  78.       Editable : Guint; 
  79.       Pg_Bg_Rgba : Gdk.RGBA.Gdk_RGBA; 
  80.       Padding : System.Address; 
  81.    end record; 
  82.    pragma Convention (C, Gtk_Text_Attributes); 
  83.  
  84.    function From_Object_Free (B : access Gtk_Text_Attributes) return Gtk_Text_Attributes; 
  85.    pragma Inline (From_Object_Free); 
  86.    --  Using Gtk.Text_Attributes.Gtk_Text_Attributes directly should rarely be 
  87.    --  necessary. It's primarily useful with Gtk.Text_Iter.Get_Attributes. As 
  88.    --  with most GTK+ structs, the fields in this struct should only be read, 
  89.    --  never modified directly. 
  90.  
  91.    ------------------ 
  92.    -- Constructors -- 
  93.    ------------------ 
  94.  
  95.    procedure Gtk_New (Text_Attr : out Gtk_Text_Attributes); 
  96.    --  Creates a Gtk.Text_Attributes.Gtk_Text_Attributes, which describes a 
  97.    --  set of properties on some text. 
  98.  
  99.    function Gtk_Text_Attributes_New return Gtk_Text_Attributes; 
  100.    --  Creates a Gtk.Text_Attributes.Gtk_Text_Attributes, which describes a 
  101.    --  set of properties on some text. 
  102.  
  103.    function Get_Type return Glib.GType; 
  104.    pragma Import (C, Get_Type, "gtk_text_attributes_get_type"); 
  105.  
  106.    ------------- 
  107.    -- Methods -- 
  108.    ------------- 
  109.  
  110.    function Copy 
  111.       (Text_Attr : Gtk_Text_Attributes) return Gtk_Text_Attributes; 
  112.    pragma Import (C, Copy, "gtk_text_attributes_copy"); 
  113.    --  Copies Src and returns a new Gtk.Text_Attributes.Gtk_Text_Attributes. 
  114.  
  115.    procedure Copy_Values 
  116.       (Text_Attr : Gtk_Text_Attributes; 
  117.        Dest      : in out Gtk_Text_Attributes); 
  118.    pragma Import (C, Copy_Values, "gtk_text_attributes_copy_values"); 
  119.    --  Copies the values from Src to Dest so that Dest has the same values as 
  120.    --  Src. Frees existing values in Dest. 
  121.    --  "dest": another Gtk.Text_Attributes.Gtk_Text_Attributes 
  122.  
  123.    function Ref (Text_Attr : Gtk_Text_Attributes) return Gtk_Text_Attributes; 
  124.    pragma Import (C, Ref, "gtk_text_attributes_ref"); 
  125.    --  Increments the reference count on Values. 
  126.  
  127.    procedure Unref (Text_Attr : Gtk_Text_Attributes); 
  128.    pragma Import (C, Unref, "gtk_text_attributes_unref"); 
  129.    --  Decrements the reference count on Values, freeing the structure if the 
  130.    --  reference count reaches 0. 
  131.  
  132. end Gtk.Text_Attributes;