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

class (IDeletable a) => IRectangle_t a where

upcastRectangle_t ::
                  forall a . (FPtr a, IRectangle_t a) => a -> Rectangle_t
upcastRectangle_t :: forall a. (FPtr a, IRectangle_t a) => a -> Rectangle_t
upcastRectangle_t 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 RawRectangle_t
fh2 :: Ptr RawRectangle_t = Ptr (Raw a) -> Ptr RawRectangle_t
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw Rectangle_t) -> Rectangle_t
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw Rectangle_t)
Ptr RawRectangle_t
fh2

downcastRectangle_t ::
                    forall a . (FPtr a, IRectangle_t a) => Rectangle_t -> a
downcastRectangle_t :: forall a. (FPtr a, IRectangle_t a) => Rectangle_t -> a
downcastRectangle_t Rectangle_t
h
  = let fh :: Ptr (Raw Rectangle_t)
fh = Rectangle_t -> Ptr (Raw Rectangle_t)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr Rectangle_t
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawRectangle_t -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw Rectangle_t)
Ptr RawRectangle_t
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2