{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- t'GI.Gtk.Objects.StyleContext.StyleContext' is an object that stores styling information affecting
-- a widget defined by t'GI.Gtk.Structs.WidgetPath.WidgetPath'.
-- 
-- In order to construct the final style information, t'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 display through
-- 'GI.Gtk.Objects.StyleContext.styleContextAddProviderForDisplay'. The resulting style is a
-- combination of all providers’ information in priority order.
-- 
-- For GTK+ widgets, any t'GI.Gtk.Objects.StyleContext.StyleContext' returned by
-- 'GI.Gtk.Objects.Widget.widgetGetStyleContext' will already have a t'GI.Gtk.Structs.WidgetPath.WidgetPath', a
-- t'GI.Gdk.Objects.Display.Display' 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 display yourself to the created style context through
-- 'GI.Gtk.Objects.StyleContext.styleContextSetPath' and possibly 'GI.Gtk.Objects.StyleContext.styleContextSetDisplay'.
-- See the “Foreign drawing“ example in gtk4-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.
-- 
-- = 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
-- t'GI.Gtk.Interfaces.StyleProvider.StyleProvider' yourself with the 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_FALLBACK'
-- priority, either a t'GI.Gtk.Objects.CssProvider.CssProvider' or a custom object implementing the
-- t'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 t'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-4.0\/gtk.css@ will
-- still take precedence over your changes, as it uses the
-- 'GI.Gtk.Constants.STYLE_PROVIDER_PRIORITY_USER' priority.

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

module GI.Gtk.Objects.StyleContext
    ( 

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


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveStyleContextMethod               ,
#endif


-- ** addClass #method:addClass#

#if defined(ENABLE_OVERLOADING)
    StyleContextAddClassMethodInfo          ,
#endif
    styleContextAddClass                    ,


-- ** addProvider #method:addProvider#

#if defined(ENABLE_OVERLOADING)
    StyleContextAddProviderMethodInfo       ,
#endif
    styleContextAddProvider                 ,


-- ** addProviderForDisplay #method:addProviderForDisplay#

    styleContextAddProviderForDisplay       ,


-- ** getBorder #method:getBorder#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetBorderMethodInfo         ,
#endif
    styleContextGetBorder                   ,


-- ** getColor #method:getColor#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetColorMethodInfo          ,
#endif
    styleContextGetColor                    ,


-- ** getDisplay #method:getDisplay#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetDisplayMethodInfo        ,
#endif
    styleContextGetDisplay                  ,


-- ** getMargin #method:getMargin#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetMarginMethodInfo         ,
#endif
    styleContextGetMargin                   ,


-- ** getPadding #method:getPadding#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetPaddingMethodInfo        ,
#endif
    styleContextGetPadding                  ,


-- ** getParent #method:getParent#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetParentMethodInfo         ,
#endif
    styleContextGetParent                   ,


-- ** getPath #method:getPath#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetPathMethodInfo           ,
#endif
    styleContextGetPath                     ,


-- ** getProperty #method:getProperty#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetPropertyMethodInfo       ,
#endif
    styleContextGetProperty                 ,


-- ** getScale #method:getScale#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetScaleMethodInfo          ,
#endif
    styleContextGetScale                    ,


-- ** getState #method:getState#

#if defined(ENABLE_OVERLOADING)
    StyleContextGetStateMethodInfo          ,
#endif
    styleContextGetState                    ,


-- ** hasClass #method:hasClass#

#if defined(ENABLE_OVERLOADING)
    StyleContextHasClassMethodInfo          ,
#endif
    styleContextHasClass                    ,


-- ** listClasses #method:listClasses#

#if defined(ENABLE_OVERLOADING)
    StyleContextListClassesMethodInfo       ,
#endif
    styleContextListClasses                 ,


-- ** lookupColor #method:lookupColor#

#if defined(ENABLE_OVERLOADING)
    StyleContextLookupColorMethodInfo       ,
#endif
    styleContextLookupColor                 ,


-- ** new #method:new#

    styleContextNew                         ,


-- ** removeClass #method:removeClass#

#if defined(ENABLE_OVERLOADING)
    StyleContextRemoveClassMethodInfo       ,
#endif
    styleContextRemoveClass                 ,


-- ** removeProvider #method:removeProvider#

#if defined(ENABLE_OVERLOADING)
    StyleContextRemoveProviderMethodInfo    ,
#endif
    styleContextRemoveProvider              ,


-- ** removeProviderForDisplay #method:removeProviderForDisplay#

    styleContextRemoveProviderForDisplay    ,


-- ** resetWidgets #method:resetWidgets#

    styleContextResetWidgets                ,


-- ** restore #method:restore#

#if defined(ENABLE_OVERLOADING)
    StyleContextRestoreMethodInfo           ,
#endif
    styleContextRestore                     ,


-- ** save #method:save#

#if defined(ENABLE_OVERLOADING)
    StyleContextSaveMethodInfo              ,
#endif
    styleContextSave                        ,


-- ** setDisplay #method:setDisplay#

#if defined(ENABLE_OVERLOADING)
    StyleContextSetDisplayMethodInfo        ,
#endif
    styleContextSetDisplay                  ,


-- ** setParent #method:setParent#

#if defined(ENABLE_OVERLOADING)
    StyleContextSetParentMethodInfo         ,
#endif
    styleContextSetParent                   ,


-- ** setPath #method:setPath#

#if defined(ENABLE_OVERLOADING)
    StyleContextSetPathMethodInfo           ,
#endif
    styleContextSetPath                     ,


-- ** setScale #method:setScale#

#if defined(ENABLE_OVERLOADING)
    StyleContextSetScaleMethodInfo          ,
#endif
    styleContextSetScale                    ,


-- ** setState #method:setState#

#if defined(ENABLE_OVERLOADING)
    StyleContextSetStateMethodInfo          ,
#endif
    styleContextSetState                    ,


-- ** toString #method:toString#

#if defined(ENABLE_OVERLOADING)
    StyleContextToStringMethodInfo          ,
#endif
    styleContextToString                    ,




 -- * Properties
-- ** display #attr:display#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    StyleContextDisplayPropertyInfo         ,
#endif
    constructStyleContextDisplay            ,
    getStyleContextDisplay                  ,
    setStyleContextDisplay                  ,
#if defined(ENABLE_OVERLOADING)
    styleContextDisplay                     ,
#endif


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

#if defined(ENABLE_OVERLOADING)
    StyleContextParentPropertyInfo          ,
#endif
    clearStyleContextParent                 ,
    constructStyleContextParent             ,
    getStyleContextParent                   ,
    setStyleContextParent                   ,
#if defined(ENABLE_OVERLOADING)
    styleContextParent                      ,
#endif




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

    C_StyleContextChangedCallback           ,
    StyleContextChangedCallback             ,
#if defined(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.GI.Base.Signals as B.Signals
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.Display as Gdk.Display
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
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.WidgetPath as Gtk.WidgetPath

-- | Memory-managed wrapper type.
newtype StyleContext = StyleContext (ManagedPtr StyleContext)
    deriving (StyleContext -> StyleContext -> Bool
(StyleContext -> StyleContext -> Bool)
-> (StyleContext -> StyleContext -> Bool) -> Eq StyleContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StyleContext -> StyleContext -> Bool
$c/= :: StyleContext -> StyleContext -> Bool
== :: StyleContext -> StyleContext -> Bool
$c== :: StyleContext -> StyleContext -> Bool
Eq)
foreign import ccall "gtk_style_context_get_type"
    c_gtk_style_context_get_type :: IO GType

instance GObject StyleContext where
    gobjectType :: IO GType
gobjectType = IO GType
c_gtk_style_context_get_type
    

-- | Convert 'StyleContext' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue StyleContext where
    toGValue :: StyleContext -> IO GValue
toGValue o :: StyleContext
o = do
        GType
gtype <- IO GType
c_gtk_style_context_get_type
        StyleContext -> (Ptr StyleContext -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StyleContext
o (GType
-> (GValue -> Ptr StyleContext -> IO ())
-> Ptr StyleContext
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr StyleContext -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO StyleContext
fromGValue gv :: GValue
gv = do
        Ptr StyleContext
ptr <- GValue -> IO (Ptr StyleContext)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr StyleContext)
        (ManagedPtr StyleContext -> StyleContext)
-> Ptr StyleContext -> IO StyleContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr StyleContext -> StyleContext
StyleContext Ptr StyleContext
ptr
        
    

-- | 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 :: o -> m StyleContext
toStyleContext = IO StyleContext -> m StyleContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StyleContext -> m StyleContext)
-> (o -> IO StyleContext) -> o -> m StyleContext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr StyleContext -> StyleContext) -> o -> IO StyleContext
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr StyleContext -> StyleContext
StyleContext

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

#if defined(ENABLE_OVERLOADING)
type family ResolveStyleContextMethod (t :: Symbol) (o :: *) :: * where
    ResolveStyleContextMethod "addClass" o = StyleContextAddClassMethodInfo
    ResolveStyleContextMethod "addProvider" o = StyleContextAddProviderMethodInfo
    ResolveStyleContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveStyleContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveStyleContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveStyleContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveStyleContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveStyleContextMethod "hasClass" o = StyleContextHasClassMethodInfo
    ResolveStyleContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveStyleContextMethod "listClasses" o = StyleContextListClassesMethodInfo
    ResolveStyleContextMethod "lookupColor" o = StyleContextLookupColorMethodInfo
    ResolveStyleContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveStyleContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveStyleContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveStyleContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveStyleContextMethod "removeClass" o = StyleContextRemoveClassMethodInfo
    ResolveStyleContextMethod "removeProvider" o = StyleContextRemoveProviderMethodInfo
    ResolveStyleContextMethod "restore" o = StyleContextRestoreMethodInfo
    ResolveStyleContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveStyleContextMethod "save" o = StyleContextSaveMethodInfo
    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 "getBorder" o = StyleContextGetBorderMethodInfo
    ResolveStyleContextMethod "getColor" o = StyleContextGetColorMethodInfo
    ResolveStyleContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveStyleContextMethod "getDisplay" o = StyleContextGetDisplayMethodInfo
    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 "getState" o = StyleContextGetStateMethodInfo
    ResolveStyleContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveStyleContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveStyleContextMethod "setDisplay" o = StyleContextSetDisplayMethodInfo
    ResolveStyleContextMethod "setParent" o = StyleContextSetParentMethodInfo
    ResolveStyleContextMethod "setPath" o = StyleContextSetPathMethodInfo
    ResolveStyleContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveStyleContextMethod "setScale" o = StyleContextSetScaleMethodInfo
    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 @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- signal StyleContext::changed
-- | The [changed](#signal:changed) signal is emitted when there is a change in the
-- t'GI.Gtk.Objects.StyleContext.StyleContext'.
-- 
-- For a t'GI.Gtk.Objects.StyleContext.StyleContext' returned by 'GI.Gtk.Objects.Widget.widgetGetStyleContext', the
-- [styleUpdated]("GI.Gtk.Objects.Widget#signal:styleUpdated") signal\/vfunc might be more convenient to use.
-- 
-- This signal is useful when using the theming layer standalone.
type StyleContextChangedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `StyleContextChangedCallback`@.
noStyleContextChangedCallback :: Maybe StyleContextChangedCallback
noStyleContextChangedCallback :: Maybe (IO ())
noStyleContextChangedCallback = Maybe (IO ())
forall a. Maybe a
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 :: IO () -> m (GClosure C_StyleContextChangedCallback)
genClosure_StyleContextChanged cb :: IO ()
cb = IO (GClosure C_StyleContextChangedCallback)
-> m (GClosure C_StyleContextChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StyleContextChangedCallback)
 -> m (GClosure C_StyleContextChangedCallback))
-> IO (GClosure C_StyleContextChangedCallback)
-> m (GClosure C_StyleContextChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_StyleContextChangedCallback
cb' = IO () -> C_StyleContextChangedCallback
wrap_StyleContextChangedCallback IO ()
cb
    C_StyleContextChangedCallback
-> IO (FunPtr C_StyleContextChangedCallback)
mk_StyleContextChangedCallback C_StyleContextChangedCallback
cb' IO (FunPtr C_StyleContextChangedCallback)
-> (FunPtr C_StyleContextChangedCallback
    -> IO (GClosure C_StyleContextChangedCallback))
-> IO (GClosure C_StyleContextChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StyleContextChangedCallback
-> IO (GClosure C_StyleContextChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


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


-- | Connect a signal handler for the [changed](#signal: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 :: a -> IO () -> m SignalHandlerId
onStyleContextChanged obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_StyleContextChangedCallback
cb' = IO () -> C_StyleContextChangedCallback
wrap_StyleContextChangedCallback IO ()
cb
    FunPtr C_StyleContextChangedCallback
cb'' <- C_StyleContextChangedCallback
-> IO (FunPtr C_StyleContextChangedCallback)
mk_StyleContextChangedCallback C_StyleContextChangedCallback
cb'
    a
-> Text
-> FunPtr C_StyleContextChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_StyleContextChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [changed](#signal: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 :: a -> IO () -> m SignalHandlerId
afterStyleContextChanged obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_StyleContextChangedCallback
cb' = IO () -> C_StyleContextChangedCallback
wrap_StyleContextChangedCallback IO ()
cb
    FunPtr C_StyleContextChangedCallback
cb'' <- C_StyleContextChangedCallback
-> IO (FunPtr C_StyleContextChangedCallback)
mk_StyleContextChangedCallback C_StyleContextChangedCallback
cb'
    a
-> Text
-> FunPtr C_StyleContextChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_StyleContextChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


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

#endif

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

-- | Get the value of the “@display@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' styleContext #display
-- @
getStyleContextDisplay :: (MonadIO m, IsStyleContext o) => o -> m Gdk.Display.Display
getStyleContextDisplay :: o -> m Display
getStyleContextDisplay obj :: o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getStyleContextDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO Display
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "display" ManagedPtr Display -> Display
Gdk.Display.Display

-- | Set the value of the “@display@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' styleContext [ #display 'Data.GI.Base.Attributes.:=' value ]
-- @
setStyleContextDisplay :: (MonadIO m, IsStyleContext o, Gdk.Display.IsDisplay a) => o -> a -> m ()
setStyleContextDisplay :: o -> a -> m ()
setStyleContextDisplay obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "display" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@display@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructStyleContextDisplay :: (IsStyleContext o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructStyleContextDisplay :: a -> IO (GValueConstruct o)
constructStyleContextDisplay val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "display" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

#if defined(ENABLE_OVERLOADING)
data StyleContextDisplayPropertyInfo
instance AttrInfo StyleContextDisplayPropertyInfo where
    type AttrAllowedOps StyleContextDisplayPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint StyleContextDisplayPropertyInfo = IsStyleContext
    type AttrSetTypeConstraint StyleContextDisplayPropertyInfo = Gdk.Display.IsDisplay
    type AttrTransferTypeConstraint StyleContextDisplayPropertyInfo = Gdk.Display.IsDisplay
    type AttrTransferType StyleContextDisplayPropertyInfo = Gdk.Display.Display
    type AttrGetType StyleContextDisplayPropertyInfo = Gdk.Display.Display
    type AttrLabel StyleContextDisplayPropertyInfo = "display"
    type AttrOrigin StyleContextDisplayPropertyInfo = StyleContext
    attrGet = getStyleContextDisplay
    attrSet = setStyleContextDisplay
    attrTransfer _ v = do
        unsafeCastTo Gdk.Display.Display v
    attrConstruct = constructStyleContextDisplay
    attrClear = undefined
#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 :: o -> m (Maybe StyleContext)
getStyleContextParent obj :: o
obj = IO (Maybe StyleContext) -> m (Maybe StyleContext)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe StyleContext) -> m (Maybe StyleContext))
-> IO (Maybe StyleContext) -> m (Maybe StyleContext)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr StyleContext -> StyleContext)
-> IO (Maybe StyleContext)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "parent" ManagedPtr StyleContext -> StyleContext
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 :: o -> a -> m ()
setStyleContextParent obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "parent" (a -> Maybe a
forall a. a -> Maybe a
Just a
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 :: a -> IO (GValueConstruct o)
constructStyleContextParent val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "parent" (a -> Maybe a
forall a. a -> Maybe a
Just a
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 :: o -> m ()
clearStyleContextParent obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe StyleContext -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "parent" (Maybe StyleContext
forall a. Maybe a
Nothing :: Maybe StyleContext)

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StyleContext
type instance O.AttributeList StyleContext = StyleContextAttributeList
type StyleContextAttributeList = ('[ '("display", StyleContextDisplayPropertyInfo), '("parent", StyleContextParentPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
styleContextDisplay :: AttrLabelProxy "display"
styleContextDisplay = AttrLabelProxy

styleContextParent :: AttrLabelProxy "parent"
styleContextParent = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
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 t'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 t'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 t'GI.Gtk.Objects.StyleContext.StyleContext'.
styleContextNew :: m StyleContext
styleContextNew  = IO StyleContext -> m StyleContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StyleContext -> m StyleContext)
-> IO StyleContext -> m StyleContext
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
result <- IO (Ptr StyleContext)
gtk_style_context_new
    Text -> Ptr StyleContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "styleContextNew" Ptr StyleContext
result
    StyleContext
result' <- ((ManagedPtr StyleContext -> StyleContext)
-> Ptr StyleContext -> IO StyleContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr StyleContext -> StyleContext
StyleContext) Ptr StyleContext
result
    StyleContext -> IO StyleContext
forall (m :: * -> *) a. Monad m => a -> m a
return StyleContext
result'

#if defined(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 t'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 { ... }
styleContextAddClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> T.Text
    -- ^ /@className@/: class name to use in styling
    -> m ()
styleContextAddClass :: a -> Text -> m ()
styleContextAddClass context :: a
context className :: Text
className = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CString
className' <- Text -> IO CString
textToCString Text
className
    Ptr StyleContext -> CString -> IO ()
gtk_style_context_add_class Ptr StyleContext
context' CString
className'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
className'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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.styleContextAddProviderForDisplay'.
-- 
-- Note: If both priorities are the same, a t'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
-- added through this function takes precedence over another added
-- through 'GI.Gtk.Objects.StyleContext.styleContextAddProviderForDisplay'.
styleContextAddProvider ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> b
    -- ^ /@provider@/: a t'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 :: a -> b -> Word32 -> m ()
styleContextAddProvider context :: a
context provider :: b
provider priority :: Word32
priority = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleProvider
provider' <- b -> IO (Ptr StyleProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
provider
    Ptr StyleContext -> Ptr StyleProvider -> Word32 -> IO ()
gtk_style_context_add_provider Ptr StyleContext
context' Ptr StyleProvider
provider' Word32
priority
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
provider
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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::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 = "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"})
    Ptr Gtk.Border.Border ->                -- border : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

-- | Gets the border for a given state as a t'GI.Gtk.Structs.Border.Border'.
-- 
-- See 'GI.Gtk.Objects.StyleContext.styleContextGetProperty' and
-- 'GI.Gtk.Constants.STYLE_PROPERTY_BORDER_WIDTH' for details.
styleContextGetBorder ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m (Gtk.Border.Border)
styleContextGetBorder :: a -> m Border
styleContextGetBorder context :: a
context = IO Border -> m Border
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Border -> m Border) -> IO Border -> m Border
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Border
border <- Int -> IO (Ptr Border)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    Ptr StyleContext -> Ptr Border -> IO ()
gtk_style_context_get_border Ptr StyleContext
context' Ptr Border
border
    Border
border' <- ((ManagedPtr Border -> Border) -> Ptr Border -> IO Border
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Border -> Border
Gtk.Border.Border) Ptr Border
border
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Border -> IO Border
forall (m :: * -> *) a. Monad m => a -> m a
return Border
border'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetBorderMethodInfo
instance (signature ~ (m (Gtk.Border.Border)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetBorderMethodInfo a signature where
    overloadedMethod = styleContextGetBorder

#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 = "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"})
    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.
styleContextGetColor ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m (Gdk.RGBA.RGBA)
styleContextGetColor :: a -> m RGBA
styleContextGetColor context :: a
context = IO RGBA -> m RGBA
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RGBA -> m RGBA) -> IO RGBA -> m RGBA
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr RGBA
color <- Int -> IO (Ptr RGBA)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    Ptr StyleContext -> Ptr RGBA -> IO ()
gtk_style_context_get_color Ptr StyleContext
context' Ptr RGBA
color
    RGBA
color' <- ((ManagedPtr RGBA -> RGBA) -> Ptr RGBA -> IO RGBA
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RGBA -> RGBA
Gdk.RGBA.RGBA) Ptr RGBA
color
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    RGBA -> IO RGBA
forall (m :: * -> *) a. Monad m => a -> m a
return RGBA
color'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetColorMethodInfo
instance (signature ~ (m (Gdk.RGBA.RGBA)), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetColorMethodInfo a signature where
    overloadedMethod = styleContextGetColor

#endif

-- method StyleContext::get_display
-- 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 = "Display" })
-- throws : False
-- Skip return : False

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

