{-# LINE 1 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LINE 2 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
module Graphics.Rendering.FreeType.Internal.GlyphMetrics
( FT_Glyph_Metrics(..)
) where

import Foreign
import Foreign.Storable

import Graphics.Rendering.FreeType.Internal.PrimitiveTypes


{-# LINE 12 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}

{-# LINE 13 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}


{-# LINE 15 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}

{-# LINE 16 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}

data FT_Glyph_Metrics = FT_Glyph_Metrics
  { width        :: FT_Pos
  , height       :: FT_Pos
  , horiBearingX :: FT_Pos
  , horiBearingY :: FT_Pos
  , horiAdvance  :: FT_Pos
  , vertBearingX :: FT_Pos
  , vertBearingY :: FT_Pos
  , vertAdvance  :: FT_Pos
  }
  deriving (Read, Show, Eq)

instance Storable FT_Glyph_Metrics where
  sizeOf    _ = (32)
{-# LINE 31 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
  alignment _ = 4
{-# LINE 32 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
  peek ptr = do
    width'  <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) ptr
{-# LINE 34 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    height' <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) ptr
{-# LINE 35 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    horiBearingX' <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 36 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    horiBearingY' <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) ptr
{-# LINE 37 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    horiAdvance'  <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 38 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    vertBearingX' <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 39 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    vertBearingY' <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 40 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    vertAdvance'  <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) ptr
{-# LINE 41 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    return $ FT_Glyph_Metrics
      { width = width'
      , height = height'
      , horiBearingX = horiBearingX'
      , horiBearingY = horiBearingY'
      , horiAdvance  = horiAdvance'
      , vertBearingX = vertBearingX'
      , vertBearingY = vertBearingY'
      , vertAdvance  = vertAdvance'
      }
  poke ptr val = do
    ((\hsc_ptr -> pokeByteOff hsc_ptr 0)) ptr (width val)
{-# LINE 53 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 4)) ptr (height val)
{-# LINE 54 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr (horiBearingX val)
{-# LINE 55 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 12)) ptr (horiBearingY val)
{-# LINE 56 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr (horiAdvance val)
{-# LINE 57 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr (vertBearingX val)
{-# LINE 58 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr (vertBearingY val)
{-# LINE 59 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 28)) ptr (vertAdvance val)
{-# LINE 60 "Graphics/Rendering/FreeType/Internal/GlyphMetrics.hsc" #-}