-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- 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.Gtk.Functions
    ( 

 -- * Methods
-- ** acceleratorGetDefaultModMask #method:acceleratorGetDefaultModMask#

    acceleratorGetDefaultModMask            ,


-- ** acceleratorGetLabel #method:acceleratorGetLabel#

    acceleratorGetLabel                     ,


-- ** acceleratorGetLabelWithKeycode #method:acceleratorGetLabelWithKeycode#

    acceleratorGetLabelWithKeycode          ,


-- ** acceleratorName #method:acceleratorName#

    acceleratorName                         ,


-- ** acceleratorNameWithKeycode #method:acceleratorNameWithKeycode#

    acceleratorNameWithKeycode              ,


-- ** acceleratorParse #method:acceleratorParse#

    acceleratorParse                        ,


-- ** acceleratorParseWithKeycode #method:acceleratorParseWithKeycode#

    acceleratorParseWithKeycode             ,


-- ** acceleratorValid #method:acceleratorValid#

    acceleratorValid                        ,


-- ** checkVersion #method:checkVersion#

    checkVersion                            ,


-- ** cssParserErrorQuark #method:cssParserErrorQuark#

    cssParserErrorQuark                     ,


-- ** cssParserWarningQuark #method:cssParserWarningQuark#

    cssParserWarningQuark                   ,


-- ** disableSetlocale #method:disableSetlocale#

    disableSetlocale                        ,


-- ** distributeNaturalAllocation #method:distributeNaturalAllocation#

    distributeNaturalAllocation             ,


-- ** getBinaryAge #method:getBinaryAge#

    getBinaryAge                            ,


-- ** getDebugFlags #method:getDebugFlags#

    getDebugFlags                           ,


-- ** getDefaultLanguage #method:getDefaultLanguage#

    getDefaultLanguage                      ,


-- ** getInterfaceAge #method:getInterfaceAge#

    getInterfaceAge                         ,


-- ** getLocaleDirection #method:getLocaleDirection#

    getLocaleDirection                      ,


-- ** getMajorVersion #method:getMajorVersion#

    getMajorVersion                         ,


-- ** getMicroVersion #method:getMicroVersion#

    getMicroVersion                         ,


-- ** getMinorVersion #method:getMinorVersion#

    getMinorVersion                         ,


-- ** hsvToRgb #method:hsvToRgb#

    hsvToRgb                                ,


-- ** init #method:init#

    init                                    ,


-- ** initCheck #method:initCheck#

    initCheck                               ,


-- ** isInitialized #method:isInitialized#

    isInitialized                           ,


-- ** printRunPageSetupDialog #method:printRunPageSetupDialog#

    printRunPageSetupDialog                 ,


-- ** printRunPageSetupDialogAsync #method:printRunPageSetupDialogAsync#

    printRunPageSetupDialogAsync            ,


-- ** renderActivity #method:renderActivity#

    renderActivity                          ,


-- ** renderArrow #method:renderArrow#

    renderArrow                             ,


-- ** renderBackground #method:renderBackground#

    renderBackground                        ,


-- ** renderCheck #method:renderCheck#

    renderCheck                             ,


-- ** renderExpander #method:renderExpander#

    renderExpander                          ,


-- ** renderFocus #method:renderFocus#

    renderFocus                             ,


-- ** renderFrame #method:renderFrame#

    renderFrame                             ,


-- ** renderHandle #method:renderHandle#

    renderHandle                            ,


-- ** renderIcon #method:renderIcon#

    renderIcon                              ,


-- ** renderInsertionCursor #method:renderInsertionCursor#

    renderInsertionCursor                   ,


-- ** renderLayout #method:renderLayout#

    renderLayout                            ,


-- ** renderLine #method:renderLine#

    renderLine                              ,


-- ** renderOption #method:renderOption#

    renderOption                            ,


-- ** rgbToHsv #method:rgbToHsv#

    rgbToHsv                                ,


-- ** setDebugFlags #method:setDebugFlags#

    setDebugFlags                           ,


-- ** showUri #method:showUri#

    showUri                                 ,


-- ** showUriFullFinish #method:showUriFullFinish#

    showUriFullFinish                       ,


-- ** testListAllTypes #method:testListAllTypes#

    testListAllTypes                        ,


-- ** testRegisterAllTypes #method:testRegisterAllTypes#

    testRegisterAllTypes                    ,


-- ** testWidgetWaitForDraw #method:testWidgetWaitForDraw#

    testWidgetWaitForDraw                   ,


-- ** treeCreateRowDragContent #method:treeCreateRowDragContent#

    treeCreateRowDragContent                ,


-- ** treeGetRowDragData #method:treeGetRowDragData#

    treeGetRowDragData                      ,




    ) 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.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.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 GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.Texture as Gdk.Texture
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.TreeModel as Gtk.TreeModel
import {-# SOURCE #-} qualified GI.Gtk.Objects.PageSetup as Gtk.PageSetup
import {-# SOURCE #-} qualified GI.Gtk.Objects.PrintSettings as Gtk.PrintSettings
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget
import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window
import {-# SOURCE #-} qualified GI.Gtk.Structs.RequestedSize as Gtk.RequestedSize
import {-# SOURCE #-} qualified GI.Gtk.Structs.TreePath as Gtk.TreePath
import qualified GI.Pango.Enums as Pango.Enums
import qualified GI.Pango.Objects.Layout as Pango.Layout
import qualified GI.Pango.Structs.Language as Pango.Language

-- function tree_get_row_drag_data
-- Args: [ Arg
--           { argCName = "value"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GValue" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tree_model"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TreeModel" }
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTreeModel" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TreePath" }
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "row in @tree_model" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_tree_get_row_drag_data" gtk_tree_get_row_drag_data :: 
    Ptr GValue ->                           -- value : TGValue
    Ptr (Ptr Gtk.TreeModel.TreeModel) ->    -- tree_model : TInterface (Name {namespace = "Gtk", name = "TreeModel"})
    Ptr (Ptr Gtk.TreePath.TreePath) ->      -- path : TInterface (Name {namespace = "Gtk", name = "TreePath"})
    IO CInt

-- | Obtains a /@treeModel@/ and /@path@/ from value of target type
-- @/GTK_TYPE_TREE_ROW_DATA/@.
-- 
-- The returned path must be freed with 'GI.Gtk.Structs.TreePath.treePathFree'.
treeGetRowDragData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GValue
    -- ^ /@value@/: a t'GI.GObject.Structs.Value.Value'
    -> m ((Bool, Maybe Gtk.TreeModel.TreeModel, Maybe Gtk.TreePath.TreePath))
    -- ^ __Returns:__ 'P.True' if /@selectionData@/ had target type @/GTK_TYPE_TREE_ROW_DATA/@
    --  is otherwise valid
treeGetRowDragData :: GValue -> m (Bool, Maybe TreeModel, Maybe TreePath)
treeGetRowDragData GValue
value = IO (Bool, Maybe TreeModel, Maybe TreePath)
-> m (Bool, Maybe TreeModel, Maybe TreePath)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Maybe TreeModel, Maybe TreePath)
 -> m (Bool, Maybe TreeModel, Maybe TreePath))
-> IO (Bool, Maybe TreeModel, Maybe TreePath)
-> m (Bool, Maybe TreeModel, Maybe TreePath)
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
    Ptr (Ptr TreeModel)
treeModel <- IO (Ptr (Ptr TreeModel))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gtk.TreeModel.TreeModel))
    Ptr (Ptr TreePath)
path <- IO (Ptr (Ptr TreePath))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gtk.TreePath.TreePath))
    CInt
result <- Ptr GValue -> Ptr (Ptr TreeModel) -> Ptr (Ptr TreePath) -> IO CInt
gtk_tree_get_row_drag_data Ptr GValue
value' Ptr (Ptr TreeModel)
treeModel Ptr (Ptr TreePath)
path
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr TreeModel
treeModel' <- Ptr (Ptr TreeModel) -> IO (Ptr TreeModel)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr TreeModel)
treeModel
    Maybe TreeModel
maybeTreeModel' <- Ptr TreeModel
-> (Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TreeModel
treeModel' ((Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel))
-> (Ptr TreeModel -> IO TreeModel) -> IO (Maybe TreeModel)
forall a b. (a -> b) -> a -> b
$ \Ptr TreeModel
treeModel'' -> do
        TreeModel
treeModel''' <- ((ManagedPtr TreeModel -> TreeModel)
-> Ptr TreeModel -> IO TreeModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TreeModel -> TreeModel
Gtk.TreeModel.TreeModel) Ptr TreeModel
treeModel''
        TreeModel -> IO TreeModel
forall (m :: * -> *) a. Monad m => a -> m a
return TreeModel
treeModel'''
    Ptr TreePath
path' <- Ptr (Ptr TreePath) -> IO (Ptr TreePath)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr TreePath)
path
    Maybe TreePath
maybePath' <- Ptr TreePath
-> (Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TreePath
path' ((Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath))
-> (Ptr TreePath -> IO TreePath) -> IO (Maybe TreePath)
forall a b. (a -> b) -> a -> b
$ \Ptr TreePath
path'' -> do
        TreePath
path''' <- ((ManagedPtr TreePath -> TreePath) -> Ptr TreePath -> IO TreePath
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TreePath -> TreePath
Gtk.TreePath.TreePath) Ptr TreePath
path''
        TreePath -> IO TreePath
forall (m :: * -> *) a. Monad m => a -> m a
return TreePath
path'''
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value'
    Ptr (Ptr TreeModel) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr TreeModel)
treeModel
    Ptr (Ptr TreePath) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr TreePath)