-- | Returns the t'GI.Gdk.Objects.Display.Display' to which /@context@/ is attached.
styleContextGetDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m Gdk.Display.Display
    -- ^ __Returns:__ a t'GI.Gdk.Objects.Display.Display'.
styleContextGetDisplay :: a -> m Display
styleContextGetDisplay context :: a
context = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Display
result <- Ptr StyleContext -> IO (Ptr Display)
gtk_style_context_get_display Ptr StyleContext
context'
    Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "styleContextGetDisplay" Ptr Display
result
    Display
result' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsStyleContext a) => O.MethodInfo StyleContextGetDisplayMethodInfo a signature where
    overloadedMethod = styleContextGetDisplay

#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 = "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"})
    Ptr Gtk.Border.Border ->                -- margin : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

-- | Gets the margin for a given state as a t'GI.Gtk.Structs.Border.Border'.
-- See @/gtk_style_property_get()/@ and 'GI.Gtk.Constants.STYLE_PROPERTY_MARGIN'
-- for details.
styleContextGetMargin ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m (Gtk.Border.Border)
styleContextGetMargin :: a -> m Border
styleContextGetMargin context :: a
context = IO Border -> m Border
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Border -> m Border) -> IO Border -> m Border
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Border
margin <- Int -> IO (Ptr Border)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    Ptr StyleContext -> Ptr Border -> IO ()
gtk_style_context_get_margin Ptr StyleContext
context' Ptr Border
margin
    Border
