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. pragma Ada_2005; 
  25.  
  26. pragma Warnings (Off, "*is already use-visible*"); 
  27. with Glib;                    use Glib; 
  28. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  29.  
  30. package Pango.Enums is 
  31.  
  32.    type Alignment is ( 
  33.       Pango_Align_Left, 
  34.       Pango_Align_Center, 
  35.       Pango_Align_Right); 
  36.    pragma Convention (C, Alignment); 
  37.  
  38.  
  39.    type Attr_Type is ( 
  40.       Pango_Attr_Invalid, 
  41.       Pango_Attr_Language, 
  42.       Pango_Attr_Family, 
  43.       Pango_Attr_Style, 
  44.       Pango_Attr_Weight, 
  45.       Pango_Attr_Variant, 
  46.       Pango_Attr_Stretch, 
  47.       Pango_Attr_Size, 
  48.       Pango_Attr_Font_Desc, 
  49.       Pango_Attr_Foreground, 
  50.       Pango_Attr_Background, 
  51.       Pango_Attr_Underline, 
  52.       Pango_Attr_Strikethrough, 
  53.       Pango_Attr_Rise, 
  54.       Pango_Attr_Shape, 
  55.       Pango_Attr_Scale, 
  56.       Pango_Attr_Fallback, 
  57.       Pango_Attr_Letter_Spacing, 
  58.       Pango_Attr_Underline_Color, 
  59.       Pango_Attr_Strikethrough_Color, 
  60.       Pango_Attr_Absolute_Size, 
  61.       Pango_Attr_Gravity, 
  62.       Pango_Attr_Gravity_Hint); 
  63.    pragma Convention (C, Attr_Type); 
  64.  
  65.  
  66.    type Coverage_Level is ( 
  67.       Pango_Coverage_None, 
  68.       Pango_Coverage_Fallback, 
  69.       Pango_Coverage_Approximate, 
  70.       Pango_Coverage_Exact); 
  71.    pragma Convention (C, Coverage_Level); 
  72.  
  73.  
  74.    type Direction is ( 
  75.       Pango_Direction_Ltr, 
  76.       Pango_Direction_Rtl, 
  77.       Pango_Direction_Ttb_Ltr, 
  78.       Pango_Direction_Ttb_Rtl, 
  79.       Pango_Direction_Weak_Ltr, 
  80.       Pango_Direction_Weak_Rtl, 
  81.       Pango_Direction_Neutral); 
  82.    pragma Convention (C, Direction); 
  83.    --  The Pango.Enums.Direction type represents a direction in the Unicode 
  84.    --  bidirectional algorithm; not every value in this enumeration makes sense 
  85.    --  for every usage of Pango.Enums.Direction; for example, the return value 
  86.    --  of pango_unichar_direction and pango_find_base_dir cannot be 
  87.    --  Pango.Enums.Pango_Direction_Weak_Ltr or 
  88.    --  Pango.Enums.Pango_Direction_Weak_Rtl, since every character is either 
  89.    --  neutral or has a strong direction; on the other hand 
  90.    --  Pango.Enums.Pango_Direction_Neutral doesn't make sense to pass to 
  91.    --  pango_itemize_with_base_dir. 
  92.    -- 
  93.    --  The Pango.Enums.Pango_Direction_Ttb_Ltr, 
  94.    --  Pango.Enums.Pango_Direction_Ttb_Rtl values come from an earlier 
  95.    --  interpretation of this enumeration as the writing direction of a block 
  96.    --  of text and are no longer used; See Pango.Enums.Gravity for how vertical 
  97.    --  text is handled in Pango. 
  98.  
  99.    type Font_Mask is mod 2 ** Integer'Size; 
  100.    pragma Convention (C, Font_Mask); 
  101.  
  102.  
  103.    Pango_Font_Mask_Family : constant Font_Mask := 1; 
  104.    Pango_Font_Mask_Style : constant Font_Mask := 2; 
  105.    Pango_Font_Mask_Variant : constant Font_Mask := 4; 
  106.    Pango_Font_Mask_Weight : constant Font_Mask := 8; 
  107.    Pango_Font_Mask_Stretch : constant Font_Mask := 16; 
  108.    Pango_Font_Mask_Size : constant Font_Mask := 32; 
  109.    Pango_Font_Mask_Gravity : constant Font_Mask := 64; 
  110.  
  111.    type Gravity is ( 
  112.       Pango_Gravity_South, 
  113.       Pango_Gravity_East, 
  114.       Pango_Gravity_North, 
  115.       Pango_Gravity_West, 
  116.       Pango_Gravity_Auto); 
  117.    pragma Convention (C, Gravity); 
  118.    --  The Pango.Enums.Gravity type represents the orientation of glyphs in a 
  119.    --  segment of text. This is useful when rendering vertical text layouts. In 
  120.    --  those situations, the layout is rotated using a non-identity 
  121.    --  PangoMatrix, and then glyph orientation is controlled using 
  122.    --  Pango.Enums.Gravity. Not every value in this enumeration makes sense for 
  123.    --  every usage of Pango.Enums.Gravity; for example, 
  124.    --  Pango.Enums.Pango_Gravity_Auto only can be passed to 
  125.    --  Pango.Context.Set_Base_Gravity and can only be returned by 
  126.    --  Pango.Context.Get_Base_Gravity. 
  127.    -- 
  128.    --  See also: Pango.Enums.GravityHint 
  129.  
  130.    type GravityHint is ( 
  131.       Pango_Gravity_Hint_Natural, 
  132.       Pango_Gravity_Hint_Strong, 
  133.       Pango_Gravity_Hint_Line); 
  134.    pragma Convention (C, GravityHint); 
  135.    --  The Pango.Enums.GravityHint defines how horizontal scripts should 
  136.    --  behave in a vertical context. That is, English excerpt in a vertical 
  137.    --  paragraph for example. 
  138.    -- 
  139.    --  See Pango.Enums.Gravity. 
  140.  
  141.    type Stretch is ( 
  142.       Pango_Stretch_Ultra_Condensed, 
  143.       Pango_Stretch_Extra_Condensed, 
  144.       Pango_Stretch_Condensed, 
  145.       Pango_Stretch_Semi_Condensed, 
  146.       Pango_Stretch_Normal, 
  147.       Pango_Stretch_Semi_Expanded, 
  148.       Pango_Stretch_Expanded, 
  149.       Pango_Stretch_Extra_Expanded, 
  150.       Pango_Stretch_Ultra_Expanded); 
  151.    pragma Convention (C, Stretch); 
  152.  
  153.  
  154.    type Style is ( 
  155.       Pango_Style_Normal, 
  156.       Pango_Style_Oblique, 
  157.       Pango_Style_Italic); 
  158.    pragma Convention (C, Style); 
  159.    --  An enumeration specifying the various slant styles possible for a font. 
  160.  
  161.    type Underline is ( 
  162.       Pango_Underline_None, 
  163.       Pango_Underline_Single, 
  164.       Pango_Underline_Double, 
  165.       Pango_Underline_Low, 
  166.       Pango_Underline_Error); 
  167.    pragma Convention (C, Underline); 
  168.  
  169.  
  170.    type Variant is ( 
  171.       Pango_Variant_Normal, 
  172.       Pango_Variant_Small_Caps); 
  173.    pragma Convention (C, Variant); 
  174.  
  175.  
  176.    type Weight is ( 
  177.       Pango_Weight_Thin, 
  178.       Pango_Weight_Ultralight, 
  179.       Pango_Weight_Light, 
  180.       Pango_Weight_Book, 
  181.       Pango_Weight_Normal, 
  182.       Pango_Weight_Medium, 
  183.       Pango_Weight_Semibold, 
  184.       Pango_Weight_Bold, 
  185.       Pango_Weight_Ultrabold, 
  186.       Pango_Weight_Heavy, 
  187.       Pango_Weight_Ultraheavy); 
  188.    pragma Convention (C, Weight); 
  189.  
  190.  
  191.    for Weight use ( 
  192.       Pango_Weight_Thin => 100, 
  193.       Pango_Weight_Ultralight => 200, 
  194.       Pango_Weight_Light => 300, 
  195.       Pango_Weight_Book => 380, 
  196.       Pango_Weight_Normal => 400, 
  197.       Pango_Weight_Medium => 500, 
  198.       Pango_Weight_Semibold => 600, 
  199.       Pango_Weight_Bold => 700, 
  200.       Pango_Weight_Ultrabold => 800, 
  201.       Pango_Weight_Heavy => 900, 
  202.       Pango_Weight_Ultraheavy => 1000); 
  203.  
  204.    type Wrap_Mode is ( 
  205.       Pango_Wrap_Word, 
  206.       Pango_Wrap_Char, 
  207.       Pango_Wrap_Word_Char); 
  208.    pragma Convention (C, Wrap_Mode); 
  209.  
  210.    ---------------------------- 
  211.    -- Enumeration Properties -- 
  212.    ---------------------------- 
  213.  
  214.    package Alignment_Properties is 
  215.       new Generic_Internal_Discrete_Property (Alignment); 
  216.    type Property_Alignment is new Alignment_Properties.Property; 
  217.  
  218.    package Attr_Type_Properties is 
  219.       new Generic_Internal_Discrete_Property (Attr_Type); 
  220.    type Property_Attr_Type is new Attr_Type_Properties.Property; 
  221.  
  222.    package Coverage_Level_Properties is 
  223.       new Generic_Internal_Discrete_Property (Coverage_Level); 
  224.    type Property_Coverage_Level is new Coverage_Level_Properties.Property; 
  225.  
  226.    package Direction_Properties is 
  227.       new Generic_Internal_Discrete_Property (Direction); 
  228.    type Property_Direction is new Direction_Properties.Property; 
  229.  
  230.    package Font_Mask_Properties is 
  231.       new Generic_Internal_Discrete_Property (Font_Mask); 
  232.    type Property_Font_Mask is new Font_Mask_Properties.Property; 
  233.  
  234.    package Gravity_Properties is 
  235.       new Generic_Internal_Discrete_Property (Gravity); 
  236.    type Property_Gravity is new Gravity_Properties.Property; 
  237.  
  238.    package GravityHint_Properties is 
  239.       new Generic_Internal_Discrete_Property (GravityHint); 
  240.    type Property_GravityHint is new GravityHint_Properties.Property; 
  241.  
  242.    package Stretch_Properties is 
  243.       new Generic_Internal_Discrete_Property (Stretch); 
  244.    type Property_Stretch is new Stretch_Properties.Property; 
  245.  
  246.    package Style_Properties is 
  247.       new Generic_Internal_Discrete_Property (Style); 
  248.    type Property_Style is new Style_Properties.Property; 
  249.  
  250.    package Underline_Properties is 
  251.       new Generic_Internal_Discrete_Property (Underline); 
  252.    type Property_Underline is new Underline_Properties.Property; 
  253.  
  254.    package Variant_Properties is 
  255.       new Generic_Internal_Discrete_Property (Variant); 
  256.    type Property_Variant is new Variant_Properties.Property; 
  257.  
  258.    package Weight_Properties is 
  259.       new Generic_Internal_Discrete_Property (Weight); 
  260.    type Property_Weight is new Weight_Properties.Property; 
  261.  
  262.    package Wrap_Mode_Properties is 
  263.       new Generic_Internal_Discrete_Property (Wrap_Mode); 
  264.    type Property_Wrap_Mode is new Wrap_Mode_Properties.Property; 
  265.  
  266.    ---------------------- 
  267.    -- GtkAda additions -- 
  268.    ---------------------- 
  269.  
  270.    Pango_Scale : constant := 1024; 
  271.    --  All internal units in Pango are expressed in terms of this unit. A 
  272.    --  typical pango size must be divided by Pango_Scale to get the equivalent 
  273.    --  in pixels. 
  274.  
  275.    function To_Pixels (Pango_Units : Gint) return Gint; 
  276.    --  Convert a size in pango units to pixels. This is a rounding of 
  277.    --  Pango_Units divided by Pango_Scale 
  278.  
  279.    --  Enum types are bound with the following algorithm: 
  280.    --    + the "Pango" prefix of the type name is stripped 
  281.    --    + Each word of the type name is separated by '_' 
  282.    --    + the full enum name is kept, but capitalized. 
  283.  
  284.    --  All enums types should be sorted by alphabetical order... 
  285.  
  286. end Pango.Enums;