lace_opengl_0.1.0_672a6415/source/lean/text/opengl-glyph.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
with
     ada.unchecked_Deallocation;

package body openGL.Glyph
is

   ---------
   --  Forge
   --

   procedure define (Self : in out Item;   glyth_Slot : in freetype_c.FT_GlyphSlot.item)
   is
   begin
      Self.Impl := new GlyphImpl.item;
      Self.Impl.define (glyth_Slot);
   end define;


   procedure define (Self : in out Item;   pImpl : in GlyphImpl.view)
   is
   begin
      Self.Impl := pImpl;
   end define;


   procedure destruct (Self : in out Item)
   is
      procedure deallocate is new ada.unchecked_Deallocation (GlyphImpl.item'Class,
                                                              GlyphImpl.view);
   begin
      deallocate (Self.Impl);
   end destruct;


   --------------
   --  Attributes
   --

   function Advance (Self : in Item) return Real
   is
   begin
      return Self.Impl.Advance;
   end Advance;


   function BBox (Self : in Item) return Bounds
   is
   begin
      return Self.Impl.BBox;
   end BBox;


   function Error (Self : in Item) return GlyphImpl.Error_Kind
   is
   begin
      return Self.Impl.Error;
   end Error;


end openGL.Glyph;