margin' <- ((ManagedPtr Border -> Border) -> Ptr Border -> IO Border
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Border -> Border
Gtk.Border.Border) Ptr Border
margin
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Border -> IO Border
forall (m :: * -> *) a. Monad m => a -> m a
return Border
margin'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetMarginMethodInfo
instance (signature ~ (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 = "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"})
    Ptr Gtk.Border.Border ->                -- padding : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO ()

-- | Gets the padding for a given state as a t'GI.Gtk.Structs.Border.Border'.
-- See @/gtk_style_context_get()/@ and 'GI.Gtk.Constants.STYLE_PROPERTY_PADDING'
-- for details.
styleContextGetPadding ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m (Gtk.Border.Border)
styleContextGetPadding :: a -> m Border
styleContextGetPadding context :: a
context = IO Border -> m Border
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Border -> m Border) -> IO Border -> m Border
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Border
padding <- Int -> IO (Ptr Border)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    Ptr StyleContext -> Ptr Border -> IO ()
gtk_style_context_get_padding Ptr StyleContext
context' Ptr Border
padding
    Border
padding' <- ((ManagedPtr Border -> Border) -> Ptr Border -> IO Border
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Border -> Border
Gtk.Border.Border) Ptr Border
padding
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Border -> IO Border
forall (m :: * -> *) a. Monad m => a -> m a
return Border
padding'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetPaddingMethodInfo
instance (signature ~ (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.
styleContextGetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m (Maybe StyleContext)
    -- ^ __Returns:__ the parent context or 'P.Nothing'
styleContextGetParent :: a -> m (Maybe StyleContext)
styleContextGetParent context :: a
context = IO (Maybe StyleContext) -> m (Maybe StyleContext)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe StyleContext) -> m (Maybe StyleContext))
-> IO (Maybe StyleContext) -> m (Maybe StyleContext)
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleContext
result <- Ptr StyleContext -> IO (Ptr StyleContext)
gtk_style_context_get_parent Ptr StyleContext
context'
    Maybe StyleContext
