{-# LINE 1 "src/Graphics/Cairo/Drawing/Transformations.hsc" #-} {-# LANGUAGE BlockArguments #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wall -fno-warn-tabs #-} module Graphics.Cairo.Drawing.Transformations where import Foreign.Ptr import Foreign.ForeignPtr hiding (newForeignPtr) import Foreign.Concurrent import Foreign.Storable import Foreign.C.Types import Foreign.Marshal import Control.Monad import Control.Monad.Primitive import Data.CairoContext import Graphics.Cairo.Utilities.CairoMatrixT.Internal cairoTranslate :: PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m () cairoTranslate :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m () cairoTranslate (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble tx CDouble ty = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) cr -> Ptr (CairoT r (PrimState m)) -> CDouble -> CDouble -> IO () forall r s. Ptr (CairoT r s) -> CDouble -> CDouble -> IO () c_cairo_translate Ptr (CairoT r (PrimState m)) cr CDouble tx CDouble ty foreign import ccall "cairo_translate" c_cairo_translate :: Ptr (CairoT r s) -> CDouble -> CDouble -> IO () cairoScale :: PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m () cairoScale :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m () cairoScale (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble sx CDouble sy = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) cr -> Ptr (CairoT r (PrimState m)) -> CDouble -> CDouble -> IO () forall r s. Ptr (CairoT r s) -> CDouble -> CDouble -> IO () c_cairo_scale Ptr (CairoT r (PrimState m)) cr CDouble sx CDouble sy foreign import ccall "cairo_scale" c_cairo_scale :: Ptr (CairoT r s) -> CDouble -> CDouble -> IO () cairoRotate :: PrimMonad m => CairoT r (PrimState m) -> CDouble -> m () cairoRotate :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> m () cairoRotate (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble a = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) cr -> Ptr (CairoT r (PrimState m)) -> CDouble -> IO () forall r s. Ptr (CairoT r s) -> CDouble -> IO () c_cairo_rotate Ptr (CairoT r (PrimState m)) cr CDouble a foreign import ccall "cairo_rotate" c_cairo_rotate :: Ptr (CairoT r s) -> CDouble -> IO () cairoTransform :: (PrimMonad m, IsCairoMatrixT mtx) => CairoT r (PrimState m) -> mtx (PrimState m) -> m () cairoTransform :: forall (m :: * -> *) (mtx :: * -> *) r. (PrimMonad m, IsCairoMatrixT mtx) => CairoT r (PrimState m) -> mtx (PrimState m) -> m () cairoTransform (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) (mtx (PrimState m) -> CairoMatrixT (PrimState m) forall s. mtx s -> CairoMatrixT s forall (mtx :: * -> *) s. IsCairoMatrixT mtx => mtx s -> CairoMatrixT s toCairoMatrixT -> CairoMatrixT ForeignPtr (CairoMatrixT (PrimState m)) fmtx) = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> ForeignPtr (CairoMatrixT (PrimState m)) -> (Ptr (CairoMatrixT (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoMatrixT (PrimState m)) fmtx \Ptr (CairoMatrixT (PrimState m)) pmtx -> Ptr (CairoT r (PrimState m)) -> Ptr (CairoMatrixT (PrimState m)) -> IO () forall r s. Ptr (CairoT r s) -> Ptr (CairoMatrixT s) -> IO () c_cairo_transform Ptr (CairoT r (PrimState m)) pcr Ptr (CairoMatrixT (PrimState m)) pmtx foreign import ccall "cairo_transform" c_cairo_transform :: Ptr (CairoT r s) -> Ptr (CairoMatrixT s) -> IO () cairoSetMatrix :: (PrimMonad m, IsCairoMatrixT mtx) => CairoT r (PrimState m) -> mtx (PrimState m) -> m () cairoSetMatrix :: forall (m :: * -> *) (mtx :: * -> *) r. (PrimMonad m, IsCairoMatrixT mtx) => CairoT r (PrimState m) -> mtx (PrimState m) -> m () cairoSetMatrix (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) (mtx (PrimState m) -> CairoMatrixT (PrimState m) forall s. mtx s -> CairoMatrixT s forall (mtx :: * -> *) s. IsCairoMatrixT mtx => mtx s -> CairoMatrixT s toCairoMatrixT -> CairoMatrixT ForeignPtr (CairoMatrixT (PrimState m)) fmtx) = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> ForeignPtr (CairoMatrixT (PrimState m)) -> (Ptr (CairoMatrixT (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoMatrixT (PrimState m)) fmtx \Ptr (CairoMatrixT (PrimState m)) pmtx -> Ptr (CairoT r (PrimState m)) -> Ptr (CairoMatrixT (PrimState m)) -> IO () forall r s. Ptr (CairoT r s) -> Ptr (CairoMatrixT s) -> IO () c_cairo_set_matrix Ptr (CairoT r (PrimState m)) pcr Ptr (CairoMatrixT (PrimState m)) pmtx cairoGetMatrix :: PrimMonad m => CairoT r (PrimState m) -> m (CairoMatrixT (PrimState m)) cairoGetMatrix :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> m (CairoMatrixT (PrimState m)) cairoGetMatrix (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) = IO (CairoMatrixT (PrimState m)) -> m (CairoMatrixT (PrimState m)) forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO (CairoMatrixT (PrimState m)) -> m (CairoMatrixT (PrimState m))) -> IO (CairoMatrixT (PrimState m)) -> m (CairoMatrixT (PrimState m)) forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoMatrixT (PrimState m)) -> CairoMatrixT (PrimState m) forall s. ForeignPtr (CairoMatrixT s) -> CairoMatrixT s CairoMatrixT (ForeignPtr (CairoMatrixT (PrimState m)) -> CairoMatrixT (PrimState m)) -> IO (ForeignPtr (CairoMatrixT (PrimState m))) -> IO (CairoMatrixT (PrimState m)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO (ForeignPtr (CairoMatrixT (PrimState m)))) -> IO (ForeignPtr (CairoMatrixT (PrimState m))) forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> do p <- Int -> IO (Ptr (CairoMatrixT (PrimState m))) forall a. Int -> IO (Ptr a) mallocBytes (Int 48) {-# LINE 64 "src/Graphics/Cairo/Drawing/Transformations.hsc" #-} c_cairo_get_matrix pcr p newForeignPtr p (free p) foreign import ccall "cairo_set_matrix" c_cairo_set_matrix :: Ptr (CairoT r s) -> Ptr (CairoMatrixT s) -> IO () foreign import ccall "cairo_get_matrix" c_cairo_get_matrix :: Ptr (CairoT r s) -> Ptr (CairoMatrixT s) -> IO () cairoIdentityMatrix :: PrimMonad m => CairoT r (PrimState m) -> m () cairoIdentityMatrix :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> m () cairoIdentityMatrix (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) = IO () -> m () forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO ()) -> IO () forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr Ptr (CairoT r (PrimState m)) -> IO () forall r s. Ptr (CairoT r s) -> IO () c_cairo_identity_matrix foreign import ccall "cairo_identity_matrix" c_cairo_identity_matrix :: Ptr (CairoT r s) -> IO () cairoUserToDevice :: PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoUserToDevice :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoUserToDevice (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble x CDouble y = IO (CDouble, CDouble) -> m (CDouble, CDouble) forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO (CDouble, CDouble) -> m (CDouble, CDouble)) -> IO (CDouble, CDouble) -> m (CDouble, CDouble) forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble px -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble py -> do (Ptr CDouble -> CDouble -> IO ()) -> [Ptr CDouble] -> [CDouble] -> IO () forall (m :: * -> *) a b c. Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () zipWithM_ Ptr CDouble -> CDouble -> IO () forall a. Storable a => Ptr a -> a -> IO () poke [Ptr CDouble px, Ptr CDouble py] [CDouble x, CDouble y] Ptr (CairoT r (PrimState m)) -> Ptr CDouble -> Ptr CDouble -> IO () forall r s. Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () c_cairo_user_to_device Ptr (CairoT r (PrimState m)) pcr Ptr CDouble px Ptr CDouble py (,) (CDouble -> CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble -> (CDouble, CDouble)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble px IO (CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble, CDouble) forall a b. IO (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble py foreign import ccall "cairo_user_to_device" c_cairo_user_to_device :: Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () cairoUserToDeviceDistance :: PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoUserToDeviceDistance :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoUserToDeviceDistance (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble dx CDouble dy = IO (CDouble, CDouble) -> m (CDouble, CDouble) forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO (CDouble, CDouble) -> m (CDouble, CDouble)) -> IO (CDouble, CDouble) -> m (CDouble, CDouble) forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble px -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble py -> do (Ptr CDouble -> CDouble -> IO ()) -> [Ptr CDouble] -> [CDouble] -> IO () forall (m :: * -> *) a b c. Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () zipWithM_ Ptr CDouble -> CDouble -> IO () forall a. Storable a => Ptr a -> a -> IO () poke [Ptr CDouble px, Ptr CDouble py] [CDouble dx, CDouble dy] Ptr (CairoT r (PrimState m)) -> Ptr CDouble -> Ptr CDouble -> IO () forall r s. Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () c_cairo_user_to_device_distance Ptr (CairoT r (PrimState m)) pcr Ptr CDouble px Ptr CDouble py (,) (CDouble -> CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble -> (CDouble, CDouble)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble px IO (CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble, CDouble) forall a b. IO (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble py foreign import ccall "cairo_user_to_device_distance" c_cairo_user_to_device_distance :: Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () cairoDeviceToUser :: PrimMonad m => (CairoT r (PrimState m)) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoDeviceToUser :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoDeviceToUser (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble x CDouble y = IO (CDouble, CDouble) -> m (CDouble, CDouble) forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO (CDouble, CDouble) -> m (CDouble, CDouble)) -> IO (CDouble, CDouble) -> m (CDouble, CDouble) forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble px -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble py -> do (Ptr CDouble -> CDouble -> IO ()) -> [Ptr CDouble] -> [CDouble] -> IO () forall (m :: * -> *) a b c. Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () zipWithM_ Ptr CDouble -> CDouble -> IO () forall a. Storable a => Ptr a -> a -> IO () poke [Ptr CDouble px, Ptr CDouble py] [CDouble x, CDouble y] Ptr (CairoT r (PrimState m)) -> Ptr CDouble -> Ptr CDouble -> IO () forall r s. Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () c_cairo_device_to_user Ptr (CairoT r (PrimState m)) pcr Ptr CDouble px Ptr CDouble py (,) (CDouble -> CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble -> (CDouble, CDouble)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble px IO (CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble, CDouble) forall a b. IO (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble py foreign import ccall "cairo_device_to_user" c_cairo_device_to_user :: Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () cairoDeviceToUserDistance :: PrimMonad m => (CairoT r (PrimState m)) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoDeviceToUserDistance :: forall (m :: * -> *) r. PrimMonad m => CairoT r (PrimState m) -> CDouble -> CDouble -> m (CDouble, CDouble) cairoDeviceToUserDistance (CairoT ForeignPtr (CairoT r (PrimState m)) fcr) CDouble dx CDouble dy = IO (CDouble, CDouble) -> m (CDouble, CDouble) forall (m :: * -> *) a. PrimMonad m => IO a -> m a unsafeIOToPrim (IO (CDouble, CDouble) -> m (CDouble, CDouble)) -> IO (CDouble, CDouble) -> m (CDouble, CDouble) forall a b. (a -> b) -> a -> b $ ForeignPtr (CairoT r (PrimState m)) -> (Ptr (CairoT r (PrimState m)) -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b withForeignPtr ForeignPtr (CairoT r (PrimState m)) fcr \Ptr (CairoT r (PrimState m)) pcr -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble px -> (Ptr CDouble -> IO (CDouble, CDouble)) -> IO (CDouble, CDouble) forall a b. Storable a => (Ptr a -> IO b) -> IO b alloca \Ptr CDouble py -> do (Ptr CDouble -> CDouble -> IO ()) -> [Ptr CDouble] -> [CDouble] -> IO () forall (m :: * -> *) a b c. Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () zipWithM_ Ptr CDouble -> CDouble -> IO () forall a. Storable a => Ptr a -> a -> IO () poke [Ptr CDouble px, Ptr CDouble py] [CDouble dx, CDouble dy] Ptr (CairoT r (PrimState m)) -> Ptr CDouble -> Ptr CDouble -> IO () forall r s. Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO () c_cairo_device_to_user_distance Ptr (CairoT r (PrimState m)) pcr Ptr CDouble px Ptr CDouble py (,) (CDouble -> CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble -> (CDouble, CDouble)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble px IO (CDouble -> (CDouble, CDouble)) -> IO CDouble -> IO (CDouble, CDouble) forall a b. IO (a -> b) -> IO a -> IO b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Ptr CDouble -> IO CDouble forall a. Storable a => Ptr a -> IO a peek Ptr CDouble py foreign import ccall "cairo_device_to_user_distance" c_cairo_device_to_user_distance :: Ptr (CairoT r s) -> Ptr CDouble -> Ptr CDouble -> IO ()