Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newtype Client = Client (ManagedPtr Client)
- class GObject o => IsClient o
- toClient :: (MonadIO m, IsClient o) => o -> m Client
- noClient :: Maybe Client
- clientAddTypeHandler :: (HasCallStack, MonadIO m, IsClient a) => a -> Text -> ClientTypeHandler -> m Bool
- clientAddTypeHandlerFull :: (HasCallStack, MonadIO m, IsClient a) => a -> Text -> ClientTypeHandler -> m Bool
- clientGetIconPaths :: (HasCallStack, MonadIO m, IsClient a) => a -> m [Text]
- clientGetRoot :: (HasCallStack, MonadIO m, IsClient a) => a -> m Menuitem
- clientGetStatus :: (HasCallStack, MonadIO m, IsClient a) => a -> m Status
- clientGetTextDirection :: (HasCallStack, MonadIO m, IsClient a) => a -> m TextDirection
- clientNew :: (HasCallStack, MonadIO m) => Text -> Text -> m Client
- constructClientDbusName :: IsClient o => Text -> IO (GValueConstruct o)
- getClientDbusName :: (MonadIO m, IsClient o) => o -> m (Maybe Text)
- constructClientDbusObject :: IsClient o => Text -> IO (GValueConstruct o)
- getClientDbusObject :: (MonadIO m, IsClient o) => o -> m (Maybe Text)
- constructClientGroupEvents :: IsClient o => Bool -> IO (GValueConstruct o)
- getClientGroupEvents :: (MonadIO m, IsClient o) => o -> m Bool
- setClientGroupEvents :: (MonadIO m, IsClient o) => o -> Bool -> m ()
- type C_ClientEventResultCallback = Ptr () -> Ptr Object -> CString -> Ptr GVariant -> Word32 -> Ptr () -> Ptr () -> IO ()
- type ClientEventResultCallback = Object -> Text -> GVariant -> Word32 -> Ptr () -> IO ()
- afterClientEventResult :: (IsClient a, MonadIO m) => a -> ClientEventResultCallback -> m SignalHandlerId
- genClosure_ClientEventResult :: ClientEventResultCallback -> IO Closure
- mk_ClientEventResultCallback :: C_ClientEventResultCallback -> IO (FunPtr C_ClientEventResultCallback)
- noClientEventResultCallback :: Maybe ClientEventResultCallback
- onClientEventResult :: (IsClient a, MonadIO m) => a -> ClientEventResultCallback -> m SignalHandlerId
- wrap_ClientEventResultCallback :: ClientEventResultCallback -> C_ClientEventResultCallback
- type C_ClientIconThemeDirsChangedCallback = Ptr () -> Ptr () -> Ptr () -> IO ()
- type ClientIconThemeDirsChangedCallback = Ptr () -> IO ()
- afterClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ClientIconThemeDirsChangedCallback -> m SignalHandlerId
- genClosure_ClientIconThemeDirsChanged :: ClientIconThemeDirsChangedCallback -> IO Closure
- mk_ClientIconThemeDirsChangedCallback :: C_ClientIconThemeDirsChangedCallback -> IO (FunPtr C_ClientIconThemeDirsChangedCallback)
- noClientIconThemeDirsChangedCallback :: Maybe ClientIconThemeDirsChangedCallback
- onClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ClientIconThemeDirsChangedCallback -> m SignalHandlerId
- wrap_ClientIconThemeDirsChangedCallback :: ClientIconThemeDirsChangedCallback -> C_ClientIconThemeDirsChangedCallback
- type C_ClientItemActivateCallback = Ptr () -> Ptr Object -> Word32 -> Ptr () -> IO ()
- type ClientItemActivateCallback = Object -> Word32 -> IO ()
- afterClientItemActivate :: (IsClient a, MonadIO m) => a -> ClientItemActivateCallback -> m SignalHandlerId
- genClosure_ClientItemActivate :: ClientItemActivateCallback -> IO Closure
- mk_ClientItemActivateCallback :: C_ClientItemActivateCallback -> IO (FunPtr C_ClientItemActivateCallback)
- noClientItemActivateCallback :: Maybe ClientItemActivateCallback
- onClientItemActivate :: (IsClient a, MonadIO m) => a -> ClientItemActivateCallback -> m SignalHandlerId
- wrap_ClientItemActivateCallback :: ClientItemActivateCallback -> C_ClientItemActivateCallback
- type C_ClientLayoutUpdatedCallback = Ptr () -> Ptr () -> IO ()
- type ClientLayoutUpdatedCallback = IO ()
- afterClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ClientLayoutUpdatedCallback -> m SignalHandlerId
- genClosure_ClientLayoutUpdated :: ClientLayoutUpdatedCallback -> IO Closure
- mk_ClientLayoutUpdatedCallback :: C_ClientLayoutUpdatedCallback -> IO (FunPtr C_ClientLayoutUpdatedCallback)
- noClientLayoutUpdatedCallback :: Maybe ClientLayoutUpdatedCallback
- onClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ClientLayoutUpdatedCallback -> m SignalHandlerId
- wrap_ClientLayoutUpdatedCallback :: ClientLayoutUpdatedCallback -> C_ClientLayoutUpdatedCallback
- type C_ClientNewMenuitemCallback = Ptr () -> Ptr Object -> Ptr () -> IO ()
- type ClientNewMenuitemCallback = Object -> IO ()
- afterClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ClientNewMenuitemCallback -> m SignalHandlerId
- genClosure_ClientNewMenuitem :: ClientNewMenuitemCallback -> IO Closure
- mk_ClientNewMenuitemCallback :: C_ClientNewMenuitemCallback -> IO (FunPtr C_ClientNewMenuitemCallback)
- noClientNewMenuitemCallback :: Maybe ClientNewMenuitemCallback
- onClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ClientNewMenuitemCallback -> m SignalHandlerId
- wrap_ClientNewMenuitemCallback :: ClientNewMenuitemCallback -> C_ClientNewMenuitemCallback
- type C_ClientRootChangedCallback = Ptr () -> Ptr Object -> Ptr () -> IO ()
- type ClientRootChangedCallback = Object -> IO ()
- afterClientRootChanged :: (IsClient a, MonadIO m) => a -> ClientRootChangedCallback -> m SignalHandlerId
- genClosure_ClientRootChanged :: ClientRootChangedCallback -> IO Closure
- mk_ClientRootChangedCallback :: C_ClientRootChangedCallback -> IO (FunPtr C_ClientRootChangedCallback)
- noClientRootChangedCallback :: Maybe ClientRootChangedCallback
- onClientRootChanged :: (IsClient a, MonadIO m) => a -> ClientRootChangedCallback -> m SignalHandlerId
- wrap_ClientRootChangedCallback :: ClientRootChangedCallback -> C_ClientRootChangedCallback
Exported types
Memory-managed wrapper type.
Instances
GObject Client Source # | |
Defined in GI.Dbusmenu.Objects.Client gobjectType :: Client -> IO GType # | |
IsObject Client Source # | |
Defined in GI.Dbusmenu.Objects.Client | |
IsClient Client Source # | |
Defined in GI.Dbusmenu.Objects.Client |
class GObject o => IsClient o Source #
Instances
(GObject a, (UnknownAncestorError Client a :: Constraint)) => IsClient a Source # | |
Defined in GI.Dbusmenu.Objects.Client | |
IsClient Client Source # | |
Defined in GI.Dbusmenu.Objects.Client |
Methods
addTypeHandler
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> Text |
|
-> ClientTypeHandler |
|
-> m Bool | Returns: If registering the new type was successful. |
This function connects into the type handling of the Client
.
Every new menuitem that comes in immediately gets asked for its
properties. When we get those properties we check the 'type'
property and look to see if it matches a handler that is known
by the client. If so, the newfunc
function is executed on that
Menuitem
. If not, then the DbusmenuClient::new-menuitem
signal is sent.
In the future the known types will be sent to the server so that it can make choices about the menu item types availble.
addTypeHandlerFull
clientAddTypeHandlerFull Source #
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> Text |
|
-> ClientTypeHandler |
|
-> m Bool | Returns: If registering the new type was successful. |
This function connects into the type handling of the Client
.
Every new menuitem that comes in immediately gets asked for its
properties. When we get those properties we check the 'type'
property and look to see if it matches a handler that is known
by the client. If so, the newfunc
function is executed on that
Menuitem
. If not, then the DbusmenuClient::new-menuitem
signal is sent.
In the future the known types will be sent to the server so that it can make choices about the menu item types availble.
getIconPaths
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> m [Text] | Returns: A NULL-terminated list of icon paths with memory managed by the client. Duplicate if you want to keep them. |
Gets the stored and exported icon paths from the client.
getRoot
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> m Menuitem | Returns: A |
Grabs the root node for the specified client client
. This
function may block. It will block if there is currently a
call to update the layout, it will block on that layout
updated and then return the newly updated layout. Chances
are that this update is in the queue for the mainloop as
it would have been requested some time ago, but in theory
it could block longer.
getStatus
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> m Status |
Gets the recommended current status that the server
is exporting for the menus. In situtations where the
value is DBUSMENU_STATUS_NOTICE
it is recommended that
the client show the menus to the user an a more noticible
way.
Return value: Status being exported.
getTextDirection
clientGetTextDirection Source #
:: (HasCallStack, MonadIO m, IsClient a) | |
=> a |
|
-> m TextDirection |
Gets the text direction that the server is exporting. If
the server is not exporting a direction then the value
DBUSMENU_TEXT_DIRECTION_NONE
will be returned.
Return value: Text direction being exported.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> m Client | Returns: A brand new |
This function creates a new client that connects to a specific server on DBus. That server is at a specific location sharing a known object. The interface is assumed by the code to be the DBus menu interface. The newly created client will start sending out events as it syncs up with the server.
Properties
dbusName
No description available in the introspection data.
constructClientDbusName :: IsClient o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “dbus-name
” property. This is rarely needed directly, but it is used by new
.
getClientDbusName :: (MonadIO m, IsClient o) => o -> m (Maybe Text) Source #
Get the value of the “dbus-name
” property.
When overloading is enabled, this is equivalent to
get
client #dbusName
dbusObject
No description available in the introspection data.
constructClientDbusObject :: IsClient o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “dbus-object
” property. This is rarely needed directly, but it is used by new
.
getClientDbusObject :: (MonadIO m, IsClient o) => o -> m (Maybe Text) Source #
Get the value of the “dbus-object
” property.
When overloading is enabled, this is equivalent to
get
client #dbusObject
groupEvents
No description available in the introspection data.
constructClientGroupEvents :: IsClient o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “group-events
” property. This is rarely needed directly, but it is used by new
.
getClientGroupEvents :: (MonadIO m, IsClient o) => o -> m Bool Source #
Get the value of the “group-events
” property.
When overloading is enabled, this is equivalent to
get
client #groupEvents
setClientGroupEvents :: (MonadIO m, IsClient o) => o -> Bool -> m () Source #
Set the value of the “group-events
” property.
When overloading is enabled, this is equivalent to
set
client [ #groupEvents:=
value ]
Signals
eventResult
type C_ClientEventResultCallback = Ptr () -> Ptr Object -> CString -> Ptr GVariant -> Word32 -> Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientEventResultCallback = Object -> Text -> GVariant -> Word32 -> Ptr () -> IO () Source #
No description available in the introspection data.
afterClientEventResult :: (IsClient a, MonadIO m) => a -> ClientEventResultCallback -> m SignalHandlerId Source #
Connect a signal handler for the “event-result
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #eventResult callback
genClosure_ClientEventResult :: ClientEventResultCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientEventResultCallback :: C_ClientEventResultCallback -> IO (FunPtr C_ClientEventResultCallback) Source #
Generate a function pointer callable from C code, from a C_ClientEventResultCallback
.
noClientEventResultCallback :: Maybe ClientEventResultCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientEventResultCallback
onClientEventResult :: (IsClient a, MonadIO m) => a -> ClientEventResultCallback -> m SignalHandlerId Source #
Connect a signal handler for the “event-result
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #eventResult callback
wrap_ClientEventResultCallback :: ClientEventResultCallback -> C_ClientEventResultCallback Source #
Wrap a ClientEventResultCallback
into a C_ClientEventResultCallback
.
iconThemeDirsChanged
type C_ClientIconThemeDirsChangedCallback = Ptr () -> Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientIconThemeDirsChangedCallback Source #
Signaled when the theme directories are changed by the server.
afterClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ClientIconThemeDirsChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “icon-theme-dirs-changed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #iconThemeDirsChanged callback
genClosure_ClientIconThemeDirsChanged :: ClientIconThemeDirsChangedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientIconThemeDirsChangedCallback :: C_ClientIconThemeDirsChangedCallback -> IO (FunPtr C_ClientIconThemeDirsChangedCallback) Source #
Generate a function pointer callable from C code, from a C_ClientIconThemeDirsChangedCallback
.
noClientIconThemeDirsChangedCallback :: Maybe ClientIconThemeDirsChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientIconThemeDirsChangedCallback
onClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ClientIconThemeDirsChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “icon-theme-dirs-changed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #iconThemeDirsChanged callback
wrap_ClientIconThemeDirsChangedCallback :: ClientIconThemeDirsChangedCallback -> C_ClientIconThemeDirsChangedCallback Source #
itemActivate
type C_ClientItemActivateCallback = Ptr () -> Ptr Object -> Word32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientItemActivateCallback Source #
Signaled when the server wants to activate an item in order to display the menu.
afterClientItemActivate :: (IsClient a, MonadIO m) => a -> ClientItemActivateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “item-activate
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #itemActivate callback
genClosure_ClientItemActivate :: ClientItemActivateCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientItemActivateCallback :: C_ClientItemActivateCallback -> IO (FunPtr C_ClientItemActivateCallback) Source #
Generate a function pointer callable from C code, from a C_ClientItemActivateCallback
.
noClientItemActivateCallback :: Maybe ClientItemActivateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientItemActivateCallback
onClientItemActivate :: (IsClient a, MonadIO m) => a -> ClientItemActivateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “item-activate
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #itemActivate callback
wrap_ClientItemActivateCallback :: ClientItemActivateCallback -> C_ClientItemActivateCallback Source #
Wrap a ClientItemActivateCallback
into a C_ClientItemActivateCallback
.
layoutUpdated
type C_ClientLayoutUpdatedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientLayoutUpdatedCallback = IO () Source #
No description available in the introspection data.
afterClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ClientLayoutUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “layout-updated
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #layoutUpdated callback
genClosure_ClientLayoutUpdated :: ClientLayoutUpdatedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientLayoutUpdatedCallback :: C_ClientLayoutUpdatedCallback -> IO (FunPtr C_ClientLayoutUpdatedCallback) Source #
Generate a function pointer callable from C code, from a C_ClientLayoutUpdatedCallback
.
noClientLayoutUpdatedCallback :: Maybe ClientLayoutUpdatedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientLayoutUpdatedCallback
onClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ClientLayoutUpdatedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “layout-updated
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #layoutUpdated callback
wrap_ClientLayoutUpdatedCallback :: ClientLayoutUpdatedCallback -> C_ClientLayoutUpdatedCallback Source #
Wrap a ClientLayoutUpdatedCallback
into a C_ClientLayoutUpdatedCallback
.
newMenuitem
type C_ClientNewMenuitemCallback = Ptr () -> Ptr Object -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientNewMenuitemCallback Source #
Signaled when the client creates a new menuitem. This
doesn't mean that it's placed anywhere. The parent that
it's applied to will signal Menuitem
::child-added
when it gets parented.
afterClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ClientNewMenuitemCallback -> m SignalHandlerId Source #
Connect a signal handler for the “new-menuitem
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #newMenuitem callback
genClosure_ClientNewMenuitem :: ClientNewMenuitemCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientNewMenuitemCallback :: C_ClientNewMenuitemCallback -> IO (FunPtr C_ClientNewMenuitemCallback) Source #
Generate a function pointer callable from C code, from a C_ClientNewMenuitemCallback
.
noClientNewMenuitemCallback :: Maybe ClientNewMenuitemCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientNewMenuitemCallback
onClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ClientNewMenuitemCallback -> m SignalHandlerId Source #
Connect a signal handler for the “new-menuitem
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #newMenuitem callback
wrap_ClientNewMenuitemCallback :: ClientNewMenuitemCallback -> C_ClientNewMenuitemCallback Source #
Wrap a ClientNewMenuitemCallback
into a C_ClientNewMenuitemCallback
.
rootChanged
type C_ClientRootChangedCallback = Ptr () -> Ptr Object -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClientRootChangedCallback Source #
The layout has changed in a way that can not be represented by the individual items changing as the root of this client has changed.
afterClientRootChanged :: (IsClient a, MonadIO m) => a -> ClientRootChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “root-changed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
client #rootChanged callback
genClosure_ClientRootChanged :: ClientRootChangedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ClientRootChangedCallback :: C_ClientRootChangedCallback -> IO (FunPtr C_ClientRootChangedCallback) Source #
Generate a function pointer callable from C code, from a C_ClientRootChangedCallback
.
noClientRootChangedCallback :: Maybe ClientRootChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClientRootChangedCallback
onClientRootChanged :: (IsClient a, MonadIO m) => a -> ClientRootChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “root-changed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
client #rootChanged callback