maybeResult <- Ptr StyleContext
-> (Ptr StyleContext -> IO StyleContext) -> IO (Maybe StyleContext)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr StyleContext
result ((Ptr StyleContext -> IO StyleContext) -> IO (Maybe StyleContext))
-> (Ptr StyleContext -> IO StyleContext) -> IO (Maybe StyleContext)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr StyleContext
result' -> do
        StyleContext
result'' <- ((ManagedPtr StyleContext -> StyleContext)
-> Ptr StyleContext -> IO StyleContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr StyleContext -> StyleContext
StyleContext) Ptr StyleContext
result'
        StyleContext -> IO StyleContext
forall (m :: * -> *) a. Monad m => a -> m a
return StyleContext
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Maybe StyleContext -> IO (Maybe StyleContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe StyleContext
maybeResult

#if defined(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.
styleContextGetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m Gtk.WidgetPath.WidgetPath
    -- ^ __Returns:__ A t'GI.Gtk.Structs.WidgetPath.WidgetPath'
styleContextGetPath :: a -> m WidgetPath
styleContextGetPath context :: a
context = IO WidgetPath -> m WidgetPath
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WidgetPath -> m WidgetPath) -> IO WidgetPath -> m WidgetPath
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr WidgetPath
result <- Ptr StyleContext -> IO (Ptr WidgetPath)
gtk_style_context_get_path Ptr StyleContext
context'
    Text -> Ptr WidgetPath -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "styleContextGetPath" Ptr WidgetPath
