{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module GDAL.OGRSurface.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import GDAL.OGRSurface.RawType import GDAL.OGRGeometry.Interface class (IOGRGeometry a) => IOGRSurface a where upcastOGRSurface :: forall a . (FPtr a, IOGRSurface a) => a -> OGRSurface upcastOGRSurface :: forall a. (FPtr a, IOGRSurface a) => a -> OGRSurface upcastOGRSurface 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 RawOGRSurface fh2 :: Ptr RawOGRSurface = Ptr (Raw a) -> Ptr RawOGRSurface forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw OGRSurface) -> OGRSurface forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw OGRSurface) Ptr RawOGRSurface fh2 downcastOGRSurface :: forall a . (FPtr a, IOGRSurface a) => OGRSurface -> a downcastOGRSurface :: forall a. (FPtr a, IOGRSurface a) => OGRSurface -> a downcastOGRSurface OGRSurface h = let fh :: Ptr (Raw OGRSurface) fh = OGRSurface -> Ptr (Raw OGRSurface) forall a. FPtr a => a -> Ptr (Raw a) get_fptr OGRSurface h fh2 :: Ptr (Raw a) fh2 = Ptr RawOGRSurface -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw OGRSurface) Ptr RawOGRSurface fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2