1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2013, AdaCore                   -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  This package defines the Gtk_Text_Attributes type. 
  31. --  </description> 
  32. --  <c_version>2.8.17</c_version> 
  33. --  <group>Multiline Text Editor</group> 
  34.  
  35. with Glib; 
  36. with Gdk.Color; 
  37. with Gtk.Enums; 
  38. with Pango.Enums; 
  39. with Pango.Font; 
  40. with Pango.Tabs; 
  41.  
  42. package Gtk.Text_Attributes is 
  43.  
  44.    type Gtk_Text_Attributes is new Glib.C_Proxy; 
  45.    type Gtk_Text_Appearance is new Glib.C_Proxy; 
  46.  
  47.    procedure Gtk_New (Text_Attr : out Gtk_Text_Attributes); 
  48.    --  Create a new Gtk_Text_Attributes structure. 
  49.  
  50.    function Get_Type return Glib.GType; 
  51.    --  Return the internal type used fro a Gtk_Text_Attributes 
  52.  
  53.    procedure Ref (Values : Gtk_Text_Attributes); 
  54.    --  Increase the reference counter of the given Gtk_Text_Attributes 
  55.    --  by one (this counter is initially set to 1 when this structure 
  56.    --  is created). 
  57.  
  58.    procedure Unref (Values : Gtk_Text_Attributes); 
  59.    --  Decrease the reference counter by one. When it reaches zero, 
  60.    --  the Gtk_Text_Attributes is automatically deallocated. 
  61.  
  62.    function Copy (Src : Gtk_Text_Attributes) return Gtk_Text_Attributes; 
  63.    --  Create a copy of the given Gtk_Text_Attributes structure. 
  64.  
  65.    procedure Copy_Values 
  66.      (Src  : Gtk_Text_Attributes; 
  67.       Dest : Gtk_Text_Attributes); 
  68.    --  Copy the values from Src into Dest so that Dest has the same values 
  69.    --  as Src. Free existing values in Dest. Dest's reference counter 
  70.    --  is preserved. 
  71.  
  72.    --------------------- 
  73.    -- Text appearance -- 
  74.    --------------------- 
  75.  
  76.    procedure Set_Rise 
  77.      (Appearance : Gtk_Text_Appearance; 
  78.       Rise       : Gint); 
  79.    function Get_Rise 
  80.      (Appearance : Gtk_Text_Appearance) return Gint; 
  81.    --  Offset of the text above the baseline (or below if negative) 
  82.  
  83.    procedure Set_Underline 
  84.      (Appearance : Gtk_Text_Appearance; 
  85.       Underline  : Pango.Enums.Underline); 
  86.    function Get_Underline 
  87.      (Appearance : Gtk_Text_Appearance) return Pango.Enums.Underline; 
  88.    --  Set the underline mode 
  89.  
  90.    procedure Set_Strikethrough 
  91.      (Appearance : Gtk_Text_Appearance; 
  92.       Strikethrough : Boolean); 
  93.    function Get_Strikethrough 
  94.      (Appearance : Gtk_Text_Appearance) return Boolean; 
  95.    --  Whether to strike through the text 
  96.  
  97.    procedure Set_Fg_Color 
  98.      (Appearance : Gtk_Text_Appearance; 
  99.       Color      : Gdk.Color.Gdk_Color); 
  100.    function Get_Fg_Color 
  101.      (Appearance : Gtk_Text_Attributes) return Gdk.Color.Gdk_Color; 
  102.    --  The color used to display the text 
  103.  
  104.    procedure Set_Bg_Color 
  105.      (Appearance : Gtk_Text_Appearance; 
  106.       Color      : Gdk.Color.Gdk_Color); 
  107.    function Get_Bg_Color 
  108.      (Appearance : Gtk_Text_Attributes) return Gdk.Color.Gdk_Color; 
  109.    --  The background color for the text 
  110.  
  111.    procedure Set_Fg_Stipple 
  112.      (Appearance : Gtk_Text_Appearance; 
  113.       Stipple    : Gdk.Gdk_Bitmap); 
  114.    function Get_Fg_Stipple 
  115.      (Appearance : Gtk_Text_Attributes) return Gdk.Gdk_Bitmap; 
  116.    --  The pattern used in the foreground 
  117.  
  118.    procedure Set_Bg_Stipple 
  119.      (Appearance : Gtk_Text_Appearance; 
  120.       Stipple    : Gdk.Gdk_Bitmap); 
  121.    function Get_Bg_Stipple 
  122.      (Appearance : Gtk_Text_Attributes) return Gdk.Gdk_Bitmap; 
  123.    --  The pattern used in the background 
  124.  
  125.    ---------------- 
  126.    -- Attributes -- 
  127.    ---------------- 
  128.  
  129.    procedure Set_Font 
  130.      (Text_Attr : Gtk_Text_Attributes; 
  131.       Font      : Pango.Font.Pango_Font_Description); 
  132.    function Get_Font (Text_Attr : Gtk_Text_Attributes) 
  133.      return Pango.Font.Pango_Font_Description; 
  134.    --  Return the Pango_Font_Description associated to the given 
  135.    --  Gtk_Text_Attributes. 
  136.  
  137.    procedure Set_Justification 
  138.      (Text_Attr : Gtk_Text_Attributes; 
  139.       Justification : Gtk.Enums.Gtk_Justification); 
  140.    function Get_Justification 
  141.      (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Justification; 
  142.    --  Set the justification for this attributes 
  143.  
  144.    procedure Set_Direction 
  145.      (Text_Attr : Gtk_Text_Attributes; 
  146.       Direction : Gtk.Enums.Gtk_Text_Direction); 
  147.    function Get_Direction 
  148.      (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Text_Direction; 
  149.    --  Set the text direction for this attributes 
  150.  
  151.    procedure Set_Font_Scale 
  152.      (Text_Attr : Gtk_Text_Attributes; 
  153.       Scale     : Gdouble); 
  154.    function Get_Font_Scale 
  155.      (Text_Attr : Gtk_Text_Attributes) return Gdouble; 
  156.    --  Set the scaling to use for the font 
  157.  
  158.    procedure Set_Left_Margin 
  159.      (Text_Attr : Gtk_Text_Attributes; 
  160.       Margin    : Gint); 
  161.    function Get_Left_Margin 
  162.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  163.    --  Set the left margin 
  164.  
  165.    procedure Set_Right_Margin 
  166.      (Text_Attr : Gtk_Text_Attributes; 
  167.       Margin    : Gint); 
  168.    function Get_Right_Margin 
  169.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  170.    --  Set the right margin 
  171.  
  172.    procedure Set_Indent 
  173.      (Text_Attr : Gtk_Text_Attributes; 
  174.       Margin    : Gint); 
  175.    function Get_Indent 
  176.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  177.    --  Amount to indent the paragraph 
  178.  
  179.    procedure Set_Pixels_Above_Line 
  180.      (Text_Attr : Gtk_Text_Attributes; 
  181.       Margin    : Gint); 
  182.    function Get_Pixels_Above_Line 
  183.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  184.    --  Set the number of blank pixels above paragraphs 
  185.  
  186.    procedure Set_Pixels_Below_Line 
  187.      (Text_Attr : Gtk_Text_Attributes; 
  188.       Margin    : Gint); 
  189.    function Get_Pixels_Below_Line 
  190.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  191.    --  Set the number of blank pixels below paragraphs 
  192.  
  193.    procedure Set_Pixels_Inside_Wrap 
  194.      (Text_Attr : Gtk_Text_Attributes; 
  195.       Margin    : Gint); 
  196.    function Get_Pixels_Inside_Wrap 
  197.      (Text_Attr : Gtk_Text_Attributes) return Gint; 
  198.    --  Set the number of pixels between wrapped lines in a paragraph 
  199.  
  200.    procedure Set_Wrap_Mode 
  201.      (Text_Attr : Gtk_Text_Attributes; 
  202.       Mode      : Gtk.Enums.Gtk_Wrap_Mode); 
  203.    function Get_Wrap_Mode 
  204.      (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Wrap_Mode; 
  205.    --  Set the wrapping mode 
  206.  
  207.    procedure Set_Invisible 
  208.      (Text_Attr : Gtk_Text_Attributes; 
  209.       Invisible : Boolean); 
  210.    function Get_Invisible (Text_Attr : Gtk_Text_Attributes) return Boolean; 
  211.    --  Whether the text is invisible 
  212.  
  213.    procedure Set_Bg_Full_Height 
  214.      (Text_Attr : Gtk_Text_Attributes; 
  215.       Full_Height : Boolean); 
  216.    function Get_Bg_Full_Height 
  217.      (Text_Attr : Gtk_Text_Attributes) return Boolean; 
  218.    --  Whether the background occupies the full line height rather than just 
  219.    --  the area occupied by the text. 
  220.  
  221.    procedure Set_Editable 
  222.      (Text_Attr : Gtk_Text_Attributes; 
  223.       Editable  : Boolean); 
  224.    function Get_Editable 
  225.      (Text_Attr : Gtk_Text_Attributes) return Boolean; 
  226.    --  Whether the text is editable 
  227.  
  228.    procedure Set_Tabs 
  229.      (Text_Attr : Gtk_Text_Attributes; 
  230.       Tabs      : Pango.Tabs.Pango_Tab_Array); 
  231.    function Get_Tabs 
  232.      (Text_Attr : Gtk_Text_Attributes) return Pango.Tabs.Pango_Tab_Array; 
  233.    --  Set the default tab stops for paragraphs 
  234.  
  235.    function Get_Appearance 
  236.      (Text_Attr : Gtk_Text_Attributes) return Gtk_Text_Appearance; 
  237.    --  Return the appearance of the text. This can be modified with the 
  238.    --  subprograms above. 
  239.  
  240.    ---------------- 
  241.    -- Properties -- 
  242.    ---------------- 
  243.  
  244.    --  <properties> 
  245.    --  The following properties are defined for this widget. See 
  246.    --  Glib.Properties for more information on properties. 
  247.    -- 
  248.    --  </properties> 
  249.  
  250. private 
  251.    pragma Import (C, Get_Type,    "gtk_text_attributes_get_type"); 
  252.    pragma Import (C, Ref,         "gtk_text_attributes_ref"); 
  253.    pragma Import (C, Unref,       "gtk_text_attributes_unref"); 
  254.    pragma Import (C, Copy,        "gtk_text_attributes_copy"); 
  255.    pragma Import (C, Copy_Values, "gtk_text_attributes_copy_values"); 
  256.    pragma Import (C, Get_Font,    "ada_text_attributes_get_font"); 
  257.    pragma Import (C, Set_Font,    "ada_text_attributes_set_font"); 
  258.  
  259.    pragma Import 
  260.      (C, Set_Justification, "ada_text_attributes_set_justification"); 
  261.    pragma Import 
  262.      (C, Get_Justification, "ada_text_attributes_Get_justification"); 
  263.    pragma Import (C, Set_Direction, "ada_text_attributes_set_direction"); 
  264.    pragma Import (C, Get_Direction, "ada_text_attributes_get_direction"); 
  265.    pragma Import 
  266.      (C, Set_Font_Scale, "ada_text_attributes_set_font_scale"); 
  267.    pragma Import 
  268.      (C, Get_Font_Scale, "ada_text_attributes_get_font_scale"); 
  269.    pragma Import (C, Set_Rise, "ada_text_appearance_set_rise"); 
  270.    pragma Import (C, Get_Rise, "ada_text_appearance_get_rise"); 
  271.    pragma Import (C, Set_Underline, "ada_text_appearance_set_underline"); 
  272.    pragma Import (C, Get_Underline, "ada_text_appearance_get_underline"); 
  273.    pragma Import (C, Set_Fg_Color, "ada_text_appearance_set_fg_color"); 
  274.    pragma Import (C, Get_Fg_Color, "ada_text_appearance_get_fg_color"); 
  275.    pragma Import (C, Set_Bg_Color, "ada_text_appearance_set_bg_color"); 
  276.    pragma Import (C, Get_Bg_Color, "ada_text_appearance_get_bg_color"); 
  277.    pragma Import (C, Set_Fg_Stipple, "ada_text_appearance_set_fg_stipple"); 
  278.    pragma Import (C, Get_Fg_Stipple, "ada_text_appearance_get_fg_stipple"); 
  279.    pragma Import (C, Set_Bg_Stipple, "ada_text_appearance_set_bg_stipple"); 
  280.    pragma Import (C, Get_Bg_Stipple, "ada_text_appearance_get_bg_stipple"); 
  281.  
  282.    pragma Import (C, Set_Left_Margin, "ada_text_attribute_set_left_margin"); 
  283.    pragma Import (C, Get_Left_Margin, "ada_text_attribute_get_left_margin"); 
  284.    pragma Import (C, Set_Right_Margin, "ada_text_attribute_set_right_margin"); 
  285.    pragma Import (C, Get_Right_Margin, "ada_text_attribute_get_right_margin"); 
  286.    pragma Import (C, Set_Indent, "ada_text_attribute_set_indent"); 
  287.    pragma Import (C, Get_Indent, "ada_text_attribute_get_indent"); 
  288.    pragma Import 
  289.      (C, Set_Pixels_Above_Line, "ada_text_attribute_set_pixels_above_line"); 
  290.    pragma Import 
  291.      (C, Get_Pixels_Above_Line, "ada_text_attribute_get_pixels_above_line"); 
  292.    pragma Import 
  293.      (C, Set_Pixels_Below_Line, "ada_text_attribute_set_pixels_below_line"); 
  294.    pragma Import 
  295.      (C, Get_Pixels_Below_Line, "ada_text_attribute_get_pixels_below_line"); 
  296.    pragma Import 
  297.      (C, Set_Pixels_Inside_Wrap, "ada_text_attribute_set_pixels_inside_wrap"); 
  298.    pragma Import 
  299.      (C, Get_Pixels_Inside_Wrap, "ada_text_attribute_get_pixels_inside_wrap"); 
  300.    pragma Import (C, Set_Wrap_Mode, "ada_text_attribute_set_wrap_mode"); 
  301.    pragma Import (C, Get_Wrap_Mode, "ada_text_attribute_get_wrap_mode"); 
  302.    pragma Import (C, Get_Appearance, "ada_text_attribute_get_appearance"); 
  303.    pragma Import (C, Set_Tabs, "ada_text_attribute_set_tabs"); 
  304.    pragma Import (C, Get_Tabs, "ada_text_attribute_get_tabs"); 
  305.  
  306. end Gtk.Text_Attributes; 
  307.  
  308. --  This package doesn't give access to the "language" property of a 
  309. --  Gtk_Text_Attributes