{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

'GI.Gtk.Objects.StyleContext.StyleContext' is an object that stores styling information affecting
a widget defined by 'GI.Gtk.Structs.WidgetPath.WidgetPath'.

In order to construct the final style information, 'GI.Gtk.Objects.StyleContext.StyleContext'
queries information from all attached @/GtkStyleProviders/@. Style providers
can be either attached explicitly to the context through
'GI.Gtk.Objects.StyleContext.styleContextAddProvider', or to the screen through
'GI.Gtk.Objects.StyleContext.styleContextAddProviderForScreen'. The resulting style is a
combination of all providers’ information in priority order.

For GTK+ widgets, any 'GI.Gtk.Objects.StyleContext.StyleContext' returned by
'GI.Gtk.Objects.Widget.widgetGetStyleContext' will already have a 'GI.Gtk.Structs.WidgetPath.WidgetPath', a
'GI.Gdk.Objects.Screen.Screen' and RTL\/LTR information set. The style context will also be
updated automatically if any of these settings change on the widget.

If you are using the theming layer standalone, you will need to set a
widget path and a screen yourself to the created style context through
'GI.Gtk.Objects.StyleContext.styleContextSetPath' and possibly 'GI.Gtk.Objects.StyleContext.styleContextSetScreen'. See
the “Foreign drawing“ example in gtk3-demo.

# Style Classes # {@/gtkstylecontext/@-classes}

Widgets can add style classes to their context, which can be used to associate
different styles by class. The documentation for individual widgets lists
which style classes it uses itself, and which style classes may be added by
applications to affect their appearance.

GTK+ defines macros for a number of style classes.

= Style Regions

Widgets can also add regions with flags to their context. This feature is
deprecated and will be removed in a future GTK+ update. Please use style
classes instead.

GTK+ defines macros for a number of style regions.

= Custom styling in UI libraries and applications

If you are developing a library with custom @/GtkWidgets/@ that
render differently than standard components, you may need to add a
'GI.Gtk.Interfaces.StyleProvider.StyleProvider' yourself with the 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_FALLBACK'
priority, either a 'GI.Gtk.Objects.CssProvider.CssProvider' or a custom object implementing the
'GI.Gtk.Interfaces.StyleProvider.StyleProvider' interface. This way themes may still attempt
to style your UI elements in a different way if needed so.

If you are using custom styling on an applications, you probably want then
to make your style information prevail to the theme’s, so you must use
a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' with the 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_APPLICATION'
priority, keep in mind that the user settings in
@XDG_CONFIG_HOME\/gtk-3.0\/gtk.css@ will
still take precedence over your changes, as it uses the
'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_USER' priority.
-}

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

module GI.Gtk.Objects.StyleContext
    (

-- * Exported types
    StyleContext(..)                        ,
    IsStyleContext                          ,
    toStyleContext                          ,
    noStyleContext                          ,


 -- * Methods
-- ** addClass #method:addClass#

#if ENABLE_OVERLOADING
    StyleContextAddClassMethodInfo          ,
#endif
    styleContextAddClass                    ,


-- ** addProvider #method:addProvider#

#if ENABLE_OVERLOADING
    StyleContextAddProviderMethodInfo       ,
#endif
    styleContextAddProvider                 ,


-- ** addProviderForScreen #method:addProviderForScreen#

    styleContextAddProviderForScreen        ,


-- ** addRegion #method:addRegion#

#if ENABLE_OVERLOADING
    StyleContextAddRegionMethodInfo         ,
#endif
    styleContextAddRegion                   ,


-- ** cancelAnimations #method:cancelAnimations#

#if ENABLE_OVERLOADING
    StyleContextCancelAnimationsMethodInfo  ,
#endif
    styleContextCancelAnimations            ,


-- ** getBackgroundColor #method:getBackgroundColor#

#if ENABLE_OVERLOADING
    StyleContextGetBackgroundColorMethodInfo,
#endif
    styleContextGetBackgroundColor          ,


-- ** getBorder #method:getBorder#

#if ENABLE_OVERLOADING
    StyleContextGetBorderMethodInfo         ,
#endif
    styleContextGetBorder                   ,


-- ** getBorderColor #method:getBorderColor#

#if ENABLE_OVERLOADING
    StyleContextGetBorderColorMethodInfo    ,
#endif
    styleContextGetBorderColor              ,


-- ** getColor #method:getColor#

#if ENABLE_OVERLOADING
    StyleContextGetColorMethodInfo          ,
#endif
    styleContextGetColor                    ,


-- ** getDirection #method:getDirection#

#if ENABLE_OVERLOADING
    StyleContextGetDirectionMethodInfo      ,
#endif
    styleContextGetDirection                ,


-- ** getFont #method:getFont#

#if ENABLE_OVERLOADING
    StyleContextGetFontMethodInfo           ,
#endif
    styleContextGetFont                     ,


-- ** getFrameClock #method:getFrameClock#

#if ENABLE_OVERLOADING
    StyleContextGetFrameClockMethodInfo     ,
#endif
    styleContextGetFrameClock               ,


-- ** getJunctionSides #method:getJunctionSides#

#if ENABLE_OVERLOADING
    StyleContextGetJunctionSidesMethodInfo  ,
#endif
    styleContextGetJunctionSides            ,


-- ** getMargin #method:getMargin#

#if ENABLE_OVERLOADING
    StyleContextGetMarginMethodInfo         ,
#endif
    styleContextGetMargin                   ,


-- ** getPadding #method:getPadding#

#if ENABLE_OVERLOADING
    StyleContextGetPaddingMethodInfo        ,
#endif
    styleContextGetPadding                  ,


-- ** getParent #method:getParent#

#if ENABLE_OVERLOADING
    StyleContextGetParentMethodInfo         ,
#endif
    styleContextGetParent                   ,


-- ** getPath #method:getPath#

#if ENABLE_OVERLOADING
    StyleContextGetPathMethodInfo           ,
#endif
    styleContextGetPath                     ,


-- ** getProperty #method:getProperty#

#if ENABLE_OVERLOADING
    StyleContextGetPropertyMethodInfo       ,
#endif
    styleContextGetProperty                 ,


-- ** getScale #method:getScale#

#if ENABLE_OVERLOADING
    StyleContextGetScaleMethodInfo          ,
#endif
    styleContextGetScale                    ,


-- ** getScreen #method:getScreen#

#if ENABLE_OVERLOADING
    StyleContextGetScreenMethodInfo         ,
#endif
    styleContextGetScreen                   ,


-- ** getSection #method:getSection#

#if ENABLE_OVERLOADING
    StyleContextGetSectionMethodInfo        ,
#endif
    styleContextGetSection                  ,


-- ** getState #method:getState#

#if ENABLE_OVERLOADING
    StyleContextGetStateMethodInfo          ,
#endif
    styleContextGetState                    ,


-- ** getStyleProperty #method:getStyleProperty#

#if ENABLE_OVERLOADING
    StyleContextGetStylePropertyMethodInfo  ,
#endif
    styleContextGetStyleProperty            ,


-- ** hasClass #method:hasClass#

#if ENABLE_OVERLOADING
    StyleContextHasClassMethodInfo          ,
#endif
    styleContextHasClass                    ,


-- ** hasRegion #method:hasRegion#

#if ENABLE_OVERLOADING
    StyleContextHasRegionMethodInfo         ,
#endif
    styleContextHasRegion                   ,


-- ** invalidate #method:invalidate#

#if ENABLE_OVERLOADING
    StyleContextInvalidateMethodInfo        ,
#endif
    styleContextInvalidate                  ,


-- ** listClasses #method:listClasses#

#if ENABLE_OVERLOADING
    StyleContextListClassesMethodInfo       ,
#endif
    styleContextListClasses                 ,


-- ** listRegions #method:listRegions#

#if ENABLE_OVERLOADING
    StyleContextListRegionsMethodInfo       ,
#endif
    styleContextListRegions                 ,


-- ** lookupColor #method:lookupColor#

#if ENABLE_OVERLOADING
    StyleContextLookupColorMethodInfo       ,
#endif
    styleContextLookupColor                 ,


-- ** lookupIconSet #method:lookupIconSet#

#if ENABLE_OVERLOADING
    StyleContextLookupIconSetMethodInfo     ,
#endif
    styleContextLookupIconSet               ,


-- ** new #method:new#

    styleContextNew                         ,


-- ** notifyStateChange #method:notifyStateChange#

#if ENABLE_OVERLOADING
    StyleContextNotifyStateChangeMethodInfo ,
#endif
    styleContextNotifyStateChange           ,


-- ** popAnimatableRegion #method:popAnimatableRegion#

#if ENABLE_OVERLOADING
    StyleContextPopAnimatableRegionMethodInfo,
#endif
    styleContextPopAnimatableRegion         ,


-- ** pushAnimatableRegion #method:pushAnimatableRegion#

#if ENABLE_OVERLOADING
    StyleContextPushAnimatableRegionMethodInfo,
#endif
    styleContextPushAnimatableRegion        ,


-- ** removeClass #method:removeClass#

#if ENABLE_OVERLOADING
    StyleContextRemoveClassMethodInfo       ,
#endif
    styleContextRemoveClass                 ,


-- ** removeProvider #method:removeProvider#

#if ENABLE_OVERLOADING
    StyleContextRemoveProviderMethodInfo    ,
#endif
    styleContextRemoveProvider              ,


-- ** removeProviderForScreen #method:removeProviderForScreen#

    styleContextRemoveProviderForScreen     ,


-- ** removeRegion #method:removeRegion#

#if ENABLE_OVERLOADING
    StyleContextRemoveRegionMethodInfo      ,
#endif
    styleContextRemoveRegion                ,


-- ** resetWidgets #method:resetWidgets#

    styleContextResetWidgets                ,


-- ** restore #method:restore#

#if ENABLE_OVERLOADING
    StyleContextRestoreMethodInfo           ,
#endif
    styleContextRestore                     ,


-- ** save #method:save#

#if ENABLE_OVERLOADING
    StyleContextSaveMethodInfo              ,
#endif
    styleContextSave                        ,


-- ** scrollAnimations #method:scrollAnimations#

#if ENABLE_OVERLOADING
    StyleContextScrollAnimationsMethodInfo  ,
#endif
    styleContextScrollAnimations            ,


-- ** setBackground #method:setBackground#

#if ENABLE_OVERLOADING
    StyleContextSetBackgroundMethodInfo     ,
#endif
    styleContextSetBackground               ,


-- ** setDirection #method:setDirection#

#if ENABLE_OVERLOADING
    StyleContextSetDirectionMethodInfo      ,
#endif
    styleContextSetDirection                ,


-- ** setFrameClock #method:setFrameClock#

#if ENABLE_OVERLOADING
    StyleContextSetFrameClockMethodInfo     ,
#endif
    styleContextSetFrameClock               ,


-- ** setJunctionSides #method:setJunctionSides#

#if ENABLE_OVERLOADING
    StyleContextSetJunctionSidesMethodInfo  ,
#endif
    styleContextSetJunctionSides            ,


-- ** setParent #method:setParent#

#if ENABLE_OVERLOADING
    StyleContextSetParentMethodInfo         ,
#endif
    styleContextSetParent                   ,


-- ** setPath #method:setPath#

#if ENABLE_OVERLOADING
    StyleContextSetPathMethodInfo           ,
#endif
    styleContextSetPath                     ,


-- ** setScale #method:setScale#

#if ENABLE_OVERLOADING
    StyleContextSetScaleMethodInfo          ,
#endif
    styleContextSetScale                    ,


-- ** setScreen #method:setScreen#

#if ENABLE_OVERLOADING
    StyleContextSetScreenMethodInfo         ,
#endif
    styleContextSetScreen                   ,


-- ** setState #method:setState#

#if ENABLE_OVERLOADING
    StyleContextSetStateMethodInfo          ,
#endif
    styleContextSetState                    ,


-- ** stateIsRunning #method:stateIsRunning#

#if ENABLE_OVERLOADING
    StyleContextStateIsRunningMethodInfo    ,
#endif
    styleContextStateIsRunning              ,


-- ** toString #method:toString#

#if ENABLE_OVERLOADING
    StyleContextToStringMethodInfo          ,
#endif
    styleContextToString                    ,




 -- * Properties
-- ** direction #attr:direction#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    StyleContextDirectionPropertyInfo       ,
#endif
    constructStyleContextDirection          ,
    getStyleContextDirection                ,
    setStyleContextDirection                ,
#if ENABLE_OVERLOADING
    styleContextDirection                   ,
#endif


-- ** paintClock #attr:paintClock#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    StyleContextPaintClockPropertyInfo      ,
#endif
    clearStyleContextPaintClock             ,
    constructStyleContextPaintClock         ,
    getStyleContextPaintClock               ,
    setStyleContextPaintClock               ,
#if ENABLE_OVERLOADING
    styleContextPaintClock                  ,
#endif


-- ** parent #attr:parent#
{- | Sets or gets the style context’s parent. See 'GI.Gtk.Objects.StyleContext.styleContextSetParent'
for details.

/Since: 3.4/
-}
#if ENABLE_OVERLOADING
    StyleContextParentPropertyInfo          ,
#endif
    clearStyleContextParent                 ,
    constructStyleContextParent             ,
    getStyleContextParent                   ,
    setStyleContextParent                   ,
#if ENABLE_OVERLOADING
    styleContextParent                      ,
#endif


-- ** screen #attr:screen#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    StyleContextScreenPropertyInfo          ,
#endif
    constructStyleContextScreen             ,
    getStyleContextScreen                   ,
    setStyleContextScreen                   ,
#if ENABLE_OVERLOADING
    styleContextScreen                      ,
#endif




 -- * Signals
-- ** changed #signal:changed#

    C_StyleContextChangedCallback           ,
    StyleContextChangedCallback             ,
#if ENABLE_OVERLOADING
    StyleContextChangedSignalInfo           ,
#endif
    afterStyleContextChanged                ,
    genClosure_StyleContextChanged          ,
    mk_StyleContextChangedCallback          ,
    noStyleContextChangedCallback           ,
    onStyleContextChanged                   ,
    wrap_StyleContextChangedCallback        ,




    ) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import qualified GI.Gdk.Objects.Screen as Gdk.Screen
