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