{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module OGDF.GraphIO.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import OGDF.GraphIO.RawType import STD.Deletable.Interface class (IDeletable a) => IGraphIO a where upcastGraphIO :: forall a . (FPtr a, IGraphIO a) => a -> GraphIO upcastGraphIO h = let fh = get_fptr h fh2 :: Ptr RawGraphIO = castPtr fh in cast_fptr_to_obj fh2 downcastGraphIO :: forall a . (FPtr a, IGraphIO a) => GraphIO -> a downcastGraphIO h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2