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. --  <description> 
  25. --  an object containing a set of pango.Font objects 
  26. -- 
  27. --  </description> 
  28. pragma Ada_2005; 
  29.  
  30. pragma Warnings (Off, "*is already use-visible*"); 
  31. with Glib;               use Glib; 
  32. with Glib.Object;        use Glib.Object; 
  33. with Pango.Font;         use Pango.Font; 
  34. with Pango.Font_Metrics; use Pango.Font_Metrics; 
  35.  
  36. package Pango.Fontset is 
  37.  
  38.    type Pango_Fontset_Record is new GObject_Record with null record; 
  39.    type Pango_Fontset is access all Pango_Fontset_Record'Class; 
  40.  
  41.    --------------- 
  42.    -- Callbacks -- 
  43.    --------------- 
  44.  
  45.    type Pango_Fontset_Foreach_Func is access function 
  46.      (Fontset : not null access Pango_Fontset_Record'Class; 
  47.       Font    : not null access Pango.Font.Pango_Font_Record'Class) 
  48.    return Boolean; 
  49.    --  A callback function used by Pango.Fontset.Foreach when enumerating the 
  50.    --  fonts in a fontset. 
  51.    --  Since: gtk+ 1.4 
  52.    --  "fontset": a Pango.Fontset.Pango_Fontset 
  53.    --  "font": a font from Fontset 
  54.  
  55.    ------------------ 
  56.    -- Constructors -- 
  57.    ------------------ 
  58.  
  59.    function Get_Type return Glib.GType; 
  60.    pragma Import (C, Get_Type, "pango_fontset_get_type"); 
  61.  
  62.    ------------- 
  63.    -- Methods -- 
  64.    ------------- 
  65.  
  66.    procedure Foreach 
  67.       (Self : not null access Pango_Fontset_Record; 
  68.        Func : Pango_Fontset_Foreach_Func); 
  69.    --  Iterates through all the fonts in a fontset, calling Func for each one. 
  70.    --  If Func returns True, that stops the iteration. 
  71.    --  Since: gtk+ 1.4 
  72.    --  "func": Callback function 
  73.  
  74.    generic 
  75.       type User_Data_Type (<>) is private; 
  76.       with procedure Destroy (Data : in out User_Data_Type) is null; 
  77.    package Foreach_User_Data is 
  78.  
  79.       type Pango_Fontset_Foreach_Func is access function 
  80.         (Fontset   : not null access Pango.Fontset.Pango_Fontset_Record'Class; 
  81.          Font      : not null access Pango.Font.Pango_Font_Record'Class; 
  82.          User_Data : User_Data_Type) return Boolean; 
  83.       --  A callback function used by Pango.Fontset.Foreach when enumerating the 
  84.       --  fonts in a fontset. 
  85.       --  Since: gtk+ 1.4 
  86.       --  "fontset": a Pango.Fontset.Pango_Fontset 
  87.       --  "font": a font from Fontset 
  88.       --  "user_data": callback data 
  89.  
  90.       procedure Foreach 
  91.          (Self : not null access Pango.Fontset.Pango_Fontset_Record'Class; 
  92.           Func : Pango_Fontset_Foreach_Func; 
  93.           Data : User_Data_Type); 
  94.       --  Iterates through all the fonts in a fontset, calling Func for each 
  95.       --  one. If Func returns True, that stops the iteration. 
  96.       --  Since: gtk+ 1.4 
  97.       --  "func": Callback function 
  98.       --  "data": data to pass to the callback function 
  99.  
  100.    end Foreach_User_Data; 
  101.  
  102.    function Get_Font 
  103.       (Self : not null access Pango_Fontset_Record; 
  104.        Wc   : Guint) return Pango.Font.Pango_Font; 
  105.    --  Returns the font in the fontset that contains the best glyph for the 
  106.    --  Unicode character Wc. 
  107.    --  "wc": a Unicode character 
  108.  
  109.    function Get_Metrics 
  110.       (Self : not null access Pango_Fontset_Record) 
  111.        return Pango.Font_Metrics.Pango_Font_Metrics; 
  112.    --  Get overall metric information for the fonts in the fontset. 
  113.  
  114. end Pango.Fontset;