{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module OGDF.SugiyamaLayout.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import OGDF.SugiyamaLayout.RawType import STD.Deletable.Interface import OGDF.LayoutModule.Interface class (IDeletable a, ILayoutModule a) => ISugiyamaLayout a where upcastSugiyamaLayout :: forall a . (FPtr a, ISugiyamaLayout a) => a -> SugiyamaLayout upcastSugiyamaLayout :: forall a. (FPtr a, ISugiyamaLayout a) => a -> SugiyamaLayout upcastSugiyamaLayout 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 RawSugiyamaLayout fh2 :: Ptr RawSugiyamaLayout = Ptr (Raw a) -> Ptr RawSugiyamaLayout forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw SugiyamaLayout) -> SugiyamaLayout forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw SugiyamaLayout) Ptr RawSugiyamaLayout fh2 downcastSugiyamaLayout :: forall a . (FPtr a, ISugiyamaLayout a) => SugiyamaLayout -> a downcastSugiyamaLayout :: forall a. (FPtr a, ISugiyamaLayout a) => SugiyamaLayout -> a downcastSugiyamaLayout SugiyamaLayout h = let fh :: Ptr (Raw SugiyamaLayout) fh = SugiyamaLayout -> Ptr (Raw SugiyamaLayout) forall a. FPtr a => a -> Ptr (Raw a) get_fptr SugiyamaLayout h fh2 :: Ptr (Raw a) fh2 = Ptr RawSugiyamaLayout -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw SugiyamaLayout) Ptr RawSugiyamaLayout fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2