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--  <group>Pango, font handling</group>
30
31with Glib; use Glib;
32with Glib.Generic_Properties; use Glib.Generic_Properties;
33pragma Elaborate_All (Glib.Generic_Properties);
34
35package Pango.Enums is
36
37   Pango_Scale : constant := 1024;
38   --  All internal units in Pango are expressed in terms of this unit. A
39   --  typical pango size must be divided by Pango_Scale to get the equivalent
40   --  in pixels.
41
42   function To_Pixels (Pango_Units : Gint) return Gint;
43   --  Convert a size in pango units to pixels. This is a rounding of
44   --  Pango_Units divided by Pango_Scale
45
46   --  Enum types are bound with the following algorithm:
47   --    + the "Pango" prefix of the type name is stripped
48   --    + Each word of the type name is separated by '_'
49   --    + the full enum name is kept, but capitalized.
50
51   --  All enums types should be sorted by alphabetical order...
52
53   type Alignment is
54     (Pango_Alignment_Left,
55      Pango_Alignment_Center,
56      Pango_Alignment_Right);
57   pragma Convention (C, Alignment);
58
59   type Attr_Type is
60     (Pango_Attr_Invalid,
61      Pango_Attr_Lang,
62      Pango_Attr_Family,
63      Pango_Attr_Style,
64      Pango_Attr_Weight,
65      Pango_Attr_Variant,
66      Pango_Attr_Stretch,
67      Pango_Attr_Size,
68      Pango_Attr_Font_Desc,
69      Pango_Attr_Foreground,
70      Pango_Attr_Background,
71      Pango_Attr_Underline,
72      Pango_Attr_Strikethrough,
73      Pango_Attr_Rise,
74      Pango_Attr_Shape,
75      Pango_Attr_Scale);
76   pragma Convention (C, Attr_Type);
77
78   type Coverage_Level is
79     (Pango_Underline_None,
80      Pango_Underline_Fallback,
81      Pango_Underline_Approximate,
82      Pango_Underline_Exact);
83   pragma Convention (C, Coverage_Level);
84
85   type Direction is
86     (Pango_Direction_Ltr,
87      Pango_Direction_Rtl,
88      Pango_Direction_Ttb_Ltr,
89      Pango_Direction_Ttb_Rtl);
90   pragma Convention (C, Direction);
91
92   --  There are some PANGO_SCALE_* macros in pango-font.h that are not
93   --  bound yet. Are they needed ???
94
95   type Stretch is
96     (Pango_Stretch_Ultra_Condensed,
97      Pango_Stretch_Extra_Condensed,
98      Pango_Stretch_Condensed,
99      Pango_Stretch_Semi_Condensed,
100      Pango_Stretch_Normal,
101      Pango_Stretch_Semi_Expanded,
102      Pango_Stretch_Expanded,
103      Pango_Stretch_Extra_Expanded,
104      Pango_Stretch_Ultra_Expanded);
105   pragma Convention (C, Stretch);
106
107   type Style is
108     (Pango_Style_Normal,
109      Pango_Style_Oblique,
110      Pango_Style_Italic);
111   pragma Convention (C, Style);
112
113   type Underline is
114     (Pango_Underline_None,
115      Pango_Underline_Single,
116      Pango_Underline_Double,
117      Pango_Underline_Low,
118      Pango_Underline_Error);
119   pragma Convention (C, Underline);
120
121   type Variant is
122     (Pango_Variant_Normal,
123      Pango_Variant_Small_Caps);
124   pragma Convention (C, Variant);
125
126   type Weight is
127     (Pango_Weight_Ultralight,
128      Pango_Weight_Light,
129      Pango_Weight_Normal,
130      Pango_Weight_Medium,
131      Pango_Weight_Semi_Bold,
132      Pango_Weight_Bold,
133      Pango_Weight_Ultrabold,
134      Pango_Weight_Heavy);
135   pragma Convention (C, Weight);
136
137   for Weight use
138     (Pango_Weight_Ultralight => 200,
139      Pango_Weight_Light      => 300,
140      Pango_Weight_Normal     => 400,
141      Pango_Weight_Medium     => 500,
142      Pango_Weight_Semi_Bold  => 600,
143      Pango_Weight_Bold       => 700,
144      Pango_Weight_Ultrabold  => 800,
145      Pango_Weight_Heavy      => 900);
146
147   type Wrap_Mode is
148     (Pango_Wrap_Word,
149      Pango_Wrap_Char,
150      Pango_Wrap_Word_Char);
151   pragma Convention (C, Wrap_Mode);
152
153   ----------------
154   -- Properties --
155   ----------------
156   --  See the package Glib.Properties for more information on how to
157   --  use properties
158
159   package Style_Properties is
160     new Generic_Internal_Discrete_Property (Style);
161   package Weight_Properties is
162     new Generic_Internal_Discrete_Property (Weight);
163   package Variant_Properties is
164     new Generic_Internal_Discrete_Property (Variant);
165   package Stretch_Properties is
166     new Generic_Internal_Discrete_Property (Stretch);
167   package Underline_Properties is
168     new Generic_Internal_Discrete_Property (Underline);
169   package Wrap_Mode_Properties is
170     new Generic_Internal_Discrete_Property (Wrap_Mode);
171
172   type Property_Style is new Style_Properties.Property;
173   type Property_Weight is new Weight_Properties.Property;
174   type Property_Variant is new Variant_Properties.Property;
175   type Property_Stretch is new Stretch_Properties.Property;
176   type Property_Underline is new Underline_Properties.Property;
177   type Property_Wrap_Mode is new Wrap_Mode_Properties.Property;
178
179end Pango.Enums;
180