gi-dbusmenu-0.4.8: Dbusmenu bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Dbusmenu.Objects.Client

Description

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

Synopsis

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

(/=) :: Client -> Client -> Bool

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

TypedObject Client Source # 
Instance details

Defined in GI.Dbusmenu.Objects.Client

Methods

glibType :: IO GType

IsGValue Client Source #

Convert Client to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Dbusmenu.Objects.Client

Methods

toGValue :: Client -> IO GValue

fromGValue :: GValue -> IO Client

HasParentTypes Client Source # 
Instance details

Defined in GI.Dbusmenu.Objects.Client

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

Overloaded methods

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 DbusmenuClient[newMenuitem](#g:signal:newMenuitem) 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 DbusmenuClient[newMenuitem](#g:signal:newMenuitem) 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 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 eventResult signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after client #eventResult callback

genClosure_ClientEventResult :: MonadIO m => ClientEventResultCallback -> m (GClosure C_ClientEventResultCallback) Source #

Wrap the callback into a GClosure.

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 eventResult signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on client #eventResult callback

iconThemeDirsChanged

type C_ClientIconThemeDirsChangedCallback = Ptr () -> Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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 -> 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

onClientIconThemeDirsChanged :: (IsClient a, MonadIO m) => 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 C_ClientItemActivateCallback = Ptr () -> Ptr Object -> Word32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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 -> 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

mk_ClientItemActivateCallback :: C_ClientItemActivateCallback -> IO (FunPtr C_ClientItemActivateCallback) Source #

Generate a function pointer callable from C code, from a C_ClientItemActivateCallback.

onClientItemActivate :: (IsClient a, MonadIO m) => 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 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 layoutUpdated signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after client #layoutUpdated callback

onClientLayoutUpdated :: (IsClient a, MonadIO m) => 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 C_ClientNewMenuitemCallback = Ptr () -> Ptr Object -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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

afterClientNewMenuitem :: (IsClient a, MonadIO m) => 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

genClosure_ClientNewMenuitem :: MonadIO m => ClientNewMenuitemCallback -> m (GClosure C_ClientNewMenuitemCallback) Source #

Wrap the callback into a GClosure.

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 newMenuitem signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on client #newMenuitem callback

rootChanged

type C_ClientRootChangedCallback = Ptr () -> Ptr Object -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

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 -> 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

genClosure_ClientRootChanged :: MonadIO m => ClientRootChangedCallback -> m (GClosure C_ClientRootChangedCallback) Source #

Wrap the callback into a GClosure.

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 rootChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on client #rootChanged callback