#define ENABLE_OVERLOADING \
(!defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.EmblemedIcon
(
EmblemedIcon(..) ,
IsEmblemedIcon ,
toEmblemedIcon ,
noEmblemedIcon ,
#if ENABLE_OVERLOADING
EmblemedIconAddEmblemMethodInfo ,
#endif
emblemedIconAddEmblem ,
#if ENABLE_OVERLOADING
EmblemedIconClearEmblemsMethodInfo ,
#endif
emblemedIconClearEmblems ,
#if ENABLE_OVERLOADING
EmblemedIconGetEmblemsMethodInfo ,
#endif
emblemedIconGetEmblems ,
#if ENABLE_OVERLOADING
EmblemedIconGetIconMethodInfo ,
#endif
emblemedIconGetIcon ,
emblemedIconNew ,
#if ENABLE_OVERLOADING
EmblemedIconGiconPropertyInfo ,
#endif
constructEmblemedIconGicon ,
#if ENABLE_OVERLOADING
emblemedIconGicon ,
#endif
getEmblemedIconGicon ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Objects.Emblem as Gio.Emblem
newtype EmblemedIcon = EmblemedIcon (ManagedPtr EmblemedIcon)
foreign import ccall "g_emblemed_icon_get_type"
c_g_emblemed_icon_get_type :: IO GType
instance GObject EmblemedIcon where
gobjectType :: EmblemedIcon -> IO GType
gobjectType _ = IO GType
c_g_emblemed_icon_get_type
class GObject o => IsEmblemedIcon o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError EmblemedIcon a) =>
IsEmblemedIcon a
#endif
instance IsEmblemedIcon EmblemedIcon
instance GObject.Object.IsObject EmblemedIcon
instance Gio.Icon.IsIcon EmblemedIcon
toEmblemedIcon :: (MonadIO m, IsEmblemedIcon o) => o -> m EmblemedIcon
toEmblemedIcon :: o -> m EmblemedIcon
toEmblemedIcon = IO EmblemedIcon -> m EmblemedIcon
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EmblemedIcon -> m EmblemedIcon)
-> (o -> IO EmblemedIcon) -> o -> m EmblemedIcon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr EmblemedIcon -> EmblemedIcon) -> o -> IO EmblemedIcon
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr EmblemedIcon -> EmblemedIcon
EmblemedIcon
noEmblemedIcon :: Maybe EmblemedIcon
noEmblemedIcon :: Maybe EmblemedIcon
noEmblemedIcon = Maybe EmblemedIcon
forall a. Maybe a
Nothing
#if ENABLE_OVERLOADING
type family ResolveEmblemedIconMethod (t :: Symbol) (o :: *) :: * where
ResolveEmblemedIconMethod "addEmblem" o = EmblemedIconAddEmblemMethodInfo
ResolveEmblemedIconMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveEmblemedIconMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveEmblemedIconMethod "clearEmblems" o = EmblemedIconClearEmblemsMethodInfo
ResolveEmblemedIconMethod "equal" o = Gio.Icon.IconEqualMethodInfo
ResolveEmblemedIconMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveEmblemedIconMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveEmblemedIconMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveEmblemedIconMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveEmblemedIconMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveEmblemedIconMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveEmblemedIconMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveEmblemedIconMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveEmblemedIconMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveEmblemedIconMethod "serialize" o = Gio.Icon.IconSerializeMethodInfo
ResolveEmblemedIconMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveEmblemedIconMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveEmblemedIconMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveEmblemedIconMethod "toString" o = Gio.Icon.IconToStringMethodInfo
ResolveEmblemedIconMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveEmblemedIconMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveEmblemedIconMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveEmblemedIconMethod "getEmblems" o = EmblemedIconGetEmblemsMethodInfo
ResolveEmblemedIconMethod "getIcon" o = EmblemedIconGetIconMethodInfo
ResolveEmblemedIconMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveEmblemedIconMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveEmblemedIconMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveEmblemedIconMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEmblemedIconMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEmblemedIconMethod t EmblemedIcon, O.MethodInfo info EmblemedIcon p) => O.IsLabelProxy t (EmblemedIcon -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEmblemedIconMethod t EmblemedIcon, O.MethodInfo info EmblemedIcon p) => O.IsLabel t (EmblemedIcon -> 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
#endif
getEmblemedIconGicon :: (MonadIO m, IsEmblemedIcon o) => o -> m (Maybe Gio.Icon.Icon)
getEmblemedIconGicon :: o -> m (Maybe Icon)
getEmblemedIconGicon obj :: o
obj = IO (Maybe Icon) -> m (Maybe Icon)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Icon) -> m (Maybe Icon))
-> IO (Maybe Icon) -> m (Maybe Icon)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Icon -> Icon) -> IO (Maybe Icon)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyObject o
obj "gicon" ManagedPtr Icon -> Icon
Gio.Icon.Icon
constructEmblemedIconGicon :: (IsEmblemedIcon o, Gio.Icon.IsIcon a) => a -> IO (GValueConstruct o)
constructEmblemedIconGicon :: a -> IO (GValueConstruct o)
constructEmblemedIconGicon val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
constructObjectPropertyObject "gicon" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
#if ENABLE_OVERLOADING
data EmblemedIconGiconPropertyInfo
instance AttrInfo EmblemedIconGiconPropertyInfo where
type AttrAllowedOps EmblemedIconGiconPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EmblemedIconGiconPropertyInfo = Gio.Icon.IsIcon
type AttrBaseTypeConstraint EmblemedIconGiconPropertyInfo = IsEmblemedIcon
type AttrGetType EmblemedIconGiconPropertyInfo = (Maybe Gio.Icon.Icon)
type AttrLabel EmblemedIconGiconPropertyInfo = "gicon"
type AttrOrigin EmblemedIconGiconPropertyInfo = EmblemedIcon
attrGet _ = getEmblemedIconGicon
attrSet _ = undefined
attrConstruct _ = constructEmblemedIconGicon
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList EmblemedIcon
type instance O.AttributeList EmblemedIcon = EmblemedIconAttributeList
type EmblemedIconAttributeList = ('[ '("gicon", EmblemedIconGiconPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
emblemedIconGicon :: AttrLabelProxy "gicon"
emblemedIconGicon = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList EmblemedIcon = EmblemedIconSignalList
type EmblemedIconSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_emblemed_icon_new" g_emblemed_icon_new ::
Ptr Gio.Icon.Icon ->
Ptr Gio.Emblem.Emblem ->
IO (Ptr EmblemedIcon)
emblemedIconNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Icon.IsIcon a, Gio.Emblem.IsEmblem b) =>
a
-> Maybe (b)
-> m EmblemedIcon
emblemedIconNew :: a -> Maybe b -> m EmblemedIcon
emblemedIconNew icon :: a
icon emblem :: Maybe b
emblem = IO EmblemedIcon -> m EmblemedIcon
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO EmblemedIcon -> m EmblemedIcon)
-> IO EmblemedIcon -> m EmblemedIcon
forall a b. (a -> b) -> a -> b
$ do
Ptr Icon
icon' <- a -> IO (Ptr Icon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
icon
Ptr Emblem
maybeEmblem <- case Maybe b
emblem of
Nothing -> Ptr Emblem -> IO (Ptr Emblem)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Emblem
forall a. Ptr a
nullPtr
Just jEmblem :: b
jEmblem -> do
Ptr Emblem
jEmblem' <- b -> IO (Ptr Emblem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jEmblem
Ptr Emblem -> IO (Ptr Emblem)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Emblem
jEmblem'
Ptr EmblemedIcon
result <- Ptr Icon -> Ptr Emblem -> IO (Ptr EmblemedIcon)
g_emblemed_icon_new Ptr Icon
icon' Ptr Emblem
maybeEmblem
Text -> Ptr EmblemedIcon -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "emblemedIconNew" Ptr EmblemedIcon
result
EmblemedIcon
result' <- ((ManagedPtr EmblemedIcon -> EmblemedIcon)
-> Ptr EmblemedIcon -> IO EmblemedIcon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr EmblemedIcon -> EmblemedIcon
EmblemedIcon) Ptr EmblemedIcon
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
icon
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
emblem b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
EmblemedIcon -> IO EmblemedIcon
forall (m :: * -> *) a. Monad m => a -> m a
return EmblemedIcon
result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_emblemed_icon_add_emblem" g_emblemed_icon_add_emblem ::
Ptr EmblemedIcon ->
Ptr Gio.Emblem.Emblem ->
IO ()
emblemedIconAddEmblem ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblemedIcon a, Gio.Emblem.IsEmblem b) =>
a
-> b
-> m ()
emblemedIconAddEmblem :: a -> b -> m ()
emblemedIconAddEmblem emblemed :: a
emblemed emblem :: b
emblem = 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 EmblemedIcon
emblemed' <- a -> IO (Ptr EmblemedIcon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
emblemed
Ptr Emblem
emblem' <- b -> IO (Ptr Emblem)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
emblem
Ptr EmblemedIcon -> Ptr Emblem -> IO ()
g_emblemed_icon_add_emblem Ptr EmblemedIcon
emblemed' Ptr Emblem
emblem'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
emblemed
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
emblem
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data EmblemedIconAddEmblemMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsEmblemedIcon a, Gio.Emblem.IsEmblem b) => O.MethodInfo EmblemedIconAddEmblemMethodInfo a signature where
overloadedMethod _ = emblemedIconAddEmblem
#endif
foreign import ccall "g_emblemed_icon_clear_emblems" g_emblemed_icon_clear_emblems ::
Ptr EmblemedIcon ->
IO ()
emblemedIconClearEmblems ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblemedIcon a) =>
a
-> m ()
emblemedIconClearEmblems :: a -> m ()
emblemedIconClearEmblems emblemed :: a
emblemed = 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 EmblemedIcon
emblemed' <- a -> IO (Ptr EmblemedIcon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
emblemed
Ptr EmblemedIcon -> IO ()
g_emblemed_icon_clear_emblems Ptr EmblemedIcon
emblemed'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
emblemed
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if ENABLE_OVERLOADING
data EmblemedIconClearEmblemsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsEmblemedIcon a) => O.MethodInfo EmblemedIconClearEmblemsMethodInfo a signature where
overloadedMethod _ = emblemedIconClearEmblems
#endif
foreign import ccall "g_emblemed_icon_get_emblems" g_emblemed_icon_get_emblems ::
Ptr EmblemedIcon ->
IO (Ptr (GList (Ptr Gio.Emblem.Emblem)))
emblemedIconGetEmblems ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblemedIcon a) =>
a
-> m [Gio.Emblem.Emblem]
emblemedIconGetEmblems :: a -> m [Emblem]
emblemedIconGetEmblems emblemed :: a
emblemed = IO [Emblem] -> m [Emblem]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Emblem] -> m [Emblem]) -> IO [Emblem] -> m [Emblem]
forall a b. (a -> b) -> a -> b
$ do
Ptr EmblemedIcon
emblemed' <- a -> IO (Ptr EmblemedIcon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
emblemed
Ptr (GList (Ptr Emblem))
result <- Ptr EmblemedIcon -> IO (Ptr (GList (Ptr Emblem)))
g_emblemed_icon_get_emblems Ptr EmblemedIcon
emblemed'
[Ptr Emblem]
result' <- Ptr (GList (Ptr Emblem)) -> IO [Ptr Emblem]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Emblem))
result
[Emblem]
result'' <- (Ptr Emblem -> IO Emblem) -> [Ptr Emblem] -> IO [Emblem]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Emblem -> Emblem) -> Ptr Emblem -> IO Emblem
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Emblem -> Emblem
Gio.Emblem.Emblem) [Ptr Emblem]
result'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
emblemed
[Emblem] -> IO [Emblem]
forall (m :: * -> *) a. Monad m => a -> m a
return [Emblem]
result''
#if ENABLE_OVERLOADING
data EmblemedIconGetEmblemsMethodInfo
instance (signature ~ (m [Gio.Emblem.Emblem]), MonadIO m, IsEmblemedIcon a) => O.MethodInfo EmblemedIconGetEmblemsMethodInfo a signature where
overloadedMethod _ = emblemedIconGetEmblems
#endif
foreign import ccall "g_emblemed_icon_get_icon" g_emblemed_icon_get_icon ::
Ptr EmblemedIcon ->
IO (Ptr Gio.Icon.Icon)
emblemedIconGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblemedIcon a) =>
a
-> m Gio.Icon.Icon
emblemedIconGetIcon :: a -> m Icon
emblemedIconGetIcon emblemed :: a
emblemed = IO Icon -> m Icon
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Icon -> m Icon) -> IO Icon -> m Icon
forall a b. (a -> b) -> a -> b
$ do
Ptr EmblemedIcon
emblemed' <- a -> IO (Ptr EmblemedIcon)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
emblemed
Ptr Icon
result <- Ptr EmblemedIcon -> IO (Ptr Icon)
g_emblemed_icon_get_icon Ptr EmblemedIcon
emblemed'
Text -> Ptr Icon -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "emblemedIconGetIcon" Ptr Icon
result
Icon
result' <- ((ManagedPtr Icon -> Icon) -> Ptr Icon -> IO Icon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Icon -> Icon
Gio.Icon.Icon) Ptr Icon
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
emblemed
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result'
#if ENABLE_OVERLOADING
data EmblemedIconGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsEmblemedIcon a) => O.MethodInfo EmblemedIconGetIconMethodInfo a signature where
overloadedMethod _ = emblemedIconGetIcon
#endif