result
    WidgetPath
result' <- ((ManagedPtr WidgetPath -> WidgetPath)
-> Ptr WidgetPath -> IO WidgetPath
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr WidgetPath -> WidgetPath
Gtk.WidgetPath.WidgetPath) Ptr WidgetPath
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    WidgetPath -> IO WidgetPath
forall (m :: * -> *) a. Monad m => a -> m a
return WidgetPath
result'

#if defined(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 = "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
    Ptr GValue ->                           -- value : TInterface (Name {namespace = "GObject", name = "Value"})
    IO ()

-- | Gets a style property from /@context@/ for the current 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 t'GI.GObject.Structs.Value.Value'.
-- GTK+ defines macros for a number of properties that can be used
-- with this function.
-- 
-- When /@value@/ is no longer needed, 'GI.GObject.Structs.Value.valueUnset' must be called
-- to free any allocated memory.
styleContextGetProperty ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> T.Text
    -- ^ /@property@/: style property name
    -> m (GValue)
styleContextGetProperty :: a -> Text -> m GValue
styleContextGetProperty context :: a
context property :: Text
property = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CString
property' <- Text -> IO CString
textToCString Text
property
    Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 24 :: IO (Ptr GValue)
    Ptr StyleContext -> CString -> Ptr GValue -> IO ()
