gi-wnck-3.0.3: GI/Wnck/Objects/ClassGroup.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
The 'GI.Wnck.Objects.ClassGroup.ClassGroup' struct contains only private fields and should not be
directly accessed.
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Wnck.Objects.ClassGroup
(
-- * Exported types
ClassGroup(..) ,
IsClassGroup ,
toClassGroup ,
noClassGroup ,
-- * Methods
-- ** get #method:get#
classGroupGet ,
-- ** getIcon #method:getIcon#
#if ENABLE_OVERLOADING
ClassGroupGetIconMethodInfo ,
#endif
classGroupGetIcon ,
-- ** getId #method:getId#
#if ENABLE_OVERLOADING
ClassGroupGetIdMethodInfo ,
#endif
classGroupGetId ,
-- ** getMiniIcon #method:getMiniIcon#
#if ENABLE_OVERLOADING
ClassGroupGetMiniIconMethodInfo ,
#endif
classGroupGetMiniIcon ,
-- ** getName #method:getName#
#if ENABLE_OVERLOADING
ClassGroupGetNameMethodInfo ,
#endif
classGroupGetName ,
-- ** getResClass #method:getResClass#
#if ENABLE_OVERLOADING
ClassGroupGetResClassMethodInfo ,
#endif
classGroupGetResClass ,
-- ** getWindows #method:getWindows#
#if ENABLE_OVERLOADING
ClassGroupGetWindowsMethodInfo ,
#endif
classGroupGetWindows ,
-- * Signals
-- ** iconChanged #signal:iconChanged#
C_ClassGroupIconChangedCallback ,
ClassGroupIconChangedCallback ,
#if ENABLE_OVERLOADING
ClassGroupIconChangedSignalInfo ,
#endif
afterClassGroupIconChanged ,
genClosure_ClassGroupIconChanged ,
mk_ClassGroupIconChangedCallback ,
noClassGroupIconChangedCallback ,
onClassGroupIconChanged ,
wrap_ClassGroupIconChangedCallback ,
-- ** nameChanged #signal:nameChanged#
C_ClassGroupNameChangedCallback ,
ClassGroupNameChangedCallback ,
#if ENABLE_OVERLOADING
ClassGroupNameChangedSignalInfo ,
#endif
afterClassGroupNameChanged ,
genClosure_ClassGroupNameChanged ,
mk_ClassGroupNameChangedCallback ,
noClassGroupNameChangedCallback ,
onClassGroupNameChanged ,
wrap_ClassGroupNameChangedCallback ,
) 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 qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import {-# SOURCE #-} qualified GI.Wnck.Objects.Window as Wnck.Window
-- | Memory-managed wrapper type.
newtype ClassGroup = ClassGroup (ManagedPtr ClassGroup)
foreign import ccall "wnck_class_group_get_type"
c_wnck_class_group_get_type :: IO GType
instance GObject ClassGroup where
gobjectType = c_wnck_class_group_get_type
-- | Type class for types which can be safely cast to `ClassGroup`, for instance with `toClassGroup`.
class (GObject o, O.IsDescendantOf ClassGroup o) => IsClassGroup o
instance (GObject o, O.IsDescendantOf ClassGroup o) => IsClassGroup o
instance O.HasParentTypes ClassGroup
type instance O.ParentTypes ClassGroup = '[GObject.Object.Object]
-- | Cast to `ClassGroup`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toClassGroup :: (MonadIO m, IsClassGroup o) => o -> m ClassGroup
toClassGroup = liftIO . unsafeCastTo ClassGroup
-- | A convenience alias for `Nothing` :: `Maybe` `ClassGroup`.
noClassGroup :: Maybe ClassGroup
noClassGroup = Nothing
#if ENABLE_OVERLOADING
type family ResolveClassGroupMethod (t :: Symbol) (o :: *) :: * where
ResolveClassGroupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveClassGroupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveClassGroupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveClassGroupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveClassGroupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveClassGroupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveClassGroupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveClassGroupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveClassGroupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveClassGroupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveClassGroupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveClassGroupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveClassGroupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveClassGroupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveClassGroupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveClassGroupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveClassGroupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveClassGroupMethod "getIcon" o = ClassGroupGetIconMethodInfo
ResolveClassGroupMethod "getId" o = ClassGroupGetIdMethodInfo
ResolveClassGroupMethod "getMiniIcon" o = ClassGroupGetMiniIconMethodInfo
ResolveClassGroupMethod "getName" o = ClassGroupGetNameMethodInfo
ResolveClassGroupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveClassGroupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveClassGroupMethod "getResClass" o = ClassGroupGetResClassMethodInfo
ResolveClassGroupMethod "getWindows" o = ClassGroupGetWindowsMethodInfo
ResolveClassGroupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveClassGroupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveClassGroupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveClassGroupMethod t ClassGroup, O.MethodInfo info ClassGroup p) => OL.IsLabel t (ClassGroup -> 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
-- signal ClassGroup::icon-changed
{- |
Emitted when the icon of /@classGroup@/ changes.
-}
type ClassGroupIconChangedCallback =
IO ()
-- | A convenience synonym for @`Nothing` :: `Maybe` `ClassGroupIconChangedCallback`@.
noClassGroupIconChangedCallback :: Maybe ClassGroupIconChangedCallback
noClassGroupIconChangedCallback = Nothing
-- | Type for the callback on the (unwrapped) C side.
type C_ClassGroupIconChangedCallback =
Ptr () -> -- object
Ptr () -> -- user_data
IO ()
-- | Generate a function pointer callable from C code, from a `C_ClassGroupIconChangedCallback`.
foreign import ccall "wrapper"
mk_ClassGroupIconChangedCallback :: C_ClassGroupIconChangedCallback -> IO (FunPtr C_ClassGroupIconChangedCallback)
-- | Wrap the callback into a `GClosure`.
genClosure_ClassGroupIconChanged :: MonadIO m => ClassGroupIconChangedCallback -> m (GClosure C_ClassGroupIconChangedCallback)
genClosure_ClassGroupIconChanged cb = liftIO $ do
let cb' = wrap_ClassGroupIconChangedCallback cb
mk_ClassGroupIconChangedCallback cb' >>= B.GClosure.newGClosure
-- | Wrap a `ClassGroupIconChangedCallback` into a `C_ClassGroupIconChangedCallback`.
wrap_ClassGroupIconChangedCallback ::
ClassGroupIconChangedCallback ->
C_ClassGroupIconChangedCallback
wrap_ClassGroupIconChangedCallback _cb _ _ = do
_cb
{- |
Connect a signal handler for the “@icon-changed@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.on' classGroup #iconChanged callback
@
-}
onClassGroupIconChanged :: (IsClassGroup a, MonadIO m) => a -> ClassGroupIconChangedCallback -> m SignalHandlerId
onClassGroupIconChanged obj cb = liftIO $ do
let cb' = wrap_ClassGroupIconChangedCallback cb
cb'' <- mk_ClassGroupIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' SignalConnectBefore
{- |
Connect a signal handler for the “@icon-changed@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.after' classGroup #iconChanged callback
@
-}
afterClassGroupIconChanged :: (IsClassGroup a, MonadIO m) => a -> ClassGroupIconChangedCallback -> m SignalHandlerId
afterClassGroupIconChanged obj cb = liftIO $ do
let cb' = wrap_ClassGroupIconChangedCallback cb
cb'' <- mk_ClassGroupIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' SignalConnectAfter
-- signal ClassGroup::name-changed
{- |
Emitted when the name of /@classGroup@/ changes.
-}
type ClassGroupNameChangedCallback =
IO ()
-- | A convenience synonym for @`Nothing` :: `Maybe` `ClassGroupNameChangedCallback`@.
noClassGroupNameChangedCallback :: Maybe ClassGroupNameChangedCallback
noClassGroupNameChangedCallback = Nothing
-- | Type for the callback on the (unwrapped) C side.
type C_ClassGroupNameChangedCallback =
Ptr () -> -- object
Ptr () -> -- user_data
IO ()
-- | Generate a function pointer callable from C code, from a `C_ClassGroupNameChangedCallback`.
foreign import ccall "wrapper"
mk_ClassGroupNameChangedCallback :: C_ClassGroupNameChangedCallback -> IO (FunPtr C_ClassGroupNameChangedCallback)
-- | Wrap the callback into a `GClosure`.
genClosure_ClassGroupNameChanged :: MonadIO m => ClassGroupNameChangedCallback -> m (GClosure C_ClassGroupNameChangedCallback)
genClosure_ClassGroupNameChanged cb = liftIO $ do
let cb' = wrap_ClassGroupNameChangedCallback cb
mk_ClassGroupNameChangedCallback cb' >>= B.GClosure.newGClosure
-- | Wrap a `ClassGroupNameChangedCallback` into a `C_ClassGroupNameChangedCallback`.
wrap_ClassGroupNameChangedCallback ::
ClassGroupNameChangedCallback ->
C_ClassGroupNameChangedCallback
wrap_ClassGroupNameChangedCallback _cb _ _ = do
_cb
{- |
Connect a signal handler for the “@name-changed@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.on' classGroup #nameChanged callback
@
-}
onClassGroupNameChanged :: (IsClassGroup a, MonadIO m) => a -> ClassGroupNameChangedCallback -> m SignalHandlerId
onClassGroupNameChanged obj cb = liftIO $ do
let cb' = wrap_ClassGroupNameChangedCallback cb
cb'' <- mk_ClassGroupNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectBefore
{- |
Connect a signal handler for the “@name-changed@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
@
'Data.GI.Base.Signals.after' classGroup #nameChanged callback
@
-}
afterClassGroupNameChanged :: (IsClassGroup a, MonadIO m) => a -> ClassGroupNameChangedCallback -> m SignalHandlerId
afterClassGroupNameChanged obj cb = liftIO $ do
let cb' = wrap_ClassGroupNameChangedCallback cb
cb'' <- mk_ClassGroupNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList ClassGroup
type instance O.AttributeList ClassGroup = ClassGroupAttributeList
type ClassGroupAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data ClassGroupIconChangedSignalInfo
instance SignalInfo ClassGroupIconChangedSignalInfo where
type HaskellCallbackType ClassGroupIconChangedSignalInfo = ClassGroupIconChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_ClassGroupIconChangedCallback cb
cb'' <- mk_ClassGroupIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' connectMode
data ClassGroupNameChangedSignalInfo
instance SignalInfo ClassGroupNameChangedSignalInfo where
type HaskellCallbackType ClassGroupNameChangedSignalInfo = ClassGroupNameChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_ClassGroupNameChangedCallback cb
cb'' <- mk_ClassGroupNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' connectMode
type instance O.SignalList ClassGroup = ClassGroupSignalList
type ClassGroupSignalList = ('[ '("iconChanged", ClassGroupIconChangedSignalInfo), '("nameChanged", ClassGroupNameChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
-- method ClassGroup::get_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}))
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_icon" wnck_class_group_get_icon ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
{- |
Gets the icon to be used for /@classGroup@/. Since there is no way to
properly find the icon, a suboptimal heuristic is used to find it. The icon
is the first icon found by looking at all the 'GI.Wnck.Objects.Application.Application' for each
'GI.Wnck.Objects.Window.Window' in /@classGroup@/, then at all the 'GI.Wnck.Objects.Window.Window' in /@classGroup@/. If
no icon was found, a fallback icon is used.
/Since: 2.2/
-}
classGroupGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m GdkPixbuf.Pixbuf.Pixbuf
{- ^ __Returns:__ the icon for /@classGroup@/. The caller should
reference the returned \<classname>GdkPixbuf\<\/classname> if it needs to keep
the icon around. -}
classGroupGetIcon classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_icon classGroup'
checkUnexpectedReturnNULL "classGroupGetIcon" result
result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
touchManagedPtr classGroup
return result'
#if ENABLE_OVERLOADING
data ClassGroupGetIconMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetIconMethodInfo a signature where
overloadedMethod _ = classGroupGetIcon
#endif
-- method ClassGroup::get_id
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_id" wnck_class_group_get_id ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO CString
{- |
Gets the identifier name for /@classGroup@/. This is the resource class for
/@classGroup@/.
/Since: 3.2/
-}
classGroupGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m T.Text
{- ^ __Returns:__ the identifier name of /@classGroup@/, or an
empty string if the group has no identifier name. -}
classGroupGetId classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_id classGroup'
checkUnexpectedReturnNULL "classGroupGetId" result
result' <- cstringToText result
touchManagedPtr classGroup
return result'
#if ENABLE_OVERLOADING
data ClassGroupGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetIdMethodInfo a signature where
overloadedMethod _ = classGroupGetId
#endif
-- method ClassGroup::get_mini_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "Pixbuf"}))
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_mini_icon" wnck_class_group_get_mini_icon ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
{- |
Gets the mini-icon to be used for /@classGroup@/. Since there is no way to
properly find the mini-icon, the same suboptimal heuristic as the one for
'GI.Wnck.Objects.ClassGroup.classGroupGetIcon' is used to find it.
/Since: 2.2/
-}
classGroupGetMiniIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m GdkPixbuf.Pixbuf.Pixbuf
{- ^ __Returns:__ the mini-icon for /@classGroup@/. The caller
should reference the returned \<classname>GdkPixbuf\<\/classname> if it needs
to keep the mini-icon around. -}
classGroupGetMiniIcon classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_mini_icon classGroup'
checkUnexpectedReturnNULL "classGroupGetMiniIcon" result
result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
touchManagedPtr classGroup
return result'
#if ENABLE_OVERLOADING
data ClassGroupGetMiniIconMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetMiniIconMethodInfo a signature where
overloadedMethod _ = classGroupGetMiniIcon
#endif
-- method ClassGroup::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_name" wnck_class_group_get_name ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO CString
{- |
Gets an human-readable name for /@classGroup@/. Since there is no way to
properly find this name, a suboptimal heuristic is used to find it. The name
is the name of all 'GI.Wnck.Objects.Application.Application' for each 'GI.Wnck.Objects.Window.Window' in /@classGroup@/ if
they all have the same name. If all 'GI.Wnck.Objects.Application.Application' don\'t have the same
name, the name is the name of all 'GI.Wnck.Objects.Window.Window' in /@classGroup@/ if they all
have the same name. If all 'GI.Wnck.Objects.Window.Window' don\'t have the same name, the
resource class name is used.
/Since: 2.2/
-}
classGroupGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m T.Text
{- ^ __Returns:__ an human-readable name for /@classGroup@/. -}
classGroupGetName classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_name classGroup'
checkUnexpectedReturnNULL "classGroupGetName" result
result' <- cstringToText result
touchManagedPtr classGroup
return result'
#if ENABLE_OVERLOADING
data ClassGroupGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetNameMethodInfo a signature where
overloadedMethod _ = classGroupGetName
#endif
-- method ClassGroup::get_res_class
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_res_class" wnck_class_group_get_res_class ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO CString
{-# DEPRECATED classGroupGetResClass ["(Since version 3.2)","Use 'GI.Wnck.Objects.ClassGroup.classGroupGetId' instead."] #-}
{- |
Gets the resource class name for /@classGroup@/.
/Since: 2.2/
-}
classGroupGetResClass ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m T.Text
{- ^ __Returns:__ the resource class name of /@classGroup@/, or an
empty string if the group has no resource class name. -}
classGroupGetResClass classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_res_class classGroup'
checkUnexpectedReturnNULL "classGroupGetResClass" result
result' <- cstringToText result
touchManagedPtr classGroup
return result'
#if ENABLE_OVERLOADING
data ClassGroupGetResClassMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetResClassMethodInfo a signature where
overloadedMethod _ = classGroupGetResClass
#endif
-- method ClassGroup::get_windows
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "class_group", argType = TInterface (Name {namespace = "Wnck", name = "ClassGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WnckClassGroup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "Wnck", name = "Window"})))
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get_windows" wnck_class_group_get_windows ::
Ptr ClassGroup -> -- class_group : TInterface (Name {namespace = "Wnck", name = "ClassGroup"})
IO (Ptr (GList (Ptr Wnck.Window.Window)))
{- |
Gets the list of 'GI.Wnck.Objects.Window.Window' that are grouped in /@classGroup@/.
/Since: 2.2/
-}
classGroupGetWindows ::
(B.CallStack.HasCallStack, MonadIO m, IsClassGroup a) =>
a
{- ^ /@classGroup@/: a 'GI.Wnck.Objects.ClassGroup.ClassGroup'. -}
-> m [Wnck.Window.Window]
{- ^ __Returns:__ the list of
'GI.Wnck.Objects.Window.Window' grouped in /@classGroup@/, or 'Nothing' if the group contains no
window. The list should not be modified nor freed, as it is owned by
/@classGroup@/. -}
classGroupGetWindows classGroup = liftIO $ do
classGroup' <- unsafeManagedPtrCastPtr classGroup
result <- wnck_class_group_get_windows classGroup'
result' <- unpackGList result
result'' <- mapM (newObject Wnck.Window.Window) result'
touchManagedPtr classGroup
return result''
#if ENABLE_OVERLOADING
data ClassGroupGetWindowsMethodInfo
instance (signature ~ (m [Wnck.Window.Window]), MonadIO m, IsClassGroup a) => O.MethodInfo ClassGroupGetWindowsMethodInfo a signature where
overloadedMethod _ = classGroupGetWindows
#endif
-- method ClassGroup::get
-- method type : MemberFunction
-- Args : [Arg {argCName = "id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "identifier name of the sought resource class.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Wnck", name = "ClassGroup"}))
-- throws : False
-- Skip return : False
foreign import ccall "wnck_class_group_get" wnck_class_group_get ::
CString -> -- id : TBasicType TUTF8
IO (Ptr ClassGroup)
{- |
Gets the 'GI.Wnck.Objects.ClassGroup.ClassGroup' corresponding to /@id@/.
/Since: 2.2/
-}
classGroupGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
{- ^ /@id@/: identifier name of the sought resource class. -}
-> m ClassGroup
{- ^ __Returns:__ the 'GI.Wnck.Objects.ClassGroup.ClassGroup' corresponding to
/@id@/, or 'Nothing' if there is no 'GI.Wnck.Objects.ClassGroup.ClassGroup' with the specified
/@id@/. The returned 'GI.Wnck.Objects.ClassGroup.ClassGroup' is owned by libwnck and must not be
referenced or unreferenced. -}
classGroupGet id = liftIO $ do
id' <- textToCString id
result <- wnck_class_group_get id'
checkUnexpectedReturnNULL "classGroupGet" result
result' <- (newObject ClassGroup) result
freeMem id'
return result'
#if ENABLE_OVERLOADING
#endif