#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.Emblem
(
Emblem(..) ,
IsEmblem ,
toEmblem ,
noEmblem ,
#if ENABLE_OVERLOADING
EmblemGetIconMethodInfo ,
#endif
emblemGetIcon ,
#if ENABLE_OVERLOADING
EmblemGetOriginMethodInfo ,
#endif
emblemGetOrigin ,
emblemNew ,
emblemNewWithOrigin ,
#if ENABLE_OVERLOADING
EmblemIconPropertyInfo ,
#endif
constructEmblemIcon ,
#if ENABLE_OVERLOADING
emblemIcon ,
#endif
getEmblemIcon ,
#if ENABLE_OVERLOADING
EmblemOriginPropertyInfo ,
#endif
constructEmblemOrigin ,
#if ENABLE_OVERLOADING
emblemOrigin ,
#endif
getEmblemOrigin ,
) 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.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
newtype Emblem = Emblem (ManagedPtr Emblem)
foreign import ccall "g_emblem_get_type"
c_g_emblem_get_type :: IO GType
instance GObject Emblem where
gobjectType = c_g_emblem_get_type
class (GObject o, O.IsDescendantOf Emblem o) => IsEmblem o
instance (GObject o, O.IsDescendantOf Emblem o) => IsEmblem o
instance O.HasParentTypes Emblem
type instance O.ParentTypes Emblem = '[GObject.Object.Object, Gio.Icon.Icon]
toEmblem :: (MonadIO m, IsEmblem o) => o -> m Emblem
toEmblem = liftIO . unsafeCastTo Emblem
noEmblem :: Maybe Emblem
noEmblem = Nothing
#if ENABLE_OVERLOADING
type family ResolveEmblemMethod (t :: Symbol) (o :: *) :: * where
ResolveEmblemMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveEmblemMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveEmblemMethod "equal" o = Gio.Icon.IconEqualMethodInfo
ResolveEmblemMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveEmblemMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveEmblemMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveEmblemMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveEmblemMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveEmblemMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveEmblemMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveEmblemMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveEmblemMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveEmblemMethod "serialize" o = Gio.Icon.IconSerializeMethodInfo
ResolveEmblemMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveEmblemMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveEmblemMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveEmblemMethod "toString" o = Gio.Icon.IconToStringMethodInfo
ResolveEmblemMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveEmblemMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveEmblemMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveEmblemMethod "getIcon" o = EmblemGetIconMethodInfo
ResolveEmblemMethod "getOrigin" o = EmblemGetOriginMethodInfo
ResolveEmblemMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveEmblemMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveEmblemMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveEmblemMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveEmblemMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveEmblemMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveEmblemMethod t Emblem, O.MethodInfo info Emblem p) => OL.IsLabel t (Emblem -> 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
getEmblemIcon :: (MonadIO m, IsEmblem o) => o -> m (Maybe GObject.Object.Object)
getEmblemIcon obj = liftIO $ B.Properties.getObjectPropertyObject obj "icon" GObject.Object.Object
constructEmblemIcon :: (IsEmblem o, GObject.Object.IsObject a) => a -> IO (GValueConstruct o)
constructEmblemIcon val = B.Properties.constructObjectPropertyObject "icon" (Just val)
#if ENABLE_OVERLOADING
data EmblemIconPropertyInfo
instance AttrInfo EmblemIconPropertyInfo where
type AttrAllowedOps EmblemIconPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint EmblemIconPropertyInfo = GObject.Object.IsObject
type AttrBaseTypeConstraint EmblemIconPropertyInfo = IsEmblem
type AttrGetType EmblemIconPropertyInfo = (Maybe GObject.Object.Object)
type AttrLabel EmblemIconPropertyInfo = "icon"
type AttrOrigin EmblemIconPropertyInfo = Emblem
attrGet _ = getEmblemIcon
attrSet _ = undefined
attrConstruct _ = constructEmblemIcon
attrClear _ = undefined
#endif
getEmblemOrigin :: (MonadIO m, IsEmblem o) => o -> m Gio.Enums.EmblemOrigin
getEmblemOrigin obj = liftIO $ B.Properties.getObjectPropertyEnum obj "origin"
constructEmblemOrigin :: (IsEmblem o) => Gio.Enums.EmblemOrigin -> IO (GValueConstruct o)
constructEmblemOrigin val = B.Properties.constructObjectPropertyEnum "origin" val
#if ENABLE_OVERLOADING
data EmblemOriginPropertyInfo
instance AttrInfo EmblemOriginPropertyInfo where
type AttrAllowedOps EmblemOriginPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint EmblemOriginPropertyInfo = (~) Gio.Enums.EmblemOrigin
type AttrBaseTypeConstraint EmblemOriginPropertyInfo = IsEmblem
type AttrGetType EmblemOriginPropertyInfo = Gio.Enums.EmblemOrigin
type AttrLabel EmblemOriginPropertyInfo = "origin"
type AttrOrigin EmblemOriginPropertyInfo = Emblem
attrGet _ = getEmblemOrigin
attrSet _ = undefined
attrConstruct _ = constructEmblemOrigin
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Emblem
type instance O.AttributeList Emblem = EmblemAttributeList
type EmblemAttributeList = ('[ '("icon", EmblemIconPropertyInfo), '("origin", EmblemOriginPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
emblemIcon :: AttrLabelProxy "icon"
emblemIcon = AttrLabelProxy
emblemOrigin :: AttrLabelProxy "origin"
emblemOrigin = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Emblem = EmblemSignalList
type EmblemSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_emblem_new" g_emblem_new ::
Ptr Gio.Icon.Icon ->
IO (Ptr Emblem)
emblemNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Icon.IsIcon a) =>
a
-> m Emblem
emblemNew icon = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
result <- g_emblem_new icon'
checkUnexpectedReturnNULL "emblemNew" result
result' <- (wrapObject Emblem) result
touchManagedPtr icon
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_emblem_new_with_origin" g_emblem_new_with_origin ::
Ptr Gio.Icon.Icon ->
CUInt ->
IO (Ptr Emblem)
emblemNewWithOrigin ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Icon.IsIcon a) =>
a
-> Gio.Enums.EmblemOrigin
-> m Emblem
emblemNewWithOrigin icon origin = liftIO $ do
icon' <- unsafeManagedPtrCastPtr icon
let origin' = (fromIntegral . fromEnum) origin
result <- g_emblem_new_with_origin icon' origin'
checkUnexpectedReturnNULL "emblemNewWithOrigin" result
result' <- (wrapObject Emblem) result
touchManagedPtr icon
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_emblem_get_icon" g_emblem_get_icon ::
Ptr Emblem ->
IO (Ptr Gio.Icon.Icon)
emblemGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblem a) =>
a
-> m Gio.Icon.Icon
emblemGetIcon emblem = liftIO $ do
emblem' <- unsafeManagedPtrCastPtr emblem
result <- g_emblem_get_icon emblem'
checkUnexpectedReturnNULL "emblemGetIcon" result
result' <- (newObject Gio.Icon.Icon) result
touchManagedPtr emblem
return result'
#if ENABLE_OVERLOADING
data EmblemGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsEmblem a) => O.MethodInfo EmblemGetIconMethodInfo a signature where
overloadedMethod _ = emblemGetIcon
#endif
foreign import ccall "g_emblem_get_origin" g_emblem_get_origin ::
Ptr Emblem ->
IO CUInt
emblemGetOrigin ::
(B.CallStack.HasCallStack, MonadIO m, IsEmblem a) =>
a
-> m Gio.Enums.EmblemOrigin
emblemGetOrigin emblem = liftIO $ do
emblem' <- unsafeManagedPtrCastPtr emblem
result <- g_emblem_get_origin emblem'
let result' = (toEnum . fromIntegral) result
touchManagedPtr emblem
return result'
#if ENABLE_OVERLOADING
data EmblemGetOriginMethodInfo
instance (signature ~ (m Gio.Enums.EmblemOrigin), MonadIO m, IsEmblem a) => O.MethodInfo EmblemGetOriginMethodInfo a signature where
overloadedMethod _ = emblemGetOrigin
#endif