#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Wnck.Objects.Application
(
Application(..) ,
IsApplication ,
toApplication ,
noApplication ,
applicationGet ,
#if ENABLE_OVERLOADING
ApplicationGetIconMethodInfo ,
#endif
applicationGetIcon ,
#if ENABLE_OVERLOADING
ApplicationGetIconIsFallbackMethodInfo ,
#endif
applicationGetIconIsFallback ,
#if ENABLE_OVERLOADING
ApplicationGetIconNameMethodInfo ,
#endif
applicationGetIconName ,
#if ENABLE_OVERLOADING
ApplicationGetMiniIconMethodInfo ,
#endif
applicationGetMiniIcon ,
#if ENABLE_OVERLOADING
ApplicationGetNWindowsMethodInfo ,
#endif
applicationGetNWindows ,
#if ENABLE_OVERLOADING
ApplicationGetNameMethodInfo ,
#endif
applicationGetName ,
#if ENABLE_OVERLOADING
ApplicationGetPidMethodInfo ,
#endif
applicationGetPid ,
#if ENABLE_OVERLOADING
ApplicationGetStartupIdMethodInfo ,
#endif
applicationGetStartupId ,
#if ENABLE_OVERLOADING
ApplicationGetWindowsMethodInfo ,
#endif
applicationGetWindows ,
#if ENABLE_OVERLOADING
ApplicationGetXidMethodInfo ,
#endif
applicationGetXid ,
ApplicationIconChangedCallback ,
#if ENABLE_OVERLOADING
ApplicationIconChangedSignalInfo ,
#endif
C_ApplicationIconChangedCallback ,
afterApplicationIconChanged ,
genClosure_ApplicationIconChanged ,
mk_ApplicationIconChangedCallback ,
noApplicationIconChangedCallback ,
onApplicationIconChanged ,
wrap_ApplicationIconChangedCallback ,
ApplicationNameChangedCallback ,
#if ENABLE_OVERLOADING
ApplicationNameChangedSignalInfo ,
#endif
C_ApplicationNameChangedCallback ,
afterApplicationNameChanged ,
genClosure_ApplicationNameChanged ,
mk_ApplicationNameChangedCallback ,
noApplicationNameChangedCallback ,
onApplicationNameChanged ,
wrap_ApplicationNameChangedCallback ,
) 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
newtype Application = Application (ManagedPtr Application)
foreign import ccall "wnck_application_get_type"
c_wnck_application_get_type :: IO GType
instance GObject Application where
gobjectType = c_wnck_application_get_type
class (GObject o, O.IsDescendantOf Application o) => IsApplication o
instance (GObject o, O.IsDescendantOf Application o) => IsApplication o
instance O.HasParentTypes Application
type instance O.ParentTypes Application = '[GObject.Object.Object]
toApplication :: (MonadIO m, IsApplication o) => o -> m Application
toApplication = liftIO . unsafeCastTo Application
noApplication :: Maybe Application
noApplication = Nothing
#if ENABLE_OVERLOADING
type family ResolveApplicationMethod (t :: Symbol) (o :: *) :: * where
ResolveApplicationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveApplicationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveApplicationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveApplicationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveApplicationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveApplicationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveApplicationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveApplicationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveApplicationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveApplicationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveApplicationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveApplicationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveApplicationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveApplicationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveApplicationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveApplicationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveApplicationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveApplicationMethod "getIcon" o = ApplicationGetIconMethodInfo
ResolveApplicationMethod "getIconIsFallback" o = ApplicationGetIconIsFallbackMethodInfo
ResolveApplicationMethod "getIconName" o = ApplicationGetIconNameMethodInfo
ResolveApplicationMethod "getMiniIcon" o = ApplicationGetMiniIconMethodInfo
ResolveApplicationMethod "getNWindows" o = ApplicationGetNWindowsMethodInfo
ResolveApplicationMethod "getName" o = ApplicationGetNameMethodInfo
ResolveApplicationMethod "getPid" o = ApplicationGetPidMethodInfo
ResolveApplicationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveApplicationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveApplicationMethod "getStartupId" o = ApplicationGetStartupIdMethodInfo
ResolveApplicationMethod "getWindows" o = ApplicationGetWindowsMethodInfo
ResolveApplicationMethod "getXid" o = ApplicationGetXidMethodInfo
ResolveApplicationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveApplicationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveApplicationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveApplicationMethod t Application, O.MethodInfo info Application p) => OL.IsLabel t (Application -> 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
type ApplicationIconChangedCallback =
IO ()
noApplicationIconChangedCallback :: Maybe ApplicationIconChangedCallback
noApplicationIconChangedCallback = Nothing
type C_ApplicationIconChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ApplicationIconChangedCallback :: C_ApplicationIconChangedCallback -> IO (FunPtr C_ApplicationIconChangedCallback)
genClosure_ApplicationIconChanged :: MonadIO m => ApplicationIconChangedCallback -> m (GClosure C_ApplicationIconChangedCallback)
genClosure_ApplicationIconChanged cb = liftIO $ do
let cb' = wrap_ApplicationIconChangedCallback cb
mk_ApplicationIconChangedCallback cb' >>= B.GClosure.newGClosure
wrap_ApplicationIconChangedCallback ::
ApplicationIconChangedCallback ->
C_ApplicationIconChangedCallback
wrap_ApplicationIconChangedCallback _cb _ _ = do
_cb
onApplicationIconChanged :: (IsApplication a, MonadIO m) => a -> ApplicationIconChangedCallback -> m SignalHandlerId
onApplicationIconChanged obj cb = liftIO $ do
let cb' = wrap_ApplicationIconChangedCallback cb
cb'' <- mk_ApplicationIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' SignalConnectBefore
afterApplicationIconChanged :: (IsApplication a, MonadIO m) => a -> ApplicationIconChangedCallback -> m SignalHandlerId
afterApplicationIconChanged obj cb = liftIO $ do
let cb' = wrap_ApplicationIconChangedCallback cb
cb'' <- mk_ApplicationIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' SignalConnectAfter
type ApplicationNameChangedCallback =
IO ()
noApplicationNameChangedCallback :: Maybe ApplicationNameChangedCallback
noApplicationNameChangedCallback = Nothing
type C_ApplicationNameChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ApplicationNameChangedCallback :: C_ApplicationNameChangedCallback -> IO (FunPtr C_ApplicationNameChangedCallback)
genClosure_ApplicationNameChanged :: MonadIO m => ApplicationNameChangedCallback -> m (GClosure C_ApplicationNameChangedCallback)
genClosure_ApplicationNameChanged cb = liftIO $ do
let cb' = wrap_ApplicationNameChangedCallback cb
mk_ApplicationNameChangedCallback cb' >>= B.GClosure.newGClosure
wrap_ApplicationNameChangedCallback ::
ApplicationNameChangedCallback ->
C_ApplicationNameChangedCallback
wrap_ApplicationNameChangedCallback _cb _ _ = do
_cb
onApplicationNameChanged :: (IsApplication a, MonadIO m) => a -> ApplicationNameChangedCallback -> m SignalHandlerId
onApplicationNameChanged obj cb = liftIO $ do
let cb' = wrap_ApplicationNameChangedCallback cb
cb'' <- mk_ApplicationNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectBefore
afterApplicationNameChanged :: (IsApplication a, MonadIO m) => a -> ApplicationNameChangedCallback -> m SignalHandlerId
afterApplicationNameChanged obj cb = liftIO $ do
let cb' = wrap_ApplicationNameChangedCallback cb
cb'' <- mk_ApplicationNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList Application
type instance O.AttributeList Application = ApplicationAttributeList
type ApplicationAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data ApplicationIconChangedSignalInfo
instance SignalInfo ApplicationIconChangedSignalInfo where
type HaskellCallbackType ApplicationIconChangedSignalInfo = ApplicationIconChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_ApplicationIconChangedCallback cb
cb'' <- mk_ApplicationIconChangedCallback cb'
connectSignalFunPtr obj "icon-changed" cb'' connectMode
data ApplicationNameChangedSignalInfo
instance SignalInfo ApplicationNameChangedSignalInfo where
type HaskellCallbackType ApplicationNameChangedSignalInfo = ApplicationNameChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_ApplicationNameChangedCallback cb
cb'' <- mk_ApplicationNameChangedCallback cb'
connectSignalFunPtr obj "name-changed" cb'' connectMode
type instance O.SignalList Application = ApplicationSignalList
type ApplicationSignalList = ('[ '("iconChanged", ApplicationIconChangedSignalInfo), '("nameChanged", ApplicationNameChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "wnck_application_get_icon" wnck_application_get_icon ::
Ptr Application ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
applicationGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m GdkPixbuf.Pixbuf.Pixbuf
applicationGetIcon app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_icon app'
checkUnexpectedReturnNULL "applicationGetIcon" result
result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetIconMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetIconMethodInfo a signature where
overloadedMethod _ = applicationGetIcon
#endif
foreign import ccall "wnck_application_get_icon_is_fallback" wnck_application_get_icon_is_fallback ::
Ptr Application ->
IO CInt
applicationGetIconIsFallback ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m Bool
applicationGetIconIsFallback app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_icon_is_fallback app'
let result' = (/= 0) result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetIconIsFallbackMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetIconIsFallbackMethodInfo a signature where
overloadedMethod _ = applicationGetIconIsFallback
#endif
foreign import ccall "wnck_application_get_icon_name" wnck_application_get_icon_name ::
Ptr Application ->
IO CString
applicationGetIconName ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m T.Text
applicationGetIconName app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_icon_name app'
checkUnexpectedReturnNULL "applicationGetIconName" result
result' <- cstringToText result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetIconNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetIconNameMethodInfo a signature where
overloadedMethod _ = applicationGetIconName
#endif
foreign import ccall "wnck_application_get_mini_icon" wnck_application_get_mini_icon ::
Ptr Application ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
applicationGetMiniIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m GdkPixbuf.Pixbuf.Pixbuf
applicationGetMiniIcon app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_mini_icon app'
checkUnexpectedReturnNULL "applicationGetMiniIcon" result
result' <- (newObject GdkPixbuf.Pixbuf.Pixbuf) result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetMiniIconMethodInfo
instance (signature ~ (m GdkPixbuf.Pixbuf.Pixbuf), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetMiniIconMethodInfo a signature where
overloadedMethod _ = applicationGetMiniIcon
#endif
foreign import ccall "wnck_application_get_n_windows" wnck_application_get_n_windows ::
Ptr Application ->
IO Int32
applicationGetNWindows ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m Int32
applicationGetNWindows app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_n_windows app'
touchManagedPtr app
return result
#if ENABLE_OVERLOADING
data ApplicationGetNWindowsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetNWindowsMethodInfo a signature where
overloadedMethod _ = applicationGetNWindows
#endif
foreign import ccall "wnck_application_get_name" wnck_application_get_name ::
Ptr Application ->
IO CString
applicationGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m T.Text
applicationGetName app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_name app'
checkUnexpectedReturnNULL "applicationGetName" result
result' <- cstringToText result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetNameMethodInfo a signature where
overloadedMethod _ = applicationGetName
#endif
foreign import ccall "wnck_application_get_pid" wnck_application_get_pid ::
Ptr Application ->
IO Int32
applicationGetPid ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m Int32
applicationGetPid app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_pid app'
touchManagedPtr app
return result
#if ENABLE_OVERLOADING
data ApplicationGetPidMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetPidMethodInfo a signature where
overloadedMethod _ = applicationGetPid
#endif
foreign import ccall "wnck_application_get_startup_id" wnck_application_get_startup_id ::
Ptr Application ->
IO CString
applicationGetStartupId ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m T.Text
applicationGetStartupId app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_startup_id app'
checkUnexpectedReturnNULL "applicationGetStartupId" result
result' <- cstringToText result
touchManagedPtr app
return result'
#if ENABLE_OVERLOADING
data ApplicationGetStartupIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetStartupIdMethodInfo a signature where
overloadedMethod _ = applicationGetStartupId
#endif
foreign import ccall "wnck_application_get_windows" wnck_application_get_windows ::
Ptr Application ->
IO (Ptr (GList (Ptr Wnck.Window.Window)))
applicationGetWindows ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m [Wnck.Window.Window]
applicationGetWindows app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_windows app'
result' <- unpackGList result
result'' <- mapM (newObject Wnck.Window.Window) result'
touchManagedPtr app
return result''
#if ENABLE_OVERLOADING
data ApplicationGetWindowsMethodInfo
instance (signature ~ (m [Wnck.Window.Window]), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetWindowsMethodInfo a signature where
overloadedMethod _ = applicationGetWindows
#endif
foreign import ccall "wnck_application_get_xid" wnck_application_get_xid ::
Ptr Application ->
IO CULong
applicationGetXid ::
(B.CallStack.HasCallStack, MonadIO m, IsApplication a) =>
a
-> m CULong
applicationGetXid app = liftIO $ do
app' <- unsafeManagedPtrCastPtr app
result <- wnck_application_get_xid app'
touchManagedPtr app
return result
#if ENABLE_OVERLOADING
data ApplicationGetXidMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsApplication a) => O.MethodInfo ApplicationGetXidMethodInfo a signature where
overloadedMethod _ = applicationGetXid
#endif
foreign import ccall "wnck_application_get" wnck_application_get ::
CULong ->
IO (Ptr Application)
applicationGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
CULong
-> m Application
applicationGet xwindow = liftIO $ do
result <- wnck_application_get xwindow
checkUnexpectedReturnNULL "applicationGet" result
result' <- (newObject Application) result
return result'
#if ENABLE_OVERLOADING
#endif