gtk_style_context_get_property Ptr StyleContext
context' CString
property' Ptr GValue
value
    GValue
value' <- ((ManagedPtr GValue -> GValue) -> Ptr GValue -> IO GValue
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr GValue -> GValue
GValue) Ptr GValue
value
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
property'
    GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
value'

#if defined(ENABLE_OVERLOADING)
data StyleContextGetPropertyMethodInfo
instance (signature ~ (T.Text -> 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.
styleContextGetScale ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m Int32
    -- ^ __Returns:__ the scale
styleContextGetScale :: a -> m Int32
styleContextGetScale context :: a
context = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Int32
result <- Ptr StyleContext -> IO Int32
gtk_style_context_get_scale Ptr StyleContext
context'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

#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 t'GI.Gtk.Flags.StateFlags'
-- to pass to t'GI.Gtk.Objects.StyleContext.StyleContext' methods, like 'GI.Gtk.Objects.StyleContext.styleContextGetPadding'.
-- If you need to retrieve the current state of a t'GI.Gtk.Objects.Widget.Widget', use
-- 'GI.Gtk.Objects.Widget.widgetGetStateFlags'.
styleContextGetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m [Gtk.Flags.StateFlags]
    -- ^ __Returns:__ the state flags
styleContextGetState :: a -> m [StateFlags]
styleContextGetState context :: a
context = IO [StateFlags] -> m [StateFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [StateFlags] -> m [StateFlags])
-> IO [StateFlags] -> m [StateFlags]
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CUInt
result <- Ptr StyleContext -> IO CUInt
gtk_style_context_get_state Ptr StyleContext
context'
    let result' :: [StateFlags]
result' = CUInt -> [StateFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    [StateFlags] -> IO [StateFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [StateFlags]
result'

#if defined(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::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 'P.True' if /@context@/ currently has defined the
-- given class name.
styleContextHasClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> T.Text
    -- ^ /@className@/: a class name
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@context@/ has /@className@/ defined
styleContextHasClass :: a -> Text -> m Bool
styleContextHasClass context :: a
context className :: Text
className = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CString
className' <- Text -> IO CString
textToCString Text
className
    CInt
result <- Ptr StyleContext -> CString -> IO CInt
gtk_style_context_has_class Ptr StyleContext
context' CString
className'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
className'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(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::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@/.
styleContextListClasses ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m [T.Text]
    -- ^ __Returns:__ a t'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 :: a -> m [Text]
styleContextListClasses context :: a
context = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr (GList CString)
result <- Ptr StyleContext -> IO (Ptr (GList CString))
gtk_style_context_list_classes Ptr StyleContext
context'
    [CString]
result' <- Ptr (GList CString) -> IO [CString]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList CString)
result
    [Text]
result'' <- (CString -> IO Text) -> [CString] -> IO [Text]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [CString]
result'
    Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''

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

#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 t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> T.Text
    -- ^ /@colorName@/: color name to lookup
    -> m ((Bool, Gdk.RGBA.RGBA))
    -- ^ __Returns:__ 'P.True' if /@colorName@/ was found and resolved, 'P.False' otherwise
styleContextLookupColor :: a -> Text -> m (Bool, RGBA)
styleContextLookupColor context :: a
context colorName :: Text
colorName = IO (Bool, RGBA) -> m (Bool, RGBA)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, RGBA) -> m (Bool, RGBA))
-> IO (Bool, RGBA) -> m (Bool, RGBA)
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CString
colorName' <- Text -> IO CString
textToCString Text
colorName
    Ptr RGBA
