File: gtk-text_attributes.ads

package info (click to toggle)
libgtkada2 2.8.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,488 kB
  • ctags: 3,888
  • sloc: ada: 103,189; ansic: 45,411; perl: 5,500; sh: 2,812; makefile: 1,146; xml: 19
file content (315 lines) | stat: -rw-r--r-- 12,712 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
-----------------------------------------------------------------------
--              GtkAda - Ada95 binding for Gtk+/Gnome                --
--                                                                   --
--                Copyright (C) 2001-2006 AdaCore                    --
--                                                                   --
-- This library is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This library is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this library; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------

--  <description>
--  This package defines the Gtk_Text_Attributes type.
--  </description>
--  <c_version>2.8.17</c_version>
--  <group>Multiline Text Editor</group>

with Glib;
with Gdk.Color;
with Gtk.Enums;
with Pango.Enums;
with Pango.Font;
with Pango.Tabs;

package Gtk.Text_Attributes is

   type Gtk_Text_Attributes is new Glib.C_Proxy;
   type Gtk_Text_Appearance is new Glib.C_Proxy;

   procedure Gtk_New (Text_Attr : out Gtk_Text_Attributes);
   --  Create a new Gtk_Text_Attributes structure.

   function Get_Type return Glib.GType;
   --  Return the internal type used fro a Gtk_Text_Attributes

   procedure Ref (Values : Gtk_Text_Attributes);
   --  Increase the reference counter of the given Gtk_Text_Attributes
   --  by one (this counter is initially set to 1 when this structure
   --  is created).

   procedure Unref (Values : Gtk_Text_Attributes);
   --  Decrease the reference counter by one. When it reaches zero,
   --  the Gtk_Text_Attributes is automatically deallocated.

   function Copy (Src : Gtk_Text_Attributes) return Gtk_Text_Attributes;
   --  Create a copy of the given Gtk_Text_Attributes structure.

   procedure Copy_Values
     (Src  : Gtk_Text_Attributes;
      Dest : Gtk_Text_Attributes);
   --  Copy the values from Src into Dest so that Dest has the same values
   --  as Src. Free existing values in Dest. Dest's reference counter
   --  is preserved.

   ---------------------
   -- Text appearance --
   ---------------------

   procedure Set_Rise
     (Appearance : Gtk_Text_Appearance;
      Rise       : Gint);
   function Get_Rise
     (Appearance : Gtk_Text_Appearance) return Gint;
   --  Offset of the text above the baseline (or below if negative)

   procedure Set_Underline
     (Appearance : Gtk_Text_Appearance;
      Underline  : Pango.Enums.Underline);
   function Get_Underline
     (Appearance : Gtk_Text_Appearance) return Pango.Enums.Underline;
   --  Set the underline mode

   procedure Set_Strikethrough
     (Appearance : Gtk_Text_Appearance;
      Strikethrough : Boolean);
   function Get_Strikethrough
     (Appearance : Gtk_Text_Appearance) return Boolean;
   --  Whether to strike through the text

   procedure Set_Fg_Color
     (Appearance : Gtk_Text_Appearance;
      Color      : Gdk.Color.Gdk_Color);
   function Get_Fg_Color
     (Appearance : Gtk_Text_Attributes) return Gdk.Color.Gdk_Color;
   --  The color used to display the text

   procedure Set_Bg_Color
     (Appearance : Gtk_Text_Appearance;
      Color      : Gdk.Color.Gdk_Color);
   function Get_Bg_Color
     (Appearance : Gtk_Text_Attributes) return Gdk.Color.Gdk_Color;
   --  The background color for the text

   procedure Set_Fg_Stipple
     (Appearance : Gtk_Text_Appearance;
      Stipple    : Gdk.Gdk_Bitmap);
   function Get_Fg_Stipple
     (Appearance : Gtk_Text_Attributes) return Gdk.Gdk_Bitmap;
   --  The pattern used in the foreground

   procedure Set_Bg_Stipple
     (Appearance : Gtk_Text_Appearance;
      Stipple    : Gdk.Gdk_Bitmap);
   function Get_Bg_Stipple
     (Appearance : Gtk_Text_Attributes) return Gdk.Gdk_Bitmap;
   --  The pattern used in the background

   ----------------
   -- Attributes --
   ----------------

   procedure Set_Font
     (Text_Attr : Gtk_Text_Attributes;
      Font      : Pango.Font.Pango_Font_Description);
   function Get_Font (Text_Attr : Gtk_Text_Attributes)
     return Pango.Font.Pango_Font_Description;
   --  Return the Pango_Font_Description associated to the given
   --  Gtk_Text_Attributes.

   procedure Set_Justification
     (Text_Attr : Gtk_Text_Attributes;
      Justification : Gtk.Enums.Gtk_Justification);
   function Get_Justification
     (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Justification;
   --  Set the justification for this attributes

   procedure Set_Direction
     (Text_Attr : Gtk_Text_Attributes;
      Direction : Gtk.Enums.Gtk_Text_Direction);
   function Get_Direction
     (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Text_Direction;
   --  Set the text direction for this attributes

   procedure Set_Font_Scale
     (Text_Attr : Gtk_Text_Attributes;
      Scale     : Gdouble);
   function Get_Font_Scale
     (Text_Attr : Gtk_Text_Attributes) return Gdouble;
   --  Set the scaling to use for the font

   procedure Set_Left_Margin
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Left_Margin
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Set the left margin

   procedure Set_Right_Margin
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Right_Margin
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Set the right margin

   procedure Set_Indent
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Indent
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Amount to indent the paragraph

   procedure Set_Pixels_Above_Line
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Pixels_Above_Line
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Set the number of blank pixels above paragraphs

   procedure Set_Pixels_Below_Line
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Pixels_Below_Line
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Set the number of blank pixels below paragraphs

   procedure Set_Pixels_Inside_Wrap
     (Text_Attr : Gtk_Text_Attributes;
      Margin    : Gint);
   function Get_Pixels_Inside_Wrap
     (Text_Attr : Gtk_Text_Attributes) return Gint;
   --  Set the number of pixels between wrapped lines in a paragraph

   procedure Set_Wrap_Mode
     (Text_Attr : Gtk_Text_Attributes;
      Mode      : Gtk.Enums.Gtk_Wrap_Mode);
   function Get_Wrap_Mode
     (Text_Attr : Gtk_Text_Attributes) return Gtk.Enums.Gtk_Wrap_Mode;
   --  Set the wrapping mode

   procedure Set_Invisible
     (Text_Attr : Gtk_Text_Attributes;
      Invisible : Boolean);
   function Get_Invisible (Text_Attr : Gtk_Text_Attributes) return Boolean;
   --  Whether the text is invisible

   procedure Set_Bg_Full_Height
     (Text_Attr : Gtk_Text_Attributes;
      Full_Height : Boolean);
   function Get_Bg_Full_Height
     (Text_Attr : Gtk_Text_Attributes) return Boolean;
   --  Whether the background occupies the full line height rather than just
   --  the area occupied by the text.

   procedure Set_Editable
     (Text_Attr : Gtk_Text_Attributes;
      Editable  : Boolean);
   function Get_Editable
     (Text_Attr : Gtk_Text_Attributes) return Boolean;
   --  Whether the text is editable

   procedure Set_Tabs
     (Text_Attr : Gtk_Text_Attributes;
      Tabs      : Pango.Tabs.Pango_Tab_Array);
   function Get_Tabs
     (Text_Attr : Gtk_Text_Attributes) return Pango.Tabs.Pango_Tab_Array;
   --  Set the default tab stops for paragraphs

   function Get_Appearance
     (Text_Attr : Gtk_Text_Attributes) return Gtk_Text_Appearance;
   --  Return the appearance of the text. This can be modified with the
   --  subprograms above.

   ----------------
   -- Properties --
   ----------------

   --  <properties>
   --  The following properties are defined for this widget. See
   --  Glib.Properties for more information on properties.
   --
   --  </properties>

private
   pragma Import (C, Get_Type,    "gtk_text_attributes_get_type");
   pragma Import (C, Ref,         "gtk_text_attributes_ref");
   pragma Import (C, Unref,       "gtk_text_attributes_unref");
   pragma Import (C, Copy,        "gtk_text_attributes_copy");
   pragma Import (C, Copy_Values, "gtk_text_attributes_copy_values");
   pragma Import (C, Get_Font,    "ada_text_attributes_get_font");
   pragma Import (C, Set_Font,    "ada_text_attributes_set_font");

   pragma Import
     (C, Set_Justification, "ada_text_attributes_set_justification");
   pragma Import
     (C, Get_Justification, "ada_text_attributes_Get_justification");
   pragma Import (C, Set_Direction, "ada_text_attributes_set_direction");
   pragma Import (C, Get_Direction, "ada_text_attributes_get_direction");
   pragma Import
     (C, Set_Font_Scale, "ada_text_attributes_set_font_scale");
   pragma Import
     (C, Get_Font_Scale, "ada_text_attributes_get_font_scale");
   pragma Import (C, Set_Rise, "ada_text_appearance_set_rise");
   pragma Import (C, Get_Rise, "ada_text_appearance_get_rise");
   pragma Import (C, Set_Underline, "ada_text_appearance_set_underline");
   pragma Import (C, Get_Underline, "ada_text_appearance_get_underline");
   pragma Import
     (C, Set_Strikethrough, "ada_text_appearance_set_strikethrough");
   pragma Import
     (C, Get_Strikethrough, "ada_text_appearance_get_strikethrough");
   pragma Import (C, Set_Fg_Color, "ada_text_appearance_set_fg_color");
   pragma Import (C, Get_Fg_Color, "ada_text_appearance_get_fg_color");
   pragma Import (C, Set_Bg_Color, "ada_text_appearance_set_bg_color");
   pragma Import (C, Get_Bg_Color, "ada_text_appearance_get_bg_color");
   pragma Import (C, Set_Fg_Stipple, "ada_text_appearance_set_fg_stipple");
   pragma Import (C, Get_Fg_Stipple, "ada_text_appearance_get_fg_stipple");
   pragma Import (C, Set_Bg_Stipple, "ada_text_appearance_set_bg_stipple");
   pragma Import (C, Get_Bg_Stipple, "ada_text_appearance_get_bg_stipple");

   pragma Import (C, Set_Left_Margin, "ada_text_attribute_set_left_margin");
   pragma Import (C, Get_Left_Margin, "ada_text_attribute_get_left_margin");
   pragma Import (C, Set_Right_Margin, "ada_text_attribute_set_right_margin");
   pragma Import (C, Get_Right_Margin, "ada_text_attribute_get_right_margin");
   pragma Import (C, Set_Indent, "ada_text_attribute_set_indent");
   pragma Import (C, Get_Indent, "ada_text_attribute_get_indent");
   pragma Import
     (C, Set_Pixels_Above_Line, "ada_text_attribute_set_pixels_above_line");
   pragma Import
     (C, Get_Pixels_Above_Line, "ada_text_attribute_get_pixels_above_line");
   pragma Import
     (C, Set_Pixels_Below_Line, "ada_text_attribute_set_pixels_below_line");
   pragma Import
     (C, Get_Pixels_Below_Line, "ada_text_attribute_get_pixels_below_line");
   pragma Import
     (C, Set_Pixels_Inside_Wrap, "ada_text_attribute_set_pixels_inside_wrap");
   pragma Import
     (C, Get_Pixels_Inside_Wrap, "ada_text_attribute_get_pixels_inside_wrap");
   pragma Import (C, Set_Wrap_Mode, "ada_text_attribute_set_wrap_mode");
   pragma Import (C, Get_Wrap_Mode, "ada_text_attribute_get_wrap_mode");
   pragma Import (C, Set_Invisible, "ada_text_attribute_set_invisible");
   pragma Import (C, Get_Invisible, "ada_text_attribute_get_invisible");
   pragma Import
     (C, Set_Bg_Full_Height, "ada_text_attribute_set_bg_full_height");
   pragma Import
     (C, Get_Bg_Full_Height, "ada_text_attribute_get_bg_full_height");
   pragma Import (C, Set_Editable, "ada_text_attribute_set_editable");
   pragma Import (C, Get_Editable, "ada_text_attribute_get_editable");
   pragma Import (C, Get_Appearance, "ada_text_attribute_get_appearance");
   pragma Import (C, Set_Tabs, "ada_text_attribute_set_tabs");
   pragma Import (C, Get_Tabs, "ada_text_attribute_get_tabs");

end Gtk.Text_Attributes;

--  This package doesn't give access to the "language" property of a
--  Gtk_Text_Attributes