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

class (IDeletable a) => IDRect a where

upcastDRect :: forall a . (FPtr a, IDRect a) => a -> DRect
upcastDRect :: forall a. (FPtr a, IDRect a) => a -> DRect
upcastDRect 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 RawDRect
fh2 :: Ptr RawDRect = Ptr (Raw a) -> Ptr RawDRect
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw DRect) -> DRect
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw DRect)
Ptr RawDRect
fh2

downcastDRect :: forall a . (FPtr a, IDRect a) => DRect -> a
downcastDRect :: forall a. (FPtr a, IDRect a) => DRect -> a
downcastDRect DRect
h
  = let fh :: Ptr (Raw DRect)
fh = DRect -> Ptr (Raw DRect)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr DRect
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawDRect -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw DRect)
Ptr RawDRect
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2