{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.StyleProperties
(
StyleProperties(..) ,
IsStyleProperties ,
toStyleProperties ,
noStyleProperties ,
#if defined(ENABLE_OVERLOADING)
ResolveStylePropertiesMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
StylePropertiesClearMethodInfo ,
#endif
stylePropertiesClear ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesGetPropertyMethodInfo ,
#endif
stylePropertiesGetProperty ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesLookupColorMethodInfo ,
#endif
stylePropertiesLookupColor ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesMapColorMethodInfo ,
#endif
stylePropertiesMapColor ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesMergeMethodInfo ,
#endif
stylePropertiesMerge ,
stylePropertiesNew ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesSetPropertyMethodInfo ,
#endif
stylePropertiesSetProperty ,
#if defined(ENABLE_OVERLOADING)
StylePropertiesUnsetPropertyMethodInfo ,
#endif
stylePropertiesUnsetProperty ,
) 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 {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.StyleProvider as Gtk.StyleProvider
import {-# SOURCE #-} qualified GI.Gtk.Structs.SymbolicColor as Gtk.SymbolicColor
newtype StyleProperties = StyleProperties (ManagedPtr StyleProperties)
deriving (StyleProperties -> StyleProperties -> Bool
(StyleProperties -> StyleProperties -> Bool)
-> (StyleProperties -> StyleProperties -> Bool)
-> Eq StyleProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StyleProperties -> StyleProperties -> Bool
$c/= :: StyleProperties -> StyleProperties -> Bool
== :: StyleProperties -> StyleProperties -> Bool
$c== :: StyleProperties -> StyleProperties -> Bool
Eq)
foreign import ccall "gtk_style_properties_get_type"
c_gtk_style_properties_get_type :: IO GType
instance GObject StyleProperties where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_style_properties_get_type
instance B.GValue.IsGValue StyleProperties where
toGValue :: StyleProperties -> IO GValue
toGValue o :: StyleProperties
o = do
GType
gtype <- IO GType
c_gtk_style_properties_get_type
StyleProperties -> (Ptr StyleProperties -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StyleProperties
o (GType
-> (GValue -> Ptr StyleProperties -> IO ())
-> Ptr StyleProperties
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr StyleProperties -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO StyleProperties
fromGValue gv :: GValue
gv = do
Ptr StyleProperties
ptr <- GValue -> IO (Ptr StyleProperties)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr StyleProperties)
(ManagedPtr StyleProperties -> StyleProperties)
-> Ptr StyleProperties -> IO StyleProperties
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr StyleProperties -> StyleProperties
StyleProperties Ptr StyleProperties
ptr
class (GObject o, O.IsDescendantOf StyleProperties o) => IsStyleProperties o
instance (GObject o, O.IsDescendantOf StyleProperties o) => IsStyleProperties o
instance O.HasParentTypes StyleProperties
type instance O.ParentTypes StyleProperties = '[GObject.Object.Object, Gtk.StyleProvider.StyleProvider]
toStyleProperties :: (MonadIO m, IsStyleProperties o) => o -> m StyleProperties
toStyleProperties :: o -> m StyleProperties
toStyleProperties = IO StyleProperties -> m StyleProperties
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StyleProperties -> m StyleProperties)
-> (o -> IO StyleProperties) -> o -> m StyleProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr StyleProperties -> StyleProperties)
-> o -> IO StyleProperties
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr StyleProperties -> StyleProperties
StyleProperties
noStyleProperties :: Maybe StyleProperties
noStyleProperties :: Maybe StyleProperties
noStyleProperties = Maybe StyleProperties
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveStylePropertiesMethod (t :: Symbol) (o :: *) :: * where
ResolveStylePropertiesMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveStylePropertiesMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveStylePropertiesMethod "clear" o = StylePropertiesClearMethodInfo
ResolveStylePropertiesMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveStylePropertiesMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveStylePropertiesMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveStylePropertiesMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveStylePropertiesMethod "lookupColor" o = StylePropertiesLookupColorMethodInfo
ResolveStylePropertiesMethod "mapColor" o = StylePropertiesMapColorMethodInfo
ResolveStylePropertiesMethod "merge" o = StylePropertiesMergeMethodInfo
ResolveStylePropertiesMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveStylePropertiesMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveStylePropertiesMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveStylePropertiesMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveStylePropertiesMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveStylePropertiesMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveStylePropertiesMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveStylePropertiesMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveStylePropertiesMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveStylePropertiesMethod "unsetProperty" o = StylePropertiesUnsetPropertyMethodInfo
ResolveStylePropertiesMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveStylePropertiesMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveStylePropertiesMethod "getIconFactory" o = Gtk.StyleProvider.StyleProviderGetIconFactoryMethodInfo
ResolveStylePropertiesMethod "getProperty" o = StylePropertiesGetPropertyMethodInfo
ResolveStylePropertiesMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveStylePropertiesMethod "getStyle" o = Gtk.StyleProvider.StyleProviderGetStyleMethodInfo
ResolveStylePropertiesMethod "getStyleProperty" o = Gtk.StyleProvider.StyleProviderGetStylePropertyMethodInfo
ResolveStylePropertiesMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveStylePropertiesMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveStylePropertiesMethod "setProperty" o = StylePropertiesSetPropertyMethodInfo
ResolveStylePropertiesMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStylePropertiesMethod t StyleProperties, O.MethodInfo info StyleProperties p) => OL.IsLabel t (StyleProperties -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StyleProperties
type instance O.AttributeList StyleProperties = StylePropertiesAttributeList
type StylePropertiesAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList StyleProperties = StylePropertiesSignalList
type StylePropertiesSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_style_properties_new" gtk_style_properties_new ::
IO (Ptr StyleProperties)
{-# DEPRECATED stylePropertiesNew ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m StyleProperties
stylePropertiesNew :: m StyleProperties
stylePropertiesNew = IO StyleProperties -> m StyleProperties
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO StyleProperties -> m StyleProperties)
-> IO StyleProperties -> m StyleProperties
forall a b. (a -> b) -> a -> b
$ do
Ptr StyleProperties
result <- IO (Ptr StyleProperties)
gtk_style_properties_new
Text -> Ptr StyleProperties -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "stylePropertiesNew" Ptr StyleProperties
result
StyleProperties
result' <- ((ManagedPtr StyleProperties -> StyleProperties)
-> Ptr StyleProperties -> IO StyleProperties
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr StyleProperties -> StyleProperties
StyleProperties) Ptr StyleProperties
result
StyleProperties -> IO StyleProperties
forall (m :: * -> *) a. Monad m => a -> m a
return StyleProperties
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_style_properties_clear" gtk_style_properties_clear ::
Ptr StyleProperties ->
IO ()
{-# DEPRECATED stylePropertiesClear ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesClear ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> m ()
stylePropertiesClear :: a -> m ()
stylePropertiesClear props :: a
props = 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 StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
Ptr StyleProperties -> IO ()
gtk_style_properties_clear Ptr StyleProperties
props'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesClearMethodInfo a signature where
overloadedMethod = stylePropertiesClear
#endif
foreign import ccall "gtk_style_properties_get_property" gtk_style_properties_get_property ::
Ptr StyleProperties ->
CString ->
CUInt ->
Ptr GValue ->
IO CInt
{-# DEPRECATED stylePropertiesGetProperty ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesGetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> [Gtk.Flags.StateFlags]
-> m ((Bool, GValue))
stylePropertiesGetProperty :: a -> Text -> [StateFlags] -> m (Bool, GValue)
stylePropertiesGetProperty props :: a
props property :: Text
property state :: [StateFlags]
state = IO (Bool, GValue) -> m (Bool, GValue)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, GValue) -> m (Bool, GValue))
-> IO (Bool, GValue) -> m (Bool, GValue)
forall a b. (a -> b) -> a -> b
$ do
Ptr StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
CString
property' <- Text -> IO CString
textToCString Text
property
let state' :: CUInt
state' = [StateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [StateFlags]
state
Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 24 :: IO (Ptr GValue)
CInt
result <- Ptr StyleProperties -> CString -> CUInt -> Ptr GValue -> IO CInt
gtk_style_properties_get_property Ptr StyleProperties
props' CString
property' CUInt
state' Ptr GValue
value
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
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
props
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
property'
(Bool, GValue) -> IO (Bool, GValue)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', GValue
value')
#if defined(ENABLE_OVERLOADING)
data StylePropertiesGetPropertyMethodInfo
instance (signature ~ (T.Text -> [Gtk.Flags.StateFlags] -> m ((Bool, GValue))), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesGetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesGetProperty
#endif
foreign import ccall "gtk_style_properties_lookup_color" gtk_style_properties_lookup_color ::
Ptr StyleProperties ->
CString ->
IO (Ptr Gtk.SymbolicColor.SymbolicColor)
{-# DEPRECATED stylePropertiesLookupColor ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
stylePropertiesLookupColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> m Gtk.SymbolicColor.SymbolicColor
stylePropertiesLookupColor :: a -> Text -> m SymbolicColor
stylePropertiesLookupColor props :: a
props name :: Text
name = IO SymbolicColor -> m SymbolicColor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SymbolicColor -> m SymbolicColor)
-> IO SymbolicColor -> m SymbolicColor
forall a b. (a -> b) -> a -> b
$ do
Ptr StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr SymbolicColor
result <- Ptr StyleProperties -> CString -> IO (Ptr SymbolicColor)
gtk_style_properties_lookup_color Ptr StyleProperties
props' CString
name'
Text -> Ptr SymbolicColor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "stylePropertiesLookupColor" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr SymbolicColor -> SymbolicColor
Gtk.SymbolicColor.SymbolicColor) Ptr SymbolicColor
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
SymbolicColor -> IO SymbolicColor
forall (m :: * -> *) a. Monad m => a -> m a
return SymbolicColor
result'
#if defined(ENABLE_OVERLOADING)
data StylePropertiesLookupColorMethodInfo
instance (signature ~ (T.Text -> m Gtk.SymbolicColor.SymbolicColor), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesLookupColorMethodInfo a signature where
overloadedMethod = stylePropertiesLookupColor
#endif
foreign import ccall "gtk_style_properties_map_color" gtk_style_properties_map_color ::
Ptr StyleProperties ->
CString ->
Ptr Gtk.SymbolicColor.SymbolicColor ->
IO ()
{-# DEPRECATED stylePropertiesMapColor ["(Since version 3.8)","t'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
stylePropertiesMapColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> Gtk.SymbolicColor.SymbolicColor
-> m ()
stylePropertiesMapColor :: a -> Text -> SymbolicColor -> m ()
stylePropertiesMapColor props :: a
props name :: Text
name color :: SymbolicColor
color = 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 StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr SymbolicColor
color' <- SymbolicColor -> IO (Ptr SymbolicColor)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SymbolicColor
color
Ptr StyleProperties -> CString -> Ptr SymbolicColor -> IO ()
gtk_style_properties_map_color Ptr StyleProperties
props' CString
name' Ptr SymbolicColor
color'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
SymbolicColor -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SymbolicColor
color
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesMapColorMethodInfo
instance (signature ~ (T.Text -> Gtk.SymbolicColor.SymbolicColor -> m ()), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesMapColorMethodInfo a signature where
overloadedMethod = stylePropertiesMapColor
#endif
foreign import ccall "gtk_style_properties_merge" gtk_style_properties_merge ::
Ptr StyleProperties ->
Ptr StyleProperties ->
CInt ->
IO ()
{-# DEPRECATED stylePropertiesMerge ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesMerge ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a, IsStyleProperties b) =>
a
-> b
-> Bool
-> m ()
stylePropertiesMerge :: a -> b -> Bool -> m ()
stylePropertiesMerge props :: a
props propsToMerge :: b
propsToMerge replace :: Bool
replace = 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 StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
Ptr StyleProperties
propsToMerge' <- b -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
propsToMerge
let replace' :: CInt
replace' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
replace
Ptr StyleProperties -> Ptr StyleProperties -> CInt -> IO ()
gtk_style_properties_merge Ptr StyleProperties
props' Ptr StyleProperties
propsToMerge' CInt
replace'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
propsToMerge
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesMergeMethodInfo
instance (signature ~ (b -> Bool -> m ()), MonadIO m, IsStyleProperties a, IsStyleProperties b) => O.MethodInfo StylePropertiesMergeMethodInfo a signature where
overloadedMethod = stylePropertiesMerge
#endif
foreign import ccall "gtk_style_properties_set_property" gtk_style_properties_set_property ::
Ptr StyleProperties ->
CString ->
CUInt ->
Ptr GValue ->
IO ()
{-# DEPRECATED stylePropertiesSetProperty ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesSetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> [Gtk.Flags.StateFlags]
-> GValue
-> m ()
stylePropertiesSetProperty :: a -> Text -> [StateFlags] -> GValue -> m ()
stylePropertiesSetProperty props :: a
props property :: Text
property state :: [StateFlags]
state value :: GValue
value = 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 StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
CString
property' <- Text -> IO CString
textToCString Text
property
let state' :: CUInt
state' = [StateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [StateFlags]
state
Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
Ptr StyleProperties -> CString -> CUInt -> Ptr GValue -> IO ()
gtk_style_properties_set_property Ptr StyleProperties
props' CString
property' CUInt
state' Ptr GValue
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
property'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesSetPropertyMethodInfo
instance (signature ~ (T.Text -> [Gtk.Flags.StateFlags] -> GValue -> m ()), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesSetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesSetProperty
#endif
foreign import ccall "gtk_style_properties_unset_property" gtk_style_properties_unset_property ::
Ptr StyleProperties ->
CString ->
CUInt ->
IO ()
{-# DEPRECATED stylePropertiesUnsetProperty ["(Since version 3.16)","t'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesUnsetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> [Gtk.Flags.StateFlags]
-> m ()
stylePropertiesUnsetProperty :: a -> Text -> [StateFlags] -> m ()
stylePropertiesUnsetProperty props :: a
props property :: Text
property state :: [StateFlags]
state = 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 StyleProperties
props' <- a -> IO (Ptr StyleProperties)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
props
CString
property' <- Text -> IO CString
textToCString Text
property
let state' :: CUInt
state' = [StateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [StateFlags]
state
Ptr StyleProperties -> CString -> CUInt -> IO ()
gtk_style_properties_unset_property Ptr StyleProperties
props' CString
property' CUInt
state'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
props
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
property'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesUnsetPropertyMethodInfo
instance (signature ~ (T.Text -> [Gtk.Flags.StateFlags] -> m ()), MonadIO m, IsStyleProperties a) => O.MethodInfo StylePropertiesUnsetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesUnsetProperty
#endif