#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Objects.StyleProperties
(
StyleProperties(..) ,
IsStyleProperties ,
toStyleProperties ,
noStyleProperties ,
#if ENABLE_OVERLOADING
StylePropertiesClearMethodInfo ,
#endif
stylePropertiesClear ,
#if ENABLE_OVERLOADING
StylePropertiesGetPropertyMethodInfo ,
#endif
stylePropertiesGetProperty ,
#if ENABLE_OVERLOADING
StylePropertiesLookupColorMethodInfo ,
#endif
stylePropertiesLookupColor ,
#if ENABLE_OVERLOADING
StylePropertiesMapColorMethodInfo ,
#endif
stylePropertiesMapColor ,
#if ENABLE_OVERLOADING
StylePropertiesMergeMethodInfo ,
#endif
stylePropertiesMerge ,
stylePropertiesNew ,
#if ENABLE_OVERLOADING
StylePropertiesSetPropertyMethodInfo ,
#endif
stylePropertiesSetProperty ,
#if 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.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)
foreign import ccall "gtk_style_properties_get_type"
c_gtk_style_properties_get_type :: IO GType
instance GObject StyleProperties where
gobjectType = c_gtk_style_properties_get_type
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 = liftIO . unsafeCastTo StyleProperties
noStyleProperties :: Maybe StyleProperties
noStyleProperties = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList StyleProperties
type instance O.AttributeList StyleProperties = StylePropertiesAttributeList
type StylePropertiesAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if 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)","'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m StyleProperties
stylePropertiesNew = liftIO $ do
result <- gtk_style_properties_new
checkUnexpectedReturnNULL "stylePropertiesNew" result
result' <- (wrapObject StyleProperties) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_style_properties_clear" gtk_style_properties_clear ::
Ptr StyleProperties ->
IO ()
{-# DEPRECATED stylePropertiesClear ["(Since version 3.16)","'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesClear ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> m ()
stylePropertiesClear props = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
gtk_style_properties_clear props'
touchManagedPtr props
return ()
#if 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)","'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 props property state = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
property' <- textToCString property
let state' = gflagsToWord state
value <- callocBoxedBytes 24 :: IO (Ptr GValue)
result <- gtk_style_properties_get_property props' property' state' value
let result' = (/= 0) result
value' <- (wrapBoxed GValue) value
touchManagedPtr props
freeMem property'
return (result', value')
#if 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)","'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
stylePropertiesLookupColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> m Gtk.SymbolicColor.SymbolicColor
stylePropertiesLookupColor props name = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
name' <- textToCString name
result <- gtk_style_properties_lookup_color props' name'
checkUnexpectedReturnNULL "stylePropertiesLookupColor" result
result' <- (newBoxed Gtk.SymbolicColor.SymbolicColor) result
touchManagedPtr props
freeMem name'
return result'
#if 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)","'GI.Gtk.Structs.SymbolicColor.SymbolicColor' is deprecated."] #-}
stylePropertiesMapColor ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> Gtk.SymbolicColor.SymbolicColor
-> m ()
stylePropertiesMapColor props name color = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
name' <- textToCString name
color' <- unsafeManagedPtrGetPtr color
gtk_style_properties_map_color props' name' color'
touchManagedPtr props
touchManagedPtr color
freeMem name'
return ()
#if 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)","'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesMerge ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a, IsStyleProperties b) =>
a
-> b
-> Bool
-> m ()
stylePropertiesMerge props propsToMerge replace = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
propsToMerge' <- unsafeManagedPtrCastPtr propsToMerge
let replace' = (fromIntegral . fromEnum) replace
gtk_style_properties_merge props' propsToMerge' replace'
touchManagedPtr props
touchManagedPtr propsToMerge
return ()
#if 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)","'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesSetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> [Gtk.Flags.StateFlags]
-> GValue
-> m ()
stylePropertiesSetProperty props property state value = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
property' <- textToCString property
let state' = gflagsToWord state
value' <- unsafeManagedPtrGetPtr value
gtk_style_properties_set_property props' property' state' value'
touchManagedPtr props
touchManagedPtr value
freeMem property'
return ()
#if 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)","'GI.Gtk.Objects.StyleProperties.StyleProperties' are deprecated."] #-}
stylePropertiesUnsetProperty ::
(B.CallStack.HasCallStack, MonadIO m, IsStyleProperties a) =>
a
-> T.Text
-> [Gtk.Flags.StateFlags]
-> m ()
stylePropertiesUnsetProperty props property state = liftIO $ do
props' <- unsafeManagedPtrCastPtr props
property' <- textToCString property
let state' = gflagsToWord state
gtk_style_properties_unset_property props' property' state'
touchManagedPtr props
freeMem property'
return ()
#if 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