{-# LINE 1 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LINE 2 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
module Graphics.Rendering.FreeType.Internal.Generic
( FT_Generic(..)
, FT_Generic_Finalizer
) where

import Foreign


{-# LINE 10 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}

{-# LINE 11 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}


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

{-# LINE 14 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}

type FT_Generic_Finalizer = FunPtr (Ptr () -> IO ())

data FT_Generic = FT_Generic
  { data_ :: Ptr ()
  , finalizer :: FT_Generic_Finalizer
  }

instance Storable FT_Generic where
  sizeOf    _ = (8)
{-# LINE 24 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
  alignment _ = 4
{-# LINE 25 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
  -- Is peek/poke defined correctly given that data is a void*
  -- and finalizer is a function pointer?
  peek ptr = do
    data_'     <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) ptr
{-# LINE 29 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
    finalizer' <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) ptr
{-# LINE 30 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
    return $ FT_Generic
      { data_ = data_'
      , finalizer = finalizer'
      }
  poke ptr val = do
    ((\hsc_ptr -> pokeByteOff hsc_ptr 0)) ptr (data_ val)
{-# LINE 36 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 4)) ptr (finalizer val) 
{-# LINE 37 "Graphics/Rendering/FreeType/Internal/Generic.hsc" #-}