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.Tabs is 
  31.  
  32.    type Pango_Tab_Array is new Glib.C_Boxed with null record; 
  33.    Null_Pango_Tab_Array : constant Pango_Tab_Array; 
  34.  
  35.    function From_Object (Object : System.Address) return Pango_Tab_Array; 
  36.    function From_Object_Free (B : access Pango_Tab_Array'Class) return Pango_Tab_Array; 
  37.    pragma Inline (From_Object_Free, From_Object); 
  38.  
  39.    type Pango_Tab_Align is ( 
  40.       Pango_Tab_Left); 
  41.    pragma Convention (C, Pango_Tab_Align); 
  42.  
  43.    ---------------------------- 
  44.    -- Enumeration Properties -- 
  45.    ---------------------------- 
  46.  
  47.    package Pango_Tab_Align_Properties is 
  48.       new Generic_Internal_Discrete_Property (Pango_Tab_Align); 
  49.    type Property_Pango_Tab_Align is new Pango_Tab_Align_Properties.Property; 
  50.  
  51.    ------------------ 
  52.    -- Constructors -- 
  53.    ------------------ 
  54.  
  55.    procedure Gdk_New 
  56.       (Self                : out Pango_Tab_Array; 
  57.        Initial_Size        : Gint; 
  58.        Positions_In_Pixels : Boolean); 
  59.    --  Creates an array of Initial_Size tab stops. Tab stops are specified in 
  60.    --  pixel units if Positions_In_Pixels is True, otherwise in Pango units. 
  61.    --  All stops are initially at position 0. 
  62.    --  "initial_size": Initial number of tab stops to allocate, can be 0 
  63.    --  "positions_in_pixels": whether positions are in pixel units 
  64.  
  65.    function Pango_Tab_Array_New 
  66.       (Initial_Size        : Gint; 
  67.        Positions_In_Pixels : Boolean) return Pango_Tab_Array; 
  68.    --  Creates an array of Initial_Size tab stops. Tab stops are specified in 
  69.    --  pixel units if Positions_In_Pixels is True, otherwise in Pango units. 
  70.    --  All stops are initially at position 0. 
  71.    --  "initial_size": Initial number of tab stops to allocate, can be 0 
  72.    --  "positions_in_pixels": whether positions are in pixel units 
  73.  
  74.    function Get_Type return Glib.GType; 
  75.    pragma Import (C, Get_Type, "pango_tab_array_get_type"); 
  76.  
  77.    ------------- 
  78.    -- Methods -- 
  79.    ------------- 
  80.  
  81.    function Copy (Self : Pango_Tab_Array) return Pango_Tab_Array; 
  82.    --  Copies a Pango.Tabs.Pango_Tab_Array 
  83.  
  84.    procedure Free (Self : Pango_Tab_Array); 
  85.    --  Frees a tab array and associated resources. 
  86.  
  87.    function Get_Positions_In_Pixels (Self : Pango_Tab_Array) return Boolean; 
  88.    --  Returns True if the tab positions are in pixels, False if they are in 
  89.    --  Pango units. 
  90.  
  91.    function Get_Size (Self : Pango_Tab_Array) return Gint; 
  92.    --  Gets the number of tab stops in Tab_Array. 
  93.  
  94.    procedure Get_Tab 
  95.       (Self      : Pango_Tab_Array; 
  96.        Tab_Index : Gint; 
  97.        Alignment : out Pango_Tab_Align; 
  98.        Location  : out Gint); 
  99.    --  Gets the alignment and position of a tab stop. 
  100.    --  "tab_index": tab stop index 
  101.    --  "alignment": location to store alignment, or null 
  102.    --  "location": location to store tab position, or null 
  103.  
  104.    procedure Set_Tab 
  105.       (Self      : Pango_Tab_Array; 
  106.        Tab_Index : Gint; 
  107.        Alignment : Pango_Tab_Align; 
  108.        Location  : Gint); 
  109.    --  Sets the alignment and location of a tab stop. Alignment must always be 
  110.    --  PANGO_TAB_LEFT in the current implementation. 
  111.    --  "tab_index": the index of a tab stop 
  112.    --  "alignment": tab alignment 
  113.    --  "location": tab location in Pango units 
  114.  
  115.    procedure Resize (Self : Pango_Tab_Array; New_Size : Gint); 
  116.    --  Resizes a tab array. You must subsequently initialize any tabs that 
  117.    --  were added as a result of growing the array. 
  118.    --  "new_size": new size of the array 
  119.  
  120. private 
  121.  
  122.    Null_Pango_Tab_Array : constant Pango_Tab_Array := (Glib.C_Boxed with null record); 
  123.  
  124. end Pango.Tabs;