-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Rsvg.Functions
    ( 

 -- * Methods


-- ** cleanup #method:cleanup#

    cleanup                                 ,


-- ** setDefaultDpi #method:setDefaultDpi#

    setDefaultDpi                           ,


-- ** setDefaultDpiXY #method:setDefaultDpiXY#

    setDefaultDpiXY                         ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R


-- function set_default_dpi_x_y
-- Args: [ Arg
--           { argCName = "dpi_x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Dots Per Inch (aka Pixels Per Inch)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dpi_y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Dots Per Inch (aka Pixels Per Inch)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "rsvg_set_default_dpi_x_y" rsvg_set_default_dpi_x_y :: 
    CDouble ->                              -- dpi_x : TBasicType TDouble
    CDouble ->                              -- dpi_y : TBasicType TDouble
    IO ()

{-# DEPRECATED setDefaultDpiXY ["(Since version 2.42.3)","This function used to set a global default DPI.  However,","it only worked if it was called before any t'GI.Rsvg.Objects.Handle.Handle' objects had been","created; it would not work after that.  To avoid global mutable state, please","use 'GI.Rsvg.Objects.Handle.handleSetDpi' instead."] #-}
-- | Do not use this function.  Create an t'GI.Rsvg.Objects.Handle.Handle' and call
-- 'GI.Rsvg.Objects.Handle.handleSetDpiXY' on it instead.
-- 
-- /Since: 2.8/
setDefaultDpiXY ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Double
    -- ^ /@dpiX@/: Dots Per Inch (aka Pixels Per Inch)
    -> Double
    -- ^ /@dpiY@/: Dots Per Inch (aka Pixels Per Inch)
    -> m ()
setDefaultDpiXY :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Double -> Double -> m ()
setDefaultDpiXY Double
dpiX Double
dpiY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let dpiX' :: CDouble
dpiX' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpiX
    let dpiY' :: CDouble
dpiY' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpiY
    CDouble -> CDouble -> IO ()
rsvg_set_default_dpi_x_y CDouble
dpiX' CDouble
dpiY'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_default_dpi
-- Args: [ Arg
--           { argCName = "dpi"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Dots Per Inch (aka Pixels Per Inch)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "rsvg_set_default_dpi" rsvg_set_default_dpi :: 
    CDouble ->                              -- dpi : TBasicType TDouble
    IO ()

{-# DEPRECATED setDefaultDpi ["(Since version 2.42.3)","This function used to set a global default DPI.  However,","it only worked if it was called before any t'GI.Rsvg.Objects.Handle.Handle' objects had been","created; it would not work after that.  To avoid global mutable state, please","use 'GI.Rsvg.Objects.Handle.handleSetDpi' instead."] #-}
-- | Do not use this function.  Create an t'GI.Rsvg.Objects.Handle.Handle' and call
-- 'GI.Rsvg.Objects.Handle.handleSetDpi' on it instead.
-- 
-- /Since: 2.8/
setDefaultDpi ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Double
    -- ^ /@dpi@/: Dots Per Inch (aka Pixels Per Inch)
    -> m ()
setDefaultDpi :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Double -> m ()
setDefaultDpi Double
dpi = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let dpi' :: CDouble
dpi' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
dpi
    CDouble -> IO ()
rsvg_set_default_dpi CDouble
dpi'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function cleanup
-- Args: []
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "rsvg_cleanup" rsvg_cleanup :: 
    IO ()

{-# DEPRECATED cleanup ["(Since version 2.46)","No-op. This function should not be called from normal programs."] #-}
-- | /No description available in the introspection data./
-- 
-- /Since: 2.36/
cleanup ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ()
cleanup :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ()
cleanup  = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    IO ()
rsvg_cleanup
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()