#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.ThemedIcon
(
ThemedIcon(..) ,
IsThemedIcon ,
toThemedIcon ,
noThemedIcon ,
#if ENABLE_OVERLOADING
ThemedIconAppendNameMethodInfo ,
#endif
themedIconAppendName ,
#if ENABLE_OVERLOADING
ThemedIconGetNamesMethodInfo ,
#endif
themedIconGetNames ,
themedIconNew ,
themedIconNewFromNames ,
themedIconNewWithDefaultFallbacks ,
#if ENABLE_OVERLOADING
ThemedIconPrependNameMethodInfo ,
#endif
themedIconPrependName ,
#if ENABLE_OVERLOADING
ThemedIconNamePropertyInfo ,
#endif
constructThemedIconName ,
#if ENABLE_OVERLOADING
themedIconName ,
#endif
#if ENABLE_OVERLOADING
ThemedIconNamesPropertyInfo ,
#endif
constructThemedIconNames ,
getThemedIconNames ,
#if ENABLE_OVERLOADING
themedIconNames ,
#endif
#if ENABLE_OVERLOADING
ThemedIconUseDefaultFallbacksPropertyInfo,
#endif
constructThemedIconUseDefaultFallbacks ,
getThemedIconUseDefaultFallbacks ,
#if ENABLE_OVERLOADING
themedIconUseDefaultFallbacks ,
#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.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.Gio.Interfaces.Icon as Gio.Icon
newtype ThemedIcon = ThemedIcon (ManagedPtr ThemedIcon)
foreign import ccall "g_themed_icon_get_type"
c_g_themed_icon_get_type :: IO GType
instance GObject ThemedIcon where
gobjectType = c_g_themed_icon_get_type
class (GObject o, O.IsDescendantOf ThemedIcon o) => IsThemedIcon o
instance (GObject o, O.IsDescendantOf ThemedIcon o) => IsThemedIcon o
instance O.HasParentTypes ThemedIcon
type instance O.ParentTypes ThemedIcon = '[GObject.Object.Object, Gio.Icon.Icon]
toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon
toThemedIcon = liftIO . unsafeCastTo ThemedIcon
noThemedIcon :: Maybe ThemedIcon
noThemedIcon = Nothing
#if ENABLE_OVERLOADING
type family ResolveThemedIconMethod (t :: Symbol) (o :: *) :: * where
ResolveThemedIconMethod "appendName" o = ThemedIconAppendNameMethodInfo
ResolveThemedIconMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveThemedIconMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveThemedIconMethod "equal" o = Gio.Icon.IconEqualMethodInfo
ResolveThemedIconMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveThemedIconMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveThemedIconMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveThemedIconMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveThemedIconMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveThemedIconMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveThemedIconMethod "prependName" o = ThemedIconPrependNameMethodInfo
ResolveThemedIconMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveThemedIconMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveThemedIconMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveThemedIconMethod "serialize" o = Gio.Icon.IconSerializeMethodInfo
ResolveThemedIconMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveThemedIconMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveThemedIconMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveThemedIconMethod "toString" o = Gio.Icon.IconToStringMethodInfo
ResolveThemedIconMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveThemedIconMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveThemedIconMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveThemedIconMethod "getNames" o = ThemedIconGetNamesMethodInfo
ResolveThemedIconMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveThemedIconMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveThemedIconMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveThemedIconMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveThemedIconMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveThemedIconMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveThemedIconMethod t ThemedIcon, O.MethodInfo info ThemedIcon p) => OL.IsLabel t (ThemedIcon -> 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
constructThemedIconName :: (IsThemedIcon o) => T.Text -> IO (GValueConstruct o)
constructThemedIconName val = B.Properties.constructObjectPropertyString "name" (Just val)
#if ENABLE_OVERLOADING
data ThemedIconNamePropertyInfo
instance AttrInfo ThemedIconNamePropertyInfo where
type AttrAllowedOps ThemedIconNamePropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrSetTypeConstraint ThemedIconNamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ThemedIconNamePropertyInfo = IsThemedIcon
type AttrGetType ThemedIconNamePropertyInfo = ()
type AttrLabel ThemedIconNamePropertyInfo = "name"
type AttrOrigin ThemedIconNamePropertyInfo = ThemedIcon
attrGet _ = undefined
attrSet _ = undefined
attrConstruct _ = constructThemedIconName
attrClear _ = undefined
#endif
getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [T.Text]
getThemedIconNames obj = liftIO $ checkUnexpectedNothing "getThemedIconNames" $ B.Properties.getObjectPropertyStringArray obj "names"
constructThemedIconNames :: (IsThemedIcon o) => [T.Text] -> IO (GValueConstruct o)
constructThemedIconNames val = B.Properties.constructObjectPropertyStringArray "names" (Just val)
#if ENABLE_OVERLOADING
data ThemedIconNamesPropertyInfo
instance AttrInfo ThemedIconNamesPropertyInfo where
type AttrAllowedOps ThemedIconNamesPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ThemedIconNamesPropertyInfo = (~) [T.Text]
type AttrBaseTypeConstraint ThemedIconNamesPropertyInfo = IsThemedIcon
type AttrGetType ThemedIconNamesPropertyInfo = [T.Text]
type AttrLabel ThemedIconNamesPropertyInfo = "names"
type AttrOrigin ThemedIconNamesPropertyInfo = ThemedIcon
attrGet _ = getThemedIconNames
attrSet _ = undefined
attrConstruct _ = constructThemedIconNames
attrClear _ = undefined
#endif
getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool
getThemedIconUseDefaultFallbacks obj = liftIO $ B.Properties.getObjectPropertyBool obj "use-default-fallbacks"
constructThemedIconUseDefaultFallbacks :: (IsThemedIcon o) => Bool -> IO (GValueConstruct o)
constructThemedIconUseDefaultFallbacks val = B.Properties.constructObjectPropertyBool "use-default-fallbacks" val
#if ENABLE_OVERLOADING
data ThemedIconUseDefaultFallbacksPropertyInfo
instance AttrInfo ThemedIconUseDefaultFallbacksPropertyInfo where
type AttrAllowedOps ThemedIconUseDefaultFallbacksPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ThemedIconUseDefaultFallbacksPropertyInfo = (~) Bool
type AttrBaseTypeConstraint ThemedIconUseDefaultFallbacksPropertyInfo = IsThemedIcon
type AttrGetType ThemedIconUseDefaultFallbacksPropertyInfo = Bool
type AttrLabel ThemedIconUseDefaultFallbacksPropertyInfo = "use-default-fallbacks"
type AttrOrigin ThemedIconUseDefaultFallbacksPropertyInfo = ThemedIcon
attrGet _ = getThemedIconUseDefaultFallbacks
attrSet _ = undefined
attrConstruct _ = constructThemedIconUseDefaultFallbacks
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ThemedIcon
type instance O.AttributeList ThemedIcon = ThemedIconAttributeList
type ThemedIconAttributeList = ('[ '("name", ThemedIconNamePropertyInfo), '("names", ThemedIconNamesPropertyInfo), '("useDefaultFallbacks", ThemedIconUseDefaultFallbacksPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
themedIconName :: AttrLabelProxy "name"
themedIconName = AttrLabelProxy
themedIconNames :: AttrLabelProxy "names"
themedIconNames = AttrLabelProxy
themedIconUseDefaultFallbacks :: AttrLabelProxy "useDefaultFallbacks"
themedIconUseDefaultFallbacks = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList ThemedIcon = ThemedIconSignalList
type ThemedIconSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_themed_icon_new" g_themed_icon_new ::
CString ->
IO (Ptr ThemedIcon)
themedIconNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ThemedIcon
themedIconNew iconname = liftIO $ do
iconname' <- textToCString iconname
result <- g_themed_icon_new iconname'
checkUnexpectedReturnNULL "themedIconNew" result
result' <- (wrapObject ThemedIcon) result
freeMem iconname'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_themed_icon_new_from_names" g_themed_icon_new_from_names ::
Ptr CString ->
Int32 ->
IO (Ptr ThemedIcon)
themedIconNewFromNames ::
(B.CallStack.HasCallStack, MonadIO m) =>
[T.Text]
-> m ThemedIcon
themedIconNewFromNames iconnames = liftIO $ do
let len = fromIntegral $ length iconnames
iconnames' <- packUTF8CArray iconnames
result <- g_themed_icon_new_from_names iconnames' len
checkUnexpectedReturnNULL "themedIconNewFromNames" result
result' <- (wrapObject ThemedIcon) result
(mapCArrayWithLength len) freeMem iconnames'
freeMem iconnames'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_themed_icon_new_with_default_fallbacks" g_themed_icon_new_with_default_fallbacks ::
CString ->
IO (Ptr ThemedIcon)
themedIconNewWithDefaultFallbacks ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ThemedIcon
themedIconNewWithDefaultFallbacks iconname = liftIO $ do
iconname' <- textToCString iconname
result <- g_themed_icon_new_with_default_fallbacks iconname'
checkUnexpectedReturnNULL "themedIconNewWithDefaultFallbacks" result
result' <- (wrapObject ThemedIcon) result
freeMem iconname'
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_themed_icon_append_name" g_themed_icon_append_name ::
Ptr ThemedIcon ->
CString ->
IO ()
themedIconAppendName ::
(B.CallStack.HasCallStack, MonadIO m, IsThemedIcon a) =>
a
-> T.Text
-> m ()
themedIconAppendName icon iconname = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
iconname' <- textToCString iconname
g_themed_icon_append_name icon' iconname'
touchManagedPtr icon
freeMem iconname'
return ()
#if ENABLE_OVERLOADING
data ThemedIconAppendNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsThemedIcon a) => O.MethodInfo ThemedIconAppendNameMethodInfo a signature where
overloadedMethod _ = themedIconAppendName
#endif
foreign import ccall "g_themed_icon_get_names" g_themed_icon_get_names ::
Ptr ThemedIcon ->
IO (Ptr CString)
themedIconGetNames ::
(B.CallStack.HasCallStack, MonadIO m, IsThemedIcon a) =>
a
-> m [T.Text]
themedIconGetNames icon = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
result <- g_themed_icon_get_names icon'
checkUnexpectedReturnNULL "themedIconGetNames" result
result' <- unpackZeroTerminatedUTF8CArray result
touchManagedPtr icon
return result'
#if ENABLE_OVERLOADING
data ThemedIconGetNamesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsThemedIcon a) => O.MethodInfo ThemedIconGetNamesMethodInfo a signature where
overloadedMethod _ = themedIconGetNames
#endif
foreign import ccall "g_themed_icon_prepend_name" g_themed_icon_prepend_name ::
Ptr ThemedIcon ->
CString ->
IO ()
themedIconPrependName ::
(B.CallStack.HasCallStack, MonadIO m, IsThemedIcon a) =>
a
-> T.Text
-> m ()
themedIconPrependName icon iconname = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
iconname' <- textToCString iconname
g_themed_icon_prepend_name icon' iconname'
touchManagedPtr icon
freeMem iconname'
return ()
#if ENABLE_OVERLOADING
data ThemedIconPrependNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsThemedIcon a) => O.MethodInfo ThemedIconPrependNameMethodInfo a signature where
overloadedMethod _ = themedIconPrependName
#endif