color <- Int -> IO (Ptr RGBA)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 32 :: IO (Ptr Gdk.RGBA.RGBA)
    CInt
result <- Ptr StyleContext -> CString -> Ptr RGBA -> IO CInt
gtk_style_context_lookup_color Ptr StyleContext
context' CString
colorName' Ptr RGBA
color
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    RGBA
color' <- ((ManagedPtr RGBA -> RGBA) -> Ptr RGBA -> IO RGBA
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RGBA -> RGBA
Gdk.RGBA.RGBA) Ptr RGBA
color
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
colorName'
    (Bool, RGBA) -> IO (Bool, RGBA)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', RGBA
color')

#if defined(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::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@/.
styleContextRemoveClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> T.Text
    -- ^ /@className@/: class name to remove
    -> m ()
styleContextRemoveClass :: a -> Text -> m ()
styleContextRemoveClass context :: a
context className :: Text
className = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    CString
className' <- Text -> IO CString
textToCString Text
className
    Ptr StyleContext -> CString -> IO ()
gtk_style_context_remove_class Ptr StyleContext
context' CString
className'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
className'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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@/.
styleContextRemoveProvider ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> b
    -- ^ /@provider@/: a t'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
    -> m ()
styleContextRemoveProvider :: a -> b -> m ()
styleContextRemoveProvider context :: a
context provider :: b
provider = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleProvider
provider' <- b -> IO (Ptr StyleProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
provider
    Ptr StyleContext -> Ptr StyleProvider -> IO ()
gtk_style_context_remove_provider Ptr StyleContext
context' Ptr StyleProvider
provider'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
provider
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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::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'.
styleContextRestore ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m ()
styleContextRestore :: a -> m ()
styleContextRestore context :: a
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleContext -> IO ()
gtk_style_context_restore Ptr StyleContext
context'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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.
styleContextSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> m ()
styleContextSave :: a -> m ()
styleContextSave context :: a
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleContext -> IO ()
gtk_style_context_save Ptr StyleContext
context'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

#endif

-- method StyleContext::set_display
-- 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 = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDisplay" , 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_display" gtk_style_context_set_display :: 
    Ptr StyleContext ->                     -- context : TInterface (Name {namespace = "Gtk", name = "StyleContext"})
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    IO ()

-- | Attaches /@context@/ to the given display.
-- 
-- The display is used to add style information from “global” style
-- providers, such as the display\'s t'GI.Gtk.Objects.Settings.Settings' instance.
-- 
-- If you are using a t'GI.Gtk.Objects.StyleContext.StyleContext' returned from
-- 'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to
-- call this yourself.
styleContextSetDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Display.IsDisplay b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> b
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display'
    -> m ()
styleContextSetDisplay :: a -> b -> m ()
styleContextSetDisplay context :: a
context display :: b
display = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr Display
display' <- b -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
display
    Ptr StyleContext -> Ptr Display -> IO ()
gtk_style_context_set_display Ptr StyleContext
context' Ptr Display
display'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
display
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data StyleContextSetDisplayMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsStyleContext a, Gdk.Display.IsDisplay b) => O.MethodInfo StyleContextSetDisplayMethodInfo a signature where
    overloadedMethod = styleContextSetDisplay

#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 t'GI.Gtk.Objects.StyleContext.StyleContext' returned from
-- 'GI.Gtk.Objects.Widget.widgetGetStyleContext', the parent will be set for you.
styleContextSetParent ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, IsStyleContext b) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Maybe (b)
    -- ^ /@parent@/: the new parent or 'P.Nothing'
    -> m ()
