{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.StyleContext
(
StyleContext(..) ,
IsStyleContext ,
toStyleContext ,
#if defined(ENABLE_OVERLOADING)
ResolveStyleContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
StyleContextAddClassMethodInfo ,
#endif
styleContextAddClass ,
#if defined(ENABLE_OVERLOADING)
StyleContextAddProviderMethodInfo ,
#endif
styleContextAddProvider ,
styleContextAddProviderForDisplay ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetBorderMethodInfo ,
#endif
styleContextGetBorder ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetColorMethodInfo ,
#endif
styleContextGetColor ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetDisplayMethodInfo ,
#endif
styleContextGetDisplay ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetMarginMethodInfo ,
#endif
styleContextGetMargin ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetPaddingMethodInfo ,
#endif
styleContextGetPadding ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetScaleMethodInfo ,
#endif
styleContextGetScale ,
#if defined(ENABLE_OVERLOADING)
StyleContextGetStateMethodInfo ,
#endif
styleContextGetState ,
#if defined(ENABLE_OVERLOADING)
StyleContextHasClassMethodInfo ,
#endif
styleContextHasClass ,
#if defined(ENABLE_OVERLOADING)
StyleContextLookupColorMethodInfo ,
#endif
styleContextLookupColor ,
#if defined(ENABLE_OVERLOADING)
StyleContextRemoveClassMethodInfo ,
#endif
styleContextRemoveClass ,
#if defined(ENABLE_OVERLOADING)
StyleContextRemoveProviderMethodInfo ,
#endif
styleContextRemoveProvider ,
styleContextRemoveProviderForDisplay ,
#if defined(ENABLE_OVERLOADING)
StyleContextRestoreMethodInfo ,
#endif
styleContextRestore ,
#if defined(ENABLE_OVERLOADING)
StyleContextSaveMethodInfo ,
#endif
styleContextSave ,
#if defined(ENABLE_OVERLOADING)
StyleContextSetDisplayMethodInfo ,
#endif
styleContextSetDisplay ,
#if defined(ENABLE_OVERLOADING)
StyleContextSetScaleMethodInfo ,
#endif
styleContextSetScale ,
#if defined(ENABLE_OVERLOADING)
StyleContextSetStateMethodInfo ,
#endif
styleContextSetState ,
#if defined(ENABLE_OVERLOADING)
StyleContextToStringMethodInfo ,
#endif
styleContextToString ,
#if defined(ENABLE_OVERLOADING)
StyleContextDisplayPropertyInfo ,
#endif
constructStyleContextDisplay ,
getStyleContextDisplay ,
setStyleContextDisplay ,
#if defined(ENABLE_OVERLOADING)
styleContextDisplay ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
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
newtype StyleContext = StyleContext (SP.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)
instance SP.ManagedPtrNewtype StyleContext where
toManagedPtr :: StyleContext -> ManagedPtr StyleContext
toManagedPtr (StyleContext ManagedPtr StyleContext
p) = ManagedPtr StyleContext
p
foreign import ccall "gtk_style_context_get_type"
c_gtk_style_context_get_type :: IO B.Types.GType
instance B.Types.TypedObject StyleContext where
glibType :: IO GType
glibType = IO GType
c_gtk_style_context_get_type
instance B.Types.GObject StyleContext
class (SP.GObject o, O.IsDescendantOf StyleContext o) => IsStyleContext o
instance (SP.GObject o, O.IsDescendantOf StyleContext o) => IsStyleContext o
instance O.HasParentTypes StyleContext
type instance O.ParentTypes StyleContext = '[GObject.Object.Object]
toStyleContext :: (MIO.MonadIO m, IsStyleContext o) => o -> m StyleContext
toStyleContext :: forall (m :: * -> *) o.
(MonadIO m, IsStyleContext o) =>
o -> m StyleContext
toStyleContext = IO StyleContext -> m StyleContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr StyleContext -> StyleContext
StyleContext
instance B.GValue.IsGValue (Maybe StyleContext) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_style_context_get_type
gvalueSet_ :: Ptr GValue -> Maybe StyleContext -> IO ()
gvalueSet_ Ptr GValue
gv Maybe StyleContext
P.Nothing = Ptr GValue -> Ptr StyleContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr StyleContext
forall a. Ptr a
FP.nullPtr :: FP.Ptr StyleContext)
gvalueSet_ Ptr GValue
gv (P.Just StyleContext
obj) = StyleContext -> (Ptr StyleContext -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StyleContext
obj (Ptr GValue -> Ptr StyleContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe StyleContext)
gvalueGet_ Ptr GValue
gv = do
Ptr StyleContext
ptr <- Ptr GValue -> IO (Ptr StyleContext)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr StyleContext)
if Ptr StyleContext
ptr Ptr StyleContext -> Ptr StyleContext -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr StyleContext
forall a. Ptr a
FP.nullPtr
then StyleContext -> Maybe StyleContext
forall a. a -> Maybe a
P.Just (StyleContext -> Maybe StyleContext)
-> IO StyleContext -> IO (Maybe StyleContext)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
else Maybe StyleContext -> IO (Maybe StyleContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe StyleContext
forall a. Maybe a
P.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 "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 "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
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 "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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveStyleContextMethod t StyleContext, O.OverloadedMethod info StyleContext p, R.HasField t StyleContext p) => R.HasField t StyleContext p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveStyleContextMethod t StyleContext, O.OverloadedMethodInfo info StyleContext) => OL.IsLabel t (O.MethodProxy info StyleContext) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getStyleContextDisplay :: (MonadIO m, IsStyleContext o) => o -> m Gdk.Display.Display
getStyleContextDisplay :: forall (m :: * -> *) o.
(MonadIO m, IsStyleContext o) =>
o -> m Display
getStyleContextDisplay o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"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 String
"display" ManagedPtr Display -> Display
Gdk.Display.Display
setStyleContextDisplay :: (MonadIO m, IsStyleContext o, Gdk.Display.IsDisplay a) => o -> a -> m ()
setStyleContextDisplay :: forall (m :: * -> *) o a.
(MonadIO m, IsStyleContext o, IsDisplay a) =>
o -> a -> m ()
setStyleContextDisplay o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"display" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructStyleContextDisplay :: (IsStyleContext o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructStyleContextDisplay :: forall o (m :: * -> *) a.
(IsStyleContext o, MonadIO m, IsDisplay a) =>
a -> m (GValueConstruct o)
constructStyleContextDisplay a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"display" (a -> Maybe a
forall a. a -> Maybe a
P.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
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StyleContext
type instance O.AttributeList StyleContext = StyleContextAttributeList
type StyleContextAttributeList = ('[ '("display", StyleContextDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
styleContextDisplay :: AttrLabelProxy "display"
styleContextDisplay = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList StyleContext = StyleContextSignalList
type StyleContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_style_context_add_class" gtk_style_context_add_class ::
Ptr StyleContext ->
CString ->
IO ()
styleContextAddClass ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> T.Text
-> m ()
styleContextAddClass :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> Text -> m ()
styleContextAddClass a
context 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.OverloadedMethod StyleContextAddClassMethodInfo a signature where
overloadedMethod = styleContextAddClass
instance O.OverloadedMethodInfo StyleContextAddClassMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextAddClass",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextAddClass"
}
#endif
foreign import ccall "gtk_style_context_add_provider" gtk_style_context_add_provider ::
Ptr StyleContext ->
Ptr Gtk.StyleProvider.StyleProvider ->
Word32 ->
IO ()
styleContextAddProvider ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
a
-> b
-> Word32
-> m ()
styleContextAddProvider :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsStyleContext a, IsStyleProvider b) =>
a -> b -> Word32 -> m ()
styleContextAddProvider a
context b
provider 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.OverloadedMethod StyleContextAddProviderMethodInfo a signature where
overloadedMethod = styleContextAddProvider
instance O.OverloadedMethodInfo StyleContextAddProviderMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextAddProvider",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextAddProvider"
}
#endif
foreign import ccall "gtk_style_context_get_border" gtk_style_context_get_border ::
Ptr StyleContext ->
Ptr Gtk.Border.Border ->
IO ()
styleContextGetBorder ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m (Gtk.Border.Border)
styleContextGetBorder :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m Border
styleContextGetBorder 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. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
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, GBoxed 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.OverloadedMethod StyleContextGetBorderMethodInfo a signature where
overloadedMethod = styleContextGetBorder
instance O.OverloadedMethodInfo StyleContextGetBorderMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetBorder",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetBorder"
}
#endif
foreign import ccall "gtk_style_context_get_color" gtk_style_context_get_color ::
Ptr StyleContext ->
Ptr Gdk.RGBA.RGBA ->
IO ()
styleContextGetColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m (Gdk.RGBA.RGBA)
styleContextGetColor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m RGBA
styleContextGetColor 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. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: 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, GBoxed 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.OverloadedMethod StyleContextGetColorMethodInfo a signature where
overloadedMethod = styleContextGetColor
instance O.OverloadedMethodInfo StyleContextGetColorMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetColor",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetColor"
}
#endif
foreign import ccall "gtk_style_context_get_display" gtk_style_context_get_display ::
Ptr StyleContext ->
IO (Ptr Gdk.Display.Display)
styleContextGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m Gdk.Display.Display
styleContextGetDisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m Display
styleContextGetDisplay 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 Text
"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.OverloadedMethod StyleContextGetDisplayMethodInfo a signature where
overloadedMethod = styleContextGetDisplay
instance O.OverloadedMethodInfo StyleContextGetDisplayMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetDisplay",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetDisplay"
}
#endif
foreign import ccall "gtk_style_context_get_margin" gtk_style_context_get_margin ::
Ptr StyleContext ->
Ptr Gtk.Border.Border ->
IO ()
styleContextGetMargin ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m (Gtk.Border.Border)
styleContextGetMargin :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m Border
styleContextGetMargin 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. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
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, GBoxed 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.OverloadedMethod StyleContextGetMarginMethodInfo a signature where
overloadedMethod = styleContextGetMargin
instance O.OverloadedMethodInfo StyleContextGetMarginMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetMargin",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetMargin"
}
#endif
foreign import ccall "gtk_style_context_get_padding" gtk_style_context_get_padding ::
Ptr StyleContext ->
Ptr Gtk.Border.Border ->
IO ()
styleContextGetPadding ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m (Gtk.Border.Border)
styleContextGetPadding :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m Border
styleContextGetPadding 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. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
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, GBoxed 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.OverloadedMethod StyleContextGetPaddingMethodInfo a signature where
overloadedMethod = styleContextGetPadding
instance O.OverloadedMethodInfo StyleContextGetPaddingMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetPadding",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetPadding"
}
#endif
foreign import ccall "gtk_style_context_get_scale" gtk_style_context_get_scale ::
Ptr StyleContext ->
IO Int32
styleContextGetScale ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m Int32
styleContextGetScale :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m Int32
styleContextGetScale 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.OverloadedMethod StyleContextGetScaleMethodInfo a signature where
overloadedMethod = styleContextGetScale
instance O.OverloadedMethodInfo StyleContextGetScaleMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetScale",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetScale"
}
#endif
foreign import ccall "gtk_style_context_get_state" gtk_style_context_get_state ::
Ptr StyleContext ->
IO CUInt
styleContextGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m [Gtk.Flags.StateFlags]
styleContextGetState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m [StateFlags]
styleContextGetState 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.OverloadedMethod StyleContextGetStateMethodInfo a signature where
overloadedMethod = styleContextGetState
instance O.OverloadedMethodInfo StyleContextGetStateMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextGetState",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextGetState"
}
#endif
foreign import ccall "gtk_style_context_has_class" gtk_style_context_has_class ::
Ptr StyleContext ->
CString ->
IO CInt
styleContextHasClass ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> T.Text
-> m Bool
styleContextHasClass :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> Text -> m Bool
styleContextHasClass a
context 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
/= CInt
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.OverloadedMethod StyleContextHasClassMethodInfo a signature where
overloadedMethod = styleContextHasClass
instance O.OverloadedMethodInfo StyleContextHasClassMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextHasClass",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextHasClass"
}
#endif
foreign import ccall "gtk_style_context_lookup_color" gtk_style_context_lookup_color ::
Ptr StyleContext ->
CString ->
Ptr Gdk.RGBA.RGBA ->
IO CInt
styleContextLookupColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> T.Text
-> m ((Bool, Gdk.RGBA.RGBA))
styleContextLookupColor :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> Text -> m (Bool, RGBA)
styleContextLookupColor a
context 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. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: 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
/= CInt
0) CInt
result
RGBA
color' <- ((ManagedPtr RGBA -> RGBA) -> Ptr RGBA -> IO RGBA
forall a.
(HasCallStack, GBoxed 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.OverloadedMethod StyleContextLookupColorMethodInfo a signature where
overloadedMethod = styleContextLookupColor
instance O.OverloadedMethodInfo StyleContextLookupColorMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextLookupColor",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextLookupColor"
}
#endif
foreign import ccall "gtk_style_context_remove_class" gtk_style_context_remove_class ::
Ptr StyleContext ->
CString ->
IO ()
styleContextRemoveClass ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> T.Text
-> m ()
styleContextRemoveClass :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> Text -> m ()
styleContextRemoveClass a
context 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.OverloadedMethod StyleContextRemoveClassMethodInfo a signature where
overloadedMethod = styleContextRemoveClass
instance O.OverloadedMethodInfo StyleContextRemoveClassMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextRemoveClass",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextRemoveClass"
}
#endif
foreign import ccall "gtk_style_context_remove_provider" gtk_style_context_remove_provider ::
Ptr StyleContext ->
Ptr Gtk.StyleProvider.StyleProvider ->
IO ()
styleContextRemoveProvider ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gtk.StyleProvider.IsStyleProvider b) =>
a
-> b
-> m ()
styleContextRemoveProvider :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsStyleContext a, IsStyleProvider b) =>
a -> b -> m ()
styleContextRemoveProvider a
context 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.OverloadedMethod StyleContextRemoveProviderMethodInfo a signature where
overloadedMethod = styleContextRemoveProvider
instance O.OverloadedMethodInfo StyleContextRemoveProviderMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextRemoveProvider",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextRemoveProvider"
}
#endif
foreign import ccall "gtk_style_context_restore" gtk_style_context_restore ::
Ptr StyleContext ->
IO ()
styleContextRestore ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m ()
styleContextRestore :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m ()
styleContextRestore 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.OverloadedMethod StyleContextRestoreMethodInfo a signature where
overloadedMethod = styleContextRestore
instance O.OverloadedMethodInfo StyleContextRestoreMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextRestore",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextRestore"
}
#endif
foreign import ccall "gtk_style_context_save" gtk_style_context_save ::
Ptr StyleContext ->
IO ()
styleContextSave ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> m ()
styleContextSave :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> m ()
styleContextSave 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.OverloadedMethod StyleContextSaveMethodInfo a signature where
overloadedMethod = styleContextSave
instance O.OverloadedMethodInfo StyleContextSaveMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextSave",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextSave"
}
#endif
foreign import ccall "gtk_style_context_set_display" gtk_style_context_set_display ::
Ptr StyleContext ->
Ptr Gdk.Display.Display ->
IO ()
styleContextSetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a, Gdk.Display.IsDisplay b) =>
a
-> b
-> m ()
styleContextSetDisplay :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsStyleContext a, IsDisplay b) =>
a -> b -> m ()
styleContextSetDisplay a
context 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.OverloadedMethod StyleContextSetDisplayMethodInfo a signature where
overloadedMethod = styleContextSetDisplay
instance O.OverloadedMethodInfo StyleContextSetDisplayMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextSetDisplay",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextSetDisplay"
}
#endif
foreign import ccall "gtk_style_context_set_scale" gtk_style_context_set_scale ::
Ptr StyleContext ->
Int32 ->
IO ()
styleContextSetScale ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> Int32
-> m ()
styleContextSetScale :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> Int32 -> m ()
styleContextSetScale a
context 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.OverloadedMethod StyleContextSetScaleMethodInfo a signature where
overloadedMethod = styleContextSetScale
instance O.OverloadedMethodInfo StyleContextSetScaleMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextSetScale",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextSetScale"
}
#endif
foreign import ccall "gtk_style_context_set_state" gtk_style_context_set_state ::
Ptr StyleContext ->
CUInt ->
IO ()
styleContextSetState ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> [Gtk.Flags.StateFlags]
-> m ()
styleContextSetState :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> [StateFlags] -> m ()
styleContextSetState a
context [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.OverloadedMethod StyleContextSetStateMethodInfo a signature where
overloadedMethod = styleContextSetState
instance O.OverloadedMethodInfo StyleContextSetStateMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextSetState",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextSetState"
}
#endif
foreign import ccall "gtk_style_context_to_string" gtk_style_context_to_string ::
Ptr StyleContext ->
CUInt ->
IO CString
styleContextToString ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleContext a) =>
a
-> [Gtk.Flags.StyleContextPrintFlags]
-> m T.Text
styleContextToString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleContext a) =>
a -> [StyleContextPrintFlags] -> m Text
styleContextToString a
context [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 Text
"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.OverloadedMethod StyleContextToStringMethodInfo a signature where
overloadedMethod = styleContextToString
instance O.OverloadedMethodInfo StyleContextToStringMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.StyleContext.styleContextToString",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-4.0.4/docs/GI-Gtk-Objects-StyleContext.html#v:styleContextToString"
}
#endif
foreign import ccall "gtk_style_context_add_provider_for_display" gtk_style_context_add_provider_for_display ::
Ptr Gdk.Display.Display ->
Ptr Gtk.StyleProvider.StyleProvider ->
Word32 ->
IO ()
styleContextAddProviderForDisplay ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.StyleProvider.IsStyleProvider b) =>
a
-> b
-> Word32
-> m ()
styleContextAddProviderForDisplay :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDisplay a, IsStyleProvider b) =>
a -> b -> Word32 -> m ()
styleContextAddProviderForDisplay a
display b
provider 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
foreign import ccall "gtk_style_context_remove_provider_for_display" gtk_style_context_remove_provider_for_display ::
Ptr Gdk.Display.Display ->
Ptr Gtk.StyleProvider.StyleProvider ->
IO ()
styleContextRemoveProviderForDisplay ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a, Gtk.StyleProvider.IsStyleProvider b) =>
a
-> b
-> m ()
styleContextRemoveProviderForDisplay :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDisplay a, IsStyleProvider b) =>
a -> b -> m ()
styleContextRemoveProviderForDisplay a
display 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