{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

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

module GI.Gtk.Functions
    (

 -- * Methods
-- ** accelGroupsActivate #method:accelGroupsActivate#

    accelGroupsActivate                     ,


-- ** accelGroupsFromObject #method:accelGroupsFromObject#

    accelGroupsFromObject                   ,


-- ** 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             ,


-- ** acceleratorSetDefaultModMask #method:acceleratorSetDefaultModMask#

    acceleratorSetDefaultModMask            ,


-- ** acceleratorValid #method:acceleratorValid#

    acceleratorValid                        ,


-- ** alternativeDialogButtonOrder #method:alternativeDialogButtonOrder#

    alternativeDialogButtonOrder            ,


-- ** bindingsActivate #method:bindingsActivate#

    bindingsActivate                        ,


-- ** bindingsActivateEvent #method:bindingsActivateEvent#

    bindingsActivateEvent                   ,


-- ** cairoShouldDrawWindow #method:cairoShouldDrawWindow#

    cairoShouldDrawWindow                   ,


-- ** cairoTransformToWindow #method:cairoTransformToWindow#

    cairoTransformToWindow                  ,


-- ** checkVersion #method:checkVersion#

    checkVersion                            ,


-- ** deviceGrabAdd #method:deviceGrabAdd#

    deviceGrabAdd                           ,


-- ** deviceGrabRemove #method:deviceGrabRemove#

    deviceGrabRemove                        ,


-- ** disableSetlocale #method:disableSetlocale#

    disableSetlocale                        ,


-- ** distributeNaturalAllocation #method:distributeNaturalAllocation#

    distributeNaturalAllocation             ,


-- ** dragCancel #method:dragCancel#

    dragCancel                              ,


-- ** dragFinish #method:dragFinish#

    dragFinish                              ,


-- ** dragGetSourceWidget #method:dragGetSourceWidget#

    dragGetSourceWidget                     ,


-- ** dragSetIconDefault #method:dragSetIconDefault#

    dragSetIconDefault                      ,


-- ** dragSetIconGicon #method:dragSetIconGicon#

    dragSetIconGicon                        ,


-- ** dragSetIconName #method:dragSetIconName#

    dragSetIconName                         ,


-- ** dragSetIconPixbuf #method:dragSetIconPixbuf#

    dragSetIconPixbuf                       ,


-- ** dragSetIconStock #method:dragSetIconStock#

    dragSetIconStock                        ,


-- ** dragSetIconSurface #method:dragSetIconSurface#

    dragSetIconSurface                      ,


-- ** dragSetIconWidget #method:dragSetIconWidget#

    dragSetIconWidget                       ,


-- ** drawInsertionCursor #method:drawInsertionCursor#

    drawInsertionCursor                     ,


-- ** eventsPending #method:eventsPending#

    eventsPending                           ,


-- ** false #method:false#

    false                                   ,


-- ** getBinaryAge #method:getBinaryAge#

    getBinaryAge                            ,


-- ** getCurrentEvent #method:getCurrentEvent#

    getCurrentEvent                         ,


-- ** getCurrentEventDevice #method:getCurrentEventDevice#

    getCurrentEventDevice                   ,


-- ** getCurrentEventState #method:getCurrentEventState#

    getCurrentEventState                    ,


-- ** getCurrentEventTime #method:getCurrentEventTime#

    getCurrentEventTime                     ,


-- ** getDebugFlags #method:getDebugFlags#

    getDebugFlags                           ,


-- ** getDefaultLanguage #method:getDefaultLanguage#

    getDefaultLanguage                      ,


-- ** getEventWidget #method:getEventWidget#

    getEventWidget                          ,


-- ** getInterfaceAge #method:getInterfaceAge#

    getInterfaceAge                         ,


-- ** getLocaleDirection #method:getLocaleDirection#

    getLocaleDirection                      ,


-- ** getMajorVersion #method:getMajorVersion#

    getMajorVersion                         ,


-- ** getMicroVersion #method:getMicroVersion#

    getMicroVersion                         ,


-- ** getMinorVersion #method:getMinorVersion#

    getMinorVersion                         ,


-- ** getOptionGroup #method:getOptionGroup#

    getOptionGroup                          ,


-- ** grabGetCurrent #method:grabGetCurrent#

    grabGetCurrent                          ,


-- ** init #method:init#

    init                                    ,


-- ** initCheck #method:initCheck#

    initCheck                               ,


-- ** initWithArgs #method:initWithArgs#

    initWithArgs                            ,


-- ** keySnooperRemove #method:keySnooperRemove#

    keySnooperRemove                        ,


-- ** main #method:main#

    main                                    ,


-- ** mainDoEvent #method:mainDoEvent#

    mainDoEvent                             ,


-- ** mainIteration #method:mainIteration#

    mainIteration                           ,


-- ** mainIterationDo #method:mainIterationDo#

    mainIterationDo                         ,


-- ** mainLevel #method:mainLevel#

    mainLevel                               ,


-- ** mainQuit #method:mainQuit#

    mainQuit                                ,


-- ** paintArrow #method:paintArrow#

    paintArrow                              ,


-- ** paintBox #method:paintBox#

    paintBox                                ,


-- ** paintBoxGap #method:paintBoxGap#

    paintBoxGap                             ,


-- ** paintCheck #method:paintCheck#

    paintCheck                              ,


-- ** paintDiamond #method:paintDiamond#

    paintDiamond                            ,


-- ** paintExpander #method:paintExpander#

    paintExpander                           ,


-- ** paintExtension #method:paintExtension#

    paintExtension                          ,


-- ** paintFlatBox #method:paintFlatBox#

    paintFlatBox                            ,


-- ** paintFocus #method:paintFocus#

    paintFocus                              ,


-- ** paintHandle #method:paintHandle#

    paintHandle                             ,


-- ** paintHline #method:paintHline#

    paintHline                              ,


-- ** paintLayout #method:paintLayout#

    paintLayout                             ,


-- ** paintOption #method:paintOption#

    paintOption                             ,


-- ** paintResizeGrip #method:paintResizeGrip#

    paintResizeGrip                         ,


-- ** paintShadow #method:paintShadow#

    paintShadow                             ,


-- ** paintShadowGap #method:paintShadowGap#

    paintShadowGap                          ,


-- ** paintSlider #method:paintSlider#

    paintSlider                             ,


-- ** paintSpinner #method:paintSpinner#

    paintSpinner                            ,


-- ** paintTab #method:paintTab#

    paintTab                                ,


-- ** paintVline #method:paintVline#

    paintVline                              ,


-- ** parseArgs #method:parseArgs#

    parseArgs                               ,


-- ** printRunPageSetupDialog #method:printRunPageSetupDialog#

    printRunPageSetupDialog                 ,


-- ** printRunPageSetupDialogAsync #method:printRunPageSetupDialogAsync#

    printRunPageSetupDialogAsync            ,


-- ** propagateEvent #method:propagateEvent#

    propagateEvent                          ,


-- ** rcAddDefaultFile #method:rcAddDefaultFile#

    rcAddDefaultFile                        ,


-- ** rcFindModuleInPath #method:rcFindModuleInPath#

    rcFindModuleInPath                      ,


-- ** rcFindPixmapInPath #method:rcFindPixmapInPath#

    rcFindPixmapInPath                      ,


-- ** rcGetDefaultFiles #method:rcGetDefaultFiles#

    rcGetDefaultFiles                       ,


-- ** rcGetImModuleFile #method:rcGetImModuleFile#

    rcGetImModuleFile                       ,


-- ** rcGetImModulePath #method:rcGetImModulePath#

    rcGetImModulePath                       ,


-- ** rcGetModuleDir #method:rcGetModuleDir#

    rcGetModuleDir                          ,


-- ** rcGetStyle #method:rcGetStyle#

    rcGetStyle                              ,


-- ** rcGetStyleByPaths #method:rcGetStyleByPaths#

    rcGetStyleByPaths                       ,


-- ** rcGetThemeDir #method:rcGetThemeDir#

    rcGetThemeDir                           ,


-- ** rcParse #method:rcParse#

    rcParse                                 ,


-- ** rcParseColor #method:rcParseColor#

    rcParseColor                            ,


-- ** rcParseColorFull #method:rcParseColorFull#

    rcParseColorFull                        ,


-- ** rcParsePriority #method:rcParsePriority#

    rcParsePriority                         ,


-- ** rcParseState #method:rcParseState#

    rcParseState                            ,


-- ** rcParseString #method:rcParseString#

    rcParseString                           ,


-- ** rcReparseAll #method:rcReparseAll#

    rcReparseAll                            ,


-- ** rcReparseAllForSettings #method:rcReparseAllForSettings#

    rcReparseAllForSettings                 ,


-- ** rcResetStyles #method:rcResetStyles#

    rcResetStyles                           ,


-- ** rcSetDefaultFiles #method:rcSetDefaultFiles#

    rcSetDefaultFiles                       ,


-- ** renderActivity #method:renderActivity#

    renderActivity                          ,


-- ** renderArrow #method:renderArrow#

    renderArrow                             ,


-- ** renderBackground #method:renderBackground#

    renderBackground                        ,


-- ** renderBackgroundGetClip #method:renderBackgroundGetClip#

    renderBackgroundGetClip                 ,


-- ** renderCheck #method:renderCheck#

    renderCheck                             ,


-- ** renderExpander #method:renderExpander#

    renderExpander                          ,


-- ** renderExtension #method:renderExtension#

    renderExtension                         ,


-- ** renderFocus #method:renderFocus#

    renderFocus                             ,


-- ** renderFrame #method:renderFrame#

    renderFrame                             ,


-- ** renderFrameGap #method:renderFrameGap#

    renderFrameGap                          ,


-- ** renderHandle #method:renderHandle#

    renderHandle                            ,


-- ** renderIcon #method:renderIcon#

    renderIcon                              ,


-- ** renderIconPixbuf #method:renderIconPixbuf#

    renderIconPixbuf                        ,


-- ** renderIconSurface #method:renderIconSurface#

    renderIconSurface                       ,


-- ** renderInsertionCursor #method:renderInsertionCursor#

    renderInsertionCursor                   ,


-- ** renderLayout #method:renderLayout#

    renderLayout                            ,


-- ** renderLine #method:renderLine#

    renderLine                              ,


-- ** renderOption #method:renderOption#

    renderOption                            ,


-- ** renderSlider #method:renderSlider#

    renderSlider                            ,


-- ** rgbToHsv #method:rgbToHsv#

    rgbToHsv                                ,


-- ** selectionAddTarget #method:selectionAddTarget#

    selectionAddTarget                      ,


-- ** selectionAddTargets #method:selectionAddTargets#

    selectionAddTargets                     ,


-- ** selectionClearTargets #method:selectionClearTargets#

    selectionClearTargets                   ,


-- ** selectionConvert #method:selectionConvert#

    selectionConvert                        ,


-- ** selectionOwnerSet #method:selectionOwnerSet#

    selectionOwnerSet                       ,


-- ** selectionOwnerSetForDisplay #method:selectionOwnerSetForDisplay#

    selectionOwnerSetForDisplay             ,


-- ** selectionRemoveAll #method:selectionRemoveAll#

    selectionRemoveAll                      ,


-- ** setDebugFlags #method:setDebugFlags#

    setDebugFlags                           ,


-- ** showUri #method:showUri#

    showUri                                 ,


-- ** showUriOnWindow #method:showUriOnWindow#

    showUriOnWindow                         ,


-- ** stockAdd #method:stockAdd#

    stockAdd                                ,


-- ** stockAddStatic #method:stockAddStatic#

    stockAddStatic                          ,


-- ** stockListIds #method:stockListIds#

    stockListIds                            ,


-- ** stockLookup #method:stockLookup#

    stockLookup                             ,


-- ** stockSetTranslateFunc #method:stockSetTranslateFunc#

    stockSetTranslateFunc                   ,


-- ** targetTableFree #method:targetTableFree#

    targetTableFree                         ,


-- ** targetTableNewFromList #method:targetTableNewFromList#

    targetTableNewFromList                  ,


-- ** targetsIncludeImage #method:targetsIncludeImage#

    targetsIncludeImage                     ,


-- ** targetsIncludeRichText #method:targetsIncludeRichText#

    targetsIncludeRichText                  ,


-- ** targetsIncludeText #method:targetsIncludeText#

    targetsIncludeText                      ,


-- ** targetsIncludeUri #method:targetsIncludeUri#

    targetsIncludeUri                       ,


-- ** testCreateSimpleWindow #method:testCreateSimpleWindow#

    testCreateSimpleWindow                  ,


-- ** testFindLabel #method:testFindLabel#

    testFindLabel                           ,


-- ** testFindSibling #method:testFindSibling#

    testFindSibling                         ,


-- ** testFindWidget #method:testFindWidget#

    testFindWidget                          ,


-- ** testListAllTypes #method:testListAllTypes#

    testListAllTypes                        ,


-- ** testRegisterAllTypes #method:testRegisterAllTypes#

    testRegisterAllTypes                    ,


-- ** testSliderGetValue #method:testSliderGetValue#

    testSliderGetValue                      ,


-- ** testSliderSetPerc #method:testSliderSetPerc#

    testSliderSetPerc                       ,


-- ** testSpinButtonClick #method:testSpinButtonClick#

    testSpinButtonClick                     ,


-- ** testTextGet #method:testTextGet#

    testTextGet                             ,


-- ** testTextSet #method:testTextSet#

    testTextSet                             ,


-- ** testWidgetClick #method:testWidgetClick#

    testWidgetClick                         ,


-- ** testWidgetSendKey #method:testWidgetSendKey#

    testWidgetSendKey                       ,


-- ** testWidgetWaitForDraw #method:testWidgetWaitForDraw#

    testWidgetWaitForDraw                   ,


-- ** treeGetRowDragData #method:treeGetRowDragData#

    treeGetRowDragData                      ,


-- ** treeSetRowDragData #method:treeSetRowDragData#

    treeSetRowDragData                      ,


-- ** true #method:true#

    true                                    ,




    ) 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.ManagedPtr as B.ManagedPtr
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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.OptionEntry as GLib.OptionEntry
import qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup
import qualified GI.GLib.Structs.Scanner as GLib.Scanner
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Enums as Gdk.Enums
import qualified GI.Gdk.Flags as Gdk.Flags
import qualified GI.Gdk.Objects.Device as Gdk.Device
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.DragContext as Gdk.DragContext
import qualified GI.Gdk.Objects.Screen as Gdk.Screen
import qualified GI.Gdk.Objects.Window as Gdk.Window
import qualified GI.Gdk.Structs.Atom as Gdk.Atom
import qualified GI.Gdk.Structs.Color as Gdk.Color
import qualified GI.Gdk.Structs.EventKey as Gdk.EventKey
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gdk.Unions.Event as Gdk.Event
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
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.AccelGroup as Gtk.AccelGroup
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.RcStyle as Gtk.RcStyle
import {-# SOURCE #-} qualified GI.Gtk.Objects.Settings as Gtk.Settings
import {-# SOURCE #-} qualified GI.Gtk.Objects.SpinButton as Gtk.SpinButton
import {-# SOURCE #-} qualified GI.Gtk.Objects.Style as Gtk.Style
import {-# SOURCE #-} qualified GI.Gtk.Objects.StyleContext as Gtk.StyleContext
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
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.IconSource as Gtk.IconSource
import {-# SOURCE #-} qualified GI.Gtk.Structs.RequestedSize as Gtk.RequestedSize
import {-# SOURCE #-} qualified GI.Gtk.Structs.SelectionData as Gtk.SelectionData
import {-# SOURCE #-} qualified GI.Gtk.Structs.StockItem as Gtk.StockItem
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetEntry as Gtk.TargetEntry
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetList as Gtk.TargetList
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 gtk_true
-- Args : []
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_true" gtk_true ::
    IO CInt

{- |
All this function does it to return 'True'.

This can be useful for example if you want to inhibit the deletion
of a window. Of course you should not do this as the user expects
a reaction from clicking the close icon of the window...

== A persistent window


=== /C code/
>
>#include <gtk/gtk.h>
>
>int
>main (int argc, char **argv)
>{
>  GtkWidget *win, *but;
>  const char *text = "Close yourself. I mean it!";
>
>  gtk_init (&argc, &argv);
>
>  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
>  g_signal_connect (win,
>                    "delete-event",
>                    G_CALLBACK (gtk_true),
>                    NULL);
>  g_signal_connect (win, "destroy",
>                    G_CALLBACK (gtk_main_quit),
>                    NULL);
>
>  but = gtk_button_new_with_label (text);
>  g_signal_connect_swapped (but, "clicked",
>                            G_CALLBACK (gtk_object_destroy),
>                            win);
>  gtk_container_add (GTK_CONTAINER (win), but);
>
>  gtk_widget_show_all (win);
>
>  gtk_main ();
>
>  return 0;
>}
-}
true ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    {- ^ __Returns:__ 'True' -}
true  = liftIO $ do
    result <- gtk_true
    let result' = (/= 0) result
    return result'


-- function gtk_tree_set_row_drag_data
-- Args : [Arg {argCName = "selection_data", argType = TInterface (Name {namespace = "Gtk", name = "SelectionData"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "some #GtkSelectionData", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},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 (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_tree_set_row_drag_data" gtk_tree_set_row_drag_data ::
    Ptr Gtk.SelectionData.SelectionData ->  -- selection_data : TInterface (Name {namespace = "Gtk", name = "SelectionData"})
    Ptr Gtk.TreeModel.TreeModel ->          -- tree_model : TInterface (Name {namespace = "Gtk", name = "TreeModel"})
    Ptr Gtk.TreePath.TreePath ->            -- path : TInterface (Name {namespace = "Gtk", name = "TreePath"})
    IO CInt

{- |
Sets selection data of target type @/GTK_TREE_MODEL_ROW/@. Normally used
in a drag_data_get handler.
-}
treeSetRowDragData ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.TreeModel.IsTreeModel a) =>
    Gtk.SelectionData.SelectionData
    {- ^ /@selectionData@/: some 'GI.Gtk.Structs.SelectionData.SelectionData' -}
    -> a
    {- ^ /@treeModel@/: a 'GI.Gtk.Interfaces.TreeModel.TreeModel' -}
    -> Gtk.TreePath.TreePath
    {- ^ /@path@/: a row in /@treeModel@/ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the 'GI.Gtk.Structs.SelectionData.SelectionData' had the proper target type to allow us to set a tree row -}
treeSetRowDragData selectionData treeModel path = liftIO $ do
    selectionData' <- unsafeManagedPtrGetPtr selectionData
    treeModel' <- unsafeManagedPtrCastPtr treeModel
    path' <- unsafeManagedPtrGetPtr path
    result <- gtk_tree_set_row_drag_data selectionData' treeModel' path'
    let result' = (/= 0) result
    touchManagedPtr selectionData
    touchManagedPtr treeModel
    touchManagedPtr path
    return result'


-- function gtk_tree_get_row_drag_data
-- Args : [Arg {argCName = "selection_data", argType = TInterface (Name {namespace = "Gtk", name = "SelectionData"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSelectionData", 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 Gtk.SelectionData.SelectionData ->  -- selection_data : TInterface (Name {namespace = "Gtk", name = "SelectionData"})
    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 selection data of target type
@/GTK_TREE_MODEL_ROW/@. Normally called from a drag_data_received handler.
This function can only be used if /@selectionData@/ originates from the same
process that’s calling this function, because a pointer to the tree model
is being passed around. If you aren’t in the same process, then you\'ll
get memory corruption. In the 'GI.Gtk.Interfaces.TreeDragDest.TreeDragDest' drag_data_received handler,
you can assume that selection data of type @/GTK_TREE_MODEL_ROW/@ is
in from the current process. The returned path must be freed with
'GI.Gtk.Structs.TreePath.treePathFree'.
-}
treeGetRowDragData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gtk.SelectionData.SelectionData
    {- ^ /@selectionData@/: a 'GI.Gtk.Structs.SelectionData.SelectionData' -}
    -> m ((Bool, Maybe Gtk.TreeModel.TreeModel, Maybe Gtk.TreePath.TreePath))
    {- ^ __Returns:__ 'True' if /@selectionData@/ had target type @/GTK_TREE_MODEL_ROW/@ and
 is otherwise valid -}
treeGetRowDragData selectionData = liftIO $ do
    selectionData' <- unsafeManagedPtrGetPtr selectionData
    treeModel <- allocMem :: IO (Ptr (Ptr Gtk.TreeModel.TreeModel))
    path <- allocMem :: IO (Ptr (Ptr Gtk.TreePath.TreePath))
    result <- gtk_tree_get_row_drag_data selectionData' treeModel path
    let result' = (/= 0) result
    treeModel' <- peek treeModel
    maybeTreeModel' <- convertIfNonNull treeModel' $ \treeModel'' -> do
        treeModel''' <- (newObject Gtk.TreeModel.TreeModel) treeModel''
        return treeModel'''
    path' <- peek path
    maybePath' <- convertIfNonNull path' $ \path'' -> do
        path''' <- (wrapBoxed Gtk.TreePath.TreePath) path''
        return path'''
    touchManagedPtr selectionData
    freeMem treeModel
    freeMem path
    return (result', maybeTreeModel', maybePath')


-- function gtk_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.

/Since: 3.10/
-}
testWidgetWaitForDraw ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: the widget to wait for -}
    -> m ()
testWidgetWaitForDraw widget = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    gtk_test_widget_wait_for_draw widget'
    touchManagedPtr widget
    return ()


-- function gtk_test_widget_send_key
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Widget to generate a key press and release on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "keyval", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A Gdk keyboard value.", 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 "Keyboard modifiers the event is setup with.", 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_test_widget_send_key" gtk_test_widget_send_key ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Word32 ->                               -- keyval : TBasicType TUInt
    CUInt ->                                -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

{- |
This function will generate keyboard press and release events in
the middle of the first GdkWindow found that belongs to /@widget@/.
For windowless widgets like 'GI.Gtk.Objects.Button.Button' (which returns 'False' from
'GI.Gtk.Objects.Widget.widgetGetHasWindow'), this will often be an
input-only event window. For other widgets, this is usually widget->window.
Certain caveats should be considered when using this function, in
particular because the mouse pointer is warped to the key press
location, see 'GI.Gdk.Functions.testSimulateKey' for details.

/Since: 2.14/
-}
testWidgetSendKey ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: Widget to generate a key press and release on. -}
    -> Word32
    {- ^ /@keyval@/: A Gdk keyboard value. -}
    -> [Gdk.Flags.ModifierType]
    {- ^ /@modifiers@/: Keyboard modifiers the event is setup with. -}
    -> m Bool
    {- ^ __Returns:__ whether all actions neccessary for the key event simulation were carried out successfully. -}
testWidgetSendKey widget keyval modifiers = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    let modifiers' = gflagsToWord modifiers
    result <- gtk_test_widget_send_key widget' keyval modifiers'
    let result' = (/= 0) result
    touchManagedPtr widget
    return result'


-- function gtk_test_widget_click
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Widget to generate a button click on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "button", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of the pointer button for the event, usually 1, 2 or 3.", 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 "Keyboard modifiers the event is setup with.", 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_test_widget_click" gtk_test_widget_click ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Word32 ->                               -- button : TBasicType TUInt
    CUInt ->                                -- modifiers : TInterface (Name {namespace = "Gdk", name = "ModifierType"})
    IO CInt

{-# DEPRECATED testWidgetClick ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
This function will generate a /@button@/ click (button press and button
release event) in the middle of the first GdkWindow found that belongs
to /@widget@/.
For windowless widgets like 'GI.Gtk.Objects.Button.Button' (which returns 'False' from
'GI.Gtk.Objects.Widget.widgetGetHasWindow'), this will often be an
input-only event window. For other widgets, this is usually widget->window.
Certain caveats should be considered when using this function, in
particular because the mouse pointer is warped to the button click
location, see 'GI.Gdk.Functions.testSimulateButton' for details.

/Since: 2.14/
-}
testWidgetClick ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: Widget to generate a button click on. -}
    -> Word32
    {- ^ /@button@/: Number of the pointer button for the event, usually 1, 2 or 3. -}
    -> [Gdk.Flags.ModifierType]
    {- ^ /@modifiers@/: Keyboard modifiers the event is setup with. -}
    -> m Bool
    {- ^ __Returns:__ whether all actions neccessary for the button click simulation were carried out successfully. -}
testWidgetClick widget button modifiers = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    let modifiers' = gflagsToWord modifiers
    result <- gtk_test_widget_click widget' button modifiers'
    let result' = (/= 0) result
    touchManagedPtr widget
    return result'


-- function gtk_test_text_set
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "valid widget pointer.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "string", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a 0-terminated C string", 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_text_set" gtk_test_text_set ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- string : TBasicType TUTF8
    IO ()

{-# DEPRECATED testTextSet ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
Set the text string of /@widget@/ to /@string@/ if it is a GtkLabel,
GtkEditable (entry and text widgets) or GtkTextView.

/Since: 2.14/
-}
testTextSet ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: valid widget pointer. -}
    -> T.Text
    {- ^ /@string@/: a 0-terminated C string -}
    -> m ()
testTextSet widget string = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    string' <- textToCString string
    gtk_test_text_set widget' string'
    touchManagedPtr widget
    freeMem string'
    return ()


-- function gtk_test_text_get
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "valid widget pointer.", 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_test_text_get" gtk_test_text_get ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    IO CString

{-# DEPRECATED testTextGet ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
Retrive the text string of /@widget@/ if it is a GtkLabel,
GtkEditable (entry and text widgets) or GtkTextView.

/Since: 2.14/
-}
testTextGet ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: valid widget pointer. -}
    -> m T.Text
    {- ^ __Returns:__ new 0-terminated C string, needs to be released with 'GI.GLib.Functions.free'. -}
testTextGet widget = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    result <- gtk_test_text_get widget'
    checkUnexpectedReturnNULL "testTextGet" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr widget
    return result'


-- function gtk_test_spin_button_click
-- Args : [Arg {argCName = "spinner", argType = TInterface (Name {namespace = "Gtk", name = "SpinButton"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "valid GtkSpinButton widget.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "button", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Number of the pointer button for the event, usually 1, 2 or 3.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "upwards", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE for upwards arrow click, %FALSE for downwards arrow click.", 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_test_spin_button_click" gtk_test_spin_button_click ::
    Ptr Gtk.SpinButton.SpinButton ->        -- spinner : TInterface (Name {namespace = "Gtk", name = "SpinButton"})
    Word32 ->                               -- button : TBasicType TUInt
    CInt ->                                 -- upwards : TBasicType TBoolean
    IO CInt

{-# DEPRECATED testSpinButtonClick ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
This function will generate a /@button@/ click in the upwards or downwards
spin button arrow areas, usually leading to an increase or decrease of
spin button’s value.

/Since: 2.14/
-}
testSpinButtonClick ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.SpinButton.IsSpinButton a) =>
    a
    {- ^ /@spinner@/: valid GtkSpinButton widget. -}
    -> Word32
    {- ^ /@button@/: Number of the pointer button for the event, usually 1, 2 or 3. -}
    -> Bool
    {- ^ /@upwards@/: 'True' for upwards arrow click, 'False' for downwards arrow click. -}
    -> m Bool
    {- ^ __Returns:__ whether all actions neccessary for the button click simulation were carried out successfully. -}
testSpinButtonClick spinner button upwards = liftIO $ do
    spinner' <- unsafeManagedPtrCastPtr spinner
    let upwards' = (fromIntegral . fromEnum) upwards
    result <- gtk_test_spin_button_click spinner' button upwards'
    let result' = (/= 0) result
    touchManagedPtr spinner
    return result'


-- function gtk_test_slider_set_perc
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "valid widget pointer.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "percentage", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "value between 0 and 100.", 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_slider_set_perc" gtk_test_slider_set_perc ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CDouble ->                              -- percentage : TBasicType TDouble
    IO ()

{-# DEPRECATED testSliderSetPerc ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
This function will adjust the slider position of all GtkRange
based widgets, such as scrollbars or scales, it’ll also adjust
spin buttons. The adjustment value of these widgets is set to
a value between the lower and upper limits, according to the
/@percentage@/ argument.

/Since: 2.14/
-}
testSliderSetPerc ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: valid widget pointer. -}
    -> Double
    {- ^ /@percentage@/: value between 0 and 100. -}
    -> m ()
testSliderSetPerc widget percentage = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    let percentage' = realToFrac percentage
    gtk_test_slider_set_perc widget' percentage'
    touchManagedPtr widget
    return ()


-- function gtk_test_slider_get_value
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "valid widget pointer.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TDouble)
-- throws : False
-- Skip return : False

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

{-# DEPRECATED testSliderGetValue ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
Retrive the literal adjustment value for GtkRange based
widgets and spin buttons. Note that the value returned by
this function is anything between the lower and upper bounds
of the adjustment belonging to /@widget@/, and is not a percentage
as passed in to 'GI.Gtk.Functions.testSliderSetPerc'.

/Since: 2.14/
-}
testSliderGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: valid widget pointer. -}
    -> m Double
    {- ^ __Returns:__ gtk_adjustment_get_value (adjustment) for an adjustment belonging to /@widget@/. -}
testSliderGetValue widget = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    result <- gtk_test_slider_get_value widget'
    let result' = realToFrac result
    touchManagedPtr widget
    return result'


-- function gtk_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.

/Since: 2.14/
-}
testRegisterAllTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ()
testRegisterAllTypes  = liftIO $ do
    gtk_test_register_all_types
    return ()


-- function gtk_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'.

/Since: 2.14/
-}
testListAllTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m (([GType], Word32))
    {- ^ __Returns:__ 
   0-terminated array of type ids -}
testListAllTypes  = liftIO $ do
    nTypes <- allocMem :: IO (Ptr Word32)
    result <- gtk_test_list_all_types nTypes
    checkUnexpectedReturnNULL "testListAllTypes" result
    result' <- (unpackMapZeroTerminatedStorableArray GType) result
    nTypes' <- peek nTypes
    freeMem nTypes
    return (result', nTypes')


-- function gtk_test_find_widget
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Container widget, usually a GtkWindow.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label_pattern", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Shell-glob pattern to match a label string.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget_type", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Type of a aearched for label sibling widget.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Widget"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_find_widget" gtk_test_find_widget ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- label_pattern : TBasicType TUTF8
    CGType ->                               -- widget_type : TBasicType TGType
    IO (Ptr Gtk.Widget.Widget)

{- |
This function will search the descendants of /@widget@/ for a widget
of type /@widgetType@/ that has a label matching /@labelPattern@/ next
to it. This is most useful for automated GUI testing, e.g. to find
the “OK” button in a dialog and synthesize clicks on it.
However see 'GI.Gtk.Functions.testFindLabel', 'GI.Gtk.Functions.testFindSibling' and
'GI.Gtk.Functions.testWidgetClick' for possible caveats involving the search of
such widgets and synthesizing widget events.

/Since: 2.14/
-}
testFindWidget ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: Container widget, usually a GtkWindow. -}
    -> T.Text
    {- ^ /@labelPattern@/: Shell-glob pattern to match a label string. -}
    -> GType
    {- ^ /@widgetType@/: Type of a aearched for label sibling widget. -}
    -> m (Maybe Gtk.Widget.Widget)
    {- ^ __Returns:__ a valid widget if any is found or 'Nothing'. -}
testFindWidget widget labelPattern widgetType = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    labelPattern' <- textToCString labelPattern
    let widgetType' = gtypeToCGType widgetType
    result <- gtk_test_find_widget widget' labelPattern' widgetType'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.Widget.Widget) result'
        return result''
    touchManagedPtr widget
    freeMem labelPattern'
    return maybeResult


-- function gtk_test_find_sibling
-- Args : [Arg {argCName = "base_widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Valid widget, part of a widget hierarchy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget_type", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Type of a aearched for sibling widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Widget"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_find_sibling" gtk_test_find_sibling ::
    Ptr Gtk.Widget.Widget ->                -- base_widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CGType ->                               -- widget_type : TBasicType TGType
    IO (Ptr Gtk.Widget.Widget)

{- |
This function will search siblings of /@baseWidget@/ and siblings of its
ancestors for all widgets matching /@widgetType@/.
Of the matching widgets, the one that is geometrically closest to
/@baseWidget@/ will be returned.
The general purpose of this function is to find the most likely “action”
widget, relative to another labeling widget. Such as finding a
button or text entry widget, given its corresponding label widget.

/Since: 2.14/
-}
testFindSibling ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@baseWidget@/: Valid widget, part of a widget hierarchy -}
    -> GType
    {- ^ /@widgetType@/: Type of a aearched for sibling widget -}
    -> m Gtk.Widget.Widget
    {- ^ __Returns:__ a widget of type /@widgetType@/ if any is found. -}
testFindSibling baseWidget widgetType = liftIO $ do
    baseWidget' <- unsafeManagedPtrCastPtr baseWidget
    let widgetType' = gtypeToCGType widgetType
    result <- gtk_test_find_sibling baseWidget' widgetType'
    checkUnexpectedReturnNULL "testFindSibling" result
    result' <- (newObject Gtk.Widget.Widget) result
    touchManagedPtr baseWidget
    return result'


-- function gtk_test_find_label
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Valid label or container widget.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "label_pattern", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Shell-glob pattern to match a label string.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Widget"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_find_label" gtk_test_find_label ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- label_pattern : TBasicType TUTF8
    IO (Ptr Gtk.Widget.Widget)

{- |
This function will search /@widget@/ and all its descendants for a GtkLabel
widget with a text string matching /@labelPattern@/.
The /@labelPattern@/ may contain asterisks “*” and question marks “?” as
placeholders, 'GI.GLib.Functions.patternMatch' is used for the matching.
Note that locales other than \"C“ tend to alter (translate” label strings,
so this function is genrally only useful in test programs with
predetermined locales, see @/gtk_test_init()/@ for more details.

/Since: 2.14/
-}
testFindLabel ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: Valid label or container widget. -}
    -> T.Text
    {- ^ /@labelPattern@/: Shell-glob pattern to match a label string. -}
    -> m Gtk.Widget.Widget
    {- ^ __Returns:__ a GtkLabel widget if any is found. -}
testFindLabel widget labelPattern = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    labelPattern' <- textToCString labelPattern
    result <- gtk_test_find_label widget' labelPattern'
    checkUnexpectedReturnNULL "testFindLabel" result
    result' <- (newObject Gtk.Widget.Widget) result
    touchManagedPtr widget
    freeMem labelPattern'
    return result'


-- function gtk_test_create_simple_window
-- Args : [Arg {argCName = "window_title", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Title of the window to be displayed.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dialog_text", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Text inside the window to be displayed.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Widget"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_test_create_simple_window" gtk_test_create_simple_window ::
    CString ->                              -- window_title : TBasicType TUTF8
    CString ->                              -- dialog_text : TBasicType TUTF8
    IO (Ptr Gtk.Widget.Widget)

{-# DEPRECATED testCreateSimpleWindow ["(Since version 3.20)","This testing infrastructure is phased out in favor of reftests."] #-}
{- |
Create a simple window with window title /@windowTitle@/ and
text contents /@dialogText@/.
The window will quit any running 'GI.Gtk.Functions.main'-loop when destroyed, and it
will automatically be destroyed upon test function teardown.

/Since: 2.14/
-}
testCreateSimpleWindow ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@windowTitle@/: Title of the window to be displayed. -}
    -> T.Text
    {- ^ /@dialogText@/: Text inside the window to be displayed. -}
    -> m Gtk.Widget.Widget
    {- ^ __Returns:__ a widget pointer to the newly created GtkWindow. -}
testCreateSimpleWindow windowTitle dialogText = liftIO $ do
    windowTitle' <- textToCString windowTitle
    dialogText' <- textToCString dialogText
    result <- gtk_test_create_simple_window windowTitle' dialogText'
    checkUnexpectedReturnNULL "testCreateSimpleWindow" result
    result' <- (newObject Gtk.Widget.Widget) result
    freeMem windowTitle'
    freeMem dialogText'
    return result'


-- function gtk_targets_include_uri
-- Args : [Arg {argCName = "targets", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GdkAtoms", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_targets_include_uri" gtk_targets_include_uri ::
    Ptr (Ptr Gdk.Atom.Atom) ->              -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"}))
    Int32 ->                                -- n_targets : TBasicType TInt
    IO CInt

{- |
Determines if any of the targets in /@targets@/ can be used to
provide an uri list.

/Since: 2.10/
-}
targetsIncludeUri ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gdk.Atom.Atom]
    {- ^ /@targets@/: an array of @/GdkAtoms/@ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@targets@/ include a suitable target for uri lists,
  otherwise 'False'. -}
targetsIncludeUri targets = liftIO $ do
    let nTargets = fromIntegral $ length targets
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packPtrArray targets'
    result <- gtk_targets_include_uri targets'' nTargets
    let result' = (/= 0) result
    mapM_ touchManagedPtr targets
    freeMem targets''
    return result'


-- function gtk_targets_include_text
-- Args : [Arg {argCName = "targets", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GdkAtoms", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_targets_include_text" gtk_targets_include_text ::
    Ptr (Ptr Gdk.Atom.Atom) ->              -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"}))
    Int32 ->                                -- n_targets : TBasicType TInt
    IO CInt

{- |
Determines if any of the targets in /@targets@/ can be used to
provide text.

/Since: 2.10/
-}
targetsIncludeText ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gdk.Atom.Atom]
    {- ^ /@targets@/: an array of @/GdkAtoms/@ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@targets@/ include a suitable target for text,
  otherwise 'False'. -}
targetsIncludeText targets = liftIO $ do
    let nTargets = fromIntegral $ length targets
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packPtrArray targets'
    result <- gtk_targets_include_text targets'' nTargets
    let result' = (/= 0) result
    mapM_ touchManagedPtr targets
    freeMem targets''
    return result'


-- function gtk_targets_include_rich_text
-- Args : [Arg {argCName = "targets", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GdkAtoms", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gtk", name = "TextBuffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTextBuffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_targets_include_rich_text" gtk_targets_include_rich_text ::
    Ptr (Ptr Gdk.Atom.Atom) ->              -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"}))
    Int32 ->                                -- n_targets : TBasicType TInt
    Ptr Gtk.TextBuffer.TextBuffer ->        -- buffer : TInterface (Name {namespace = "Gtk", name = "TextBuffer"})
    IO CInt

{- |
Determines if any of the targets in /@targets@/ can be used to
provide rich text.

/Since: 2.10/
-}
targetsIncludeRichText ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.TextBuffer.IsTextBuffer a) =>
    [Gdk.Atom.Atom]
    {- ^ /@targets@/: an array of @/GdkAtoms/@ -}
    -> a
    {- ^ /@buffer@/: a 'GI.Gtk.Objects.TextBuffer.TextBuffer' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@targets@/ include a suitable target for rich text,
              otherwise 'False'. -}
targetsIncludeRichText targets buffer = liftIO $ do
    let nTargets = fromIntegral $ length targets
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packPtrArray targets'
    buffer' <- unsafeManagedPtrCastPtr buffer
    result <- gtk_targets_include_rich_text targets'' nTargets buffer'
    let result' = (/= 0) result
    mapM_ touchManagedPtr targets
    touchManagedPtr buffer
    freeMem targets''
    return result'


-- function gtk_targets_include_image
-- Args : [Arg {argCName = "targets", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an array of #GdkAtoms", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "writable", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "whether to accept only targets for which GTK+ knows\n  how to convert a pixbuf into the format", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_targets_include_image" gtk_targets_include_image ::
    Ptr (Ptr Gdk.Atom.Atom) ->              -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gdk", name = "Atom"}))
    Int32 ->                                -- n_targets : TBasicType TInt
    CInt ->                                 -- writable : TBasicType TBoolean
    IO CInt

{- |
Determines if any of the targets in /@targets@/ can be used to
provide a 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf'.

/Since: 2.10/
-}
targetsIncludeImage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gdk.Atom.Atom]
    {- ^ /@targets@/: an array of @/GdkAtoms/@ -}
    -> Bool
    {- ^ /@writable@/: whether to accept only targets for which GTK+ knows
  how to convert a pixbuf into the format -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@targets@/ include a suitable target for images,
  otherwise 'False'. -}
targetsIncludeImage targets writable = liftIO $ do
    let nTargets = fromIntegral $ length targets
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packPtrArray targets'
    let writable' = (fromIntegral . fromEnum) writable
    result <- gtk_targets_include_image targets'' nTargets writable'
    let result' = (/= 0) result
    mapM_ touchManagedPtr targets
    freeMem targets''
    return result'


-- function gtk_target_table_new_from_list
-- Args : [Arg {argCName = "list", argType = TInterface (Name {namespace = "Gtk", name = "TargetList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTargetList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the number ot targets in the table", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the number ot targets in the table", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- returnType : Just (TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"})))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_target_table_new_from_list" gtk_target_table_new_from_list ::
    Ptr Gtk.TargetList.TargetList ->        -- list : TInterface (Name {namespace = "Gtk", name = "TargetList"})
    Ptr Int32 ->                            -- n_targets : TBasicType TInt
    IO (Ptr Gtk.TargetEntry.TargetEntry)

{- |
This function creates an 'GI.Gtk.Structs.TargetEntry.TargetEntry' array that contains the
same targets as the passed @/list/@. The returned table is newly
allocated and should be freed using 'GI.Gtk.Functions.targetTableFree' when no
longer needed.

/Since: 2.10/
-}
targetTableNewFromList ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Gtk.TargetList.TargetList
    {- ^ /@list@/: a 'GI.Gtk.Structs.TargetList.TargetList' -}
    -> m [Gtk.TargetEntry.TargetEntry]
    {- ^ __Returns:__ the new table. -}
targetTableNewFromList list = liftIO $ do
    list' <- unsafeManagedPtrGetPtr list
    nTargets <- allocMem :: IO (Ptr Int32)
    result <- gtk_target_table_new_from_list list' nTargets
    nTargets' <- peek nTargets
    checkUnexpectedReturnNULL "targetTableNewFromList" result
    result' <- (unpackBoxedArrayWithLength 16 nTargets') result
    result'' <- mapM (wrapBoxed Gtk.TargetEntry.TargetEntry) result'
    freeMem result
    touchManagedPtr list
    freeMem nTargets
    return result''


-- function gtk_target_table_free
-- Args : [Arg {argCName = "targets", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTargetEntry array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of entries in the array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_targets", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the number of entries in the array", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_target_table_free" gtk_target_table_free ::
    Ptr Gtk.TargetEntry.TargetEntry ->      -- targets : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"}))
    Int32 ->                                -- n_targets : TBasicType TInt
    IO ()

{- |
This function frees a target table as returned by
'GI.Gtk.Functions.targetTableNewFromList'

/Since: 2.10/
-}
targetTableFree ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gtk.TargetEntry.TargetEntry]
    {- ^ /@targets@/: a 'GI.Gtk.Structs.TargetEntry.TargetEntry' array -}
    -> m ()
targetTableFree targets = liftIO $ do
    let nTargets = fromIntegral $ length targets
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packBlockArray 16 targets'
    gtk_target_table_free targets'' nTargets
    mapM_ touchManagedPtr targets
    freeMem targets''
    return ()


-- function gtk_stock_set_translate_func
-- Args : [Arg {argCName = "domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the translation domain for which @func shall be used", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "func", argType = TInterface (Name {namespace = "Gtk", name = "TranslateFunc"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkTranslateFunc", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 2, argDestroy = 3, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to @func", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "notify", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDestroyNotify that is called when @data is\n  no longer needed", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_stock_set_translate_func" gtk_stock_set_translate_func ::
    CString ->                              -- domain : TBasicType TUTF8
    FunPtr Gtk.Callbacks.C_TranslateFunc -> -- func : TInterface (Name {namespace = "Gtk", name = "TranslateFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{-# DEPRECATED stockSetTranslateFunc ["(Since version 3.10)"] #-}
{- |
Sets a function to be used for translating the /@label@/ of
a stock item.

If no function is registered for a translation domain,
'GI.GLib.Functions.dgettext' is used.

The function is used for all stock items whose
/@translationDomain@/ matches /@domain@/. Note that it is possible
to use strings different from the actual gettext translation domain
of your application for this, as long as your 'GI.Gtk.Callbacks.TranslateFunc' uses
the correct domain when calling @/dgettext()/@. This can be useful, e.g.
when dealing with message contexts:


=== /C code/
>
>GtkStockItem items[] = {
> { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" },
> { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" },
>};
>
>gchar *
>my_translate_func (const gchar *msgid,
>                   gpointer     data)
>{
>  gchar *msgctxt = data;
>
>  return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid);
>}
>
>...
>
>gtk_stock_add (items, G_N_ELEMENTS (items));
>gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items");
>gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items");


/Since: 2.8/
-}
stockSetTranslateFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@domain@/: the translation domain for which /@func@/ shall be used -}
    -> Gtk.Callbacks.TranslateFunc
    {- ^ /@func@/: a 'GI.Gtk.Callbacks.TranslateFunc' -}
    -> m ()
stockSetTranslateFunc domain func = liftIO $ do
    domain' <- textToCString domain
    func' <- Gtk.Callbacks.mk_TranslateFunc (Gtk.Callbacks.wrap_TranslateFunc Nothing (Gtk.Callbacks.drop_closures_TranslateFunc func))
    let data_ = castFunPtrToPtr func'
    let notify = safeFreeFunPtrPtr
    gtk_stock_set_translate_func domain' func' data_ notify
    freeMem domain'
    return ()


-- function gtk_stock_lookup
-- Args : [Arg {argCName = "stock_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a stock item name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "item", argType = TInterface (Name {namespace = "Gtk", name = "StockItem"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "stock item to initialize with values", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_stock_lookup" gtk_stock_lookup ::
    CString ->                              -- stock_id : TBasicType TUTF8
    Ptr Gtk.StockItem.StockItem ->          -- item : TInterface (Name {namespace = "Gtk", name = "StockItem"})
    IO CInt

{-# DEPRECATED stockLookup ["(Since version 3.10)"] #-}
{- |
Fills /@item@/ with the registered values for /@stockId@/, returning 'True'
if /@stockId@/ was known.
-}
stockLookup ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@stockId@/: a stock item name -}
    -> m ((Bool, Gtk.StockItem.StockItem))
    {- ^ __Returns:__ 'True' if /@item@/ was initialized -}
stockLookup stockId = liftIO $ do
    stockId' <- textToCString stockId
    item <- callocBytes 32 :: IO (Ptr Gtk.StockItem.StockItem)
    result <- gtk_stock_lookup stockId' item
    let result' = (/= 0) result
    item' <- (wrapPtr Gtk.StockItem.StockItem) item
    freeMem stockId'
    return (result', item')


-- function gtk_stock_list_ids
-- Args : []
-- Lengths : []
-- returnType : Just (TGSList (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_stock_list_ids" gtk_stock_list_ids ::
    IO (Ptr (GSList CString))

{-# DEPRECATED stockListIds ["(Since version 3.10)"] #-}
{- |
Retrieves a list of all known stock IDs added to a 'GI.Gtk.Objects.IconFactory.IconFactory'
or registered with 'GI.Gtk.Functions.stockAdd'. The list must be freed with @/g_slist_free()/@,
and each string in the list must be freed with 'GI.GLib.Functions.free'.
-}
stockListIds ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [T.Text]
    {- ^ __Returns:__ a list of known stock IDs -}
stockListIds  = liftIO $ do
    result <- gtk_stock_list_ids
    result' <- unpackGSList result
    result'' <- mapM cstringToText result'
    mapGSList freeMem result
    g_slist_free result
    return result''


-- function gtk_stock_add_static
-- Args : [Arg {argCName = "items", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStockItem or array of #GtkStockItem", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_items", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of items", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_items", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of items", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_stock_add_static" gtk_stock_add_static ::
    Ptr Gtk.StockItem.StockItem ->          -- items : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"}))
    Word32 ->                               -- n_items : TBasicType TUInt
    IO ()

{-# DEPRECATED stockAddStatic ["(Since version 3.10)"] #-}
{- |
Same as 'GI.Gtk.Functions.stockAdd', but doesn’t copy /@items@/, so
/@items@/ must persist until application exit.
-}
stockAddStatic ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gtk.StockItem.StockItem]
    {- ^ /@items@/: a 'GI.Gtk.Structs.StockItem.StockItem' or array of 'GI.Gtk.Structs.StockItem.StockItem' -}
    -> m ()
stockAddStatic items = liftIO $ do
    let nItems = fromIntegral $ length items
    items' <- mapM unsafeManagedPtrGetPtr items
    items'' <- packBlockArray 32 items'
    gtk_stock_add_static items'' nItems
    mapM_ touchManagedPtr items
    freeMem items''
    return ()


-- function gtk_stock_add
-- Args : [Arg {argCName = "items", argType = TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStockItem or array of items", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_items", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of #GtkStockItem in @items", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "n_items", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of #GtkStockItem in @items", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_stock_add" gtk_stock_add ::
    Ptr Gtk.StockItem.StockItem ->          -- items : TCArray False (-1) 1 (TInterface (Name {namespace = "Gtk", name = "StockItem"}))
    Word32 ->                               -- n_items : TBasicType TUInt
    IO ()

{-# DEPRECATED stockAdd ["(Since version 3.10)"] #-}
{- |
Registers each of the stock items in /@items@/. If an item already
exists with the same stock ID as one of the /@items@/, the old item
gets replaced. The stock items are copied, so GTK+ does not hold
any pointer into /@items@/ and /@items@/ can be freed. Use
'GI.Gtk.Functions.stockAddStatic' if /@items@/ is persistent and GTK+ need not
copy the array.
-}
stockAdd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Gtk.StockItem.StockItem]
    {- ^ /@items@/: a 'GI.Gtk.Structs.StockItem.StockItem' or array of items -}
    -> m ()
stockAdd items = liftIO $ do
    let nItems = fromIntegral $ length items
    items' <- mapM unsafeManagedPtrGetPtr items
    items'' <- packBlockArray 32 items'
    gtk_stock_add items'' nItems
    mapM_ touchManagedPtr items
    freeMem items''
    return ()


-- function gtk_show_uri_on_window
-- 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 "a timestamp to prevent focus stealing", 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_on_window" gtk_show_uri_on_window ::
    Ptr Gtk.Window.Window ->                -- parent : TInterface (Name {namespace = "Gtk", name = "Window"})
    CString ->                              -- uri : TBasicType TUTF8
    Word32 ->                               -- timestamp : TBasicType TUInt32
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
This is a convenience function for launching the default application
to show the uri. 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@


Ideally the timestamp is taken from the event triggering
the 'GI.Gtk.Functions.showUri' call. If timestamp is not known you can take
'GI.Gdk.Constants.CURRENT_TIME'.

This is the recommended call to be used as it passes information
necessary for sandbox helpers to parent their dialogs properly.

/Since: 3.22/
-}
showUriOnWindow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a) =>
    Maybe (a)
    {- ^ /@parent@/: parent window -}
    -> T.Text
    {- ^ /@uri@/: the uri to show -}
    -> Word32
    {- ^ /@timestamp@/: a timestamp to prevent focus stealing -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
showUriOnWindow parent uri timestamp = liftIO $ do
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    uri' <- textToCString uri
    onException (do
        _ <- propagateGError $ gtk_show_uri_on_window maybeParent uri' timestamp
        whenJust parent touchManagedPtr
        freeMem uri'
        return ()
     ) (do
        freeMem uri'
     )


-- function gtk_show_uri
-- Args : [Arg {argCName = "screen", argType = TInterface (Name {namespace = "Gdk", name = "Screen"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "screen to show the uri on\n    or %NULL for the default screen", 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 "a timestamp to prevent focus stealing", 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" gtk_show_uri ::
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    CString ->                              -- uri : TBasicType TUTF8
    Word32 ->                               -- timestamp : TBasicType TUInt32
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
A convenience function for launching the default application
to show the uri. Like 'GI.Gtk.Functions.showUriOnWindow', but takes a screen
as transient parent instead of a window.

Note that this function is deprecated as it does not pass the necessary
information for helpers to parent their dialog properly, when run from
sandboxed applications for example.

/Since: 2.14/
-}
showUri ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a) =>
    Maybe (a)
    {- ^ /@screen@/: screen to show the uri on
    or 'Nothing' for the default screen -}
    -> T.Text
    {- ^ /@uri@/: the uri to show -}
    -> Word32
    {- ^ /@timestamp@/: a timestamp to prevent focus stealing -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
showUri screen uri timestamp = liftIO $ do
    maybeScreen <- case screen of
        Nothing -> return nullPtr
        Just jScreen -> do
            jScreen' <- unsafeManagedPtrCastPtr jScreen
            return jScreen'
    uri' <- textToCString uri
    onException (do
        _ <- propagateGError $ gtk_show_uri maybeScreen uri' timestamp
        whenJust screen touchManagedPtr
        freeMem uri'
        return ()
     ) (do
        freeMem uri'
     )


-- function gtk_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 flags = liftIO $ do
    gtk_set_debug_flags flags
    return ()


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

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

{- |
Removes all handlers and unsets ownership of all
selections for a widget. Called when widget is being
destroyed. This function will not generally be
called by applications.
-}
selectionRemoveAll ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> m ()
selectionRemoveAll widget = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    gtk_selection_remove_all widget'
    touchManagedPtr widget
    return ()


-- function gtk_selection_owner_set_for_display
-- Args : [Arg {argCName = "display", argType = TInterface (Name {namespace = "Gdk", name = "Display"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GdkDisplay where the selection is set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "new selection owner (a #GtkWidget), or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an interned atom representing the selection to claim.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time_", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "timestamp with which to claim the selection", 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_selection_owner_set_for_display" gtk_selection_owner_set_for_display ::
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Ptr Gdk.Atom.Atom ->                    -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Word32 ->                               -- time_ : TBasicType TUInt32
    IO CInt

{- |
Claim ownership of a given selection for a particular widget, or,
if /@widget@/ is 'Nothing', release ownership of the selection.

/Since: 2.2/
-}
selectionOwnerSetForDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@display@/: the 'GI.Gdk.Objects.Display.Display' where the selection is set -}
    -> Maybe (b)
    {- ^ /@widget@/: new selection owner (a 'GI.Gtk.Objects.Widget.Widget'), or 'Nothing'. -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: an interned atom representing the selection to claim. -}
    -> Word32
    {- ^ /@time_@/: timestamp with which to claim the selection -}
    -> m Bool
    {- ^ __Returns:__ TRUE if the operation succeeded -}
selectionOwnerSetForDisplay display widget selection time_ = liftIO $ do
    display' <- unsafeManagedPtrCastPtr display
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    selection' <- unsafeManagedPtrGetPtr selection
    result <- gtk_selection_owner_set_for_display display' maybeWidget selection' time_
    let result' = (/= 0) result
    touchManagedPtr display
    whenJust widget touchManagedPtr
    touchManagedPtr selection
    return result'


-- function gtk_selection_owner_set
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkWidget, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an interned atom representing the selection to claim", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time_", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "timestamp with which to claim the selection", 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_selection_owner_set" gtk_selection_owner_set ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Ptr Gdk.Atom.Atom ->                    -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Word32 ->                               -- time_ : TBasicType TUInt32
    IO CInt

{- |
Claims ownership of a given selection for a particular widget,
or, if /@widget@/ is 'Nothing', release ownership of the selection.
-}
selectionOwnerSet ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    Maybe (a)
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget', or 'Nothing'. -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: an interned atom representing the selection to claim -}
    -> Word32
    {- ^ /@time_@/: timestamp with which to claim the selection -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the operation succeeded -}
selectionOwnerSet widget selection time_ = liftIO $ do
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    selection' <- unsafeManagedPtrGetPtr selection
    result <- gtk_selection_owner_set maybeWidget selection' time_
    let result' = (/= 0) result
    whenJust widget touchManagedPtr
    touchManagedPtr selection
    return result'


-- function gtk_selection_convert
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The widget which acts as requestor", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Which selection to get", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "target", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Form of information desired (e.g., STRING)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "time_", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Time of request (usually of triggering event)\n       In emergency, you could use #GDK_CURRENT_TIME", 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_selection_convert" gtk_selection_convert ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Ptr Gdk.Atom.Atom ->                    -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Ptr Gdk.Atom.Atom ->                    -- target : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Word32 ->                               -- time_ : TBasicType TUInt32
    IO CInt

{- |
Requests the contents of a selection. When received,
a “selection-received” signal will be generated.
-}
selectionConvert ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: The widget which acts as requestor -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: Which selection to get -}
    -> Gdk.Atom.Atom
    {- ^ /@target@/: Form of information desired (e.g., STRING) -}
    -> Word32
    {- ^ /@time_@/: Time of request (usually of triggering event)
       In emergency, you could use 'GI.Gdk.Constants.CURRENT_TIME' -}
    -> m Bool
    {- ^ __Returns:__ 'True' if requested succeeded. 'False' if we could not process
         request. (e.g., there was already a request in process for
         this widget). -}
selectionConvert widget selection target time_ = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    selection' <- unsafeManagedPtrGetPtr selection
    target' <- unsafeManagedPtrGetPtr target
    result <- gtk_selection_convert widget' selection' target' time_
    let result' = (/= 0) result
    touchManagedPtr widget
    touchManagedPtr selection
    touchManagedPtr target
    return result'


-- function gtk_selection_clear_targets
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an atom representing a selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

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

{- |
Remove all targets registered for the given selection for the
widget.
-}
selectionClearTargets ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: an atom representing a selection -}
    -> m ()
selectionClearTargets widget selection = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    selection' <- unsafeManagedPtrGetPtr selection
    gtk_selection_clear_targets widget' selection'
    touchManagedPtr widget
    touchManagedPtr selection
    return ()


-- function gtk_selection_add_targets
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "targets", argType = TCArray False (-1) 3 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a table of targets to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ntargets", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of entries in @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : [Arg {argCName = "ntargets", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "number of entries in @targets", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_selection_add_targets" gtk_selection_add_targets ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Ptr Gdk.Atom.Atom ->                    -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Ptr Gtk.TargetEntry.TargetEntry ->      -- targets : TCArray False (-1) 3 (TInterface (Name {namespace = "Gtk", name = "TargetEntry"}))
    Word32 ->                               -- ntargets : TBasicType TUInt
    IO ()

{- |
Prepends a table of targets to the list of supported targets
for a given widget and selection.
-}
selectionAddTargets ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: the selection -}
    -> [Gtk.TargetEntry.TargetEntry]
    {- ^ /@targets@/: a table of targets to add -}
    -> m ()
selectionAddTargets widget selection targets = liftIO $ do
    let ntargets = fromIntegral $ length targets
    widget' <- unsafeManagedPtrCastPtr widget
    selection' <- unsafeManagedPtrGetPtr selection
    targets' <- mapM unsafeManagedPtrGetPtr targets
    targets'' <- packBlockArray 16 targets'
    gtk_selection_add_targets widget' selection' targets'' ntargets
    touchManagedPtr widget
    touchManagedPtr selection
    mapM_ touchManagedPtr targets
    freeMem targets''
    return ()


-- function gtk_selection_add_target
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selection", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the selection", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "target", argType = TInterface (Name {namespace = "Gdk", name = "Atom"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "target to add.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "info", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A unsigned integer which will be passed back to the application.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_selection_add_target" gtk_selection_add_target ::
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    Ptr Gdk.Atom.Atom ->                    -- selection : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Ptr Gdk.Atom.Atom ->                    -- target : TInterface (Name {namespace = "Gdk", name = "Atom"})
    Word32 ->                               -- info : TBasicType TUInt
    IO ()

{- |
Appends a specified target to the list of supported targets for a
given widget and selection.
-}
selectionAddTarget ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> Gdk.Atom.Atom
    {- ^ /@selection@/: the selection -}
    -> Gdk.Atom.Atom
    {- ^ /@target@/: target to add. -}
    -> Word32
    {- ^ /@info@/: A unsigned integer which will be passed back to the application. -}
    -> m ()
selectionAddTarget widget selection target info = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    selection' <- unsafeManagedPtrGetPtr selection
    target' <- unsafeManagedPtrGetPtr target
    gtk_selection_add_target widget' selection' target' info
    touchManagedPtr widget
    touchManagedPtr selection
    touchManagedPtr target
    return ()


-- function gtk_rgb_to_hsv
-- Args : [Arg {argCName = "r", argType = TBasicType TDouble, 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 TDouble, 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 TDouble, 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 TDouble, 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 TDouble, 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 TDouble, 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 ::
    CDouble ->                              -- r : TBasicType TDouble
    CDouble ->                              -- g : TBasicType TDouble
    CDouble ->                              -- b : TBasicType TDouble
    Ptr CDouble ->                          -- h : TBasicType TDouble
    Ptr CDouble ->                          -- s : TBasicType TDouble
    Ptr CDouble ->                          -- v : TBasicType TDouble
    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.

/Since: 2.14/
-}
rgbToHsv ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Double
    {- ^ /@r@/: Red -}
    -> Double
    {- ^ /@g@/: Green -}
    -> Double
    {- ^ /@b@/: Blue -}
    -> m ((Double, Double, Double))
rgbToHsv r g b = liftIO $ do
    let r' = realToFrac r
    let g' = realToFrac g
    let b' = realToFrac b
    h <- allocMem :: IO (Ptr CDouble)
    s <- allocMem :: IO (Ptr CDouble)
    v <- allocMem :: IO (Ptr CDouble)
    gtk_rgb_to_hsv r' g' b' h s v
    h' <- peek h
    let h'' = realToFrac h'
    s' <- peek s
    let s'' = realToFrac s'
    v' <- peek v
    let v'' = realToFrac v'
    freeMem h
    freeMem s
    freeMem v
    return (h'', s'', v'')


-- function gtk_render_slider
-- 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},Arg {argCName = "orientation", argType = TInterface (Name {namespace = "Gtk", name = "Orientation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "orientation of the slider", 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_slider" gtk_render_slider ::
    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
    CUInt ->                                -- orientation : TInterface (Name {namespace = "Gtk", name = "Orientation"})
    IO ()

{- |
Renders a slider (as in 'GI.Gtk.Objects.Scale.Scale') in the rectangle defined by /@x@/, /@y@/,
/@width@/, /@height@/. /@orientation@/ defines whether the slider is vertical
or horizontal.

Typical slider rendering:

<<https://developer.gnome.org/gtk3/stable/sliders.png>>

/Since: 3.0/
-}
renderSlider ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 -}
    -> Gtk.Enums.Orientation
    {- ^ /@orientation@/: orientation of the slider -}
    -> m ()
renderSlider context cr x y width height orientation = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    let orientation' = (fromIntegral . fromEnum) orientation
    gtk_render_slider context' cr' x' y' width' height' orientation'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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 '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/gtk3/stable/options.png>>

/Since: 3.0/
-}
renderOption ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_option context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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).

/Since: 3.0/
-}
renderLine ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x0 y0 x1 y1 = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x0' = realToFrac x0
    let y0' = realToFrac y0
    let x1' = realToFrac x1
    let y1' = realToFrac y1
    gtk_render_line context' cr' x0' y0' x1' y1'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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@/

/Since: 3.0/
-}
renderLayout ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Double
    {- ^ /@x@/: X origin -}
    -> Double
    {- ^ /@y@/: Y origin -}
    -> b
    {- ^ /@layout@/: the 'GI.Pango.Objects.Layout.Layout' to render -}
    -> m ()
renderLayout context cr x y layout = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    layout' <- unsafeManagedPtrCastPtr layout
    gtk_render_layout context' cr' x' y' layout'
    touchManagedPtr context
    touchManagedPtr cr
    touchManagedPtr layout
    return ()


-- function gtk_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@/.

/Since: 3.4/
-}
renderInsertionCursor ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, Pango.Layout.IsLayout b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Double
    {- ^ /@x@/: X origin -}
    -> Double
    {- ^ /@y@/: Y origin -}
    -> b
    {- ^ /@layout@/: the 'GI.Pango.Objects.Layout.Layout' of the text -}
    -> Int32
    {- ^ /@index@/: the index in the 'GI.Pango.Objects.Layout.Layout' -}
    -> Pango.Enums.Direction
    {- ^ /@direction@/: the 'GI.Pango.Enums.Direction' of the text -}
    -> m ()
renderInsertionCursor context cr x y layout index direction = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    layout' <- unsafeManagedPtrCastPtr layout
    let direction' = (fromIntegral . fromEnum) direction
    gtk_render_insertion_cursor context' cr' x' y' layout' index direction'
    touchManagedPtr context
    touchManagedPtr cr
    touchManagedPtr layout
    return ()


-- function gtk_render_icon_surface
-- 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 = "surface", argType = TInterface (Name {namespace = "cairo", name = "Surface"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #cairo_surface_t 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 @icon", 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 @incon", 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_surface" gtk_render_icon_surface ::
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    Ptr Cairo.Surface.Surface ->            -- surface : TInterface (Name {namespace = "cairo", name = "Surface"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    IO ()

{- |
Renders the icon in /@surface@/ at the specified /@x@/ and /@y@/ coordinates.

/Since: 3.10/
-}
renderIconSurface ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Cairo.Surface.Surface
    {- ^ /@surface@/: a 'GI.Cairo.Structs.Surface.Surface' containing the icon to draw -}
    -> Double
    {- ^ /@x@/: X position for the /@icon@/ -}
    -> Double
    {- ^ /@y@/: Y position for the /@incon@/ -}
    -> m ()
renderIconSurface context cr surface x y = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    surface' <- unsafeManagedPtrGetPtr surface
    let x' = realToFrac x
    let y' = realToFrac y
    gtk_render_icon_surface context' cr' surface' x' y'
    touchManagedPtr context
    touchManagedPtr cr
    touchManagedPtr surface
    return ()


-- function gtk_render_icon_pixbuf
-- 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 = "source", argType = TInterface (Name {namespace = "Gtk", name = "IconSource"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkIconSource specifying the icon to render", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the size (#GtkIconSize) to render the icon at.\n       A size of `(GtkIconSize) -1` means render at the size of the source\n       and don\8217t scale.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_icon_pixbuf" gtk_render_icon_pixbuf ::
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gtk.IconSource.IconSource ->        -- source : TInterface (Name {namespace = "Gtk", name = "IconSource"})
    Int32 ->                                -- size : TBasicType TInt
    IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)

{-# DEPRECATED renderIconPixbuf ["(Since version 3.10)","Use 'GI.Gtk.Objects.IconTheme.iconThemeLoadIcon' instead."] #-}
{- |
Renders the icon specified by /@source@/ at the given /@size@/, returning the result
in a pixbuf.

/Since: 3.0/
-}
renderIconPixbuf ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Gtk.IconSource.IconSource
    {- ^ /@source@/: the 'GI.Gtk.Structs.IconSource.IconSource' specifying the icon to render -}
    -> Int32
    {- ^ /@size@/: the size ('GI.Gtk.Enums.IconSize') to render the icon at.
       A size of @(GtkIconSize) -1@ means render at the size of the source
       and don’t scale. -}
    -> m GdkPixbuf.Pixbuf.Pixbuf
    {- ^ __Returns:__ a newly-created 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' containing the rendered icon -}
renderIconPixbuf context source size = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    source' <- unsafeManagedPtrGetPtr source
    result <- gtk_render_icon_pixbuf context' source' size
    checkUnexpectedReturnNULL "renderIconPixbuf" result
    result' <- (wrapObject GdkPixbuf.Pixbuf.Pixbuf) result
    touchManagedPtr context
    touchManagedPtr source
    return result'


-- function gtk_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 = "pixbuf", argType = TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbuf 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 @pixbuf", 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 @pixbuf", 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 GdkPixbuf.Pixbuf.Pixbuf ->          -- pixbuf : TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    IO ()

{- |
Renders the icon in /@pixbuf@/ at the specified /@x@/ and /@y@/ coordinates.

This function will render the icon in /@pixbuf@/ at exactly its size,
regardless of scaling factors, which may not be appropriate when
drawing on displays with high pixel densities.

You probably want to use 'GI.Gtk.Functions.renderIconSurface' instead, if you
already have a Cairo surface.

/Since: 3.2/
-}
renderIcon ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a, GdkPixbuf.Pixbuf.IsPixbuf b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> b
    {- ^ /@pixbuf@/: a 'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' containing the icon to draw -}
    -> Double
    {- ^ /@x@/: X position for the /@pixbuf@/ -}
    -> Double
    {- ^ /@y@/: Y position for the /@pixbuf@/ -}
    -> m ()
renderIcon context cr pixbuf x y = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    pixbuf' <- unsafeManagedPtrCastPtr pixbuf
    let x' = realToFrac x
    let y' = realToFrac y
    gtk_render_icon context' cr' pixbuf' x' y'
    touchManagedPtr context
    touchManagedPtr cr
    touchManagedPtr pixbuf
    return ()


-- function gtk_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 'GI.Gtk.Objects.HandleBox.HandleBox', 'GI.Gtk.Objects.Paned.Paned' and
'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/gtk3/stable/handles.png>>

/Since: 3.0/
-}
renderHandle ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_handle context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_render_frame_gap
-- 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},Arg {argCName = "gap_side", argType = TInterface (Name {namespace = "Gtk", name = "PositionType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "side where the gap is", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "xy0_gap", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "initial coordinate (X or Y depending on @gap_side) for the gap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "xy1_gap", argType = TBasicType TDouble, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "end coordinate (X or Y depending on @gap_side) for the gap", 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_gap" gtk_render_frame_gap ::
    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
    CUInt ->                                -- gap_side : TInterface (Name {namespace = "Gtk", name = "PositionType"})
    CDouble ->                              -- xy0_gap : TBasicType TDouble
    CDouble ->                              -- xy1_gap : TBasicType TDouble
    IO ()

{-# DEPRECATED renderFrameGap ["(Since version 3.24)","Use 'GI.Gtk.Functions.renderFrame' instead. Themes can create gaps","    by omitting borders via CSS."] #-}
{- |
Renders a frame around the rectangle defined by (/@x@/, /@y@/, /@width@/, /@height@/),
leaving a gap on one side. /@xy0Gap@/ and /@xy1Gap@/ will mean X coordinates
for 'GI.Gtk.Enums.PositionTypeTop' and 'GI.Gtk.Enums.PositionTypeBottom' gap sides, and Y coordinates for
'GI.Gtk.Enums.PositionTypeLeft' and 'GI.Gtk.Enums.PositionTypeRight'.

Typical rendering of a frame with a gap:

<<https://developer.gnome.org/gtk3/stable/frame-gap.png>>

/Since: 3.0/
-}
renderFrameGap ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 -}
    -> Gtk.Enums.PositionType
    {- ^ /@gapSide@/: side where the gap is -}
    -> Double
    {- ^ /@xy0Gap@/: initial coordinate (X or Y depending on /@gapSide@/) for the gap -}
    -> Double
    {- ^ /@xy1Gap@/: end coordinate (X or Y depending on /@gapSide@/) for the gap -}
    -> m ()
renderFrameGap context cr x y width height gapSide xy0Gap xy1Gap = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    let gapSide' = (fromIntegral . fromEnum) gapSide
    let xy0Gap' = realToFrac xy0Gap
    let xy1Gap' = realToFrac xy1Gap
    gtk_render_frame_gap context' cr' x' y' width' height' gapSide' xy0Gap' xy1Gap'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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/gtk3/stable/frames.png>>

/Since: 3.0/
-}
renderFrame ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_frame context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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/gtk3/stable/focus.png>>

/Since: 3.0/
-}
renderFocus ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_focus context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_render_extension
-- 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},Arg {argCName = "gap_side", argType = TInterface (Name {namespace = "Gtk", name = "PositionType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "side where the gap is", 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_extension" gtk_render_extension ::
    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
    CUInt ->                                -- gap_side : TInterface (Name {namespace = "Gtk", name = "PositionType"})
    IO ()

{- |
Renders a extension (as in a 'GI.Gtk.Objects.Notebook.Notebook' tab) in the rectangle
defined by /@x@/, /@y@/, /@width@/, /@height@/. The side where the extension
connects to is defined by /@gapSide@/.

Typical extension rendering:

<<https://developer.gnome.org/gtk3/stable/extensions.png>>

/Since: 3.0/
-}
renderExtension ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 -}
    -> Gtk.Enums.PositionType
    {- ^ /@gapSide@/: side where the gap is -}
    -> m ()
renderExtension context cr x y width height gapSide = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    let gapSide' = (fromIntegral . fromEnum) gapSide
    gtk_render_extension context' cr' x' y' width' height' gapSide'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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 'GI.Gtk.Objects.TreeView.TreeView' and '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/gtk3/stable/expanders.png>>

/Since: 3.0/
-}
renderExpander ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_expander context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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 '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/gtk3/stable/checks.png>>

/Since: 3.0/
-}
renderCheck ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_check context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_render_background_get_clip
-- 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 = "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},Arg {argCName = "out_clip", argType = TInterface (Name {namespace = "Gdk", name = "Rectangle"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the clip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_render_background_get_clip" gtk_render_background_get_clip ::
    Ptr Gtk.StyleContext.StyleContext ->    -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CDouble ->                              -- x : TBasicType TDouble
    CDouble ->                              -- y : TBasicType TDouble
    CDouble ->                              -- width : TBasicType TDouble
    CDouble ->                              -- height : TBasicType TDouble
    Ptr Gdk.Rectangle.Rectangle ->          -- out_clip : TInterface (Name {namespace = "Gdk", name = "Rectangle"})
    IO ()

{- |
Returns the area that will be affected (i.e. drawn to) when
calling 'GI.Gtk.Functions.renderBackground' for the given /@context@/ and
rectangle.

/Since: 3.20/
-}
renderBackgroundGetClip ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Double
    {- ^ /@x@/: X origin of the rectangle -}
    -> Double
    {- ^ /@y@/: Y origin of the rectangle -}
    -> Double
    {- ^ /@width@/: rectangle width -}
    -> Double
    {- ^ /@height@/: rectangle height -}
    -> m (Gdk.Rectangle.Rectangle)
renderBackgroundGetClip context x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    outClip <- callocBoxedBytes 16 :: IO (Ptr Gdk.Rectangle.Rectangle)
    gtk_render_background_get_clip context' x' y' width' height' outClip
    outClip' <- (wrapBoxed Gdk.Rectangle.Rectangle) outClip
    touchManagedPtr context
    return outClip'


-- function gtk_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/gtk3/stable/background.png>>

/Since: 3.0./
-}
renderBackground ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_background context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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/gtk3/stable/arrows.png>>

/Since: 3.0/
-}
renderArrow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr angle x y size = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let angle' = realToFrac angle
    let x' = realToFrac x
    let y' = realToFrac y
    let size' = realToFrac size
    gtk_render_arrow context' cr' angle' x' y' size'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_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 'GI.Gtk.Objects.Spinner.Spinner').
The state 'GI.Gtk.Flags.StateFlagsChecked' determines whether there is
activity going on.

/Since: 3.0/
-}
renderActivity ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.StyleContext.IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a '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 context cr x y width height = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    cr' <- unsafeManagedPtrGetPtr cr
    let x' = realToFrac x
    let y' = realToFrac y
    let width' = realToFrac width
    let height' = realToFrac height
    gtk_render_activity context' cr' x' y' width' height'
    touchManagedPtr context
    touchManagedPtr cr
    return ()


-- function gtk_rc_set_default_files
-- Args : [Arg {argCName = "filenames", argType = TCArray True (-1) (-1) (TBasicType TFileName), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A\n    %NULL-terminated list of filenames.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_set_default_files" gtk_rc_set_default_files ::
    Ptr CString ->                          -- filenames : TCArray True (-1) (-1) (TBasicType TFileName)
    IO ()

{-# DEPRECATED rcSetDefaultFiles ["(Since version 3.0)","Use 'GI.Gtk.Objects.StyleContext.StyleContext' with a custom 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' instead"] #-}
{- |
Sets the list of files that GTK+ will read at the
end of 'GI.Gtk.Functions.init'.
-}
rcSetDefaultFiles ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [[Char]]
    {- ^ /@filenames@/: A
    'Nothing'-terminated list of filenames. -}
    -> m ()
rcSetDefaultFiles filenames = liftIO $ do
    filenames' <- packZeroTerminatedFileNameArray filenames
    gtk_rc_set_default_files filenames'
    mapZeroTerminatedCArray freeMem filenames'
    freeMem filenames'
    return ()


-- function gtk_rc_reset_styles
-- Args : [Arg {argCName = "settings", argType = TInterface (Name {namespace = "Gtk", name = "Settings"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSettings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_reset_styles" gtk_rc_reset_styles ::
    Ptr Gtk.Settings.Settings ->            -- settings : TInterface (Name {namespace = "Gtk", name = "Settings"})
    IO ()

{-# DEPRECATED rcResetStyles ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
This function recomputes the styles for all widgets that use a
particular 'GI.Gtk.Objects.Settings.Settings' object. (There is one 'GI.Gtk.Objects.Settings.Settings' object
per 'GI.Gdk.Objects.Screen.Screen', see 'GI.Gtk.Objects.Settings.settingsGetForScreen'); It is useful
when some global parameter has changed that affects the appearance
of all widgets, because when a widget gets a new style, it will
both redraw and recompute any cached information about its
appearance. As an example, it is used when the default font size
set by the operating system changes. Note that this function
doesn’t affect widgets that have a style set explicitly on them
with 'GI.Gtk.Objects.Widget.widgetSetStyle'.

/Since: 2.4/
-}
rcResetStyles ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Settings.IsSettings a) =>
    a
    {- ^ /@settings@/: a 'GI.Gtk.Objects.Settings.Settings' -}
    -> m ()
rcResetStyles settings = liftIO $ do
    settings' <- unsafeManagedPtrCastPtr settings
    gtk_rc_reset_styles settings'
    touchManagedPtr settings
    return ()


-- function gtk_rc_reparse_all_for_settings
-- Args : [Arg {argCName = "settings", argType = TInterface (Name {namespace = "Gtk", name = "Settings"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSettings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "force_load", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "load whether or not anything changed", 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_rc_reparse_all_for_settings" gtk_rc_reparse_all_for_settings ::
    Ptr Gtk.Settings.Settings ->            -- settings : TInterface (Name {namespace = "Gtk", name = "Settings"})
    CInt ->                                 -- force_load : TBasicType TBoolean
    IO CInt

{-# DEPRECATED rcReparseAllForSettings ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
If the modification time on any previously read file
for the given 'GI.Gtk.Objects.Settings.Settings' has changed, discard all style information
and then reread all previously read RC files.
-}
rcReparseAllForSettings ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Settings.IsSettings a) =>
    a
    {- ^ /@settings@/: a 'GI.Gtk.Objects.Settings.Settings' -}
    -> Bool
    {- ^ /@forceLoad@/: load whether or not anything changed -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the files were reread. -}
rcReparseAllForSettings settings forceLoad = liftIO $ do
    settings' <- unsafeManagedPtrCastPtr settings
    let forceLoad' = (fromIntegral . fromEnum) forceLoad
    result <- gtk_rc_reparse_all_for_settings settings' forceLoad'
    let result' = (/= 0) result
    touchManagedPtr settings
    return result'


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

foreign import ccall "gtk_rc_reparse_all" gtk_rc_reparse_all ::
    IO CInt

{-# DEPRECATED rcReparseAll ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
If the modification time on any previously read file for the
default 'GI.Gtk.Objects.Settings.Settings' has changed, discard all style information
and then reread all previously read RC files.
-}
rcReparseAll ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    {- ^ __Returns:__ 'True' if the files were reread. -}
rcReparseAll  = liftIO $ do
    result <- gtk_rc_reparse_all
    let result' = (/= 0) result
    return result'


-- function gtk_rc_parse_string
-- Args : [Arg {argCName = "rc_string", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string to parse.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse_string" gtk_rc_parse_string ::
    CString ->                              -- rc_string : TBasicType TUTF8
    IO ()

{-# DEPRECATED rcParseString ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Parses resource information directly from a string.
-}
rcParseString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@rcString@/: a string to parse. -}
    -> m ()
rcParseString rcString = liftIO $ do
    rcString' <- textToCString rcString
    gtk_rc_parse_string rcString'
    freeMem rcString'
    return ()


-- function gtk_rc_parse_state
-- Args : [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner (must be initialized for parsing an RC file)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to a #GtkStateType variable in which to\n store the result.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse_state" gtk_rc_parse_state ::
    Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Ptr CUInt ->                            -- state : TInterface (Name {namespace = "Gtk", name = "StateType"})
    IO Word32

{-# DEPRECATED rcParseState ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead"] #-}
{- |
Parses a 'GI.Gtk.Enums.StateType' variable from the format expected
in a RC file.
-}
rcParseState ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Scanner.Scanner
    {- ^ /@scanner@/: a 'GI.GLib.Structs.Scanner.Scanner' (must be initialized for parsing an RC file) -}
    -> m ((Word32, Gtk.Enums.StateType))
    {- ^ __Returns:__ 'GI.GLib.Enums.TokenTypeNone' if parsing succeeded, otherwise the token
  that was expected but not found. -}
rcParseState scanner = liftIO $ do
    scanner' <- unsafeManagedPtrGetPtr scanner
    state <- allocMem :: IO (Ptr CUInt)
    result <- gtk_rc_parse_state scanner' state
    state' <- peek state
    let state'' = (toEnum . fromIntegral) state'
    touchManagedPtr scanner
    freeMem state
    return (result, state'')


-- function gtk_rc_parse_priority
-- Args : [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner (must be initialized for parsing an RC file)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "priority", argType = TInterface (Name {namespace = "Gtk", name = "PathPriorityType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A pointer to #GtkPathPriorityType variable in which\n to store the result.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse_priority" gtk_rc_parse_priority ::
    Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    CUInt ->                                -- priority : TInterface (Name {namespace = "Gtk", name = "PathPriorityType"})
    IO Word32

{-# DEPRECATED rcParsePriority ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead"] #-}
{- |
Parses a 'GI.Gtk.Enums.PathPriorityType' variable from the format expected
in a RC file.
-}
rcParsePriority ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Scanner.Scanner
    {- ^ /@scanner@/: a 'GI.GLib.Structs.Scanner.Scanner' (must be initialized for parsing an RC file) -}
    -> Gtk.Enums.PathPriorityType
    {- ^ /@priority@/: A pointer to 'GI.Gtk.Enums.PathPriorityType' variable in which
 to store the result. -}
    -> m Word32
    {- ^ __Returns:__ 'GI.GLib.Enums.TokenTypeNone' if parsing succeeded, otherwise the token
  that was expected but not found. -}
rcParsePriority scanner priority = liftIO $ do
    scanner' <- unsafeManagedPtrGetPtr scanner
    let priority' = (fromIntegral . fromEnum) priority
    result <- gtk_rc_parse_priority scanner' priority'
    touchManagedPtr scanner
    return result


-- function gtk_rc_parse_color_full
-- Args : [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "RcStyle"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkRcStyle, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "Color"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to a #GdkColor in which to store\n    the result", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse_color_full" gtk_rc_parse_color_full ::
    Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Ptr Gtk.RcStyle.RcStyle ->              -- style : TInterface (Name {namespace = "Gtk", name = "RcStyle"})
    Ptr Gdk.Color.Color ->                  -- color : TInterface (Name {namespace = "Gdk", name = "Color"})
    IO Word32

{-# DEPRECATED rcParseColorFull ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead"] #-}
{- |
Parses a color in the format expected
in a RC file. If /@style@/ is not 'Nothing', it will be consulted to resolve
references to symbolic colors.

/Since: 2.12/
-}
rcParseColorFull ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.RcStyle.IsRcStyle a) =>
    GLib.Scanner.Scanner
    {- ^ /@scanner@/: a 'GI.GLib.Structs.Scanner.Scanner' -}
    -> Maybe (a)
    {- ^ /@style@/: a 'GI.Gtk.Objects.RcStyle.RcStyle', or 'Nothing' -}
    -> m ((Word32, Gdk.Color.Color))
    {- ^ __Returns:__ 'GI.GLib.Enums.TokenTypeNone' if parsing succeeded, otherwise the token
    that was expected but not found -}
rcParseColorFull scanner style = liftIO $ do
    scanner' <- unsafeManagedPtrGetPtr scanner
    maybeStyle <- case style of
        Nothing -> return nullPtr
        Just jStyle -> do
            jStyle' <- unsafeManagedPtrCastPtr jStyle
            return jStyle'
    color <- callocBoxedBytes 12 :: IO (Ptr Gdk.Color.Color)
    result <- gtk_rc_parse_color_full scanner' maybeStyle color
    color' <- (wrapBoxed Gdk.Color.Color) color
    touchManagedPtr scanner
    whenJust style touchManagedPtr
    return (result, color')


-- function gtk_rc_parse_color
-- Args : [Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GScanner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "Color"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to a #GdkColor in which to store\n    the result", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse_color" gtk_rc_parse_color ::
    Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Ptr Gdk.Color.Color ->                  -- color : TInterface (Name {namespace = "Gdk", name = "Color"})
    IO Word32

{-# DEPRECATED rcParseColor ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead"] #-}
{- |
Parses a color in the format expected
in a RC file.

Note that theme engines should use 'GI.Gtk.Functions.rcParseColorFull' in
order to support symbolic colors.
-}
rcParseColor ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Scanner.Scanner
    {- ^ /@scanner@/: a 'GI.GLib.Structs.Scanner.Scanner' -}
    -> m ((Word32, Gdk.Color.Color))
    {- ^ __Returns:__ 'GI.GLib.Enums.TokenTypeNone' if parsing succeeded, otherwise the token
    that was expected but not found -}
rcParseColor scanner = liftIO $ do
    scanner' <- unsafeManagedPtrGetPtr scanner
    color <- callocBoxedBytes 12 :: IO (Ptr Gdk.Color.Color)
    result <- gtk_rc_parse_color scanner' color
    color' <- (wrapBoxed Gdk.Color.Color) color
    touchManagedPtr scanner
    return (result, color')


-- function gtk_rc_parse
-- Args : [Arg {argCName = "filename", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the filename of a file to parse. If @filename is not absolute, it\n is searched in the current directory.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_parse" gtk_rc_parse ::
    CString ->                              -- filename : TBasicType TUTF8
    IO ()

{-# DEPRECATED rcParse ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Parses a given resource file.
-}
rcParse ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@filename@/: the filename of a file to parse. If /@filename@/ is not absolute, it
 is searched in the current directory. -}
    -> m ()
rcParse filename = liftIO $ do
    filename' <- textToCString filename
    gtk_rc_parse filename'
    freeMem filename'
    return ()


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

foreign import ccall "gtk_rc_get_theme_dir" gtk_rc_get_theme_dir ::
    IO CString

{-# DEPRECATED rcGetThemeDir ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Returns the standard directory in which themes should
be installed. (GTK+ does not actually use this directory
itself.)
-}
rcGetThemeDir ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m T.Text
    {- ^ __Returns:__ The directory (must be freed with 'GI.GLib.Functions.free'). -}
rcGetThemeDir  = liftIO $ do
    result <- gtk_rc_get_theme_dir
    checkUnexpectedReturnNULL "rcGetThemeDir" result
    result' <- cstringToText result
    freeMem result
    return result'


-- function gtk_rc_get_style_by_paths
-- Args : [Arg {argCName = "settings", argType = TInterface (Name {namespace = "Gtk", name = "Settings"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSettings object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget path to use when looking up the\n    style, or %NULL if no matching against the widget path should be done", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "class_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the class path to use when looking up the style,\n    or %NULL if no matching against the class path should be done.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "type", argType = TBasicType TGType, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a type that will be used along with parent types of this type\n    when matching against class styles, or #G_TYPE_NONE", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Style"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_get_style_by_paths" gtk_rc_get_style_by_paths ::
    Ptr Gtk.Settings.Settings ->            -- settings : TInterface (Name {namespace = "Gtk", name = "Settings"})
    CString ->                              -- widget_path : TBasicType TUTF8
    CString ->                              -- class_path : TBasicType TUTF8
    CGType ->                               -- type : TBasicType TGType
    IO (Ptr Gtk.Style.Style)

{-# DEPRECATED rcGetStyleByPaths ["(Since version 3.0)","Use 'GI.Gtk.Objects.StyleContext.StyleContext' instead"] #-}
{- |
Creates up a 'GI.Gtk.Objects.Style.Style' from styles defined in a RC file by providing
the raw components used in matching. This function may be useful
when creating pseudo-widgets that should be themed like widgets but
don’t actually have corresponding GTK+ widgets. An example of this
would be items inside a GNOME canvas widget.

The action of 'GI.Gtk.Functions.rcGetStyle' is similar to:

=== /C code/
>
> gtk_widget_path (widget, NULL, &path, NULL);
> gtk_widget_class_path (widget, NULL, &class_path, NULL);
> gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
>                            path, class_path,
>                            G_OBJECT_TYPE (widget));
-}
rcGetStyleByPaths ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Settings.IsSettings a) =>
    a
    {- ^ /@settings@/: a 'GI.Gtk.Objects.Settings.Settings' object -}
    -> Maybe (T.Text)
    {- ^ /@widgetPath@/: the widget path to use when looking up the
    style, or 'Nothing' if no matching against the widget path should be done -}
    -> Maybe (T.Text)
    {- ^ /@classPath@/: the class path to use when looking up the style,
    or 'Nothing' if no matching against the class path should be done. -}
    -> GType
    {- ^ /@type@/: a type that will be used along with parent types of this type
    when matching against class styles, or @/G_TYPE_NONE/@ -}
    -> m (Maybe Gtk.Style.Style)
    {- ^ __Returns:__ A style created by matching
    with the supplied paths, or 'Nothing' if nothing matching was
    specified and the default style should be used. The returned
    value is owned by GTK+ as part of an internal cache, so you
    must call 'GI.GObject.Objects.Object.objectRef' on the returned value if you want to
    keep a reference to it. -}
rcGetStyleByPaths settings widgetPath classPath type_ = liftIO $ do
    settings' <- unsafeManagedPtrCastPtr settings
    maybeWidgetPath <- case widgetPath of
        Nothing -> return nullPtr
        Just jWidgetPath -> do
            jWidgetPath' <- textToCString jWidgetPath
            return jWidgetPath'
    maybeClassPath <- case classPath of
        Nothing -> return nullPtr
        Just jClassPath -> do
            jClassPath' <- textToCString jClassPath
            return jClassPath'
    let type_' = gtypeToCGType type_
    result <- gtk_rc_get_style_by_paths settings' maybeWidgetPath maybeClassPath type_'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.Style.Style) result'
        return result''
    touchManagedPtr settings
    freeMem maybeWidgetPath
    freeMem maybeClassPath
    return maybeResult


-- function gtk_rc_get_style
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Style"}))
-- throws : False
-- Skip return : False

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

{-# DEPRECATED rcGetStyle ["(Since version 3.0)","Use 'GI.Gtk.Objects.StyleContext.StyleContext' instead"] #-}
{- |
Finds all matching RC styles for a given widget,
composites them together, and then creates a
'GI.Gtk.Objects.Style.Style' representing the composite appearance.
(GTK+ actually keeps a cache of previously
created styles, so a new style may not be
created.)
-}
rcGetStyle ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> m Gtk.Style.Style
    {- ^ __Returns:__ the resulting style. No refcount is added
  to the returned style, so if you want to save this style around,
  you should add a reference yourself. -}
rcGetStyle widget = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    result <- gtk_rc_get_style widget'
    checkUnexpectedReturnNULL "rcGetStyle" result
    result' <- (newObject Gtk.Style.Style) result
    touchManagedPtr widget
    return result'


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

foreign import ccall "gtk_rc_get_module_dir" gtk_rc_get_module_dir ::
    IO CString

{-# DEPRECATED rcGetModuleDir ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Returns a directory in which GTK+ looks for theme engines.
For full information about the search for theme engines,
see the docs for @GTK_PATH@ in [Running GTK+ Applications][gtk-running].
-}
rcGetModuleDir ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Char]
    {- ^ __Returns:__ the directory. (Must be freed with 'GI.GLib.Functions.free') -}
rcGetModuleDir  = liftIO $ do
    result <- gtk_rc_get_module_dir
    checkUnexpectedReturnNULL "rcGetModuleDir" result
    result' <- cstringToString result
    freeMem result
    return result'


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

foreign import ccall "gtk_rc_get_im_module_path" gtk_rc_get_im_module_path ::
    IO CString

{-# DEPRECATED rcGetImModulePath ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Obtains the path in which to look for IM modules. See the documentation
of the @GTK_PATH@
environment variable for more details about looking up modules. This
function is useful solely for utilities supplied with GTK+ and should
not be used by applications under normal circumstances.
-}
rcGetImModulePath ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Char]
    {- ^ __Returns:__ a newly-allocated string containing the
   path in which to look for IM modules. -}
rcGetImModulePath  = liftIO $ do
    result <- gtk_rc_get_im_module_path
    checkUnexpectedReturnNULL "rcGetImModulePath" result
    result' <- cstringToString result
    freeMem result
    return result'


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

foreign import ccall "gtk_rc_get_im_module_file" gtk_rc_get_im_module_file ::
    IO CString

{-# DEPRECATED rcGetImModuleFile ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Obtains the path to the IM modules file. See the documentation
of the @GTK_IM_MODULE_FILE@
environment variable for more details.
-}
rcGetImModuleFile ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Char]
    {- ^ __Returns:__ a newly-allocated string containing the
   name of the file listing the IM modules available for loading -}
rcGetImModuleFile  = liftIO $ do
    result <- gtk_rc_get_im_module_file
    checkUnexpectedReturnNULL "rcGetImModuleFile" result
    result' <- cstringToString result
    freeMem result
    return result'


-- function gtk_rc_get_default_files
-- Args : []
-- Lengths : []
-- returnType : Just (TCArray True (-1) (-1) (TBasicType TFileName))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_get_default_files" gtk_rc_get_default_files ::
    IO (Ptr CString)

{-# DEPRECATED rcGetDefaultFiles ["(Since version 3.0)","Use 'GI.Gtk.Objects.StyleContext.StyleContext' instead"] #-}
{- |
Retrieves the current list of RC files that will be parsed
at the end of 'GI.Gtk.Functions.init'.
-}
rcGetDefaultFiles ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [[Char]]
    {- ^ __Returns:__ 
     A 'Nothing'-terminated array of filenames.  This memory is owned
    by GTK+ and must not be freed by the application.  If you want
    to store this information, you should make a copy. -}
rcGetDefaultFiles  = liftIO $ do
    result <- gtk_rc_get_default_files
    checkUnexpectedReturnNULL "rcGetDefaultFiles" result
    result' <- unpackZeroTerminatedFileNameArray result
    return result'


-- function gtk_rc_find_pixmap_in_path
-- Args : [Arg {argCName = "settings", argType = TInterface (Name {namespace = "Gtk", name = "Settings"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkSettings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "scanner", argType = TInterface (Name {namespace = "GLib", name = "Scanner"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Scanner used to get line number information for the\n  warning message, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "pixmap_file", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of the pixmap file to locate.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TFileName)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_find_pixmap_in_path" gtk_rc_find_pixmap_in_path ::
    Ptr Gtk.Settings.Settings ->            -- settings : TInterface (Name {namespace = "Gtk", name = "Settings"})
    Ptr GLib.Scanner.Scanner ->             -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    CString ->                              -- pixmap_file : TBasicType TUTF8
    IO CString

{-# DEPRECATED rcFindPixmapInPath ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Looks up a file in pixmap path for the specified 'GI.Gtk.Objects.Settings.Settings'.
If the file is not found, it outputs a warning message using
@/g_warning()/@ and returns 'Nothing'.
-}
rcFindPixmapInPath ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Settings.IsSettings a) =>
    a
    {- ^ /@settings@/: a 'GI.Gtk.Objects.Settings.Settings' -}
    -> GLib.Scanner.Scanner
    {- ^ /@scanner@/: Scanner used to get line number information for the
  warning message, or 'Nothing' -}
    -> T.Text
    {- ^ /@pixmapFile@/: name of the pixmap file to locate. -}
    -> m [Char]
    {- ^ __Returns:__ the filename. -}
rcFindPixmapInPath settings scanner pixmapFile = liftIO $ do
    settings' <- unsafeManagedPtrCastPtr settings
    scanner' <- unsafeManagedPtrGetPtr scanner
    pixmapFile' <- textToCString pixmapFile
    result <- gtk_rc_find_pixmap_in_path settings' scanner' pixmapFile'
    checkUnexpectedReturnNULL "rcFindPixmapInPath" result
    result' <- cstringToString result
    freeMem result
    touchManagedPtr settings
    touchManagedPtr scanner
    freeMem pixmapFile'
    return result'


-- function gtk_rc_find_module_in_path
-- Args : [Arg {argCName = "module_file", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "name of a theme engine", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TFileName)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_find_module_in_path" gtk_rc_find_module_in_path ::
    CString ->                              -- module_file : TBasicType TUTF8
    IO CString

{-# DEPRECATED rcFindModuleInPath ["(Since version 3.0)","Use 'GI.Gtk.Objects.CssProvider.CssProvider' instead."] #-}
{- |
Searches for a theme engine in the GTK+ search path. This function
is not useful for applications and should not be used.
-}
rcFindModuleInPath ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    {- ^ /@moduleFile@/: name of a theme engine -}
    -> m [Char]
    {- ^ __Returns:__ The filename, if found (must be
  freed with 'GI.GLib.Functions.free'), otherwise 'Nothing'. -}
rcFindModuleInPath moduleFile = liftIO $ do
    moduleFile' <- textToCString moduleFile
    result <- gtk_rc_find_module_in_path moduleFile'
    checkUnexpectedReturnNULL "rcFindModuleInPath" result
    result' <- cstringToString result
    freeMem result
    freeMem moduleFile'
    return result'


-- function gtk_rc_add_default_file
-- Args : [Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pathname to the file. If @filename\n   is not absolute, it is searched in the current directory.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_rc_add_default_file" gtk_rc_add_default_file ::
    CString ->                              -- filename : TBasicType TFileName
    IO ()

{-# DEPRECATED rcAddDefaultFile ["(Since version 3.0)","Use 'GI.Gtk.Objects.StyleContext.StyleContext' with a custom 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' instead"] #-}
{- |
Adds a file to the list of files to be parsed at the
end of 'GI.Gtk.Functions.init'.
-}
rcAddDefaultFile ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [Char]
    {- ^ /@filename@/: the pathname to the file. If /@filename@/
   is not absolute, it is searched in the current directory. -}
    -> m ()
rcAddDefaultFile filename = liftIO $ do
    filename' <- stringToCString filename
    gtk_rc_add_default_file filename'
    freeMem filename'
    return ()


-- function gtk_propagate_event
-- Args : [Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gdk", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an event", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

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

{- |
Sends an event to a widget, propagating the event to parent widgets
if the event remains unhandled.

Events received by GTK+ from GDK normally begin in 'GI.Gtk.Functions.mainDoEvent'.
Depending on the type of event, existence of modal dialogs, grabs, etc.,
the event may be propagated; if so, this function is used.

'GI.Gtk.Functions.propagateEvent' calls 'GI.Gtk.Objects.Widget.widgetEvent' on each widget it
decides to send the event to. So 'GI.Gtk.Objects.Widget.widgetEvent' is the lowest-level
function; it simply emits the 'GI.Gtk.Objects.Widget.Widget'::@/event/@ and possibly an
event-specific signal on a widget. 'GI.Gtk.Functions.propagateEvent' is a bit
higher-level, and 'GI.Gtk.Functions.mainDoEvent' is the highest level.

All that said, you most likely don’t want to use any of these
functions; synthesizing events is rarely needed. There are almost
certainly better ways to achieve your goals. For example, use
'GI.Gdk.Objects.Window.windowInvalidateRect' or 'GI.Gtk.Objects.Widget.widgetQueueDraw' instead
of making up expose events.
-}
propagateEvent ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Widget.IsWidget a) =>
    a
    {- ^ /@widget@/: a 'GI.Gtk.Objects.Widget.Widget' -}
    -> Gdk.Event.Event
    {- ^ /@event@/: an event -}
    -> m ()
propagateEvent widget event = liftIO $ do
    widget' <- unsafeManagedPtrCastPtr widget
    event' <- unsafeManagedPtrGetPtr event
    gtk_propagate_event widget' event'
    touchManagedPtr widget
    touchManagedPtr event
    return ()


-- function gtk_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 signal of the dialog.

/Since: 2.10/
-}
printRunPageSetupDialogAsync ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Window.IsWindow a, Gtk.PageSetup.IsPageSetup b, Gtk.PrintSettings.IsPrintSettings c) =>
    Maybe (a)
    {- ^ /@parent@/: transient parent, or 'Nothing' -}
    -> Maybe (b)
    {- ^ /@pageSetup@/: an existing 'GI.Gtk.Objects.PageSetup.PageSetup', or 'Nothing' -}
    -> c
    {- ^ /@settings@/: a 'GI.Gtk.Objects.PrintSettings.PrintSettings' -}
    -> Gtk.Callbacks.PageSetupDoneFunc
    {- ^ /@doneCb@/: a function to call when the user saves
          the modified page setup -}
    -> m ()
printRunPageSetupDialogAsync parent pageSetup settings doneCb = liftIO $ do
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    maybePageSetup <- case pageSetup of
        Nothing -> return nullPtr
        Just jPageSetup -> do
            jPageSetup' <- unsafeManagedPtrCastPtr jPageSetup
            return jPageSetup'
    settings' <- unsafeManagedPtrCastPtr settings
    ptrdoneCb <- callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_PageSetupDoneFunc))
    doneCb' <- Gtk.Callbacks.mk_PageSetupDoneFunc (Gtk.Callbacks.wrap_PageSetupDoneFunc (Just ptrdoneCb) (Gtk.Callbacks.drop_closures_PageSetupDoneFunc doneCb))
    poke ptrdoneCb doneCb'
    let data_ = nullPtr
    gtk_print_run_page_setup_dialog_async maybeParent maybePageSetup settings' doneCb' data_
    whenJust parent touchManagedPtr
    whenJust pageSetup touchManagedPtr
    touchManagedPtr settings
    return ()


-- function gtk_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 '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.

/Since: 2.10/
-}
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 'GI.Gtk.Objects.PageSetup.PageSetup' -}
    -> c
    {- ^ /@settings@/: a 'GI.Gtk.Objects.PrintSettings.PrintSettings' -}
    -> m Gtk.PageSetup.PageSetup
    {- ^ __Returns:__ a new 'GI.Gtk.Objects.PageSetup.PageSetup' -}
printRunPageSetupDialog parent pageSetup settings = liftIO $ do
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    maybePageSetup <- case pageSetup of
        Nothing -> return nullPtr
        Just jPageSetup -> do
            jPageSetup' <- unsafeManagedPtrCastPtr jPageSetup
            return jPageSetup'
    settings' <- unsafeManagedPtrCastPtr settings
    result <- gtk_print_run_page_setup_dialog maybeParent maybePageSetup settings'
    checkUnexpectedReturnNULL "printRunPageSetupDialog" result
    result' <- (wrapObject Gtk.PageSetup.PageSetup) result
    whenJust parent touchManagedPtr
    whenJust pageSetup touchManagedPtr
    touchManagedPtr settings
    return result'


-- function gtk_parse_args
-- Args : [Arg {argCName = "argc", argType = TBasicType TInt, direction = DirectionInout, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to the number of command line arguments", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything},Arg {argCName = "argv", argType = TCArray False (-1) 0 (TBasicType TUTF8), direction = DirectionInout, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to the array of\n    command line arguments", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : [Arg {argCName = "argc", argType = TBasicType TInt, direction = DirectionInout, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a pointer to the number of command line arguments", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_parse_args" gtk_parse_args ::
    Ptr Int32 ->                            -- argc : TBasicType TInt
    Ptr (Ptr CString) ->                    -- argv : TCArray False (-1) 0 (TBasicType TUTF8)
    IO CInt

{- |
Parses command line arguments, and initializes global
attributes of GTK+, but does not actually open a connection
to a display. (See 'GI.Gdk.Objects.Display.displayOpen', 'GI.Gdk.Functions.getDisplayArgName')

Any arguments used by GTK+ or GDK are removed from the array and
/@argc@/ and /@argv@/ are updated accordingly.

There is no need to call this function explicitly if you are using
'GI.Gtk.Functions.init', or 'GI.Gtk.Functions.initCheck'.

Note that many aspects of GTK+ require a display connection to
function, so this way of initializing GTK+ is really only useful
for specialized use cases.
-}
parseArgs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    [T.Text]
    {- ^ /@argv@/: a pointer to the array of
    command line arguments -}
    -> m ((Bool, [T.Text]))
    {- ^ __Returns:__ 'True' if initialization succeeded, otherwise 'False' -}
parseArgs argv = liftIO $ do
    let argc = fromIntegral $ length argv
    argc' <- allocMem :: IO (Ptr Int32)
    poke argc' argc
    argv' <- packUTF8CArray argv
    argv'' <- allocMem :: IO (Ptr (Ptr CString))
    poke argv'' argv'
    result <- gtk_parse_args argc' argv''
    argc'' <- peek argc'
    let result' = (/= 0) result
    argv''' <- peek argv''
    argv'''' <- (unpackUTF8CArrayWithLength argc'') argv'''
    (mapCArrayWithLength argc'') freeMem argv'''
    freeMem argv'''
    freeMem argc'
    freeMem argv''
    return (result', argv'''')


-- function gtk_paint_vline
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y1_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the starting y coordinate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y2_", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the ending y coordinate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the x coordinate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_vline" gtk_paint_vline ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Int32 ->                                -- y1_ : TBasicType TInt
    Int32 ->                                -- y2_ : TBasicType TInt
    Int32 ->                                -- x : TBasicType TInt
    IO ()

{-# DEPRECATED paintVline ["(Since version 3.0)","Use 'GI.Gtk.Functions.renderLine' instead"] #-}
{- |
Draws a vertical line from (/@x@/, /@y1_@/) to (/@x@/, /@y2_@/) in /@cr@/
using the given style and state.
-}
paintVline ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail -}
    -> Int32
    {- ^ /@y1_@/: the starting y coordinate -}
    -> Int32
    {- ^ /@y2_@/: the ending y coordinate -}
    -> Int32
    {- ^ /@x@/: the x coordinate -}
    -> m ()
paintVline style cr stateType widget detail y1_ y2_ x = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    gtk_paint_vline style' cr' stateType' maybeWidget maybeDetail y1_ y2_ x
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_tab
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "shadow_type", argType = TInterface (Name {namespace = "Gtk", name = "ShadowType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the type of shadow to draw", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "x origin of the rectangle to draw the tab in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "y origin of the rectangle to draw the tab in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width of the rectangle to draw the tab in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height of the rectangle to draw the tab in", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_tab" gtk_paint_tab ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    CUInt ->                                -- shadow_type : TInterface (Name {namespace = "Gtk", name = "ShadowType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

{-# DEPRECATED paintTab ["(Since version 3.0)","Use cairo instead"] #-}
{- |
Draws an option menu tab (i.e. the up and down pointing arrows)
in the given rectangle on /@cr@/ using the given parameters.
-}
paintTab ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Gtk.Enums.ShadowType
    {- ^ /@shadowType@/: the type of shadow to draw -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail -}
    -> Int32
    {- ^ /@x@/: x origin of the rectangle to draw the tab in -}
    -> Int32
    {- ^ /@y@/: y origin of the rectangle to draw the tab in -}
    -> Int32
    {- ^ /@width@/: the width of the rectangle to draw the tab in -}
    -> Int32
    {- ^ /@height@/: the height of the rectangle to draw the tab in -}
    -> m ()
paintTab style cr stateType shadowType widget detail x y width height = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    let shadowType' = (fromIntegral . fromEnum) shadowType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    gtk_paint_tab style' cr' stateType' shadowType' maybeWidget maybeDetail x y width height
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_spinner
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget (may be %NULL)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail (may be %NULL)", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "step", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the nth step", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the x origin of the rectangle in which to draw the spinner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the y origin of the rectangle in which to draw the spinner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width of the rectangle in which to draw the spinner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height of the rectangle in which to draw the spinner", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_spinner" gtk_paint_spinner ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Word32 ->                               -- step : TBasicType TUInt
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

{-# DEPRECATED paintSpinner ["(Since version 3.0)","Use 'GI.Gtk.Functions.renderIcon' and the 'GI.Gtk.Objects.StyleContext.StyleContext'","  you are drawing instead"] #-}
{- |
Draws a spinner on /@window@/ using the given parameters.
-}
paintSpinner ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget (may be 'Nothing') -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail (may be 'Nothing') -}
    -> Word32
    {- ^ /@step@/: the nth step -}
    -> Int32
    {- ^ /@x@/: the x origin of the rectangle in which to draw the spinner -}
    -> Int32
    {- ^ /@y@/: the y origin of the rectangle in which to draw the spinner -}
    -> Int32
    {- ^ /@width@/: the width of the rectangle in which to draw the spinner -}
    -> Int32
    {- ^ /@height@/: the height of the rectangle in which to draw the spinner -}
    -> m ()
paintSpinner style cr stateType widget detail step x y width height = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    gtk_paint_spinner style' cr' stateType' maybeWidget maybeDetail step x y width height
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_slider
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "shadow_type", argType = TInterface (Name {namespace = "Gtk", name = "ShadowType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a shadow", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the x origin of the rectangle in which to draw a slider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the y origin of the rectangle in which to draw a slider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width of the rectangle in which to draw a slider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height of the rectangle in which to draw a slider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "orientation", argType = TInterface (Name {namespace = "Gtk", name = "Orientation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the orientation to be used", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_slider" gtk_paint_slider ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    CUInt ->                                -- shadow_type : TInterface (Name {namespace = "Gtk", name = "ShadowType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    CUInt ->                                -- orientation : TInterface (Name {namespace = "Gtk", name = "Orientation"})
    IO ()

{-# DEPRECATED paintSlider ["(Since version 3.0)","Use 'GI.Gtk.Functions.renderSlider' instead"] #-}
{- |
Draws a slider in the given rectangle on /@cr@/ using the
given style and orientation.
-}
paintSlider ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Gtk.Enums.ShadowType
    {- ^ /@shadowType@/: a shadow -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail -}
    -> Int32
    {- ^ /@x@/: the x origin of the rectangle in which to draw a slider -}
    -> Int32
    {- ^ /@y@/: the y origin of the rectangle in which to draw a slider -}
    -> Int32
    {- ^ /@width@/: the width of the rectangle in which to draw a slider -}
    -> Int32
    {- ^ /@height@/: the height of the rectangle in which to draw a slider -}
    -> Gtk.Enums.Orientation
    {- ^ /@orientation@/: the orientation to be used -}
    -> m ()
paintSlider style cr stateType shadowType widget detail x y width height orientation = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    let shadowType' = (fromIntegral . fromEnum) shadowType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    let orientation' = (fromIntegral . fromEnum) orientation
    gtk_paint_slider style' cr' stateType' shadowType' maybeWidget maybeDetail x y width height orientation'
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_shadow_gap
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "shadow_type", argType = TInterface (Name {namespace = "Gtk", name = "ShadowType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "type of shadow to draw", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, 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 TInt, 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 TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width of the rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width of the rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "gap_side", argType = TInterface (Name {namespace = "Gtk", name = "PositionType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "side in which to leave the gap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "gap_x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "starting position of the gap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "gap_width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width of the gap", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_shadow_gap" gtk_paint_shadow_gap ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    CUInt ->                                -- shadow_type : TInterface (Name {namespace = "Gtk", name = "ShadowType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    CUInt ->                                -- gap_side : TInterface (Name {namespace = "Gtk", name = "PositionType"})
    Int32 ->                                -- gap_x : TBasicType TInt
    Int32 ->                                -- gap_width : TBasicType TInt
    IO ()

{-# DEPRECATED paintShadowGap ["(Since version 3.0)","Use 'GI.Gtk.Functions.renderFrameGap' instead"] #-}
{- |
Draws a shadow around the given rectangle in /@cr@/
using the given style and state and shadow type, leaving a
gap in one side.
-}
paintShadowGap ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Gtk.Enums.ShadowType
    {- ^ /@shadowType@/: type of shadow to draw -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail -}
    -> Int32
    {- ^ /@x@/: x origin of the rectangle -}
    -> Int32
    {- ^ /@y@/: y origin of the rectangle -}
    -> Int32
    {- ^ /@width@/: width of the rectangle -}
    -> Int32
    {- ^ /@height@/: width of the rectangle -}
    -> Gtk.Enums.PositionType
    {- ^ /@gapSide@/: side in which to leave the gap -}
    -> Int32
    {- ^ /@gapX@/: starting position of the gap -}
    -> Int32
    {- ^ /@gapWidth@/: width of the gap -}
    -> m ()
paintShadowGap style cr stateType shadowType widget detail x y width height gapSide gapX gapWidth = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    let shadowType' = (fromIntegral . fromEnum) shadowType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    let gapSide' = (fromIntegral . fromEnum) gapSide
    gtk_paint_shadow_gap style' cr' stateType' shadowType' maybeWidget maybeDetail x y width height gapSide' gapX gapWidth
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_shadow
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "shadow_type", argType = TInterface (Name {namespace = "Gtk", name = "ShadowType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "type of shadow to draw", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, 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 TInt, 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 TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width of the rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "width of the rectangle", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_paint_shadow" gtk_paint_shadow ::
    Ptr Gtk.Style.Style ->                  -- style : TInterface (Name {namespace = "Gtk", name = "Style"})
    Ptr Cairo.Context.Context ->            -- cr : TInterface (Name {namespace = "cairo", name = "Context"})
    CUInt ->                                -- state_type : TInterface (Name {namespace = "Gtk", name = "StateType"})
    CUInt ->                                -- shadow_type : TInterface (Name {namespace = "Gtk", name = "ShadowType"})
    Ptr Gtk.Widget.Widget ->                -- widget : TInterface (Name {namespace = "Gtk", name = "Widget"})
    CString ->                              -- detail : TBasicType TUTF8
    Int32 ->                                -- x : TBasicType TInt
    Int32 ->                                -- y : TBasicType TInt
    Int32 ->                                -- width : TBasicType TInt
    Int32 ->                                -- height : TBasicType TInt
    IO ()

{-# DEPRECATED paintShadow ["(Since version 3.0)","Use 'GI.Gtk.Functions.renderFrame' instead"] #-}
{- |
Draws a shadow around the given rectangle in /@cr@/
using the given style and state and shadow type.
-}
paintShadow ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.Style.IsStyle a, Gtk.Widget.IsWidget b) =>
    a
    {- ^ /@style@/: a 'GI.Gtk.Objects.Style.Style' -}
    -> Cairo.Context.Context
    {- ^ /@cr@/: a 'GI.Cairo.Structs.Context.Context' -}
    -> Gtk.Enums.StateType
    {- ^ /@stateType@/: a state -}
    -> Gtk.Enums.ShadowType
    {- ^ /@shadowType@/: type of shadow to draw -}
    -> Maybe (b)
    {- ^ /@widget@/: the widget -}
    -> Maybe (T.Text)
    {- ^ /@detail@/: a style detail -}
    -> Int32
    {- ^ /@x@/: x origin of the rectangle -}
    -> Int32
    {- ^ /@y@/: y origin of the rectangle -}
    -> Int32
    {- ^ /@width@/: width of the rectangle -}
    -> Int32
    {- ^ /@height@/: width of the rectangle -}
    -> m ()
paintShadow style cr stateType shadowType widget detail x y width height = liftIO $ do
    style' <- unsafeManagedPtrCastPtr style
    cr' <- unsafeManagedPtrGetPtr cr
    let stateType' = (fromIntegral . fromEnum) stateType
    let shadowType' = (fromIntegral . fromEnum) shadowType
    maybeWidget <- case widget of
        Nothing -> return nullPtr
        Just jWidget -> do
            jWidget' <- unsafeManagedPtrCastPtr jWidget
            return jWidget'
    maybeDetail <- case detail of
        Nothing -> return nullPtr
        Just jDetail -> do
            jDetail' <- textToCString jDetail
            return jDetail'
    gtk_paint_shadow style' cr' stateType' shadowType' maybeWidget maybeDetail x y width height
    touchManagedPtr style
    touchManagedPtr cr
    whenJust widget touchManagedPtr
    freeMem maybeDetail
    return ()


-- function gtk_paint_resize_grip
-- Args : [Arg {argCName = "style", argType = TInterface (Name {namespace = "Gtk", name = "Style"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyle", 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 = "state_type", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "widget", argType = TInterface (Name {namespace = "Gtk", name = "Widget"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the widget", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "detail", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a style detail", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "edge", argType = TInterface (Name {namespace = "Gdk", name = "WindowEdge"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the edge in which to draw the resize grip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "x", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the x origin of the rectangle in which to draw the resize grip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "y", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the y origin of the rectangle in which to draw the resize grip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "width", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the width of the rectangle in which to draw the resize grip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "height", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the height of the rectangle in which to draw the resize grip", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
<