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