{-# 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 ,
#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.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.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 {-# 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 (SP.ManagedPtr StyleProperties)
deriving (StyleProperties -> StyleProperties -> Bool
(StyleProperties -> StyleProperties -> Bool)
-> (StyleProperties -> StyleProperties -> Bool)
-> Eq StyleProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StyleProperties -> StyleProperties -> Bool
== :: StyleProperties -> StyleProperties -> Bool
$c/= :: StyleProperties -> StyleProperties -> Bool
/= :: StyleProperties -> StyleProperties -> Bool
Eq)
instance SP.ManagedPtrNewtype StyleProperties where
toManagedPtr :: StyleProperties -> ManagedPtr StyleProperties
toManagedPtr (StyleProperties ManagedPtr StyleProperties
p) = ManagedPtr StyleProperties
p
foreign import ccall "gtk_style_properties_get_type"
c_gtk_style_properties_get_type :: IO B.Types.GType
instance B.Types.TypedObject StyleProperties where
glibType :: IO GType
glibType = IO GType
c_gtk_style_properties_get_type
instance B.Types.GObject StyleProperties
class (SP.GObject o, O.IsDescendantOf StyleProperties o) => IsStyleProperties o
instance (SP.GObject o, O.IsDescendantOf StyleProperties o) => IsStyleProperties o
instance O.HasParentTypes StyleProperties
type instance O.ParentTypes StyleProperties = '[GObject.Object.Object, Gtk.StyleProvider.StyleProvider]
toStyleProperties :: (MIO.MonadIO m, IsStyleProperties o) => o -> m StyleProperties
toStyleProperties :: forall (m :: * -> *) o.
(MonadIO m, IsStyleProperties o) =>
o -> m StyleProperties
toStyleProperties = IO StyleProperties -> m StyleProperties
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr StyleProperties -> StyleProperties
StyleProperties
instance B.GValue.IsGValue (Maybe StyleProperties) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_style_properties_get_type
gvalueSet_ :: Ptr GValue -> Maybe StyleProperties -> IO ()
gvalueSet_ Ptr GValue
gv Maybe StyleProperties
P.Nothing = Ptr GValue -> Ptr StyleProperties -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr StyleProperties
forall a. Ptr a
FP.nullPtr :: FP.Ptr StyleProperties)
gvalueSet_ Ptr GValue
gv (P.Just StyleProperties
obj) = StyleProperties -> (Ptr StyleProperties -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr StyleProperties
obj (Ptr GValue -> Ptr StyleProperties -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe StyleProperties)
gvalueGet_ Ptr GValue
gv = do
Ptr StyleProperties
ptr <- Ptr GValue -> IO (Ptr StyleProperties)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr StyleProperties)
if Ptr StyleProperties
ptr Ptr StyleProperties -> Ptr StyleProperties -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr StyleProperties
forall a. Ptr a
FP.nullPtr
then StyleProperties -> Maybe StyleProperties
forall a. a -> Maybe a
P.Just (StyleProperties -> Maybe StyleProperties)
-> IO StyleProperties -> IO (Maybe StyleProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
else Maybe StyleProperties -> IO (Maybe StyleProperties)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe StyleProperties
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveStylePropertiesMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveStylePropertiesMethod t StyleProperties, O.OverloadedMethod info StyleProperties p, R.HasField t StyleProperties p) => R.HasField t StyleProperties p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveStylePropertiesMethod t StyleProperties, O.OverloadedMethodInfo info StyleProperties) => OL.IsLabel t (O.MethodProxy info StyleProperties) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList StyleProperties
type instance O.AttributeList StyleProperties = StylePropertiesAttributeList
type StylePropertiesAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList StyleProperties = StylePropertiesSignalList
type StylePropertiesSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m StyleProperties
stylePropertiesNew = IO StyleProperties -> m StyleProperties
forall a. IO a -> m a
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 Text
"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 a. a -> IO a
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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> m ()
stylePropertiesClear a
props = IO () -> m ()
forall a. IO a -> m a
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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data StylePropertiesClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsStyleProperties a) => O.OverloadedMethod StylePropertiesClearMethodInfo a signature where
overloadedMethod = stylePropertiesClear
instance O.OverloadedMethodInfo StylePropertiesClearMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesClear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> Text -> [StateFlags] -> m (Bool, GValue)
stylePropertiesGetProperty a
props Text
property [StateFlags]
state = IO (Bool, GValue) -> m (Bool, GValue)
forall a. IO a -> m a
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. Int -> IO (Ptr a)
SP.callocBytes Int
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
/= CInt
0) CInt
result
GValue
value' <- Ptr GValue -> IO GValue
B.GValue.wrapGValuePtr 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 a. a -> IO a
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.OverloadedMethod StylePropertiesGetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesGetProperty
instance O.OverloadedMethodInfo StylePropertiesGetPropertyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesGetProperty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> Text -> m SymbolicColor
stylePropertiesLookupColor a
props Text
name = IO SymbolicColor -> m SymbolicColor
forall a. IO a -> m a
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 Text
"stylePropertiesLookupColor" Ptr SymbolicColor
result
SymbolicColor
result' <- ((ManagedPtr SymbolicColor -> SymbolicColor)
-> Ptr SymbolicColor -> IO SymbolicColor
forall a.
(HasCallStack, GBoxed 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 a. a -> IO a
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.OverloadedMethod StylePropertiesLookupColorMethodInfo a signature where
overloadedMethod = stylePropertiesLookupColor
instance O.OverloadedMethodInfo StylePropertiesLookupColorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesLookupColor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> Text -> SymbolicColor -> m ()
stylePropertiesMapColor a
props Text
name SymbolicColor
color = IO () -> m ()
forall a. IO a -> m a
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 a. a -> IO a
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.OverloadedMethod StylePropertiesMapColorMethodInfo a signature where
overloadedMethod = stylePropertiesMapColor
instance O.OverloadedMethodInfo StylePropertiesMapColorMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesMapColor",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsStyleProperties a,
IsStyleProperties b) =>
a -> b -> Bool -> m ()
stylePropertiesMerge a
props b
propsToMerge Bool
replace = IO () -> m ()
forall a. IO a -> m a
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
P.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
P.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 a. a -> IO a
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.OverloadedMethod StylePropertiesMergeMethodInfo a signature where
overloadedMethod = stylePropertiesMerge
instance O.OverloadedMethodInfo StylePropertiesMergeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesMerge",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> Text -> [StateFlags] -> GValue -> m ()
stylePropertiesSetProperty a
props Text
property [StateFlags]
state GValue
value = IO () -> m ()
forall a. IO a -> m a
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 a. a -> IO a
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.OverloadedMethod StylePropertiesSetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesSetProperty
instance O.OverloadedMethodInfo StylePropertiesSetPropertyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesSetProperty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsStyleProperties a) =>
a -> Text -> [StateFlags] -> m ()
stylePropertiesUnsetProperty a
props Text
property [StateFlags]
state = IO () -> m ()
forall a. IO a -> m a
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 a. a -> IO a
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.OverloadedMethod StylePropertiesUnsetPropertyMethodInfo a signature where
overloadedMethod = stylePropertiesUnsetProperty
instance O.OverloadedMethodInfo StylePropertiesUnsetPropertyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.StyleProperties.stylePropertiesUnsetProperty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-StyleProperties.html#v:stylePropertiesUnsetProperty"
})
#endif