styleContextSetParent :: a -> Maybe b -> m ()
styleContextSetParent context :: a
context parent :: Maybe b
parent = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleContext
maybeParent <- case Maybe b
parent of
        Nothing -> Ptr StyleContext -> IO (Ptr StyleContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleContext
forall a. Ptr a
nullPtr
        Just jParent :: b
jParent -> do
            Ptr StyleContext
jParent' <- b -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr StyleContext -> IO (Ptr StyleContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleContext
jParent'
    Ptr StyleContext -> Ptr StyleContext -> IO ()
gtk_style_context_set_parent Ptr StyleContext
context' Ptr StyleContext
maybeParent
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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 t'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 t'GI.Gtk.Objects.StyleContext.StyleContext' returned from
-- 'GI.Gtk.Objects.Widget.widgetGetStyleContext', you do not need to call
-- this yourself.
styleContextSetPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Gtk.WidgetPath.WidgetPath
    -- ^ /@path@/: a t'GI.Gtk.Structs.WidgetPath.WidgetPath'
    -> m ()
styleContextSetPath :: a -> WidgetPath -> m ()
styleContextSetPath context :: a
context path :: WidgetPath
path = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr WidgetPath
path' <- WidgetPath -> IO (Ptr WidgetPath)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr WidgetPath
path
    Ptr StyleContext -> Ptr WidgetPath -> IO ()
gtk_style_context_set_path Ptr StyleContext
context' Ptr WidgetPath
path'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    WidgetPath -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr WidgetPath
path
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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.
styleContextSetScale ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> Int32
    -- ^ /@scale@/: scale
    -> m ()
styleContextSetScale :: a -> Int32 -> m ()
styleContextSetScale context :: a
context scale :: Int32
scale = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    Ptr StyleContext -> Int32 -> IO ()
gtk_style_context_set_scale Ptr StyleContext
context' Int32
scale
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

#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.
styleContextSetState ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'GI.Gtk.Objects.StyleContext.StyleContext'
    -> [Gtk.Flags.StateFlags]
    -- ^ /@flags@/: state to represent
    -> m ()
styleContextSetState :: a -> [StateFlags] -> m ()
styleContextSetState context :: a
context flags :: [StateFlags]
flags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    let flags' :: CUInt
flags' = [StateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [StateFlags]
flags
    Ptr StyleContext -> CUInt -> IO ()
gtk_style_context_set_state Ptr StyleContext
context' CUInt
flags'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(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::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.
styleContextToString ::
    (B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
    a
    -- ^ /@context@/: a t'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 :: a -> [StyleContextPrintFlags] -> m Text
styleContextToString context :: a
context flags :: [StyleContextPrintFlags]
flags = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr StyleContext
context' <- a -> IO (Ptr StyleContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
context
    let flags' :: CUInt
flags' = [StyleContextPrintFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [StyleContextPrintFlags]
flags
    CString
result <- Ptr StyleContext -> CUInt -> IO CString
gtk_style_context_to_string Ptr StyleContext
context' CUInt
flags'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "styleContextToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
context
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(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_display
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDisplay" , 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_display" gtk_style_context_add_provider_for_display :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    Word32 ->                               -- priority : TBasicType TUInt
    IO ()

-- | Adds a global style provider to /@display@/, which will be used
-- in style construction for all @/GtkStyleContexts/@ under /@display@/.
-- 
-- GTK+ uses this to make styling information from t'GI.Gtk.Objects.Settings.Settings'
-- available.
-- 
-- Note: If both priorities are the same, A t'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
-- added through 'GI.Gtk.Objects.StyleContext.styleContextAddProvider' takes precedence
-- over another added through this function.
styleContextAddProviderForDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display'
    -> b
    -- ^ /@provider@/: a t'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 ()
styleContextAddProviderForDisplay :: a -> b -> Word32 -> m ()
styleContextAddProviderForDisplay display :: a
display provider :: b
provider priority :: Word32
priority = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr StyleProvider
provider' <- b -> IO (Ptr StyleProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
provider
    Ptr Display -> Ptr StyleProvider -> Word32 -> IO ()
gtk_style_context_add_provider_for_display Ptr Display
display' Ptr StyleProvider
provider' Word32
priority
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
provider
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method StyleContext::remove_provider_for_display
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDisplay" , 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_display" gtk_style_context_remove_provider_for_display :: 
    Ptr Gdk.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    Ptr Gtk.StyleProvider.StyleProvider ->  -- provider : TInterface (Name {namespace = "Gtk", name = "StyleProvider"})
    IO ()

-- | Removes /@provider@/ from the global style providers list in /@display@/.
styleContextRemoveProviderForDisplay ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.StyleProvider.IsStyleProvider b) =>
    a
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display'
    -> b
    -- ^ /@provider@/: a t'GI.Gtk.Interfaces.StyleProvider.StyleProvider'
    -> m ()
styleContextRemoveProviderForDisplay :: a -> b -> m ()
styleContextRemoveProviderForDisplay display :: a
display provider :: b
provider = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr StyleProvider
provider' <- b -> IO (Ptr StyleProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
provider
    Ptr Display -> Ptr StyleProvider -> IO ()
gtk_style_context_remove_provider_for_display Ptr Display
display' Ptr StyleProvider
provider'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
provider
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method StyleContext::reset_widgets
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "display"
--           , argType =
--               TInterface Name { namespace = "Gdk" , name = "Display" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GdkDisplay" , 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.Display.Display ->              -- display : TInterface (Name {namespace = "Gdk", name = "Display"})
    IO ()

-- | This function recomputes the styles for all widgets under a particular
-- t'GI.Gdk.Objects.Display.Display'. 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 t'GI.Gtk.Objects.Settings.Settings' object.
styleContextResetWidgets ::
    (B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
    a
    -- ^ /@display@/: a t'GI.Gdk.Objects.Display.Display'
    -> m ()
styleContextResetWidgets :: a -> m ()
styleContextResetWidgets display :: a
display = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
    Ptr Display -> IO ()
gtk_style_context_reset_widgets Ptr Display
display'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif