{-# 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 h
  = let fh = get_fptr h
        fh2 :: Ptr RawSugiyamaLayout = castPtr fh
      in cast_fptr_to_obj fh2

downcastSugiyamaLayout ::
                       forall a . (FPtr a, ISugiyamaLayout a) => SugiyamaLayout -> a
downcastSugiyamaLayout h
  = let fh = get_fptr h
        fh2 = castPtr fh
      in cast_fptr_to_obj fh2