import qualified GI.Gdk.Objects.Window as Gdk.Window
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.StyleProvider as Gtk.StyleProvider
import {-# SOURCE #-} qualified GI.Gtk.Structs.Border as Gtk.Border
import {-# SOURCE #-} qualified GI.Gtk.Structs.CssSection as Gtk.CssSection
import {-# SOURCE #-} qualified GI.Gtk.Structs.IconSet as Gtk.IconSet
import {-# SOURCE #-} qualified GI.Gtk.Structs.WidgetPath as Gtk.WidgetPath
import qualified GI.Pango.Structs.FontDescription as Pango.FontDescription

-- | Memory-managed wrapper type.
newtype StyleContext = StyleContext (ManagedPtr StyleContext)
foreign import ccall "gtk_style_context_get_type"
    c_gtk_style_context_get_type :: IO GType

instance GObject StyleContext where
    gobjectType = c_gtk_style_context_get_type


-- | Type class for types which can be safely cast to `StyleContext`, for instance with `toStyleContext`.
class (GObject o, O.IsDescendantOf StyleContext o) => IsStyleContext o
instance (GObject o, O.IsDescendantOf StyleContext o) => IsStyleContext o

instance O.HasParentTypes StyleContext
type instance O.ParentTypes StyleContext = '[GObject.Object.Object]

-- | Cast to `StyleContext`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toStyleContext :: (MonadIO m, IsStyleContext o) => o -> m StyleContext
toStyleContext = liftIO . unsafeCastTo StyleContext

-- | A convenience alias for `Nothing` :: `Maybe` `StyleContext`.
noStyleContext :: Maybe StyleContext
noStyleContext = Nothing

#if ENABLE_OVERLOADING
type family ResolveStyleContextMethod (t :: Symbol) (o :: *) :: * where
    ResolveStyleContextMethod "addClass" o = StyleContextAddClassMethodInfo
    ResolveStyleContextMethod "addProvider" o = StyleContextAddProviderMethodInfo
    ResolveStyleContextMethod "addRegion" o = StyleContextAddRegionMethodInfo
    ResolveStyleContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveStyleContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveStyleContextMethod "cancelAnimations" o = StyleContextCancelAnimationsMethodInfo
    ResolveStyleContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveStyleContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveStyleContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveStyleContextMethod "hasClass" o = StyleContextHasClassMethodInfo
    ResolveStyleContextMethod "hasRegion" o = StyleContextHasRegionMethodInfo
    ResolveStyleContextMethod "invalidate" o = StyleContextInvalidateMethodInfo
    ResolveStyleContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveStyleContextMethod "listClasses" o = StyleContextListClassesMethodInfo
    ResolveStyleContextMethod "listRegions" o = StyleContextListRegionsMethodInfo
    ResolveStyleContextMethod "lookupColor" o = StyleContextLookupColorMethodInfo
    ResolveStyleContextMethod "lookupIconSet" o = StyleContextLookupIconSetMethodInfo
    ResolveStyleContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveStyleContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveStyleContextMethod "notifyStateChange" o = StyleContextNotifyStateChangeMethodInfo
    ResolveStyleContextMethod "popAnimatableRegion" o = StyleContextPopAnimatableRegionMethodInfo
    ResolveStyleContextMethod "pushAnimatableRegion" o = StyleContextPushAnimatableRegionMethodInfo
    ResolveStyleContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveStyleContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveStyleContextMethod "removeClass" o = StyleContextRemoveClassMethodInfo
    ResolveStyleContextMethod "removeProvider" o = StyleContextRemoveProviderMethodInfo
    ResolveStyleContextMethod "removeRegion" o = StyleContextRemoveRegionMethodInfo
    ResolveStyleContextMethod "restore" o = StyleContextRestoreMethodInfo
    ResolveStyleContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveStyleContextMethod "save" o = StyleContextSaveMethodInfo
    ResolveStyleContextMethod "scrollAnimations" o = StyleContextScrollAnimationsMethodInfo
    ResolveStyleContextMethod "stateIsRunning" o = StyleContextStateIsRunningMethodInfo
    ResolveStyleContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveStyleContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveStyleContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveStyleContextMethod "toString" o = StyleContextToStringMethodInfo
    ResolveStyleContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveStyleContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveStyleContextMethod "getBackgroundColor" o = StyleContextGetBackgroundColorMethodInfo
    ResolveStyleContextMethod "getBorder" o = StyleContextGetBorderMethodInfo
    ResolveStyleContextMethod "getBorderColor" o = StyleContextGetBorderColorMethodInfo
    ResolveStyleContextMethod "getColor" o = StyleContextGetColorMethodInfo
    ResolveStyleContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveStyleContextMethod "getDirection" o = StyleContextGetDirectionMethodInfo
    ResolveStyleContextMethod "getFont" o = StyleContextGetFontMethodInfo
    ResolveStyleContextMethod "getFrameClock" o = StyleContextGetFrameClockMethodInfo
    ResolveStyleContextMethod "getJunctionSides" o = StyleContextGetJunctionSidesMethodInfo
    ResolveStyleContextMethod "getMargin" o = StyleContextGetMarginMethodInfo
    ResolveStyleContextMethod "getPadding" o = StyleContextGetPaddingMethodInfo
    ResolveStyleContextMethod "getParent" o = StyleContextGetParentMethodInfo
    ResolveStyleContextMethod "getPath" o = StyleContextGetPathMethodInfo
    ResolveStyleContextMethod "getProperty" o = StyleContextGetPropertyMethodInfo
    ResolveStyleContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveStyleContextMethod "getScale" o = StyleContextGetScaleMethodInfo
    ResolveStyleContextMethod "getScreen" o = StyleContextGetScreenMethodInfo
    ResolveStyleContextMethod "getSection" o = StyleContextGetSectionMethodInfo
    ResolveStyleContextMethod "getState" o = StyleContextGetStateMethodInfo
    ResolveStyleContextMethod "getStyleProperty" o = StyleContextGetStylePropertyMethodInfo
    ResolveStyleContextMethod "setBackground" o = StyleContextSetBackgroundMethodInfo
    ResolveStyleContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveStyleContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveStyleContextMethod "setDirection" o = StyleContextSetDirectionMethodInfo
    ResolveStyleContextMethod "setFrameClock" o = StyleContextSetFrameClockMethodInfo
    ResolveStyleContextMethod "setJunctionSides" o = StyleContextSetJunctionSidesMethodInfo
    ResolveStyleContextMethod "setParent" o = StyleContextSetParentMethodInfo
    ResolveStyleContextMethod "setPath" o = StyleContextSetPathMethodInfo
    ResolveStyleContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveStyleContextMethod "setScale" o = StyleContextSetScaleMethodInfo
    ResolveStyleContextMethod "setScreen" o = StyleContextSetScreenMethodInfo
    ResolveStyleContextMethod "setState" o = StyleContextSetStateMethodInfo
    ResolveStyleContextMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveStyleContextMethod t StyleContext, O.MethodInfo info StyleContext p) => OL.IsLabel t (StyleContext -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

-- signal StyleContext::changed
{- |
The ::changed signal is emitted when there is a change in the
'GI.Gtk.Objects.StyleContext.StyleContext'.

For a 'GI.Gtk.Objects.StyleContext.StyleContext' returned by 'GI.Gtk.Objects.Widget.widgetGetStyleContext', the
'GI.Gtk.Objects.Widget.Widget'::@/style-updated/@ signal\/vfunc might be more convenient to use.

This signal is useful when using the theming layer standalone.

/Since: 3.0/
-}
type StyleContextChangedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `StyleContextChangedCallback`@.
noStyleContextChangedCallback :: Maybe StyleContextChangedCallback
noStyleContextChangedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_StyleContextChangedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_StyleContextChangedCallback`.
foreign import ccall "wrapper"
    mk_StyleContextChangedCallback :: C_StyleContextChangedCallback -> IO (FunPtr C_StyleContextChangedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_StyleContextChanged :: MonadIO m => StyleContextChangedCallback -> m (GClosure C_StyleContextChangedCallback)
genClosure_StyleContextChanged cb = liftIO $ do
    let cb' = wrap_StyleContextChangedCallback cb
    mk_StyleContextChangedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `StyleContextChangedCallback` into a `C_StyleContextChangedCallback`.
wrap_StyleContextChangedCallback ::
    StyleContextChangedCallback ->
    C_StyleContextChangedCallback
wrap_StyleContextChangedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@changed@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' styleContext #changed callback
@
-}
onStyleContextChanged :: (IsStyleContext a, MonadIO m) => a -> StyleContextChangedCallback -> m SignalHandlerId
onStyleContextChanged obj cb = liftIO $ do
    let cb' = wrap_StyleContextChangedCallback cb
    cb'' <- mk_StyleContextChangedCallback cb'
    connectSignalFunPtr obj "changed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@changed@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' styleContext #changed callback
@
-}
afterStyleContextChanged :: (IsStyleContext a, MonadIO m) => a -> StyleContextChangedCallback -> m SignalHandlerId
afterStyleContextChanged obj cb = liftIO $ do
    let cb' = wrap_StyleContextChangedCallback cb
    cb'' <- mk_StyleContextChangedCallback cb'
    connectSignalFunPtr obj "changed" cb'' SignalConnectAfter


-- VVV Prop "direction"
   -- Type: TInterface (Name {namespace = "Gtk", name = "TextDirection"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@direction@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' styleContext #direction
@
-}
getStyleContextDirection :: (MonadIO m, IsStyleContext o) => o -> m Gtk.Enums.TextDirection
getStyleContextDirection obj = liftIO $ B.Properties.getObjectPropertyEnum obj "direction"

{- |
Set the value of the “@direction@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' styleContext [ #direction 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStyleContextDirection :: (MonadIO m, IsStyleContext o) => o -> Gtk.Enums.TextDirection -> m ()
setStyleContextDirection obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "direction" val

{- |
Construct a `GValueConstruct` with valid value for the “@direction@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStyleContextDirection :: (IsStyleContext o) => Gtk.Enums.TextDirection -> IO (GValueConstruct o)
constructStyleContextDirection val = B.Properties.constructObjectPropertyEnum "direction" val

#if ENABLE_OVERLOADING
data StyleContextDirectionPropertyInfo
instance AttrInfo StyleContextDirectionPropertyInfo where
    type AttrAllowedOps StyleContextDirectionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint StyleContextDirectionPropertyInfo = (~) Gtk.Enums.TextDirection
    type AttrBaseTypeConstraint StyleContextDirectionPropertyInfo = IsStyleContext
    type AttrGetType StyleContextDirectionPropertyInfo = Gtk.Enums.TextDirection
    type AttrLabel StyleContextDirectionPropertyInfo = "direction"
    type AttrOrigin StyleContextDirectionPropertyInfo = StyleContext
    attrGet _ = getStyleContextDirection
    attrSet _ = setStyleContextDirection
    attrConstruct _ = constructStyleContextDirection
    attrClear _ = undefined
#endif

-- VVV Prop "paint-clock"
   -- Type: TInterface (Name {namespace = "Gdk", name = "FrameClock"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@paint-clock@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' styleContext #paintClock
@
-}
getStyleContextPaintClock :: (MonadIO m, IsStyleContext o) => o -> m (Maybe Gdk.FrameClock.FrameClock)
getStyleContextPaintClock obj = liftIO $ B.Properties.getObjectPropertyObject obj "paint-clock" Gdk.FrameClock.FrameClock

{- |
Set the value of the “@paint-clock@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' styleContext [ #paintClock 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStyleContextPaintClock :: (MonadIO m, IsStyleContext o, Gdk.FrameClock.IsFrameClock a) => o -> a -> m ()
setStyleContextPaintClock obj val = liftIO $ B.Properties.setObjectPropertyObject obj "paint-clock" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@paint-clock@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStyleContextPaintClock :: (IsStyleContext o, Gdk.FrameClock.IsFrameClock a) => a -> IO (GValueConstruct o)
constructStyleContextPaintClock val = B.Properties.constructObjectPropertyObject "paint-clock" (Just val)

{- |
Set the value of the “@paint-clock@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.clear' #paintClock
@
-}
clearStyleContextPaintClock :: (MonadIO m, IsStyleContext o) => o -> m ()
clearStyleContextPaintClock obj = liftIO $ B.Properties.setObjectPropertyObject obj "paint-clock" (Nothing :: Maybe Gdk.FrameClock.FrameClock)

#if ENABLE_OVERLOADING
data StyleContextPaintClockPropertyInfo
instance AttrInfo StyleContextPaintClockPropertyInfo where
    type AttrAllowedOps StyleContextPaintClockPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint StyleContextPaintClockPropertyInfo = Gdk.FrameClock.IsFrameClock
    type AttrBaseTypeConstraint StyleContextPaintClockPropertyInfo = IsStyleContext
    type AttrGetType StyleContextPaintClockPropertyInfo = (Maybe Gdk.FrameClock.FrameClock)
    type AttrLabel StyleContextPaintClockPropertyInfo = "paint-clock"
    type AttrOrigin StyleContextPaintClockPropertyInfo = StyleContext
    attrGet _ = getStyleContextPaintClock
    attrSet _ = setStyleContextPaintClock
    attrConstruct _ = constructStyleContextPaintClock
    attrClear _ = clearStyleContextPaintClock
#endif

-- VVV Prop "parent"
   -- Type: TInterface (Name {namespace = "Gtk", name = "StyleContext"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

{- |
Get the value of the “@parent@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' styleContext #parent
@
-}
getStyleContextParent :: (MonadIO m, IsStyleContext o) => o -> m (Maybe StyleContext)
getStyleContextParent obj = liftIO $ B.Properties.getObjectPropertyObject obj "parent" StyleContext

{- |
Set the value of the “@parent@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' styleContext [ #parent 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStyleContextParent :: (MonadIO m, IsStyleContext o, IsStyleContext a) => o -> a -> m ()
setStyleContextParent obj val = liftIO $ B.Properties.setObjectPropertyObject obj "parent" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@parent@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStyleContextParent :: (IsStyleContext o, IsStyleContext a) => a -> IO (GValueConstruct o)
constructStyleContextParent val = B.Properties.constructObjectPropertyObject "parent" (Just val)

{- |
Set the value of the “@parent@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.clear' #parent
@
-}
clearStyleContextParent :: (MonadIO m, IsStyleContext o) => o -> m ()
clearStyleContextParent obj = liftIO $ B.Properties.setObjectPropertyObject obj "parent" (Nothing :: Maybe StyleContext)

#if ENABLE_OVERLOADING
data StyleContextParentPropertyInfo
instance AttrInfo StyleContextParentPropertyInfo where
    type AttrAllowedOps StyleContextParentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint StyleContextParentPropertyInfo = IsStyleContext
    type AttrBaseTypeConstraint StyleContextParentPropertyInfo = IsStyleContext
    type AttrGetType StyleContextParentPropertyInfo = (Maybe StyleContext)
    type AttrLabel StyleContextParentPropertyInfo = "parent"
    type AttrOrigin StyleContextParentPropertyInfo = StyleContext
    attrGet _ = getStyleContextParent
    attrSet _ = setStyleContextParent
    attrConstruct _ = constructStyleContextParent
    attrClear _ = clearStyleContextParent
#endif

-- VVV Prop "screen"
   -- Type: TInterface (Name {namespace = "Gdk", name = "Screen"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@screen@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' styleContext #screen
@
-}
getStyleContextScreen :: (MonadIO m, IsStyleContext o) => o -> m Gdk.Screen.Screen
getStyleContextScreen obj = liftIO $ checkUnexpectedNothing "getStyleContextScreen" $ B.Properties.getObjectPropertyObject obj "screen" Gdk.Screen.Screen

{- |
Set the value of the “@screen@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' styleContext [ #screen 'Data.GI.Base.Attributes.:=' value ]
@
-}
setStyleContextScreen :: (MonadIO m, IsStyleContext o, Gdk.Screen.IsScreen a) => o -> a -> m ()
setStyleContextScreen obj val = liftIO $ B.Properties.setObjectPropertyObject obj "screen" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@screen@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructStyleContextScreen :: (IsStyleContext o, Gdk.Screen.IsScreen a) => a -> IO (GValueConstruct o)
constructStyleContextScreen val = B.Properties.constructObjectPropertyObject "screen" (Just val)

#if ENABLE_OVERLOADING
data StyleContextScreenPropertyInfo
instance AttrInfo StyleContextScreenPropertyInfo where
    type AttrAllowedOps StyleContextScreenPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint StyleContextScreenPropertyInfo = Gdk.Screen.IsScreen
    type AttrBaseTypeConstraint StyleContextScreenPropertyInfo = IsStyleContext
    type AttrGetType StyleContextScreenPropertyInfo = Gdk.Screen.Screen
    type AttrLabel StyleContextScreenPropertyInfo = "screen"
    type AttrOrigin StyleContextScreenPropertyInfo = StyleContext
    attrGet _ = getStyleContextScreen
    attrSet _ = setStyleContextScreen
    attrConstruct _ = constructStyleContextScreen
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList StyleContext
type instance O.AttributeList StyleContext = StyleContextAttributeList
type StyleContextAttributeList = ('[ '("direction", StyleContextDirectionPropertyInfo), '("paintClock", StyleContextPaintClockPropertyInfo), '("parent", StyleContextParentPropertyInfo), '("screen", StyleContextScreenPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
styleContextDirection :: AttrLabelProxy "direction"
styleContextDirection = AttrLabelProxy

styleContextPaintClock :: AttrLabelProxy "paintClock"
styleContextPaintClock = AttrLabelProxy

styleContextParent :: AttrLabelProxy "parent"
styleContextParent = AttrLabelProxy

styleContextScreen :: AttrLabelProxy "screen"
styleContextScreen = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
data StyleContextChangedSignalInfo
instance SignalInfo StyleContextChangedSignalInfo where
    type HaskellCallbackType StyleContextChangedSignalInfo = StyleContextChangedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_StyleContextChangedCallback cb
        cb'' <- mk_StyleContextChangedCallback cb'
        connectSignalFunPtr obj "changed" cb'' connectMode

type instance O.SignalList StyleContext = StyleContextSignalList
type StyleContextSignalList = ('[ '("changed", StyleContextChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method StyleContext::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "StyleContext"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_new" gtk_style_context_new ::
    IO (Ptr StyleContext)

{- |
Creates a standalone 'GI.Gtk.Objects.StyleContext.StyleContext', this style context
won’t be attached to any widget, so you may want
to call 'GI.Gtk.Objects.StyleContext.styleContextSetPath' yourself.

This function is only useful when using the theming layer
separated from GTK+, if you are using 'GI.Gtk.Objects.StyleContext.StyleContext' to
theme @/GtkWidgets/@, use 'GI.Gtk.Objects.Widget.widgetGetStyleContext'
in order to get a style context ready to theme the widget.
-}
styleContextNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m StyleContext
    {- ^ __Returns:__ A newly created 'GI.Gtk.Objects.StyleContext.StyleContext'. -}
styleContextNew  = liftIO $ do
    result <- gtk_style_context_new
    checkUnexpectedReturnNULL "styleContextNew" result
    result' <- (wrapObject StyleContext) result
    return result'

#if ENABLE_OVERLOADING
#endif

-- method StyleContext::add_class
-- method type : OrdinaryMethod
-- 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 = "class_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "class name to use in styling", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_add_class" gtk_style_context_add_class ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- class_name : TBasicType TUTF8
    IO ()

{- |
Adds a style class to /@context@/, so posterior calls to
@/gtk_style_context_get()/@ or any of the gtk_render_*()
functions will make use of this new class for styling.

In the CSS file format, a 'GI.Gtk.Objects.Entry.Entry' defining a “search”
class, would be matched by:

> <!-- language="CSS" -->
>entry.search { ... }


While any widget defining a “search” class would be
matched by:
> <!-- language="CSS" -->
>.search { ... }


/Since: 3.0/
-}
styleContextAddClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@className@/: class name to use in styling -}
    -> m ()
styleContextAddClass context className = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    className' <- textToCString className
    gtk_style_context_add_class context' className'
    touchManagedPtr context
    freeMem className'
    return ()

#if ENABLE_OVERLOADING
data StyleContextAddClassMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextAddClassMethodInfo a signature where
    overloadedMethod _ = styleContextAddClass

#endif

-- method StyleContext::add_provider
-- method type : OrdinaryMethod
-- 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 = "provider", argType = TInterface (Name {namespace = "Gtk", name = "StyleProvider"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyleProvider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "priority", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the priority of the style provider. The lower\n           it is, the earlier it will be used in the style\n           construction. Typically this will be in the range\n           between %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and\n           %GTK_STYLE_PROVIDER_PRIORITY_USER", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_add_provider" gtk_style_context_add_provider ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    Word32 ->                               -- priority : TBasicType TUInt
    IO ()

{- |
Adds a style provider to /@context@/, to be used in style construction.
Note that a style provider added by this function only affects
the style of the widget to which /@context@/ belongs. If you want
to affect the style of all widgets, use
'GI.Gtk.Objects.StyleContext.styleContextAddProviderForScreen'.

Note: If both priorities are the same, a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
added through this function takes precedence over another added
through 'GI.Gtk.Objects.StyleContext.styleContextAddProviderForScreen'.

/Since: 3.0/
-}
styleContextAddProvider ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@provider@/: a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' -}
    -> Word32
    {- ^ /@priority@/: the priority of the style provider. The lower
           it is, the earlier it will be used in the style
           construction. Typically this will be in the range
           between 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_FALLBACK' and
           'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_USER' -}
    -> m ()
styleContextAddProvider context provider priority = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    provider' <- unsafeManagedPtrCastPtr provider
    gtk_style_context_add_provider context' provider' priority
    touchManagedPtr context
    touchManagedPtr provider
    return ()

#if ENABLE_OVERLOADING
data StyleContextAddProviderMethodInfo
instance (signature ~ (b -> Word32 -> m ()), MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) => O.MethodInfo StyleContextAddProviderMethodInfo a signature where
    overloadedMethod _ = styleContextAddProvider

#endif

-- method StyleContext::add_region
-- method type : OrdinaryMethod
-- 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 = "region_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "region name to use in styling", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gtk", name = "RegionFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags that apply to the region", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_add_region" gtk_style_context_add_region ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- region_name : TBasicType TUTF8
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gtk", name = "RegionFlags"})
    IO ()

{-# DEPRECATED styleContextAddRegion ["(Since version 3.14)"] #-}
{- |
Adds a region to /@context@/, so posterior calls to
@/gtk_style_context_get()/@ or any of the gtk_render_*()
functions will make use of this new region for styling.

In the CSS file format, a 'GI.Gtk.Objects.TreeView.TreeView' defining a “row”
region, would be matched by:

> <!-- language="CSS" -->
>treeview row { ... }


Pseudo-classes are used for matching /@flags@/, so the two
following rules:
> <!-- language="CSS" -->
>treeview row:nth-child(even) { ... }
>treeview row:nth-child(odd) { ... }


would apply to even and odd rows, respectively.

Region names must only contain lowercase letters
and “-”, starting always with a lowercase letter.

/Since: 3.0/
-}
styleContextAddRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@regionName@/: region name to use in styling -}
    -> [Gtk.Flags.RegionFlags]
    {- ^ /@flags@/: flags that apply to the region -}
    -> m ()
styleContextAddRegion context regionName flags = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    regionName' <- textToCString regionName
    let flags' = gflagsToWord flags
    gtk_style_context_add_region context' regionName' flags'
    touchManagedPtr context
    freeMem regionName'
    return ()

#if ENABLE_OVERLOADING
data StyleContextAddRegionMethodInfo
instance (signature ~ (T.Text -> [Gtk.Flags.RegionFlags] -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextAddRegionMethodInfo a signature where
    overloadedMethod _ = styleContextAddRegion

#endif

-- method StyleContext::cancel_animations
-- method type : OrdinaryMethod
-- 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 = "region_id", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "animatable region to stop, or %NULL.\n    See gtk_style_context_push_animatable_region()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_cancel_animations" gtk_style_context_cancel_animations ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr () ->                               -- region_id : TBasicType TPtr
    IO ()

{-# DEPRECATED styleContextCancelAnimations ["(Since version 3.6)","This function does nothing."] #-}
{- |
Stops all running animations for /@regionId@/ and all animatable
regions underneath.

A 'Nothing' /@regionId@/ will stop all ongoing animations in /@context@/,
when dealing with a 'GI.Gtk.Objects.StyleContext.StyleContext' obtained through
'GI.Gtk.Objects.Widget.widgetGetStyleContext', this is normally done for you
in all circumstances you would expect all widget to be stopped,
so this should be only used in complex widgets with different
animatable regions.

/Since: 3.0/
-}
styleContextCancelAnimations ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Ptr ()
    {- ^ /@regionId@/: animatable region to stop, or 'Nothing'.
    See 'GI.Gtk.Objects.StyleContext.styleContextPushAnimatableRegion' -}
    -> m ()
styleContextCancelAnimations context regionId = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_cancel_animations context' regionId
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextCancelAnimationsMethodInfo
instance (signature ~ (Ptr () -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextCancelAnimationsMethodInfo a signature where
    overloadedMethod _ = styleContextCancelAnimations

#endif

-- method StyleContext::get_background_color
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the color for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "RGBA"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the background color", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_background_color" gtk_style_context_get_background_color ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO ()

{-# DEPRECATED styleContextGetBackgroundColor ["(Since version 3.16)","Use 'GI.Gtk.Functions.renderBackground' instead."] #-}
{- |
Gets the background color for a given state.

This function is far less useful than it seems, and it should not be used in
newly written code. CSS has no concept of \"background color\", as a background
can be an image, or a gradient, or any other pattern including solid colors.

The only reason why you would call 'GI.Gtk.Objects.StyleContext.styleContextGetBackgroundColor' is
to use the returned value to draw the background with it; the correct way to
achieve this result is to use 'GI.Gtk.Functions.renderBackground' instead, along with CSS
style classes to modify the color to be rendered.

/Since: 3.0/
-}
styleContextGetBackgroundColor ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the color for -}
    -> m (Gdk.RGBA.RGBA)
styleContextGetBackgroundColor context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    color <- callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    gtk_style_context_get_background_color context' state' color
    color' <- (wrapBoxed Gdk.RGBA.RGBA) color
    touchManagedPtr context
    return color'

#if ENABLE_OVERLOADING
data StyleContextGetBackgroundColorMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gdk.RGBA.RGBA)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetBackgroundColorMethodInfo a signature where
    overloadedMethod _ = styleContextGetBackgroundColor

#endif

-- method StyleContext::get_border
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the border for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "border", argType = TInterface (Name {namespace = "Gtk", name = "Border"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the border settings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_border" gtk_style_context_get_border ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gtk.Border.Border ->                -- border : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

{- |
Gets the border for a given state as a 'GI.Gtk.Structs.Border.Border'.

See 'GI.Gtk.Objects.StyleContext.styleContextGetProperty' and
'GI.Gtk.Constants.STYLE_PROPERTY_BORDER_WIDTH' for details.

/Since: 3.0/
-}
styleContextGetBorder ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the border for -}
    -> m (Gtk.Border.Border)
styleContextGetBorder context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    border <- callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    gtk_style_context_get_border context' state' border
    border' <- (wrapBoxed Gtk.Border.Border) border
    touchManagedPtr context
    return border'

#if ENABLE_OVERLOADING
data StyleContextGetBorderMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gtk.Border.Border)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetBorderMethodInfo a signature where
    overloadedMethod _ = styleContextGetBorder

#endif

-- method StyleContext::get_border_color
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the color for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "RGBA"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the border color", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_border_color" gtk_style_context_get_border_color ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO ()

{-# DEPRECATED styleContextGetBorderColor ["(Since version 3.16)","Use 'GI.Gtk.Functions.renderFrame' instead."] #-}
{- |
Gets the border color for a given state.

/Since: 3.0/
-}
styleContextGetBorderColor ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the color for -}
    -> m (Gdk.RGBA.RGBA)
styleContextGetBorderColor context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    color <- callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    gtk_style_context_get_border_color context' state' color
    color' <- (wrapBoxed Gdk.RGBA.RGBA) color
    touchManagedPtr context
    return color'

#if ENABLE_OVERLOADING
data StyleContextGetBorderColorMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gdk.RGBA.RGBA)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetBorderColorMethodInfo a signature where
    overloadedMethod _ = styleContextGetBorderColor

#endif

-- method StyleContext::get_color
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the color for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "RGBA"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the foreground color", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_color" gtk_style_context_get_color ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO ()

{- |
Gets the foreground color for a given state.

See 'GI.Gtk.Objects.StyleContext.styleContextGetProperty' and
'GI.Gtk.Constants.STYLE_PROPERTY_COLOR' for details.

/Since: 3.0/
-}
styleContextGetColor ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the color for -}
    -> m (Gdk.RGBA.RGBA)
styleContextGetColor context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    color <- callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    gtk_style_context_get_color context' state' color
    color' <- (wrapBoxed Gdk.RGBA.RGBA) color
    touchManagedPtr context
    return color'

#if ENABLE_OVERLOADING
data StyleContextGetColorMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gdk.RGBA.RGBA)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetColorMethodInfo a signature where
    overloadedMethod _ = styleContextGetColor

#endif

-- method StyleContext::get_direction
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "TextDirection"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_direction" gtk_style_context_get_direction ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO CUInt

{-# DEPRECATED styleContextGetDirection ["(Since version 3.8)","Use 'GI.Gtk.Objects.StyleContext.styleContextGetState' and","  check for @/GTK_STATE_FLAG_DIR_LTR/@ and","  @/GTK_STATE_FLAG_DIR_RTL/@ instead."] #-}
{- |
Returns the widget direction used for rendering.

/Since: 3.0/
-}
styleContextGetDirection ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m Gtk.Enums.TextDirection
    {- ^ __Returns:__ the widget direction -}
styleContextGetDirection context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_direction context'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetDirectionMethodInfo
instance (signature ~ (m Gtk.Enums.TextDirection), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetDirectionMethodInfo a signature where
    overloadedMethod _ = styleContextGetDirection

#endif

-- method StyleContext::get_font
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the font for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Pango", name = "FontDescription"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_font" gtk_style_context_get_font ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    IO (Ptr Pango.FontDescription.FontDescription)

{-# DEPRECATED styleContextGetFont ["(Since version 3.8)","Use @/gtk_style_context_get()/@ for \\\"font\\\" or","    subproperties instead."] #-}
{- |
Returns the font description for a given state. The returned
object is const and will remain valid until the
'GI.Gtk.Objects.StyleContext.StyleContext'::@/changed/@ signal happens.

/Since: 3.0/
-}
styleContextGetFont ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the font for -}
    -> m Pango.FontDescription.FontDescription
    {- ^ __Returns:__ the 'GI.Pango.Structs.FontDescription.FontDescription' for the given
         state.  This object is owned by GTK+ and should not be
         freed. -}
styleContextGetFont context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    result <- gtk_style_context_get_font context' state'
    checkUnexpectedReturnNULL "styleContextGetFont" result
    result' <- (newBoxed Pango.FontDescription.FontDescription) result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetFontMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m Pango.FontDescription.FontDescription), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetFontMethodInfo a signature where
    overloadedMethod _ = styleContextGetFont

#endif

-- method StyleContext::get_frame_clock
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gdk", name = "FrameClock"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_frame_clock" gtk_style_context_get_frame_clock ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr Gdk.FrameClock.FrameClock)

{- |
Returns the 'GI.Gdk.Objects.FrameClock.FrameClock' to which /@context@/ is attached.

/Since: 3.8/
-}
styleContextGetFrameClock ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m (Maybe Gdk.FrameClock.FrameClock)
    {- ^ __Returns:__ a 'GI.Gdk.Objects.FrameClock.FrameClock', or 'Nothing'
 if /@context@/ does not have an attached frame clock. -}
styleContextGetFrameClock context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_frame_clock context'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gdk.FrameClock.FrameClock) result'
        return result''
    touchManagedPtr context
    return maybeResult

#if ENABLE_OVERLOADING
data StyleContextGetFrameClockMethodInfo
instance (signature ~ (m (Maybe Gdk.FrameClock.FrameClock)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetFrameClockMethodInfo a signature where
    overloadedMethod _ = styleContextGetFrameClock

#endif

-- method StyleContext::get_junction_sides
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "JunctionSides"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_junction_sides" gtk_style_context_get_junction_sides ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO CUInt

{- |
Returns the sides where rendered elements connect visually with others.

/Since: 3.0/
-}
styleContextGetJunctionSides ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m [Gtk.Flags.JunctionSides]
    {- ^ __Returns:__ the junction sides -}
styleContextGetJunctionSides context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_junction_sides context'
    let result' = wordToGFlags result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetJunctionSidesMethodInfo
instance (signature ~ (m [Gtk.Flags.JunctionSides]), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetJunctionSidesMethodInfo a signature where
    overloadedMethod _ = styleContextGetJunctionSides

#endif

-- method StyleContext::get_margin
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the border for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "margin", argType = TInterface (Name {namespace = "Gtk", name = "Border"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the margin settings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_margin" gtk_style_context_get_margin ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gtk.Border.Border ->                -- margin : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

{- |
Gets the margin for a given state as a 'GI.Gtk.Structs.Border.Border'.
See @/gtk_style_property_get()/@ and 'GI.Gtk.Constants.STYLE_PROPERTY_MARGIN'
for details.

/Since: 3.0/
-}
styleContextGetMargin ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the border for -}
    -> m (Gtk.Border.Border)
styleContextGetMargin context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    margin <- callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    gtk_style_context_get_margin context' state' margin
    margin' <- (wrapBoxed Gtk.Border.Border) margin
    touchManagedPtr context
    return margin'

#if ENABLE_OVERLOADING
data StyleContextGetMarginMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gtk.Border.Border)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetMarginMethodInfo a signature where
    overloadedMethod _ = styleContextGetMargin

#endif

-- method StyleContext::get_padding
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the padding for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "padding", argType = TInterface (Name {namespace = "Gtk", name = "Border"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return value for the padding settings", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_padding" gtk_style_context_get_padding ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr Gtk.Border.Border ->                -- padding : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

{- |
Gets the padding for a given state as a 'GI.Gtk.Structs.Border.Border'.
See @/gtk_style_context_get()/@ and 'GI.Gtk.Constants.STYLE_PROPERTY_PADDING'
for details.

/Since: 3.0/
-}
styleContextGetPadding ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the padding for -}
    -> m (Gtk.Border.Border)
styleContextGetPadding context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = gflagsToWord state
    padding <- callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    gtk_style_context_get_padding context' state' padding
    padding' <- (wrapBoxed Gtk.Border.Border) padding
    touchManagedPtr context
    return padding'

#if ENABLE_OVERLOADING
data StyleContextGetPaddingMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m (Gtk.Border.Border)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetPaddingMethodInfo a signature where
    overloadedMethod _ = styleContextGetPadding

#endif

-- method StyleContext::get_parent
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "StyleContext"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_parent" gtk_style_context_get_parent ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr StyleContext)

{- |
Gets the parent context set via 'GI.Gtk.Objects.StyleContext.styleContextSetParent'.
See that function for details.

/Since: 3.4/
-}
styleContextGetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m (Maybe StyleContext)
    {- ^ __Returns:__ the parent context or 'Nothing' -}
styleContextGetParent context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_parent context'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject StyleContext) result'
        return result''
    touchManagedPtr context
    return maybeResult

#if ENABLE_OVERLOADING
data StyleContextGetParentMethodInfo
instance (signature ~ (m (Maybe StyleContext)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetParentMethodInfo a signature where
    overloadedMethod _ = styleContextGetParent

#endif

-- method StyleContext::get_path
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "WidgetPath"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_path" gtk_style_context_get_path ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr Gtk.WidgetPath.WidgetPath)

{- |
Returns the widget path used for style matching.

/Since: 3.0/
-}
styleContextGetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m Gtk.WidgetPath.WidgetPath
    {- ^ __Returns:__ A 'GI.Gtk.Structs.WidgetPath.WidgetPath' -}
styleContextGetPath context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_path context'
    checkUnexpectedReturnNULL "styleContextGetPath" result
    result' <- (newBoxed Gtk.WidgetPath.WidgetPath) result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetPathMethodInfo
instance (signature ~ (m Gtk.WidgetPath.WidgetPath), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetPathMethodInfo a signature where
    overloadedMethod _ = styleContextGetPath

#endif

-- method StyleContext::get_property
-- method type : OrdinaryMethod
-- 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 = "property", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "style property name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to retrieve the property value for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the style property value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_property" gtk_style_context_get_property ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- property : TBasicType TUTF8
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    Ptr GValue ->                           -- value : TInterface (Name {namespace = "GObject", name = "Value"})
    IO ()

{- |
Gets a style property from /@context@/ for the given state.

Note that not all CSS properties that are supported by GTK+ can be
retrieved in this way, since they may not be representable as 'GI.GObject.Structs.Value.Value'.
GTK+ defines macros for a number of properties that can be used
with this function.

Note that passing a state other than the current state of /@context@/
is not recommended unless the style context has been saved with
'GI.Gtk.Objects.StyleContext.styleContextSave'.

When /@value@/ is no longer needed, 'GI.GObject.Structs.Value.valueUnset' must be called
to free any allocated memory.

/Since: 3.0/
-}
styleContextGetProperty ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@property@/: style property name -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@state@/: state to retrieve the property value for -}
    -> m (GValue)
styleContextGetProperty context property state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    property' <- textToCString property
    let state' = gflagsToWord state
    value <- callocBoxedBytes 24 :: IO (Ptr GValue)
    gtk_style_context_get_property context' property' state' value
    value' <- (wrapBoxed GValue) value
    touchManagedPtr context
    freeMem property'
    return value'

#if ENABLE_OVERLOADING
data StyleContextGetPropertyMethodInfo
instance (signature ~ (T.Text -> [Gtk.Flags.StateFlags] -> m (GValue)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetPropertyMethodInfo a signature where
    overloadedMethod _ = styleContextGetProperty

#endif

-- method StyleContext::get_scale
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_scale" gtk_style_context_get_scale ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO Int32

{- |
Returns the scale used for assets.

/Since: 3.10/
-}
styleContextGetScale ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m Int32
    {- ^ __Returns:__ the scale -}
styleContextGetScale context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_scale context'
    touchManagedPtr context
    return result

#if ENABLE_OVERLOADING
data StyleContextGetScaleMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetScaleMethodInfo a signature where
    overloadedMethod _ = styleContextGetScale

#endif

-- method StyleContext::get_screen
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gdk", name = "Screen"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_screen" gtk_style_context_get_screen ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr Gdk.Screen.Screen)

{- |
Returns the 'GI.Gdk.Objects.Screen.Screen' to which /@context@/ is attached.
-}
styleContextGetScreen ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m Gdk.Screen.Screen
    {- ^ __Returns:__ a 'GI.Gdk.Objects.Screen.Screen'. -}
styleContextGetScreen context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_screen context'
    checkUnexpectedReturnNULL "styleContextGetScreen" result
    result' <- (newObject Gdk.Screen.Screen) result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetScreenMethodInfo
instance (signature ~ (m Gdk.Screen.Screen), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetScreenMethodInfo a signature where
    overloadedMethod _ = styleContextGetScreen

#endif

-- method StyleContext::get_section
-- method type : OrdinaryMethod
-- 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 = "property", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "style property name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "CssSection"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_section" gtk_style_context_get_section ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- property : TBasicType TUTF8
    IO (Ptr Gtk.CssSection.CssSection)

{- |
Queries the location in the CSS where /@property@/ was defined for the
current /@context@/. Note that the state to be queried is taken from
'GI.Gtk.Objects.StyleContext.styleContextGetState'.

If the location is not available, 'Nothing' will be returned. The
location might not be available for various reasons, such as the
property being overridden, /@property@/ not naming a supported CSS
property or tracking of definitions being disabled for performance
reasons.

Shorthand CSS properties cannot be queried for a location and will
always return 'Nothing'.
-}
styleContextGetSection ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@property@/: style property name -}
    -> m (Maybe Gtk.CssSection.CssSection)
    {- ^ __Returns:__ 'Nothing' or the section where a value
for /@property@/ was defined -}
styleContextGetSection context property = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    property' <- textToCString property
    result <- gtk_style_context_get_section context' property'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newBoxed Gtk.CssSection.CssSection) result'
        return result''
    touchManagedPtr context
    freeMem property'
    return maybeResult

#if ENABLE_OVERLOADING
data StyleContextGetSectionMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gtk.CssSection.CssSection)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetSectionMethodInfo a signature where
    overloadedMethod _ = styleContextGetSection

#endif

-- method StyleContext::get_state
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "StateFlags"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_state" gtk_style_context_get_state ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO CUInt

{- |
Returns the state used for style matching.

This method should only be used to retrieve the 'GI.Gtk.Flags.StateFlags'
to pass to 'GI.Gtk.Objects.StyleContext.StyleContext' methods, like 'GI.Gtk.Objects.StyleContext.styleContextGetPadding'.
If you need to retrieve the current state of a 'GI.Gtk.Objects.Widget.Widget', use
'GI.Gtk.Objects.Widget.widgetGetStateFlags'.

/Since: 3.0/
-}
styleContextGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m [Gtk.Flags.StateFlags]
    {- ^ __Returns:__ the state flags -}
styleContextGetState context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_get_state context'
    let result' = wordToGFlags result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextGetStateMethodInfo
instance (signature ~ (m [Gtk.Flags.StateFlags]), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetStateMethodInfo a signature where
    overloadedMethod _ = styleContextGetState

#endif

-- method StyleContext::get_style_property
-- method type : OrdinaryMethod
-- 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 = "property_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the widget style property", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for the property value", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_get_style_property" gtk_style_context_get_style_property ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- property_name : TBasicType TUTF8
    Ptr GValue ->                           -- value : TInterface (Name {namespace = "GObject", name = "Value"})
    IO ()

{- |
Gets the value for a widget style property.

When /@value@/ is no longer needed, 'GI.GObject.Structs.Value.valueUnset' must be called
to free any allocated memory.
-}
styleContextGetStyleProperty ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@propertyName@/: the name of the widget style property -}
    -> GValue
    {- ^ /@value@/: Return location for the property value -}
    -> m ()
styleContextGetStyleProperty context propertyName value = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    propertyName' <- textToCString propertyName
    value' <- unsafeManagedPtrGetPtr value
    gtk_style_context_get_style_property context' propertyName' value'
    touchManagedPtr context
    touchManagedPtr value
    freeMem propertyName'
    return ()

#if ENABLE_OVERLOADING
data StyleContextGetStylePropertyMethodInfo
instance (signature ~ (T.Text -> GValue -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetStylePropertyMethodInfo a signature where
    overloadedMethod _ = styleContextGetStyleProperty

#endif

-- method StyleContext::has_class
-- method type : OrdinaryMethod
-- 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 = "class_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a class name", 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_style_context_has_class" gtk_style_context_has_class ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- class_name : TBasicType TUTF8
    IO CInt

{- |
Returns 'True' if /@context@/ currently has defined the
given class name.

/Since: 3.0/
-}
styleContextHasClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@className@/: a class name -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@context@/ has /@className@/ defined -}
styleContextHasClass context className = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    className' <- textToCString className
    result <- gtk_style_context_has_class context' className'
    let result' = (/= 0) result
    touchManagedPtr context
    freeMem className'
    return result'

#if ENABLE_OVERLOADING
data StyleContextHasClassMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextHasClassMethodInfo a signature where
    overloadedMethod _ = styleContextHasClass

#endif

-- method StyleContext::has_region
-- method type : OrdinaryMethod
-- 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 = "region_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a region name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags_return", argType = TInterface (Name {namespace = "Gtk", name = "RegionFlags"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for region flags", 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_style_context_has_region" gtk_style_context_has_region ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- region_name : TBasicType TUTF8
    Ptr CUInt ->                            -- flags_return : TInterface (Name {namespace = "Gtk", name = "RegionFlags"})
    IO CInt

{-# DEPRECATED styleContextHasRegion ["(Since version 3.14)"] #-}
{- |
Returns 'True' if /@context@/ has the region defined.
If /@flagsReturn@/ is not 'Nothing', it is set to the flags
affecting the region.

/Since: 3.0/
-}
styleContextHasRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@regionName@/: a region name -}
    -> m ((Bool, [Gtk.Flags.RegionFlags]))
    {- ^ __Returns:__ 'True' if region is defined -}
styleContextHasRegion context regionName = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    regionName' <- textToCString regionName
    flagsReturn <- allocMem :: IO (Ptr CUInt)
    result <- gtk_style_context_has_region context' regionName' flagsReturn
    let result' = (/= 0) result
    flagsReturn' <- peek flagsReturn
    let flagsReturn'' = wordToGFlags flagsReturn'
    touchManagedPtr context
    freeMem regionName'
    freeMem flagsReturn
    return (result', flagsReturn'')

#if ENABLE_OVERLOADING
data StyleContextHasRegionMethodInfo
instance (signature ~ (T.Text -> m ((Bool, [Gtk.Flags.RegionFlags]))), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextHasRegionMethodInfo a signature where
    overloadedMethod _ = styleContextHasRegion

#endif

-- method StyleContext::invalidate
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_invalidate" gtk_style_context_invalidate ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO ()

{-# DEPRECATED styleContextInvalidate ["(Since version 3.12)","Style contexts are invalidated automatically."] #-}
{- |
Invalidates /@context@/ style information, so it will be reconstructed
again. It is useful if you modify the /@context@/ and need the new
information immediately.

/Since: 3.0/
-}
styleContextInvalidate ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext'. -}
    -> m ()
styleContextInvalidate context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_invalidate context'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextInvalidateMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextInvalidateMethodInfo a signature where
    overloadedMethod _ = styleContextInvalidate

#endif

-- method StyleContext::list_classes
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TGList (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_list_classes" gtk_style_context_list_classes ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr (GList CString))

{- |
Returns the list of classes currently defined in /@context@/.

/Since: 3.0/
-}
styleContextListClasses ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of
         strings with the currently defined classes. The contents
         of the list are owned by GTK+, but you must free the list
         itself with @/g_list_free()/@ when you are done with it. -}
styleContextListClasses context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_list_classes context'
    result' <- unpackGList result
    result'' <- mapM cstringToText result'
    g_list_free result
    touchManagedPtr context
    return result''

#if ENABLE_OVERLOADING
data StyleContextListClassesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextListClassesMethodInfo a signature where
    overloadedMethod _ = styleContextListClasses

#endif

-- method StyleContext::list_regions
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Just (TGList (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_list_regions" gtk_style_context_list_regions ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO (Ptr (GList CString))

{-# DEPRECATED styleContextListRegions ["(Since version 3.14)"] #-}
{- |
Returns the list of regions currently defined in /@context@/.

/Since: 3.0/
-}
styleContextListRegions ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of
         strings with the currently defined regions. The contents
         of the list are owned by GTK+, but you must free the list
         itself with @/g_list_free()/@ when you are done with it. -}
styleContextListRegions context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- gtk_style_context_list_regions context'
    result' <- unpackGList result
    result'' <- mapM cstringToText result'
    g_list_free result
    touchManagedPtr context
    return result''

#if ENABLE_OVERLOADING
data StyleContextListRegionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextListRegionsMethodInfo a signature where
    overloadedMethod _ = styleContextListRegions

#endif

-- method StyleContext::lookup_color
-- method type : OrdinaryMethod
-- 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 = "color_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "color name to lookup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "color", argType = TInterface (Name {namespace = "Gdk", name = "RGBA"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Return location for the looked up color", 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_style_context_lookup_color" gtk_style_context_lookup_color ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- color_name : TBasicType TUTF8
    Ptr Gdk.RGBA.RGBA ->                    -- color : TInterface (Name {namespace = "Gdk", name = "RGBA"})
    IO CInt

{- |
Looks up and resolves a color name in the /@context@/ color map.
-}
styleContextLookupColor ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@colorName@/: color name to lookup -}
    -> m ((Bool, Gdk.RGBA.RGBA))
    {- ^ __Returns:__ 'True' if /@colorName@/ was found and resolved, 'False' otherwise -}
styleContextLookupColor context colorName = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    colorName' <- textToCString colorName
    color <- callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    result <- gtk_style_context_lookup_color context' colorName' color
    let result' = (/= 0) result
    color' <- (wrapBoxed Gdk.RGBA.RGBA) color
    touchManagedPtr context
    freeMem colorName'
    return (result', color')

#if ENABLE_OVERLOADING
data StyleContextLookupColorMethodInfo
instance (signature ~ (T.Text -> m ((Bool, Gdk.RGBA.RGBA))), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextLookupColorMethodInfo a signature where
    overloadedMethod _ = styleContextLookupColor

#endif

-- method StyleContext::lookup_icon_set
-- method type : OrdinaryMethod
-- 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 = "stock_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an icon name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "IconSet"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_lookup_icon_set" gtk_style_context_lookup_icon_set ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- stock_id : TBasicType TUTF8
    IO (Ptr Gtk.IconSet.IconSet)

{-# DEPRECATED styleContextLookupIconSet ["(Since version 3.10)","Use 'GI.Gtk.Objects.IconTheme.iconThemeLookupIcon' instead."] #-}
{- |
Looks up /@stockId@/ in the icon factories associated to /@context@/ and
the default icon factory, returning an icon set if found, otherwise
'Nothing'.
-}
styleContextLookupIconSet ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@stockId@/: an icon name -}
    -> m (Maybe Gtk.IconSet.IconSet)
    {- ^ __Returns:__ The looked up @/GtkIconSet/@, or 'Nothing' -}
styleContextLookupIconSet context stockId = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    stockId' <- textToCString stockId
    result <- gtk_style_context_lookup_icon_set context' stockId'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newBoxed Gtk.IconSet.IconSet) result'
        return result''
    touchManagedPtr context
    freeMem stockId'
    return maybeResult

#if ENABLE_OVERLOADING
data StyleContextLookupIconSetMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gtk.IconSet.IconSet)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextLookupIconSetMethodInfo a signature where
    overloadedMethod _ = styleContextLookupIconSet

#endif

-- method StyleContext::notify_state_change
-- method type : OrdinaryMethod
-- 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 = "window", argType = TInterface (Name {namespace = "Gdk", name = "Window"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkWindow", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "region_id", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "animatable region to notify on, or %NULL.\n    See gtk_style_context_push_animatable_region()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to trigger transition for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "state_value", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE if @state is the state we are changing to,\n    %FALSE if we are changing away from it", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_notify_state_change" gtk_style_context_notify_state_change ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.Window.Window ->                -- window : TInterface (Name {namespace = "Gdk", name = "Window"})
    Ptr () ->                               -- region_id : TBasicType TPtr
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateType"})
    CInt ->                                 -- state_value : TBasicType TBoolean
    IO ()

{-# DEPRECATED styleContextNotifyStateChange ["(Since version 3.6)","This function does nothing."] #-}
{- |
Notifies a state change on /@context@/, so if the current style makes use
of transition animations, one will be started so all rendered elements
under /@regionId@/ are animated for state /@state@/ being set to value
/@stateValue@/.

The /@window@/ parameter is used in order to invalidate the rendered area
as the animation runs, so make sure it is the same window that is being
rendered on by the gtk_render_*() functions.

If /@regionId@/ is 'Nothing', all rendered elements using /@context@/ will be
affected by this state transition.

As a practical example, a 'GI.Gtk.Objects.Button.Button' notifying a state transition on
the prelight state:
> <!-- language="C" -->
>gtk_style_context_notify_state_change (context,
>                                       gtk_widget_get_window (widget),
>                                       NULL,
>                                       GTK_STATE_PRELIGHT,
>                                       button->in_button);


Can be handled in the CSS file like this:
> <!-- language="CSS" -->
>button {
>    background-color: #f00
>}
>
>button:hover {
>    background-color: #fff;
>    transition: 200ms linear
>}


This combination will animate the button background from red to white
if a pointer enters the button, and back to red if the pointer leaves
the button.

Note that /@state@/ is used when finding the transition parameters, which
is why the style places the transition under the :hover pseudo-class.

/Since: 3.0/
-}
styleContextNotifyStateChange ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@window@/: a 'GI.Gdk.Objects.Window.Window' -}
    -> Ptr ()
    {- ^ /@regionId@/: animatable region to notify on, or 'Nothing'.
    See 'GI.Gtk.Objects.StyleContext.styleContextPushAnimatableRegion' -}
    -> Gtk.Enums.StateType
    {- ^ /@state@/: state to trigger transition for -}
    -> Bool
    {- ^ /@stateValue@/: 'True' if /@state@/ is the state we are changing to,
    'False' if we are changing away from it -}
    -> m ()
styleContextNotifyStateChange context window regionId state stateValue = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    window' <- unsafeManagedPtrCastPtr window
    let state' = (fromIntegral . fromEnum) state
    let stateValue' = (fromIntegral . fromEnum) stateValue
    gtk_style_context_notify_state_change context' window' regionId state' stateValue'
    touchManagedPtr context
    touchManagedPtr window
    return ()

#if ENABLE_OVERLOADING
data StyleContextNotifyStateChangeMethodInfo
instance (signature ~ (b -> Ptr () -> Gtk.Enums.StateType -> Bool -> m ()), MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) => O.MethodInfo StyleContextNotifyStateChangeMethodInfo a signature where
    overloadedMethod _ = styleContextNotifyStateChange

#endif

-- method StyleContext::pop_animatable_region
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_pop_animatable_region" gtk_style_context_pop_animatable_region ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO ()

{-# DEPRECATED styleContextPopAnimatableRegion ["(Since version 3.6)","This function does nothing."] #-}
{- |
Pops an animatable region from /@context@/.
See 'GI.Gtk.Objects.StyleContext.styleContextPushAnimatableRegion'.

/Since: 3.0/
-}
styleContextPopAnimatableRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m ()
styleContextPopAnimatableRegion context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_pop_animatable_region context'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextPopAnimatableRegionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextPopAnimatableRegionMethodInfo a signature where
    overloadedMethod _ = styleContextPopAnimatableRegion

#endif

-- method StyleContext::push_animatable_region
-- method type : OrdinaryMethod
-- 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 = "region_id", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "unique identifier for the animatable region", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_push_animatable_region" gtk_style_context_push_animatable_region ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr () ->                               -- region_id : TBasicType TPtr
    IO ()

{-# DEPRECATED styleContextPushAnimatableRegion ["(Since version 3.6)","This function does nothing."] #-}
{- |
Pushes an animatable region, so all further gtk_render_*() calls between
this call and the following 'GI.Gtk.Objects.StyleContext.styleContextPopAnimatableRegion'
will potentially show transition animations for this region if
'GI.Gtk.Objects.StyleContext.styleContextNotifyStateChange' is called for a given state,
and the current theme\/style defines transition animations for state
changes.

The /@regionId@/ used must be unique in /@context@/ so the themes
can uniquely identify rendered elements subject to a state transition.

/Since: 3.0/
-}
styleContextPushAnimatableRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Ptr ()
    {- ^ /@regionId@/: unique identifier for the animatable region -}
    -> m ()
styleContextPushAnimatableRegion context regionId = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_push_animatable_region context' regionId
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextPushAnimatableRegionMethodInfo
instance (signature ~ (Ptr () -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextPushAnimatableRegionMethodInfo a signature where
    overloadedMethod _ = styleContextPushAnimatableRegion

#endif

-- method StyleContext::remove_class
-- method type : OrdinaryMethod
-- 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 = "class_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "class name to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_remove_class" gtk_style_context_remove_class ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- class_name : TBasicType TUTF8
    IO ()

{- |
Removes /@className@/ from /@context@/.

/Since: 3.0/
-}
styleContextRemoveClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@className@/: class name to remove -}
    -> m ()
styleContextRemoveClass context className = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    className' <- textToCString className
    gtk_style_context_remove_class context' className'
    touchManagedPtr context
    freeMem className'
    return ()

#if ENABLE_OVERLOADING
data StyleContextRemoveClassMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextRemoveClassMethodInfo a signature where
    overloadedMethod _ = styleContextRemoveClass

#endif

-- method StyleContext::remove_provider
-- method type : OrdinaryMethod
-- 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 = "provider", argType = TInterface (Name {namespace = "Gtk", name = "StyleProvider"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyleProvider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_remove_provider" gtk_style_context_remove_provider ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    IO ()

{- |
Removes /@provider@/ from the style providers list in /@context@/.

/Since: 3.0/
-}
styleContextRemoveProvider ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@provider@/: a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' -}
    -> m ()
styleContextRemoveProvider context provider = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    provider' <- unsafeManagedPtrCastPtr provider
    gtk_style_context_remove_provider context' provider'
    touchManagedPtr context
    touchManagedPtr provider
    return ()

#if ENABLE_OVERLOADING
data StyleContextRemoveProviderMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) => O.MethodInfo StyleContextRemoveProviderMethodInfo a signature where
    overloadedMethod _ = styleContextRemoveProvider

#endif

-- method StyleContext::remove_region
-- method type : OrdinaryMethod
-- 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 = "region_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "region name to unset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_remove_region" gtk_style_context_remove_region ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CString ->                              -- region_name : TBasicType TUTF8
    IO ()

{-# DEPRECATED styleContextRemoveRegion ["(Since version 3.14)"] #-}
{- |
Removes a region from /@context@/.

/Since: 3.0/
-}
styleContextRemoveRegion ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> T.Text
    {- ^ /@regionName@/: region name to unset -}
    -> m ()
styleContextRemoveRegion context regionName = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    regionName' <- textToCString regionName
    gtk_style_context_remove_region context' regionName'
    touchManagedPtr context
    freeMem regionName'
    return ()

#if ENABLE_OVERLOADING
data StyleContextRemoveRegionMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextRemoveRegionMethodInfo a signature where
    overloadedMethod _ = styleContextRemoveRegion

#endif

-- method StyleContext::restore
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_restore" gtk_style_context_restore ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO ()

{- |
Restores /@context@/ state to a previous stage.
See 'GI.Gtk.Objects.StyleContext.styleContextSave'.

/Since: 3.0/
-}
styleContextRestore ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m ()
styleContextRestore context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_restore context'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextRestoreMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextRestoreMethodInfo a signature where
    overloadedMethod _ = styleContextRestore

#endif

-- method StyleContext::save
-- method type : OrdinaryMethod
-- 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}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_save" gtk_style_context_save ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO ()

{- |
Saves the /@context@/ state, so temporary modifications done through
'GI.Gtk.Objects.StyleContext.styleContextAddClass', 'GI.Gtk.Objects.StyleContext.styleContextRemoveClass',
'GI.Gtk.Objects.StyleContext.styleContextSetState', etc. can quickly be reverted
in one go through 'GI.Gtk.Objects.StyleContext.styleContextRestore'.

The matching call to 'GI.Gtk.Objects.StyleContext.styleContextRestore' must be done
before GTK returns to the main loop.

/Since: 3.0/
-}
styleContextSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> m ()
styleContextSave context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_save context'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextSaveMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSaveMethodInfo a signature where
    overloadedMethod _ = styleContextSave

#endif

-- method StyleContext::scroll_animations
-- method type : OrdinaryMethod
-- 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 = "window", argType = TInterface (Name {namespace = "Gdk", name = "Window"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkWindow used previously in\n         gtk_style_context_notify_state_change()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dx", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Amount to scroll in the X axis", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dy", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Amount to scroll in the Y axis", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_scroll_animations" gtk_style_context_scroll_animations ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.Window.Window ->                -- window : TInterface (Name {namespace = "Gdk", name = "Window"})
    Int32 ->                                -- dx : TBasicType TInt
    Int32 ->                                -- dy : TBasicType TInt
    IO ()

{-# DEPRECATED styleContextScrollAnimations ["(Since version 3.6)","This function does nothing."] #-}
{- |
This function is analogous to 'GI.Gdk.Objects.Window.windowScroll', and
should be called together with it so the invalidation
areas for any ongoing animation are scrolled together
with it.

/Since: 3.0/
-}
styleContextScrollAnimations ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@window@/: a 'GI.Gdk.Objects.Window.Window' used previously in
         'GI.Gtk.Objects.StyleContext.styleContextNotifyStateChange' -}
    -> Int32
    {- ^ /@dx@/: Amount to scroll in the X axis -}
    -> Int32
    {- ^ /@dy@/: Amount to scroll in the Y axis -}
    -> m ()
styleContextScrollAnimations context window dx dy = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    window' <- unsafeManagedPtrCastPtr window
    gtk_style_context_scroll_animations context' window' dx dy
    touchManagedPtr context
    touchManagedPtr window
    return ()

#if ENABLE_OVERLOADING
data StyleContextScrollAnimationsMethodInfo
instance (signature ~ (b -> Int32 -> Int32 -> m ()), MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) => O.MethodInfo StyleContextScrollAnimationsMethodInfo a signature where
    overloadedMethod _ = styleContextScrollAnimations

#endif

-- method StyleContext::set_background
-- method type : OrdinaryMethod
-- 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 = "window", argType = TInterface (Name {namespace = "Gdk", name = "Window"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkWindow", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_background" gtk_style_context_set_background ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.Window.Window ->                -- window : TInterface (Name {namespace = "Gdk", name = "Window"})
    IO ()

{-# DEPRECATED styleContextSetBackground ["(Since version 3.18)","Use 'GI.Gtk.Functions.renderBackground' instead.","  Note that clients still using this function are now responsible","  for calling this function again whenever /@context@/ is invalidated."] #-}
{- |
Sets the background of /@window@/ to the background pattern or
color specified in /@context@/ for its current state.

/Since: 3.0/
-}
styleContextSetBackground ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@window@/: a 'GI.Gdk.Objects.Window.Window' -}
    -> m ()
styleContextSetBackground context window = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    window' <- unsafeManagedPtrCastPtr window
    gtk_style_context_set_background context' window'
    touchManagedPtr context
    touchManagedPtr window
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetBackgroundMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsStyleContext a, Gdk.Window.IsWindow b) => O.MethodInfo StyleContextSetBackgroundMethodInfo a signature where
    overloadedMethod _ = styleContextSetBackground

#endif

-- method StyleContext::set_direction
-- method type : OrdinaryMethod
-- 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 = "direction", argType = TInterface (Name {namespace = "Gtk", name = "TextDirection"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the new direction.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_direction" gtk_style_context_set_direction ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "Gtk", name = "TextDirection"})
    IO ()

{-# DEPRECATED styleContextSetDirection ["(Since version 3.8)","Use 'GI.Gtk.Objects.StyleContext.styleContextSetState' with","  @/GTK_STATE_FLAG_DIR_LTR/@ and @/GTK_STATE_FLAG_DIR_RTL/@","  instead."] #-}
{- |
Sets the reading direction for rendering purposes.

If you are using a 'GI.Gtk.Objects.StyleContext.StyleContext' returned from
'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to
call this yourself.

/Since: 3.0/
-}
styleContextSetDirection ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Gtk.Enums.TextDirection
    {- ^ /@direction@/: the new direction. -}
    -> m ()
styleContextSetDirection context direction = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let direction' = (fromIntegral . fromEnum) direction
    gtk_style_context_set_direction context' direction'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetDirectionMethodInfo
instance (signature ~ (Gtk.Enums.TextDirection -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSetDirectionMethodInfo a signature where
    overloadedMethod _ = styleContextSetDirection

#endif

-- method StyleContext::set_frame_clock
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "Gtk", name = "StyleContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkFrameClock", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "frame_clock", argType = TInterface (Name {namespace = "Gdk", name = "FrameClock"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkFrameClock", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_frame_clock" gtk_style_context_set_frame_clock ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.FrameClock.FrameClock ->        -- frame_clock : TInterface (Name {namespace = "Gdk", name = "FrameClock"})
    IO ()

{- |
Attaches /@context@/ to the given frame clock.

The frame clock is used for the timing of animations.

If you are using a 'GI.Gtk.Objects.StyleContext.StyleContext' returned from
'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to
call this yourself.

/Since: 3.8/
-}
styleContextSetFrameClock ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.FrameClock.IsFrameClock b) =>
    a
    {- ^ /@context@/: a 'GI.Gdk.Objects.FrameClock.FrameClock' -}
    -> b
    {- ^ /@frameClock@/: a 'GI.Gdk.Objects.FrameClock.FrameClock' -}
    -> m ()
styleContextSetFrameClock context frameClock = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    frameClock' <- unsafeManagedPtrCastPtr frameClock
    gtk_style_context_set_frame_clock context' frameClock'
    touchManagedPtr context
    touchManagedPtr frameClock
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetFrameClockMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsStyleContext a, Gdk.FrameClock.IsFrameClock b) => O.MethodInfo StyleContextSetFrameClockMethodInfo a signature where
    overloadedMethod _ = styleContextSetFrameClock

#endif

-- method StyleContext::set_junction_sides
-- method type : OrdinaryMethod
-- 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 = "sides", argType = TInterface (Name {namespace = "Gtk", name = "JunctionSides"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "sides where rendered elements are visually connected to\n    other elements", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_junction_sides" gtk_style_context_set_junction_sides ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- sides : TInterface (Name {namespace = "Gtk", name = "JunctionSides"})
    IO ()

{- |
Sets the sides where rendered elements (mostly through
'GI.Gtk.Functions.renderFrame') will visually connect with other visual elements.

This is merely a hint that may or may not be honored
by themes.

Container widgets are expected to set junction hints as appropriate
for their children, so it should not normally be necessary to call
this function manually.

/Since: 3.0/
-}
styleContextSetJunctionSides ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.JunctionSides]
    {- ^ /@sides@/: sides where rendered elements are visually connected to
    other elements -}
    -> m ()
styleContextSetJunctionSides context sides = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let sides' = gflagsToWord sides
    gtk_style_context_set_junction_sides context' sides'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetJunctionSidesMethodInfo
instance (signature ~ ([Gtk.Flags.JunctionSides] -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSetJunctionSidesMethodInfo a signature where
    overloadedMethod _ = styleContextSetJunctionSides

#endif

-- method StyleContext::set_parent
-- method type : OrdinaryMethod
-- 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 = "parent", argType = TInterface (Name {namespace = "Gtk", name = "StyleContext"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the new parent or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_parent" gtk_style_context_set_parent ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr StyleContext ->                     -- parent : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    IO ()

{- |
Sets the parent style context for /@context@/. The parent style
context is used to implement
<http://www.w3.org/TR/css3-cascade/#inheritance inheritance>
of properties.

If you are using a 'GI.Gtk.Objects.StyleContext.StyleContext' returned from
'GI.Gtk.Objects.Widget.widgetGetStyleContext', the parent will be set for you.

/Since: 3.4/
-}
styleContextSetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, IsStyleContext b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Maybe (b)
    {- ^ /@parent@/: the new parent or 'Nothing' -}
    -> m ()
styleContextSetParent context parent = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    gtk_style_context_set_parent context' maybeParent
    touchManagedPtr context
    whenJust parent touchManagedPtr
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetParentMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsStyleContext a, IsStyleContext b) => O.MethodInfo StyleContextSetParentMethodInfo a signature where
    overloadedMethod _ = styleContextSetParent

#endif

-- method StyleContext::set_path
-- method type : OrdinaryMethod
-- 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 = "path", argType = TInterface (Name {namespace = "Gtk", name = "WidgetPath"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkWidgetPath", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_path" gtk_style_context_set_path ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gtk.WidgetPath.WidgetPath ->        -- path : TInterface (Name {namespace = "Gtk", name = "WidgetPath"})
    IO ()

{- |
Sets the 'GI.Gtk.Structs.WidgetPath.WidgetPath' used for style matching. As a
consequence, the style will be regenerated to match
the new given path.

If you are using a 'GI.Gtk.Objects.StyleContext.StyleContext' returned from
'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to call
this yourself.

/Since: 3.0/
-}
styleContextSetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Gtk.WidgetPath.WidgetPath
    {- ^ /@path@/: a 'GI.Gtk.Structs.WidgetPath.WidgetPath' -}
    -> m ()
styleContextSetPath context path = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    path' <- unsafeManagedPtrGetPtr path
    gtk_style_context_set_path context' path'
    touchManagedPtr context
    touchManagedPtr path
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetPathMethodInfo
instance (signature ~ (Gtk.WidgetPath.WidgetPath -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSetPathMethodInfo a signature where
    overloadedMethod _ = styleContextSetPath

#endif

-- method StyleContext::set_scale
-- method type : OrdinaryMethod
-- 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 = "scale", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "scale", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_scale" gtk_style_context_set_scale ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Int32 ->                                -- scale : TBasicType TInt
    IO ()

{- |
Sets the scale to use when getting image assets for the style.

/Since: 3.10/
-}
styleContextSetScale ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Int32
    {- ^ /@scale@/: scale -}
    -> m ()
styleContextSetScale context scale = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    gtk_style_context_set_scale context' scale
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetScaleMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSetScaleMethodInfo a signature where
    overloadedMethod _ = styleContextSetScale

#endif

-- method StyleContext::set_screen
-- method type : OrdinaryMethod
-- 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 = "screen", argType = TInterface (Name {namespace = "Gdk", name = "Screen"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkScreen", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_screen" gtk_style_context_set_screen ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    IO ()

{- |
Attaches /@context@/ to the given screen.

The screen is used to add style information from “global” style
providers, such as the screen’s 'GI.Gtk.Objects.Settings.Settings' instance.

If you are using a 'GI.Gtk.Objects.StyleContext.StyleContext' returned from
'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to
call this yourself.

/Since: 3.0/
-}
styleContextSetScreen ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Screen.IsScreen b) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> b
    {- ^ /@screen@/: a 'GI.Gdk.Objects.Screen.Screen' -}
    -> m ()
styleContextSetScreen context screen = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    screen' <- unsafeManagedPtrCastPtr screen
    gtk_style_context_set_screen context' screen'
    touchManagedPtr context
    touchManagedPtr screen
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetScreenMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsStyleContext a, Gdk.Screen.IsScreen b) => O.MethodInfo StyleContextSetScreenMethodInfo a signature where
    overloadedMethod _ = styleContextSetScreen

#endif

-- method StyleContext::set_state
-- method type : OrdinaryMethod
-- 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 = "flags", argType = TInterface (Name {namespace = "Gtk", name = "StateFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "state to represent", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_set_state" gtk_style_context_set_state ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gtk", name = "StateFlags"})
    IO ()

{- |
Sets the state to be used for style matching.

/Since: 3.0/
-}
styleContextSetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StateFlags]
    {- ^ /@flags@/: state to represent -}
    -> m ()
styleContextSetState context flags = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let flags' = gflagsToWord flags
    gtk_style_context_set_state context' flags'
    touchManagedPtr context
    return ()

#if ENABLE_OVERLOADING
data StyleContextSetStateMethodInfo
instance (signature ~ ([Gtk.Flags.StateFlags] -> m ()), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextSetStateMethodInfo a signature where
    overloadedMethod _ = styleContextSetState

#endif

-- method StyleContext::state_is_running
-- method type : OrdinaryMethod
-- 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 = "state", argType = TInterface (Name {namespace = "Gtk", name = "StateType"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a widget state", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "progress", argType = TBasicType TDouble, direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the transition progress", 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_style_context_state_is_running" gtk_style_context_state_is_running ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- state : TInterface (Name {namespace = "Gtk", name = "StateType"})
    Ptr CDouble ->                          -- progress : TBasicType TDouble
    IO CInt

{-# DEPRECATED styleContextStateIsRunning ["(Since version 3.6)","This function always returns 'False'"] #-}
{- |
Returns 'True' if there is a transition animation running for the
current region (see 'GI.Gtk.Objects.StyleContext.styleContextPushAnimatableRegion').

If /@progress@/ is not 'Nothing', the animation progress will be returned
there, 0.0 means the state is closest to being unset, while 1.0 means
it’s closest to being set. This means transition animation will
run from 0 to 1 when /@state@/ is being set and from 1 to 0 when
it’s being unset.

/Since: 3.0/
-}
styleContextStateIsRunning ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> Gtk.Enums.StateType
    {- ^ /@state@/: a widget state -}
    -> m ((Bool, Double))
    {- ^ __Returns:__ 'True' if there is a running transition animation for /@state@/. -}
styleContextStateIsRunning context state = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let state' = (fromIntegral . fromEnum) state
    progress <- allocMem :: IO (Ptr CDouble)
    result <- gtk_style_context_state_is_running context' state' progress
    let result' = (/= 0) result
    progress' <- peek progress
    let progress'' = realToFrac progress'
    touchManagedPtr context
    freeMem progress
    return (result', progress'')

#if ENABLE_OVERLOADING
data StyleContextStateIsRunningMethodInfo
instance (signature ~ (Gtk.Enums.StateType -> m ((Bool, Double))), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextStateIsRunningMethodInfo a signature where
    overloadedMethod _ = styleContextStateIsRunning

#endif

-- method StyleContext::to_string
-- method type : OrdinaryMethod
-- 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 = "flags", argType = TInterface (Name {namespace = "Gtk", name = "StyleContextPrintFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Flags that determine what to print", 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_style_context_to_string" gtk_style_context_to_string ::
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gtk", name = "StyleContextPrintFlags"})
    IO CString

{- |
Converts the style context into a string representation.

The string representation always includes information about
the name, state, id, visibility and style classes of the CSS
node that is backing /@context@/. Depending on the flags, more
information may be included.

This function is intended for testing and debugging of the
CSS implementation in GTK+. There are no guarantees about
the format of the returned string, it may change.

/Since: 3.20/
-}
styleContextToString ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    {- ^ /@context@/: a 'GI.Gtk.Objects.StyleContext.StyleContext' -}
    -> [Gtk.Flags.StyleContextPrintFlags]
    {- ^ /@flags@/: Flags that determine what to print -}
    -> m T.Text
    {- ^ __Returns:__ a newly allocated string representing /@context@/ -}
styleContextToString context flags = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let flags' = gflagsToWord flags
    result <- gtk_style_context_to_string context' flags'
    checkUnexpectedReturnNULL "styleContextToString" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr context
    return result'

#if ENABLE_OVERLOADING
data StyleContextToStringMethodInfo
instance (signature ~ ([Gtk.Flags.StyleContextPrintFlags] -> m T.Text), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextToStringMethodInfo a signature where
    overloadedMethod _ = styleContextToString

#endif

-- method StyleContext::add_provider_for_screen
-- method type : MemberFunction
-- Args : [Arg {argCName = "screen", argType = TInterface (Name {namespace = "Gdk", name = "Screen"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkScreen", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "provider", argType = TInterface (Name {namespace = "Gtk", name = "StyleProvider"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyleProvider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "priority", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the priority of the style provider. The lower\n           it is, the earlier it will be used in the style\n           construction. Typically this will be in the range\n           between %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK and\n           %GTK_STYLE_PROVIDER_PRIORITY_USER", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_add_provider_for_screen" gtk_style_context_add_provider_for_screen ::
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    Word32 ->                               -- priority : TBasicType TUInt
    IO ()

{- |
Adds a global style provider to /@screen@/, which will be used
in style construction for all @/GtkStyleContexts/@ under /@screen@/.

GTK+ uses this to make styling information from 'GI.Gtk.Objects.Settings.Settings'
available.

Note: If both priorities are the same, A 'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
added through 'GI.Gtk.Objects.StyleContext.styleContextAddProvider' takes precedence
over another added through this function.

/Since: 3.0/
-}
styleContextAddProviderForScreen ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    {- ^ /@screen@/: a 'GI.Gdk.Objects.Screen.Screen' -}
    -> b
    {- ^ /@provider@/: a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' -}
    -> Word32
    {- ^ /@priority@/: the priority of the style provider. The lower
           it is, the earlier it will be used in the style
           construction. Typically this will be in the range
           between 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_FALLBACK' and
           'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_USER' -}
    -> m ()
styleContextAddProviderForScreen screen provider priority = liftIO $ do
    screen' <- unsafeManagedPtrCastPtr screen
    provider' <- unsafeManagedPtrCastPtr provider
    gtk_style_context_add_provider_for_screen screen' provider' priority
    touchManagedPtr screen
    touchManagedPtr provider
    return ()

#if ENABLE_OVERLOADING
#endif

-- method StyleContext::remove_provider_for_screen
-- method type : MemberFunction
-- Args : [Arg {argCName = "screen", argType = TInterface (Name {namespace = "Gdk", name = "Screen"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkScreen", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "provider", argType = TInterface (Name {namespace = "Gtk", name = "StyleProvider"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkStyleProvider", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_remove_provider_for_screen" gtk_style_context_remove_provider_for_screen ::
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    IO ()

{- |
Removes /@provider@/ from the global style providers list in /@screen@/.

/Since: 3.0/
-}
styleContextRemoveProviderForScreen ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    {- ^ /@screen@/: a 'GI.Gdk.Objects.Screen.Screen' -}
    -> b
    {- ^ /@provider@/: a 'GI.Gtk.Interfaces.StyleProvider.StyleProvider' -}
    -> m ()
styleContextRemoveProviderForScreen screen provider = liftIO $ do
    screen' <- unsafeManagedPtrCastPtr screen
    provider' <- unsafeManagedPtrCastPtr provider
    gtk_style_context_remove_provider_for_screen screen' provider'
    touchManagedPtr screen
    touchManagedPtr provider
    return ()

#if ENABLE_OVERLOADING
#endif

-- method StyleContext::reset_widgets
-- method type : MemberFunction
-- Args : [Arg {argCName = "screen", argType = TInterface (Name {namespace = "Gdk", name = "Screen"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkScreen", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_style_context_reset_widgets" gtk_style_context_reset_widgets ::
    Ptr Gdk.Screen.Screen ->                -- screen : TInterface (Name {namespace = "Gdk", name = "Screen"})
    IO ()

{- |
This function recomputes the styles for all widgets under a particular
'GI.Gdk.Objects.Screen.Screen'. This 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 color scheme changes
in the related 'GI.Gtk.Objects.Settings.Settings' object.

/Since: 3.0/
-}
styleContextResetWidgets ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Screen.IsScreen a) =>
    a
    {- ^ /@screen@/: a 'GI.Gdk.Objects.Screen.Screen' -}
    -> m ()
styleContextResetWidgets screen = liftIO $ do
    screen' <- unsafeManagedPtrCastPtr screen
    gtk_style_context_reset_widgets screen'
    touchManagedPtr screen
    return ()

#if ENABLE_OVERLOADING
#endif