path
    (Bool, Maybe TreeModel, Maybe TreePath)
-> IO (Bool, Maybe TreeModel, Maybe TreePath)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Maybe TreeModel
maybeTreeModel', Maybe TreePath
maybePath')


-- function tree_create_row_drag_content
-- Args: [ Arg
--           { argCName = "tree_model"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TreeModel" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTreeModel" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TreePath" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a row in @tree_model"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ContentProvider" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_tree_create_row_drag_content" gtk_tree_create_row_drag_content :: 
    Ptr Gtk.TreeModel.TreeModel ->          -- tree_model : TInterface (Name {namespace = "Gtk", name = "TreeModel"})
    Ptr Gtk.TreePath.TreePath ->            -- path : TInterface (Name {namespace = "Gtk", name = "TreePath"})
    IO (Ptr Gdk.ContentProvider.ContentProvider)

-- | Creates a content provider for dragging /@path@/ from /@treeModel@/.
treeCreateRowDragContent ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.TreeModel.IsTreeModel a) =>
    a
    -- ^ /@treeModel@/: a t'GI.Gtk.Interfaces.TreeModel.TreeModel'
    -> Gtk.TreePath.TreePath
    -- ^ /@path@/: a row in /@treeModel@/
    -> m Gdk.ContentProvider.ContentProvider
    -- ^ __Returns:__ a new t'GI.Gdk.Objects.ContentProvider.ContentProvider'
treeCreateRowDragContent :: a -> TreePath -> m ContentProvider
treeCreateRowDragContent a
treeModel TreePath
path = IO ContentProvider -> m ContentProvider
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentProvider -> m ContentProvider)
-> IO ContentProvider -> m ContentProvider
forall a b. (a -> b) -> a -> b
$ do
    Ptr TreeModel
treeModel' <- a -> IO (Ptr TreeModel)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
treeModel
    Ptr TreePath
path' <- TreePath -> IO (Ptr TreePath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TreePath
path
    Ptr ContentProvider
result <- Ptr TreeModel -> Ptr TreePath -> IO (Ptr ContentProvider)
gtk_tree_create_row_drag_content Ptr TreeModel
treeModel' Ptr TreePath
path'
    Text -> Ptr ContentProvider -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"treeCreateRowDragContent" Ptr ContentProvider
result
    ContentProvider
result' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider) Ptr ContentProvider
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
treeModel
    TreePath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TreePath
path
    ContentProvider -> IO ContentProvider
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result'


