gi-dbusmenu-0.4.14: Dbusmenu bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Dbusmenu.Objects.Client

Contents

- Exported types
- Methods
  - addTypeHandler
  - addTypeHandlerFull
  - getIconPaths
  - getRoot
  - getStatus
  - getTextDirection
  - new
- Properties
  - dbusName
  - dbusObject
  - groupEvents
- Signals
  - eventResult
  - iconThemeDirsChanged
  - itemActivate
  - layoutUpdated
  - newMenuitem
  - rootChanged

Description

The client for a `Server` creating a shared object set of `Menuitem` objects.

Synopsis

- newtype Client = Client (ManagedPtr Client)
- class (GObject o, IsDescendantOf Client o) => IsClient o
- toClient :: (MonadIO m, IsClient o) => o -> m 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, MonadIO m) => Text -> m (GValueConstruct o)
- getClientDbusName :: (MonadIO m, IsClient o) => o -> m (Maybe Text)
- constructClientDbusObject :: (IsClient o, MonadIO m) => Text -> m (GValueConstruct o)
- getClientDbusObject :: (MonadIO m, IsClient o) => o -> m (Maybe Text)
- constructClientGroupEvents :: (IsClient o, MonadIO m) => Bool -> m (GValueConstruct o)
- getClientGroupEvents :: (MonadIO m, IsClient o) => o -> m Bool
- setClientGroupEvents :: (MonadIO m, IsClient o) => o -> Bool -> m ()
- type ClientEventResultCallback = Object -> Text -> GVariant -> Word32 -> Ptr () -> IO ()
- afterClientEventResult :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientEventResultCallback) -> m SignalHandlerId
- onClientEventResult :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientEventResultCallback) -> m SignalHandlerId
- type ClientIconThemeDirsChangedCallback = Ptr () -> IO ()
- afterClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientIconThemeDirsChangedCallback) -> m SignalHandlerId
- onClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientIconThemeDirsChangedCallback) -> m SignalHandlerId
- type ClientItemActivateCallback = Object -> Word32 -> IO ()
- afterClientItemActivate :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientItemActivateCallback) -> m SignalHandlerId
- onClientItemActivate :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientItemActivateCallback) -> m SignalHandlerId
- type ClientLayoutUpdatedCallback = IO ()
- afterClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientLayoutUpdatedCallback) -> m SignalHandlerId
- onClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientLayoutUpdatedCallback) -> m SignalHandlerId
- type ClientNewMenuitemCallback = Object -> IO ()
- afterClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientNewMenuitemCallback) -> m SignalHandlerId
- onClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientNewMenuitemCallback) -> m SignalHandlerId
- type ClientRootChangedCallback = Object -> IO ()
- afterClientRootChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientRootChangedCallback) -> m SignalHandlerId
- onClientRootChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientRootChangedCallback) -> m SignalHandlerId

# Exported types

newtype Client Source #

Memory-managed wrapper type.

Constructors

Client (ManagedPtr Client) |

#### Instances

Instances details

Eq Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client Methods (==) :: Client -> Client -> Bool Source # (/=) :: Client -> Client -> Bool Source #
GObject Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client
ManagedPtrNewtype Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client Methods toManagedPtr :: Client -> ManagedPtr Client Source #
TypedObject Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client Methods glibType :: IO GType Source #
HasParentTypes Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client
IsGValue (Maybe Client) Source # | Convert `Client` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Dbusmenu.Objects.Client Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Client -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Client) Source #
type ParentTypes Client Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client type ParentTypes Client = '[Object]

class (GObject o, IsDescendantOf Client o) => IsClient o Source #

Type class for types which can be safely cast to `Client`, for instance with `toClient`.

#### Instances

Instances details

(GObject o, IsDescendantOf Client o) => IsClient o Source # |
Instance details Defined in GI.Dbusmenu.Objects.Client

toClient :: (MonadIO m, IsClient o) => o -> m Client Source #

Cast to `Client`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

