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