{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module OGDF.FMMMLayout.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import OGDF.FMMMLayout.RawType
import STD.Deletable.Interface
import OGDF.LayoutModule.Interface

class (IDeletable a, ILayoutModule a) => IFMMMLayout a where

upcastFMMMLayout ::
                 forall a . (FPtr a, IFMMMLayout a) => a -> FMMMLayout
upcastFMMMLayout :: forall a. (FPtr a, IFMMMLayout a) => a -> FMMMLayout
upcastFMMMLayout 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 RawFMMMLayout
fh2 :: Ptr RawFMMMLayout = Ptr (Raw a) -> Ptr RawFMMMLayout
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw FMMMLayout) -> FMMMLayout
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw FMMMLayout)
Ptr RawFMMMLayout
fh2

downcastFMMMLayout ::
                   forall a . (FPtr a, IFMMMLayout a) => FMMMLayout -> a
downcastFMMMLayout :: forall a. (FPtr a, IFMMMLayout a) => FMMMLayout -> a
downcastFMMMLayout FMMMLayout
h
  = let fh :: Ptr (Raw FMMMLayout)
fh = FMMMLayout -> Ptr (Raw FMMMLayout)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr FMMMLayout
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawFMMMLayout -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw FMMMLayout)
Ptr RawFMMMLayout
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2