-- function test_widget_wait_for_draw
-- Args: [ Arg
--           { argCName = "widget"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Widget" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the widget to wait for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_widget_wait_for_draw" gtk_test_widget_wait_for_draw :: 
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    IO ()

-- | Enters the main loop and waits for /@widget@/ to be “drawn”. In this
-- context that means it waits for the frame clock of /@widget@/ to have
-- run a full styling, layout and drawing cycle.
-- 
-- This function is intended to be used for syncing with actions that
-- depend on /@widget@/ relayouting or on interaction with the display
-- server.
testWidgetWaitForDraw ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    -- ^ /@widget@/: the widget to wait for
    -> m ()
testWidgetWaitForDraw :: a -> m ()
testWidgetWaitForDraw a
widget = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Widget
widget' <- a -> IO (Ptr Widget)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
widget
    Ptr Widget -> IO ()
gtk_test_widget_wait_for_draw Ptr Widget
widget'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
widget
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


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

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

-- | Force registration of all core Gtk+ and Gdk object types.
-- This allowes to refer to any of those object types via
-- 'GI.GObject.Functions.typeFromName' after calling this function.
testRegisterAllTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ()
testRegisterAllTypes :: m ()
testRegisterAllTypes  = 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 ()
gtk_test_register_all_types
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function test_list_all_types
-- Args: [ Arg
--           { argCName = "n_types"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to store number of types"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) 0 (TBasicType TGType))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_list_all_types" gtk_test_list_all_types :: 
    Ptr Word32 ->                           -- n_types : TBasicType TUInt
    IO (Ptr CGType)

-- | Return the type ids that have been registered after
-- calling 'GI.Gtk.Functions.testRegisterAllTypes'.
testListAllTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m (([GType], Word32))
    -- ^ __Returns:__ 
    --    0-terminated array of type ids
testListAllTypes :: m ([GType], Word32)
testListAllTypes  = IO ([GType], Word32) -> m ([GType], Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([GType], Word32) -> m ([GType], Word32))
-> IO ([GType], Word32) -> m ([GType], Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Word32
nTypes <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CGType
result <- Ptr Word32 -> IO (Ptr CGType)
gtk_test_list_all_types Ptr Word32
nTypes
    Text -> Ptr CGType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"testListAllTypes" Ptr CGType
result
    [GType]
result' <- ((CGType -> GType) -> Ptr CGType -> IO [GType]
forall a b.
(Eq a, Num a, Storable a) =>
(a -> b) -> Ptr a -> IO [b]
unpackMapZeroTerminatedStorableArray CGType -> GType
GType) Ptr CGType
result
    Word32
nTypes' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
nTypes
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
nTypes
    ([GType], Word32) -> IO ([GType], Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return ([GType]
result', Word32
nTypes')


-- function show_uri_full_finish
-- Args: [ Arg
--           { argCName = "parent"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GtkWindow passed to gtk_show_uri()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#GAsyncResult that was passed to @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "gtk_show_uri_full_finish" gtk_show_uri_full_finish :: 
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finished the 'GI.Gtk.Functions.showUri' call and returns the result
-- of the operation.
showUriFullFinish ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@parent@/: the t'GI.Gtk.Objects.Window.Window' passed to 'GI.Gtk.Functions.showUri'
    -> b
    -- ^ /@result@/: t'GI.Gio.Interfaces.AsyncResult.AsyncResult' that was passed to /@callback@/
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
showUriFullFinish :: a -> b -> m ()
showUriFullFinish a
parent b
result_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
parent' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
parent
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Window -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gtk_show_uri_full_finish Ptr Window
parent' Ptr AsyncResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
parent
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )


-- function show_uri_full
-- XXX Could not generate function show_uri_full

{-  Bad introspection data: Closure not found! Callable
      { returnType = Nothing
      , returnMayBeNull = False
      , returnTransfer = TransferNothing
      , returnDocumentation =
          Documentation { rawDocText = Nothing , sinceVersion = Nothing }
      , args =
          [ Arg
              { argCName = "parent"
              , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText = Just "parent window" , sinceVersion = Nothing }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "uri"
              , argType = TBasicType TUTF8
              , direction = DirectionIn
              , mayBeNull = False
              , argDoc =
                  Documentation
                    { rawDocText = Just "the uri to show" , sinceVersion = Nothing }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "timestamp"
              , argType = TBasicType TUInt32
              , direction = DirectionIn
              , mayBeNull = False
              , argDoc =
                  Documentation
                    { rawDocText =
                        Just
                          "timestamp from the event that triggered this call, or %GDK_CURRENT_TIME"
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "cancellable"
              , argType =
                  TInterface Name { namespace = "Gio" , name = "Cancellable" }
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText = Just "a #GCancellable to cancel the launch"
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "callback"
              , argType =
                  TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText =
                        Just "a callback to call when the action is complete"
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeAsync
              , argClosure = 5
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "user_data"
              , argType = TBasicType TPtr
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText = Just "data to pass to @callback"
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeInvalid
              , argClosure = 4
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          ]
      , skipReturn = False
      , callableThrows = False
      , callableDeprecated = Nothing
      , callableDocumentation =
          Documentation
            { rawDocText =
                Just
                  "This function launches the default application for showing\na given uri.\n\nThe uri must be of a form understood by GIO (i.e. you need\nto install gvfs to get support for uri schemes such as http://\nor ftp://, as only local files are handled by GIO itself).\nTypical examples are\n- `file:///home/gnome/pict.jpg`\n- `http://www.gnome.org`\n- `mailto:me@gnome.org`\n\nThe @callback will be called when the launch is completed.\nIt should call gtk_show_uri_full_finish() to obtain the result.\n\nThis is the recommended call to be used as it passes information\nnecessary for sandbox helpers to parent their dialogs properly."
            , sinceVersion = Nothing
            }
      , callableResolvable = Just True
      }
    fromList
      [ ( 5
        , Arg
            { argCName = "callback"
            , argType =
                TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
            , direction = DirectionIn
            , mayBeNull = True
            , argDoc =
                Documentation
                  { rawDocText =
                      Just "a callback to call when the action is complete"
                  , sinceVersion = Nothing
                  }
            , argScope = ScopeTypeAsync
            , argClosure = 5
            , argDestroy = -1
            , argCallerAllocates = False
            , transfer = TransferNothing
            }
        )
      ]
    4
-}

-- function show_uri
-- Args: [ Arg
--           { argCName = "parent"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "parent window" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the uri to show" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "timestamp from the event that triggered this call, or %GDK_CURRENT_TIME"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_show_uri" gtk_show_uri :: 
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    CString ->                              -- uri : TBasicType TUTF8
    Word32 ->                               -- timestamp : TBasicType TUInt32
    IO ()

-- | This function launches the default application for showing
-- a given uri, or shows an error dialog if that fails.
-- 
-- The uri must be of a form understood by GIO (i.e. you need
-- to install gvfs to get support for uri schemes such as http:\/\/
-- or ftp:\/\/, as only local files are handled by GIO itself).
-- Typical examples are
-- 
-- * @file:\/\/\/home\/gnome\/pict.jpg@
-- * @http:\/\/www.gnome.org@
-- * @mailto:me\@gnome.org@
showUri ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    Maybe (a)
    -- ^ /@parent@/: parent window
    -> T.Text
    -- ^ /@uri@/: the uri to show
    -> Word32
    -- ^ /@timestamp@/: timestamp from the event that triggered this call, or 'GI.Gdk.Constants.CURRENT_TIME'
    -> m ()
showUri :: Maybe a -> Text -> Word32 -> m ()
showUri Maybe a
parent Text
uri Word32
timestamp = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
maybeParent <- case Maybe a
parent of
        Maybe a
Nothing -> Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
        Just a
jParent -> do
            Ptr Window
jParent' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jParent
            Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
jParent'
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    Ptr Window -> CString -> Word32 -> IO ()
gtk_show_uri Ptr Window
maybeParent CString
uri' Word32
timestamp
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
parent a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_debug_flags
-- Args: [ Arg
--           { argCName = "flags"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_set_debug_flags" gtk_set_debug_flags :: 
    Word32 ->                               -- flags : TBasicType TUInt
    IO ()

-- | Sets the GTK debug flags.
setDebugFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -> m ()
setDebugFlags :: Word32 -> m ()
setDebugFlags Word32
flags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Word32 -> IO ()
gtk_set_debug_flags Word32
flags
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function rgb_to_hsv
-- Args: [ Arg
--           { argCName = "r"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Red" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "g"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Green" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Blue" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "h"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the hue component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "s"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the saturation component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "v"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the value component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rgb_to_hsv" gtk_rgb_to_hsv :: 
    CFloat ->                               -- r : TBasicType TFloat
    CFloat ->                               -- g : TBasicType TFloat
    CFloat ->                               -- b : TBasicType TFloat
    Ptr CFloat ->                           -- h : TBasicType TFloat
    Ptr CFloat ->                           -- s : TBasicType TFloat
    Ptr CFloat ->                           -- v : TBasicType TFloat
    IO ()

-- | Converts a color from RGB space to HSV.
-- 
-- Input values must be in the [0.0, 1.0] range;
-- output values will be in the same range.
rgbToHsv ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Float
    -- ^ /@r@/: Red
    -> Float
    -- ^ /@g@/: Green
    -> Float
    -- ^ /@b@/: Blue
    -> m ((Float, Float, Float))
rgbToHsv :: Float -> Float -> Float -> m (Float, Float, Float)
rgbToHsv Float
r Float
g Float
b = IO (Float, Float, Float) -> m (Float, Float, Float)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float, Float) -> m (Float, Float, Float))
-> IO (Float, Float, Float) -> m (Float, Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    let r' :: CFloat
r' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
r
    let g' :: CFloat
g' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
g
    let b' :: CFloat
b' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
b
    Ptr CFloat
h <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
s <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
v <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    CFloat
-> CFloat
-> CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> IO ()
gtk_rgb_to_hsv CFloat
r' CFloat
g' CFloat
b' Ptr CFloat
h Ptr CFloat
s Ptr CFloat
v
    CFloat
h' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
h
    let h'' :: Float
h'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
h'
    CFloat
s' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
s
    let s'' :: Float
s'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
s'
    CFloat
v' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
v
    let v'' :: Float
v'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
v'
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
h
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
s
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
v
    (Float, Float, Float) -> IO (Float, Float, Float)
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
h'', Float
s'', Float
v'')


-- function render_slider
-- XXX Could not generate function render_slider

-- Bad introspection data: Could not resolve the symbol “gtk_render_slider” in the “Gtk” namespace, ignoring.

-- function render_option
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_option" gtk_render_option :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders an option mark (as in a t'GI.Gtk.Objects.RadioButton.RadioButton'), the 'GI.Gtk.Flags.StateFlagsChecked'
-- state will determine whether the option is on or off, and
-- 'GI.Gtk.Flags.StateFlagsInconsistent' whether it should be marked as undefined.
-- 
-- Typical option mark rendering:
-- 
-- <<https://developer.gnome.org/gtk4/stable/options.png>>
renderOption ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderOption :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderOption a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_option Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_line
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x0"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate for the origin of the line"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y0"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate for the origin of the line"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x1"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X coordinate for the end of the line"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y1"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y coordinate for the end of the line"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_line" gtk_render_line :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x0 : TBasicType TDouble
    CDouble ->                              -- y0 : TBasicType TDouble
    CDouble ->                              -- x1 : TBasicType TDouble
    CDouble ->                              -- y1 : TBasicType TDouble
    IO ()

-- | Renders a line from (x0, y0) to (x1, y1).
renderLine ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x0@/: X coordinate for the origin of the line
    -> Double
    -- ^ /@y0@/: Y coordinate for the origin of the line
    -> Double
    -- ^ /@x1@/: X coordinate for the end of the line
    -> Double
    -- ^ /@y1@/: Y coordinate for the end of the line
    -> m ()
renderLine :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderLine a
context Context
cr Double
x0 Double
y0 Double
x1 Double
y1 = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x0' :: CDouble
x0' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x0
    let y0' :: CDouble
y0' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y0
    let x1' :: CDouble
x1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x1
    let y1' :: CDouble
y1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y1
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_line Ptr StyleContext
context' Ptr Context
cr' CDouble
x0' CDouble
y0' CDouble
x1' CDouble
y1'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_layout
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #PangoLayout to render"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_layout" gtk_render_layout :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    Ptr Pango.Layout.Layout ->              -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    IO ()

-- | Renders /@layout@/ on the coordinates /@x@/, /@y@/
renderLayout ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin
    -> Double
    -- ^ /@y@/: Y origin
    -> b
    -- ^ /@layout@/: the t'GI.Pango.Objects.Layout.Layout' to render
    -> m ()
renderLayout :: a -> Context -> Double -> Double -> b -> m ()
renderLayout a
context Context
cr Double
x Double
y b
layout = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    Ptr Layout
layout' <- b -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
layout
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> Ptr Layout -> IO ()
gtk_render_layout Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' Ptr Layout
layout'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_insertion_cursor
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layout"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Layout" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #PangoLayout of the text"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the index in the #PangoLayout"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "Pango" , name = "Direction" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #PangoDirection of the text"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_insertion_cursor" gtk_render_insertion_cursor :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    Ptr Pango.Layout.Layout ->              -- layout : TInterface (Name {namespace = "Pango", name = "Layout"})
    Int32 ->                                -- index : TBasicType TInt
    CUInt ->                                -- direction : TInterface (Name {namespace = "Pango", name = "Direction"})
    IO ()

-- | Draws a text caret on /@cr@/ at the specified index of /@layout@/.
renderInsertionCursor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin
    -> Double
    -- ^ /@y@/: Y origin
    -> b
    -- ^ /@layout@/: the t'GI.Pango.Objects.Layout.Layout' of the text
    -> Int32
    -- ^ /@index@/: the index in the t'GI.Pango.Objects.Layout.Layout'
    -> Pango.Enums.Direction
    -- ^ /@direction@/: the t'GI.Pango.Enums.Direction' of the text
    -> m ()
renderInsertionCursor :: a -> Context -> Double -> Double -> b -> Int32 -> Direction -> m ()
renderInsertionCursor a
context Context
cr Double
x Double
y b
layout Int32
index Direction
direction = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    Ptr Layout
layout' <- b -> IO (Ptr Layout)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
layout
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (Direction -> Int) -> Direction -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Direction -> Int
forall a. Enum a => a -> Int
fromEnum) Direction
direction
    Ptr StyleContext
-> Ptr Context
-> CDouble
-> CDouble
-> Ptr Layout
-> Int32
-> CUInt
-> IO ()
gtk_render_insertion_cursor Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' Ptr Layout
layout' Int32
index CUInt
direction'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
layout
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_icon
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "texture"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Texture" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkTexture containing the icon to draw"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X position for the @texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y position for the @texture"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_icon" gtk_render_icon :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Gdk.Texture.Texture ->              -- texture : TInterface (Name {namespace = "Gdk", name = "Texture"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    IO ()

-- | Renders the icon in /@texture@/ at the specified /@x@/ and /@y@/ coordinates.
-- 
-- This function will render the icon in /@texture@/ at exactly its size,
-- regardless of scaling factors, which may not be appropriate when
-- drawing on displays with high pixel densities.
renderIcon ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Gdk.Texture.IsTexture b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> b
    -- ^ /@texture@/: a t'GI.Gdk.Objects.Texture.Texture' containing the icon to draw
    -> Double
    -- ^ /@x@/: X position for the /@texture@/
    -> Double
    -- ^ /@y@/: Y position for the /@texture@/
    -> m ()
renderIcon :: a -> Context -> b -> Double -> Double -> m ()
renderIcon a
context Context
cr b
texture Double
x Double
y = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    Ptr Texture
texture' <- b -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
texture
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    Ptr StyleContext
-> Ptr Context -> Ptr Texture -> CDouble -> CDouble -> IO ()
gtk_render_icon Ptr StyleContext
context' Ptr Context
cr' Ptr Texture
texture' CDouble
x' CDouble
y'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
texture
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_handle
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_handle" gtk_render_handle :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders a handle (as in t'GI.Gtk.Objects.Paned.Paned' and
-- t'GI.Gtk.Objects.Window.Window'’s resize grip), in the rectangle
-- determined by /@x@/, /@y@/, /@width@/, /@height@/.
-- 
-- Handles rendered for the paned and grip classes:
-- 
-- <<https://developer.gnome.org/gtk4/stable/handles.png>>
renderHandle ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderHandle :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderHandle a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_handle Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_frame
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_frame" gtk_render_frame :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders a frame around the rectangle defined by /@x@/, /@y@/, /@width@/, /@height@/.
-- 
-- Examples of frame rendering, showing the effect of @border-image@,
-- @border-color@, @border-width@, @border-radius@ and junctions:
-- 
-- <<https://developer.gnome.org/gtk4/stable/frames.png>>
renderFrame ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderFrame :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderFrame a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_frame Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_focus
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_focus" gtk_render_focus :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders a focus indicator on the rectangle determined by /@x@/, /@y@/, /@width@/, /@height@/.
-- 
-- Typical focus rendering:
-- 
-- <<https://developer.gnome.org/gtk4/stable/focus.png>>
renderFocus ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderFocus :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderFocus a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_focus Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_expander
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_expander" gtk_render_expander :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders an expander (as used in t'GI.Gtk.Objects.TreeView.TreeView' and t'GI.Gtk.Objects.Expander.Expander') in the area
-- defined by /@x@/, /@y@/, /@width@/, /@height@/. The state 'GI.Gtk.Flags.StateFlagsChecked'
-- determines whether the expander is collapsed or expanded.
-- 
-- Typical expander rendering:
-- 
-- <<https://developer.gnome.org/gtk4/stable/expanders.png>>
renderExpander ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderExpander :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderExpander a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_expander Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_check
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_check" gtk_render_check :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders a checkmark (as in a t'GI.Gtk.Objects.CheckButton.CheckButton').
-- 
-- The 'GI.Gtk.Flags.StateFlagsChecked' state determines whether the check is
-- on or off, and 'GI.Gtk.Flags.StateFlagsInconsistent' determines whether it
-- should be marked as undefined.
-- 
-- Typical checkmark rendering:
-- 
-- <<https://developer.gnome.org/gtk4/stable/checks.png>>
renderCheck ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderCheck :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderCheck a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_check Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_background
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_background" gtk_render_background :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders the background of an element.
-- 
-- Typical background rendering, showing the effect of
-- @background-image@, @border-width@ and @border-radius@:
-- 
-- <<https://developer.gnome.org/gtk4/stable/background.png>>
renderBackground ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderBackground :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderBackground a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_background Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_arrow
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "angle"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "arrow angle from 0 to 2 * %G_PI, being 0 the arrow pointing to the north"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the render area"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the render area"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "square side for render area"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_arrow" gtk_render_arrow :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- angle : TBasicType TDouble
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- size : TBasicType TDouble
    IO ()

-- | Renders an arrow pointing to /@angle@/.
-- 
-- Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π:
-- 
-- <<https://developer.gnome.org/gtk4/stable/arrows.png>>
renderArrow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@angle@/: arrow angle from 0 to 2 * 'GI.GLib.Constants.PI', being 0 the arrow pointing to the north
    -> Double
    -- ^ /@x@/: X origin of the render area
    -> Double
    -- ^ /@y@/: Y origin of the render area
    -> Double
    -- ^ /@size@/: square side for render area
    -> m ()
renderArrow :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderArrow a
context Context
cr Double
angle Double
x Double
y Double
size = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let angle' :: CDouble
angle' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
angle
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let size' :: CDouble
size' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
size
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_arrow Ptr StyleContext
context' Ptr Context
cr' CDouble
angle' CDouble
x' CDouble
y' CDouble
size'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function render_activity
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "StyleContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkStyleContext" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cr"
--           , argType =
--               TInterface Name { namespace = "cairo" , name = "Context" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #cairo_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y origin of the rectangle"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "width"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle width" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "height"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "rectangle height" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_activity" gtk_render_activity :: 
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    IO ()

-- | Renders an activity indicator (such as in t'GI.Gtk.Objects.Spinner.Spinner').
-- The state 'GI.Gtk.Flags.StateFlagsChecked' determines whether there is
-- activity going on.
renderActivity ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Cairo.Context.Context
    -- ^ /@cr@/: a t'GI.Cairo.Structs.Context.Context'
    -> Double
    -- ^ /@x@/: X origin of the rectangle
    -> Double
    -- ^ /@y@/: Y origin of the rectangle
    -> Double
    -- ^ /@width@/: rectangle width
    -> Double
    -- ^ /@height@/: rectangle height
    -> m ()
renderActivity :: a -> Context -> Double -> Double -> Double -> Double -> m ()
renderActivity a
context Context
cr Double
x Double
y Double
width Double
height = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Context
cr' <- Context -> IO (Ptr Context)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Context
cr
    let x' :: CDouble
x' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
x
    let y' :: CDouble
y' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
y
    let width' :: CDouble
width' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
width
    let height' :: CDouble
height' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
height
    Ptr StyleContext
-> Ptr Context -> CDouble -> CDouble -> CDouble -> CDouble -> IO ()
gtk_render_activity Ptr StyleContext
context' Ptr Context
cr' CDouble
x' CDouble
y' CDouble
width' CDouble
height'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Context -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Context
cr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function print_run_page_setup_dialog_async
-- Args: [ Arg
--           { argCName = "parent"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "transient parent, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "page_setup"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PageSetup" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an existing #GtkPageSetup, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "settings"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PrintSettings" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkPrintSettings"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "done_cb"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PageSetupDoneFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a function to call when the user saves\n          the modified page setup"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data to pass to @done_cb"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_run_page_setup_dialog_async" gtk_print_run_page_setup_dialog_async :: 
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    Ptr Gtk.PageSetup.PageSetup ->          -- page_setup : TInterface (Name {namespace = "Gtk", name = "PageSetup"})
    Ptr Gtk.PrintSettings.PrintSettings ->  -- settings : TInterface (Name {namespace = "Gtk", name = "PrintSettings"})
    FunPtr Gtk.Callbacks.C_PageSetupDoneFunc -> -- done_cb : TInterface (Name {namespace = "Gtk", name = "PageSetupDoneFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    IO ()

-- | Runs a page setup dialog, letting the user modify the values from /@pageSetup@/.
-- 
-- In contrast to 'GI.Gtk.Functions.printRunPageSetupDialog', this function  returns after
-- showing the page setup dialog on platforms that support this, and calls /@doneCb@/
-- from a signal handler for the [response](#g:signal:response) signal of the dialog.
printRunPageSetupDialogAsync ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a, Gtk.PageSetup.IsPageSetup b, Gtk.PrintSettings.IsPrintSettings c) =>
    Maybe (a)
    -- ^ /@parent@/: transient parent, or 'P.Nothing'
    -> Maybe (b)
    -- ^ /@pageSetup@/: an existing t'GI.Gtk.Objects.PageSetup.PageSetup', or 'P.Nothing'
    -> c
    -- ^ /@settings@/: a t'GI.Gtk.Objects.PrintSettings.PrintSettings'
    -> Gtk.Callbacks.PageSetupDoneFunc
    -- ^ /@doneCb@/: a function to call when the user saves
    --           the modified page setup
    -> m ()
printRunPageSetupDialogAsync :: Maybe a -> Maybe b -> c -> PageSetupDoneFunc -> m ()
printRunPageSetupDialogAsync Maybe a
parent Maybe b
pageSetup c
settings PageSetupDoneFunc
doneCb = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
maybeParent <- case Maybe a
parent of
        Maybe a
Nothing -> Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
        Just a
jParent -> do
            Ptr Window
jParent' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jParent
            Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
jParent'
    Ptr PageSetup
maybePageSetup <- case Maybe b
pageSetup of
        Maybe b
Nothing -> Ptr PageSetup -> IO (Ptr PageSetup)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr PageSetup
forall a. Ptr a
nullPtr
        Just b
jPageSetup -> do
            Ptr PageSetup
jPageSetup' <- b -> IO (Ptr PageSetup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jPageSetup
            Ptr PageSetup -> IO (Ptr PageSetup)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr PageSetup
jPageSetup'
    Ptr PrintSettings
settings' <- c -> IO (Ptr PrintSettings)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
settings
    Ptr (FunPtr C_PageSetupDoneFunc)
ptrdoneCb <- IO (Ptr (FunPtr C_PageSetupDoneFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_PageSetupDoneFunc))
    FunPtr C_PageSetupDoneFunc
doneCb' <- C_PageSetupDoneFunc -> IO (FunPtr C_PageSetupDoneFunc)
Gtk.Callbacks.mk_PageSetupDoneFunc (Maybe (Ptr (FunPtr C_PageSetupDoneFunc))
-> PageSetupDoneFunc_WithClosures -> C_PageSetupDoneFunc
Gtk.Callbacks.wrap_PageSetupDoneFunc (Ptr (FunPtr C_PageSetupDoneFunc)
-> Maybe (Ptr (FunPtr C_PageSetupDoneFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_PageSetupDoneFunc)
ptrdoneCb) (PageSetupDoneFunc -> PageSetupDoneFunc_WithClosures
Gtk.Callbacks.drop_closures_PageSetupDoneFunc PageSetupDoneFunc
doneCb))
    Ptr (FunPtr C_PageSetupDoneFunc)
-> FunPtr C_PageSetupDoneFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_PageSetupDoneFunc)
ptrdoneCb FunPtr C_PageSetupDoneFunc
doneCb'
    let data_ :: Ptr a
data_ = Ptr a
forall a. Ptr a
nullPtr
    Ptr Window
-> Ptr PageSetup
-> Ptr PrintSettings
-> FunPtr C_PageSetupDoneFunc
-> Ptr ()
-> IO ()
gtk_print_run_page_setup_dialog_async Ptr Window
maybeParent Ptr PageSetup
maybePageSetup Ptr PrintSettings
settings' FunPtr C_PageSetupDoneFunc
doneCb' Ptr ()
forall a. Ptr a
data_
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
parent a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
pageSetup b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
settings
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function print_run_page_setup_dialog
-- Args: [ Arg
--           { argCName = "parent"
--           , argType = TInterface Name { namespace = "Gtk" , name = "Window" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "transient parent" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "page_setup"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PageSetup" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an existing #GtkPageSetup"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "settings"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "PrintSettings" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkPrintSettings"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gtk" , name = "PageSetup" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_print_run_page_setup_dialog" gtk_print_run_page_setup_dialog :: 
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    Ptr Gtk.PageSetup.PageSetup ->          -- page_setup : TInterface (Name {namespace = "Gtk", name = "PageSetup"})
    Ptr Gtk.PrintSettings.PrintSettings ->  -- settings : TInterface (Name {namespace = "Gtk", name = "PrintSettings"})
    IO (Ptr Gtk.PageSetup.PageSetup)

-- | Runs a page setup dialog, letting the user modify the values from
-- /@pageSetup@/. If the user cancels the dialog, the returned t'GI.Gtk.Objects.PageSetup.PageSetup'
-- is identical to the passed in /@pageSetup@/, otherwise it contains the
-- modifications done in the dialog.
-- 
-- Note that this function may use a recursive mainloop to show the page
-- setup dialog. See 'GI.Gtk.Functions.printRunPageSetupDialogAsync' if this is
-- a problem.
printRunPageSetupDialog ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a, Gtk.PageSetup.IsPageSetup b, Gtk.PrintSettings.IsPrintSettings c) =>
    Maybe (a)
    -- ^ /@parent@/: transient parent
    -> Maybe (b)
    -- ^ /@pageSetup@/: an existing t'GI.Gtk.Objects.PageSetup.PageSetup'
    -> c
    -- ^ /@settings@/: a t'GI.Gtk.Objects.PrintSettings.PrintSettings'
    -> m Gtk.PageSetup.PageSetup
    -- ^ __Returns:__ a new t'GI.Gtk.Objects.PageSetup.PageSetup'
printRunPageSetupDialog :: Maybe a -> Maybe b -> c -> m PageSetup
printRunPageSetupDialog Maybe a
parent Maybe b
pageSetup c
settings = IO PageSetup -> m PageSetup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PageSetup -> m PageSetup) -> IO PageSetup -> m PageSetup
forall a b. (a -> b) -> a -> b
$ do
    Ptr Window
maybeParent <- case Maybe a
parent of
        Maybe a
Nothing -> Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
        Just a
jParent -> do
            Ptr Window
jParent' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jParent
            Ptr Window -> IO (Ptr Window)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
jParent'
    Ptr PageSetup
maybePageSetup <- case Maybe b
pageSetup of
        Maybe b
Nothing -> Ptr PageSetup -> IO (Ptr PageSetup)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr PageSetup
forall a. Ptr a
nullPtr
        Just b
jPageSetup -> do
            Ptr PageSetup
jPageSetup' <- b -> IO (Ptr PageSetup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jPageSetup
            Ptr PageSetup -> IO (Ptr PageSetup)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr PageSetup
jPageSetup'
    Ptr PrintSettings
settings' <- c -> IO (Ptr PrintSettings)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
settings
    Ptr PageSetup
result <- Ptr Window
-> Ptr PageSetup -> Ptr PrintSettings -> IO (Ptr PageSetup)
gtk_print_run_page_setup_dialog Ptr Window
maybeParent Ptr PageSetup
maybePageSetup Ptr PrintSettings
settings'
    Text -> Ptr PageSetup -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"printRunPageSetupDialog" Ptr PageSetup
result
    PageSetup
result' <- ((ManagedPtr PageSetup -> PageSetup)
-> Ptr PageSetup -> IO PageSetup
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PageSetup -> PageSetup
Gtk.PageSetup.PageSetup) Ptr PageSetup
result
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
parent a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
pageSetup b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
settings
    PageSetup -> IO PageSetup
forall (m :: * -> *) a. Monad m => a -> m a
return PageSetup
result'


-- function is_initialized
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_is_initialized" gtk_is_initialized :: 
    IO CInt

-- | Use this function to check if GTK has been initialized with 'GI.Gtk.Functions.init'
-- or 'GI.Gtk.Functions.initCheck'.
isInitialized ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    -- ^ __Returns:__ the initialization status
isInitialized :: m Bool
isInitialized  = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CInt
result <- IO CInt
gtk_is_initialized
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function init_check
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_init_check" gtk_init_check :: 
    IO CInt

-- | This function does the same work as 'GI.Gtk.Functions.init' with only a single
-- change: It does not terminate the program if the windowing system
-- can’t be initialized. Instead it returns 'P.False' on failure.
-- 
-- This way the application can fall back to some other means of
-- communication with the user - for example a curses or command line
-- interface.
initCheck ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    -- ^ __Returns:__ 'P.True' if the windowing system has been successfully
    --     initialized, 'P.False' otherwise
initCheck :: m Bool
initCheck  = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CInt
result <- IO CInt
gtk_init_check
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


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

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

-- | Call this function before using any other GTK functions in your GUI
-- applications.  It will initialize everything needed to operate the
-- toolkit and parses some standard command line options.
-- 
-- If you are using t'GI.Gtk.Objects.Application.Application', you don\'t have to call 'GI.Gtk.Functions.init'
-- or 'GI.Gtk.Functions.initCheck'; the [startup]("GI.Gio.Objects.Application#g:signal:startup") handler
-- does it for you.
-- 
-- This function will terminate your program if it was unable to
-- initialize the windowing system for some reason. If you want
-- your program to fall back to a textual interface you want to
-- call 'GI.Gtk.Functions.initCheck' instead.
-- 
-- GTK calls @signal (SIGPIPE, SIG_IGN)@
-- during initialization, to ignore SIGPIPE signals, since these are
-- almost never wanted in graphical applications. If you do need to
-- handle SIGPIPE for some reason, reset the handler after 'GI.Gtk.Functions.init',
-- but notice that other libraries (e.g. libdbus or gvfs) might do
-- similar things.
init ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ()
init :: m ()
init  = 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 ()
gtk_init
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function im_modules_init
-- XXX Could not generate function im_modules_init

-- Bad introspection data: Could not resolve the symbol “gtk_im_modules_init” in the “Gtk” namespace, ignoring.

-- function hsv_to_rgb
-- Args: [ Arg
--           { argCName = "h"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Hue" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "s"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Saturation" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "v"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Value" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "r"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the red component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "g"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the green component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "b"
--           , argType = TBasicType TFloat
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Return value for the blue component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_hsv_to_rgb" gtk_hsv_to_rgb :: 
    CFloat ->                               -- h : TBasicType TFloat
    CFloat ->                               -- s : TBasicType TFloat
    CFloat ->                               -- v : TBasicType TFloat
    Ptr CFloat ->                           -- r : TBasicType TFloat
    Ptr CFloat ->                           -- g : TBasicType TFloat
    Ptr CFloat ->                           -- b : TBasicType TFloat
    IO ()

-- | Converts a color from HSV space to RGB.
-- 
-- Input values must be in the [0.0, 1.0] range;
-- output values will be in the same range.
hsvToRgb ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Float
    -- ^ /@h@/: Hue
    -> Float
    -- ^ /@s@/: Saturation
    -> Float
    -- ^ /@v@/: Value
    -> m ((Float, Float, Float))
hsvToRgb :: Float -> Float -> Float -> m (Float, Float, Float)
hsvToRgb Float
h Float
s Float
v = IO (Float, Float, Float) -> m (Float, Float, Float)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Float, Float) -> m (Float, Float, Float))
-> IO (Float, Float, Float) -> m (Float, Float, Float)
forall a b. (a -> b) -> a -> b
$ do
    let h' :: CFloat
h' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
h
    let s' :: CFloat
s' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
s
    let v' :: CFloat
v' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
v
    Ptr CFloat
r <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
g <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    Ptr CFloat
b <- IO (Ptr CFloat)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CFloat)
    CFloat
-> CFloat
-> CFloat
-> Ptr CFloat
-> Ptr CFloat
-> Ptr CFloat
-> IO ()
gtk_hsv_to_rgb CFloat
h' CFloat
s' CFloat
v' Ptr CFloat
r Ptr CFloat
g Ptr CFloat
b
    CFloat
r' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
r
    let r'' :: Float
r'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
r'
    CFloat
g' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
g
    let g'' :: Float
g'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
g'
    CFloat
b' <- Ptr CFloat -> IO CFloat
forall a. Storable a => Ptr a -> IO a
peek Ptr CFloat
b
    let b'' :: Float
b'' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
b'
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
r
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
g
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
b
    (Float, Float, Float) -> IO (Float, Float, Float)
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
r'', Float
g'', Float
b'')


-- function get_minor_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_minor_version" gtk_get_minor_version :: 
    IO Word32

-- | Returns the minor version number of the GTK library.
-- (e.g. in GTK version 3.1.5 this is 1.)
-- 
-- This function is in the library, so it represents the GTK library
-- your code is are running against. Contrast with the
-- 'GI.Gtk.Constants.MINOR_VERSION' macro, which represents the minor version of the
-- GTK headers you have included when compiling your code.
getMinorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the minor version number of the GTK library
getMinorVersion :: m Word32
getMinorVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_minor_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_micro_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_micro_version" gtk_get_micro_version :: 
    IO Word32

-- | Returns the micro version number of the GTK library.
-- (e.g. in GTK version 3.1.5 this is 5.)
-- 
-- This function is in the library, so it represents the GTK library
-- your code is are running against. Contrast with the
-- 'GI.Gtk.Constants.MICRO_VERSION' macro, which represents the micro version of the
-- GTK headers you have included when compiling your code.
getMicroVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the micro version number of the GTK library
getMicroVersion :: m Word32
getMicroVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_micro_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_major_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_major_version" gtk_get_major_version :: 
    IO Word32

-- | Returns the major version number of the GTK library.
-- (e.g. in GTK version 3.1.5 this is 3.)
-- 
-- This function is in the library, so it represents the GTK library
-- your code is running against. Contrast with the 'GI.Gtk.Constants.MAJOR_VERSION'
-- macro, which represents the major version of the GTK headers you
-- have included when compiling your code.
getMajorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the major version number of the GTK library
getMajorVersion :: m Word32
getMajorVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_major_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_locale_direction
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gtk" , name = "TextDirection" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_locale_direction" gtk_get_locale_direction :: 
    IO CUInt

-- | Get the direction of the current locale. This is the expected
-- reading direction for text and UI.
-- 
-- This function depends on the current locale being set with
-- @/setlocale()/@ and will default to setting the 'GI.Gtk.Enums.TextDirectionLtr'
-- direction otherwise. 'GI.Gtk.Enums.TextDirectionNone' will never be returned.
-- 
-- GTK sets the default text direction according to the locale
-- during 'GI.Gtk.Functions.init', and you should normally use
-- 'GI.Gtk.Objects.Widget.widgetGetDirection' or 'GI.Gtk.Objects.Widget.widgetGetDefaultDirection'
-- to obtain the current direcion.
-- 
-- This function is only needed rare cases when the locale is
-- changed after GTK has already been initialized. In this case,
-- you can use it to update the default text direction as follows:
-- 
-- 
-- === /C code/
-- >
-- >setlocale (LC_ALL, new_locale);
-- >direction = gtk_get_locale_direction ();
-- >gtk_widget_set_default_direction (direction);
getLocaleDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Gtk.Enums.TextDirection
    -- ^ __Returns:__ the t'GI.Gtk.Enums.TextDirection' of the current locale
getLocaleDirection :: m TextDirection
getLocaleDirection  = IO TextDirection -> m TextDirection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TextDirection -> m TextDirection)
-> IO TextDirection -> m TextDirection
forall a b. (a -> b) -> a -> b
$ do
    CUInt
result <- IO CUInt
gtk_get_locale_direction
    let result' :: TextDirection
result' = (Int -> TextDirection
forall a. Enum a => Int -> a
toEnum (Int -> TextDirection) -> (CUInt -> Int) -> CUInt -> TextDirection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    TextDirection -> IO TextDirection
forall (m :: * -> *) a. Monad m => a -> m a
return TextDirection
result'


-- function get_interface_age
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_interface_age" gtk_get_interface_age :: 
    IO Word32

-- | Returns the interface age as passed to @libtool@
-- when building the GTK library the process is running against.
-- If @libtool@ means nothing to you, don\'t
-- worry about it.
getInterfaceAge ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the interface age of the GTK library
getInterfaceAge :: m Word32
getInterfaceAge  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_interface_age
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_default_language
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Pango" , name = "Language" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_default_language" gtk_get_default_language :: 
    IO (Ptr Pango.Language.Language)

-- | Returns the t'GI.Pango.Structs.Language.Language' for the default language currently in
-- effect. (Note that this can change over the life of an
-- application.) The default language is derived from the current
-- locale. It determines, for example, whether GTK uses the
-- right-to-left or left-to-right text direction.
-- 
-- This function is equivalent to 'GI.Pango.Functions.languageGetDefault'.
-- See that function for details.
getDefaultLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Pango.Language.Language
    -- ^ __Returns:__ the default language as a t'GI.Pango.Structs.Language.Language',
    --     must not be freed
getDefaultLanguage :: m Language
getDefaultLanguage  = IO Language -> m Language
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Language -> m Language) -> IO Language -> m Language
forall a b. (a -> b) -> a -> b
$ do
    Ptr Language
result <- IO (Ptr Language)
gtk_get_default_language
    Text -> Ptr Language -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"getDefaultLanguage" Ptr Language
result
    Language
result' <- ((ManagedPtr Language -> Language) -> Ptr Language -> IO Language
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Language -> Language
Pango.Language.Language) Ptr Language
result
    Language -> IO Language
forall (m :: * -> *) a. Monad m => a -> m a
return Language
result'


-- function get_debug_flags
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_debug_flags" gtk_get_debug_flags :: 
    IO Word32

-- | Returns the GTK debug flags.
-- 
-- This function is intended for GTK modules that want
-- to adjust their debug output based on GTK debug flags.
getDebugFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the GTK debug flags.
getDebugFlags :: m Word32
getDebugFlags  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_debug_flags
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_binary_age
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_get_binary_age" gtk_get_binary_age :: 
    IO Word32

-- | Returns the binary age as passed to @libtool@
-- when building the GTK library the process is running against.
-- If @libtool@ means nothing to you, don\'t
-- worry about it.
getBinaryAge ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the binary age of the GTK library
getBinaryAge :: m Word32
getBinaryAge  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_get_binary_age
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function distribute_natural_allocation
-- Args: [ Arg
--           { argCName = "extra_space"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Extra space to redistribute among children after subtracting\n              minimum sizes and any child padding from the overall allocation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_requested_sizes"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of requests to fit into the allocation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "sizes"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "RequestedSize" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "An array of structs with a client pointer and a minimum/natural size\n        in the orientation of the allocation."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_distribute_natural_allocation" gtk_distribute_natural_allocation :: 
    Int32 ->                                -- extra_space : TBasicType TInt
    Word32 ->                               -- n_requested_sizes : TBasicType TUInt
    Ptr Gtk.RequestedSize.RequestedSize ->  -- sizes : TInterface (Name {namespace = "Gtk", name = "RequestedSize"})
    IO Int32

-- | Distributes /@extraSpace@/ to child /@sizes@/ by bringing smaller
-- children up to natural size first.
-- 
-- The remaining space will be added to the /@minimumSize@/ member of the
-- GtkRequestedSize struct. If all sizes reach their natural size then
-- the remaining space is returned.
distributeNaturalAllocation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Int32
    -- ^ /@extraSpace@/: Extra space to redistribute among children after subtracting
    --               minimum sizes and any child padding from the overall allocation
    -> Word32
    -- ^ /@nRequestedSizes@/: Number of requests to fit into the allocation
    -> Gtk.RequestedSize.RequestedSize
    -- ^ /@sizes@/: An array of structs with a client pointer and a minimum\/natural size
    --         in the orientation of the allocation.
    -> m Int32
    -- ^ __Returns:__ The remainder of /@extraSpace@/ after redistributing space
    -- to /@sizes@/.
distributeNaturalAllocation :: Int32 -> Word32 -> RequestedSize -> m Int32
distributeNaturalAllocation Int32
extraSpace Word32
nRequestedSizes RequestedSize
sizes = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr RequestedSize
sizes' <- RequestedSize -> IO (Ptr RequestedSize)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RequestedSize
sizes
    Int32
result <- Int32 -> Word32 -> Ptr RequestedSize -> IO Int32
gtk_distribute_natural_allocation Int32
extraSpace Word32
nRequestedSizes Ptr RequestedSize
sizes'
    RequestedSize -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RequestedSize
sizes
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


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

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

-- | Prevents 'GI.Gtk.Functions.init', 'GI.Gtk.Functions.initCheck' and
-- @/gtk_parse_args()/@ from automatically
-- calling @setlocale (LC_ALL, \"\")@. You would
-- want to use this function if you wanted to set the locale for
-- your program to something other than the user’s locale, or if
-- you wanted to set different values for different locale categories.
-- 
-- Most programs should not need to call this function.
disableSetlocale ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ()
disableSetlocale :: m ()
disableSetlocale  = 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 ()
gtk_disable_setlocale
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function css_parser_warning_quark
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_css_parser_warning_quark" gtk_css_parser_warning_quark :: 
    IO Word32

-- | /No description available in the introspection data./
cssParserWarningQuark ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
cssParserWarningQuark :: m Word32
cssParserWarningQuark  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_css_parser_warning_quark
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function css_parser_error_quark
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_css_parser_error_quark" gtk_css_parser_error_quark :: 
    IO Word32

-- | /No description available in the introspection data./
cssParserErrorQuark ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
cssParserErrorQuark :: m Word32
cssParserErrorQuark  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
gtk_css_parser_error_quark
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function check_version
-- Args: [ Arg
--           { argCName = "required_major"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the required major version"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "required_minor"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the required minor version"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "required_micro"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the required micro version"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_check_version" gtk_check_version :: 
    Word32 ->                               -- required_major : TBasicType TUInt
    Word32 ->                               -- required_minor : TBasicType TUInt
    Word32 ->                               -- required_micro : TBasicType TUInt
    IO CString

-- | Checks that the GTK library in use is compatible with the
-- given version. Generally you would pass in the constants
-- 'GI.Gtk.Constants.MAJOR_VERSION', 'GI.Gtk.Constants.MINOR_VERSION', 'GI.Gtk.Constants.MICRO_VERSION'
-- as the three arguments to this function; that produces
-- a check that the library in use is compatible with
-- the version of GTK the application or module was compiled
-- against.
-- 
-- Compatibility is defined by two things: first the version
-- of the running library is newer than the version
-- /@requiredMajor@/.required_minor./@requiredMicro@/. Second
-- the running library must be binary compatible with the
-- version /@requiredMajor@/.required_minor./@requiredMicro@/
-- (same major version.)
-- 
-- This function is primarily for GTK modules; the module
-- can call this function to check that it wasn’t loaded
-- into an incompatible version of GTK. However, such a
-- check isn’t completely reliable, since the module may be
-- linked against an old version of GTK and calling the
-- old version of 'GI.Gtk.Functions.checkVersion', but still get loaded
-- into an application using a newer version of GTK.
checkVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@requiredMajor@/: the required major version
    -> Word32
    -- ^ /@requiredMinor@/: the required minor version
    -> Word32
    -- ^ /@requiredMicro@/: the required micro version
    -> m (Maybe T.Text)
    -- ^ __Returns:__ 'P.Nothing' if the GTK library is compatible with the
    --   given version, or a string describing the version mismatch.
    --   The returned string is owned by GTK and should not be modified
    --   or freed.
checkVersion :: Word32 -> Word32 -> Word32 -> m (Maybe Text)
checkVersion Word32
requiredMajor Word32
requiredMinor Word32
requiredMicro = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    CString
result <- Word32 -> Word32 -> Word32 -> IO CString
gtk_check_version Word32
requiredMajor Word32
requiredMinor Word32
requiredMicro
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult


-- function accelerator_valid
-- Args: [ Arg
--           { argCName = "keyval"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a GDK keyval" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "modifiers"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "modifier mask" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_valid" gtk_accelerator_valid :: 
    Word32 ->                               -- keyval : TBasicType TUInt
    CUInt ->                                -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

-- | Determines whether a given keyval and modifier mask constitute
-- a valid keyboard accelerator. For example, the 'GI.Gdk.Constants.KEY_a' keyval
-- plus @/GDK_CONTROL_MASK/@ is valid - this is a “Ctrl+a” accelerator.
-- But, you can\'t, for instance, use the 'GI.Gdk.Constants.KEY_Control_L' keyval
-- as an accelerator.
acceleratorValid ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@keyval@/: a GDK keyval
    -> [Gdk.Flags.ModifierType]
    -- ^ /@modifiers@/: modifier mask
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the accelerator is valid
acceleratorValid :: Word32 -> [ModifierType] -> m Bool
acceleratorValid Word32
keyval [ModifierType]
modifiers = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    let modifiers' :: CUInt
modifiers' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
modifiers
    CInt
result <- Word32 -> CUInt -> IO CInt
gtk_accelerator_valid Word32
keyval CUInt
modifiers'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function accelerator_parse_with_keycode
-- Args: [ Arg
--           { argCName = "accelerator"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "string representing an accelerator"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #GdkDisplay to look up @accelerator_codes in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for accelerator\n    keyval, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "accelerator_codes"
--           , argType = TCArray True (-1) (-1) (TBasicType TUInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "\n    return location for accelerator keycodes, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for accelerator\n    modifier mask, %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_parse_with_keycode" gtk_accelerator_parse_with_keycode :: 
    CString ->                              -- accelerator : TBasicType TUTF8
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Ptr Word32 ->                           -- accelerator_key : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- accelerator_codes : TCArray True (-1) (-1) (TBasicType TUInt)
    Ptr CUInt ->                            -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

-- | Parses a string representing an accelerator, similarly to
-- 'GI.Gtk.Functions.acceleratorParse' but handles keycodes as well. This is only
-- useful for system-level components, applications should use
-- 'GI.Gtk.Functions.acceleratorParse' instead.
-- 
-- If /@acceleratorCodes@/ is given and the result stored in it is non-'P.Nothing',
-- the result must be freed with 'GI.GLib.Functions.free'.
-- 
-- If a keycode is present in the accelerator and no /@acceleratorCodes@/
-- is given, the parse will fail.
-- 
-- If the parse fails, /@acceleratorKey@/, /@acceleratorMods@/ and
-- /@acceleratorCodes@/ will be set to 0 (zero).
acceleratorParseWithKeycode ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    T.Text
    -- ^ /@accelerator@/: string representing an accelerator
    -> Maybe (a)
    -- ^ /@display@/: the t'GI.Gdk.Objects.Display.Display' to look up /@acceleratorCodes@/ in
    -> m ((Bool, Word32, [Word32], [Gdk.Flags.ModifierType]))
    -- ^ __Returns:__ 'P.True' if parsing succeeded
acceleratorParseWithKeycode :: Text -> Maybe a -> m (Bool, Word32, [Word32], [ModifierType])
acceleratorParseWithKeycode Text
accelerator Maybe a
display = IO (Bool, Word32, [Word32], [ModifierType])
-> m (Bool, Word32, [Word32], [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, [Word32], [ModifierType])
 -> m (Bool, Word32, [Word32], [ModifierType]))
-> IO (Bool, Word32, [Word32], [ModifierType])
-> m (Bool, Word32, [Word32], [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
    CString
accelerator' <- Text -> IO CString
textToCString Text
accelerator
    Ptr Display
maybeDisplay <- case Maybe a
display of
        Maybe a
Nothing -> Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
forall a. Ptr a
nullPtr
        Just a
jDisplay -> do
            Ptr Display
jDisplay' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jDisplay
            Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
jDisplay'
    Ptr Word32
acceleratorKey <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
acceleratorCodes <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Ptr CUInt
acceleratorMods <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    CInt
result <- CString
-> Ptr Display
-> Ptr Word32
-> Ptr (Ptr Word32)
-> Ptr CUInt
-> IO CInt
gtk_accelerator_parse_with_keycode CString
accelerator' Ptr Display
maybeDisplay Ptr Word32
acceleratorKey Ptr (Ptr Word32)
acceleratorCodes Ptr CUInt
acceleratorMods
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word32
acceleratorKey' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
acceleratorKey
    Ptr Word32
acceleratorCodes' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
acceleratorCodes
    [Word32]
acceleratorCodes'' <- Ptr Word32 -> IO [Word32]
forall a. (Eq a, Num a, Storable a) => Ptr a -> IO [a]
unpackZeroTerminatedStorableArray Ptr Word32
acceleratorCodes'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
acceleratorCodes'
    CUInt
acceleratorMods' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
acceleratorMods
    let acceleratorMods'' :: [ModifierType]
acceleratorMods'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
acceleratorMods'
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
display a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelerator'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
acceleratorKey
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
acceleratorCodes
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
acceleratorMods
    (Bool, Word32, [Word32], [ModifierType])
-> IO (Bool, Word32, [Word32], [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
acceleratorKey', [Word32]
acceleratorCodes'', [ModifierType]
acceleratorMods'')


-- function accelerator_parse
-- Args: [ Arg
--           { argCName = "accelerator"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "string representing an accelerator"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for accelerator\n    keyval, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "return location for accelerator\n    modifier mask, %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_parse" gtk_accelerator_parse :: 
    CString ->                              -- accelerator : TBasicType TUTF8
    Ptr Word32 ->                           -- accelerator_key : TBasicType TUInt
    Ptr CUInt ->                            -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

-- | Parses a string representing an accelerator. The format looks like
-- “\<Control>a” or “\<Shift>\<Alt>F1”.
-- 
-- The parser is fairly liberal and allows lower or upper case, and also
-- abbreviations such as “\<Ctl>” and “\<Ctrl>”. Key names are parsed using
-- 'GI.Gdk.Functions.keyvalFromName'. For character keys the name is not the symbol,
-- but the lowercase name, e.g. one would use “\<Ctrl>minus” instead of
-- “\<Ctrl>-”.
-- 
-- If the parse fails, /@acceleratorKey@/ and /@acceleratorMods@/ will
-- be set to 0 (zero).
acceleratorParse ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@accelerator@/: string representing an accelerator
    -> m ((Bool, Word32, [Gdk.Flags.ModifierType]))
acceleratorParse :: Text -> m (Bool, Word32, [ModifierType])
acceleratorParse Text
accelerator = IO (Bool, Word32, [ModifierType])
-> m (Bool, Word32, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, [ModifierType])
 -> m (Bool, Word32, [ModifierType]))
-> IO (Bool, Word32, [ModifierType])
-> m (Bool, Word32, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
    CString
accelerator' <- Text -> IO CString
textToCString Text
accelerator
    Ptr Word32
acceleratorKey <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CUInt
acceleratorMods <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
    CInt
result <- CString -> Ptr Word32 -> Ptr CUInt -> IO CInt
gtk_accelerator_parse CString
accelerator' Ptr Word32
acceleratorKey Ptr CUInt
acceleratorMods
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word32
acceleratorKey' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
acceleratorKey
    CUInt
acceleratorMods' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
acceleratorMods
    let acceleratorMods'' :: [ModifierType]
acceleratorMods'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
acceleratorMods'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
accelerator'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
acceleratorKey
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
acceleratorMods
    (Bool, Word32, [ModifierType]) -> IO (Bool, Word32, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
acceleratorKey', [ModifierType]
acceleratorMods'')


-- function accelerator_name_with_keycode
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GdkDisplay or %NULL to use the default display"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keyval" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keycode"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keycode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator modifier mask"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_name_with_keycode" gtk_accelerator_name_with_keycode :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Word32 ->                               -- accelerator_key : TBasicType TUInt
    Word32 ->                               -- keycode : TBasicType TUInt
    CUInt ->                                -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CString

-- | Converts an accelerator keyval and modifier mask
-- into a string parseable by 'GI.Gtk.Functions.acceleratorParseWithKeycode',
-- similarly to 'GI.Gtk.Functions.acceleratorName' but handling keycodes.
-- This is only useful for system-level components, applications
-- should use 'GI.Gtk.Functions.acceleratorParse' instead.
acceleratorNameWithKeycode ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    Maybe (a)
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display' or 'P.Nothing' to use the default display
    -> Word32
    -- ^ /@acceleratorKey@/: accelerator keyval
    -> Word32
    -- ^ /@keycode@/: accelerator keycode
    -> [Gdk.Flags.ModifierType]
    -- ^ /@acceleratorMods@/: accelerator modifier mask
    -> m T.Text
    -- ^ __Returns:__ a newly allocated accelerator name.
acceleratorNameWithKeycode :: Maybe a -> Word32 -> Word32 -> [ModifierType] -> m Text
acceleratorNameWithKeycode Maybe a
display Word32
acceleratorKey Word32
keycode [ModifierType]
acceleratorMods = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
maybeDisplay <- case Maybe a
display of
        Maybe a
Nothing -> Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
forall a. Ptr a
nullPtr
        Just a
jDisplay -> do
            Ptr Display
jDisplay' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jDisplay
            Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
jDisplay'
    let acceleratorMods' :: CUInt
acceleratorMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
acceleratorMods
    CString
result <- Ptr Display -> Word32 -> Word32 -> CUInt -> IO CString
gtk_accelerator_name_with_keycode Ptr Display
maybeDisplay Word32
acceleratorKey Word32
keycode CUInt
acceleratorMods'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"acceleratorNameWithKeycode" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
display a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function accelerator_name
-- Args: [ Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keyval" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator modifier mask"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_name" gtk_accelerator_name :: 
    Word32 ->                               -- accelerator_key : TBasicType TUInt
    CUInt ->                                -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CString

-- | Converts an accelerator keyval and modifier mask into a string
-- parseable by 'GI.Gtk.Functions.acceleratorParse'. For example, if you pass in
-- 'GI.Gdk.Constants.KEY_q' and @/GDK_CONTROL_MASK/@, this function returns “\<Control>q”.
-- 
-- If you need to display accelerators in the user interface,
-- see 'GI.Gtk.Functions.acceleratorGetLabel'.
acceleratorName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@acceleratorKey@/: accelerator keyval
    -> [Gdk.Flags.ModifierType]
    -- ^ /@acceleratorMods@/: accelerator modifier mask
    -> m T.Text
    -- ^ __Returns:__ a newly-allocated accelerator name
acceleratorName :: Word32 -> [ModifierType] -> m Text
acceleratorName Word32
acceleratorKey [ModifierType]
acceleratorMods = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let acceleratorMods' :: CUInt
acceleratorMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
acceleratorMods
    CString
result <- Word32 -> CUInt -> IO CString
gtk_accelerator_name Word32
acceleratorKey CUInt
acceleratorMods'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"acceleratorName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function accelerator_get_label_with_keycode
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GdkDisplay or %NULL to use the default display"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keyval" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keycode"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keycode"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator modifier mask"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_get_label_with_keycode" gtk_accelerator_get_label_with_keycode :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Word32 ->                               -- accelerator_key : TBasicType TUInt
    Word32 ->                               -- keycode : TBasicType TUInt
    CUInt ->                                -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CString

-- | Converts an accelerator keyval and modifier mask
-- into a (possibly translated) string that can be displayed to
-- a user, similarly to 'GI.Gtk.Functions.acceleratorGetLabel', but handling
-- keycodes.
-- 
-- This is only useful for system-level components, applications
-- should use 'GI.Gtk.Functions.acceleratorParse' instead.
acceleratorGetLabelWithKeycode ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    Maybe (a)
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display' or 'P.Nothing' to use the default display
    -> Word32
    -- ^ /@acceleratorKey@/: accelerator keyval
    -> Word32
    -- ^ /@keycode@/: accelerator keycode
    -> [Gdk.Flags.ModifierType]
    -- ^ /@acceleratorMods@/: accelerator modifier mask
    -> m T.Text
    -- ^ __Returns:__ a newly-allocated string representing the accelerator.
acceleratorGetLabelWithKeycode :: Maybe a -> Word32 -> Word32 -> [ModifierType] -> m Text
acceleratorGetLabelWithKeycode Maybe a
display Word32
acceleratorKey Word32
keycode [ModifierType]
acceleratorMods = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
maybeDisplay <- case Maybe a
display of
        Maybe a
Nothing -> Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
forall a. Ptr a
nullPtr
        Just a
jDisplay -> do
            Ptr Display
jDisplay' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jDisplay
            Ptr Display -> IO (Ptr Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Display
jDisplay'
    let acceleratorMods' :: CUInt
acceleratorMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
acceleratorMods
    CString
result <- Ptr Display -> Word32 -> Word32 -> CUInt -> IO CString
gtk_accelerator_get_label_with_keycode Ptr Display
maybeDisplay Word32
acceleratorKey Word32
keycode CUInt
acceleratorMods'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"acceleratorGetLabelWithKeycode" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
display a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function accelerator_get_label
-- Args: [ Arg
--           { argCName = "accelerator_key"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator keyval" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "accelerator_mods"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "ModifierType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "accelerator modifier mask"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_get_label" gtk_accelerator_get_label :: 
    Word32 ->                               -- accelerator_key : TBasicType TUInt
    CUInt ->                                -- accelerator_mods : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CString

-- | Converts an accelerator keyval and modifier mask into a string
-- which can be used to represent the accelerator to the user.
acceleratorGetLabel ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@acceleratorKey@/: accelerator keyval
    -> [Gdk.Flags.ModifierType]
    -- ^ /@acceleratorMods@/: accelerator modifier mask
    -> m T.Text
    -- ^ __Returns:__ a newly-allocated string representing the accelerator.
acceleratorGetLabel :: Word32 -> [ModifierType] -> m Text
acceleratorGetLabel Word32
acceleratorKey [ModifierType]
acceleratorMods = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let acceleratorMods' :: CUInt
acceleratorMods' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
acceleratorMods
    CString
result <- Word32 -> CUInt -> IO CString
gtk_accelerator_get_label Word32
acceleratorKey CUInt
acceleratorMods'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"acceleratorGetLabel" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function accelerator_get_default_mod_mask
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gdk" , name = "ModifierType" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_accelerator_get_default_mod_mask" gtk_accelerator_get_default_mod_mask :: 
    IO CUInt

-- | Gets the modifier mask.
-- 
-- The modifier mask determines which modifiers are considered significant
-- for keyboard accelerators. This includes all keyboard modifiers except
-- for 'GI.Gdk.Flags.ModifierTypeLockMask'.
acceleratorGetDefaultModMask ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Gdk.Flags.ModifierType]
    -- ^ __Returns:__ the modifier mask for accelerators
acceleratorGetDefaultModMask :: m [ModifierType]
acceleratorGetDefaultModMask  = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
    CUInt
result <- IO CUInt
gtk_accelerator_get_default_mod_mask
    let result' :: [ModifierType]
result' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    [ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
result'