addTypeHandler, addTypeHandlerFull, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getIconPaths, getProperty, getQdata, getRoot, getStatus, getTextDirection.

#### Setters

setData, setDataFull, setProperty.

## addTypeHandler

clientAddTypeHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: Client where we're getting types coming in
-> Text | `type`: A text string that will be matched with the 'type' property on incoming menu items
-> ClientTypeHandler | `newfunc`: The function that will be executed with those new items when they come in.
-> 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 DbusmenuClientnewMenuitem 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 #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: Client where we're getting types coming in
-> Text | `type`: A text string that will be matched with the 'type' property on incoming menu items
-> ClientTypeHandler | `newfunc`: The function that will be executed with those new items when they come in.
-> 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 DbusmenuClientnewMenuitem 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

clientGetIconPaths Source #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: The `Client` to get the icon paths from
-> 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

clientGetRoot Source #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: The `Client` to get the root node from
-> m Menuitem | Returns: A `Menuitem` representing the root of menu on the server. If there is no server or there is an error receiving its layout it'll return `NULL`.

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

clientGetStatus Source #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: `Client` to check the status on
-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsClient a) |
=> a | `client`: `Client` to check the text direction on
-> 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

clientNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `name`: The DBus name for the server to connect to
-> Text | `object`: The object on the server to monitor
-> m Client | Returns: A brand new `Client`

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, MonadIO m) => Text -> m (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, MonadIO m) => Text -> m (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, MonadIO m) => Bool -> m (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 ClientEventResultCallback = Object -> Text -> GVariant -> Word32 -> Ptr () -> IO () Source #

No description available in the introspection data.

afterClientEventResult :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientEventResultCallback) -> m SignalHandlerId Source #

Connect a signal handler for the eventResult signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #eventResult callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientEventResult :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientEventResultCallback) -> m SignalHandlerId Source #

Connect a signal handler for the eventResult signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #eventResult callback

## iconThemeDirsChanged

type ClientIconThemeDirsChangedCallback Source #

Arguments

= Ptr () | `arg1`: A `GStrv` of theme directories
-> IO () |

Signaled when the theme directories are changed by the server.

afterClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientIconThemeDirsChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the iconThemeDirsChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #iconThemeDirsChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientIconThemeDirsChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the iconThemeDirsChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #iconThemeDirsChanged callback

## itemActivate

type ClientItemActivateCallback Source #

Arguments

= Object | `arg1`: The `Menuitem` activated
-> Word32 | `arg2`: A timestamp that the event happened at
-> IO () |

Signaled when the server wants to activate an item in order to display the menu.

afterClientItemActivate :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientItemActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the itemActivate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #itemActivate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientItemActivate :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientItemActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the itemActivate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #itemActivate callback

## layoutUpdated

type ClientLayoutUpdatedCallback = IO () Source #

No description available in the introspection data.

afterClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientLayoutUpdatedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the layoutUpdated signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #layoutUpdated callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientLayoutUpdated :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientLayoutUpdatedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the layoutUpdated signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #layoutUpdated callback

## newMenuitem

type ClientNewMenuitemCallback Source #

Arguments

= Object | `arg1`: The new `Menuitem` created
-> IO () |

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::childAdded when it gets parented.

afterClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientNewMenuitemCallback) -> m SignalHandlerId Source #

Connect a signal handler for the newMenuitem signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #newMenuitem callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientNewMenuitem :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientNewMenuitemCallback) -> m SignalHandlerId Source #

Connect a signal handler for the newMenuitem signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #newMenuitem callback

## rootChanged

type ClientRootChangedCallback Source #

Arguments

= Object | `arg1`: The new root `Menuitem`
-> IO () |

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 -> ((?self :: a) => ClientRootChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the rootChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after client #rootChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onClientRootChanged :: (IsClient a, MonadIO m) => a -> ((?self :: a) => ClientRootChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the rootChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on client #rootChanged callback