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