Dbusmenu.Client¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Name of the DBus client we’re connecting to. |
||
r/w/co |
The Object on the client that we’re getting our data from. |
||
r/w |
Event grouping lowers the number of messages on DBus and will be set automatically based on the version to optimize traffic. It can be disabled for testing or other purposes. |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Signaled when the theme directories are changed by the server. |
|
Signaled when the server wants to activate an item in order to display the menu. |
|
Signaled when the client creates a new menuitem. |
|
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. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Dbusmenu.Client(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The client for a
Dbusmenu.Server
creating a shared object set ofDbusmenu.Menuitem
objects.- classmethod new(name, object)¶
- Parameters:
- Returns:
A brand new
Dbusmenu.Client
- Return type:
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.
- add_type_handler(type, newfunc)¶
- Parameters:
type (
str
) – A text string that will be matched with the ‘type’ property on incoming menu itemsnewfunc (
Dbusmenu.ClientTypeHandler
) – The function that will be executed with those new items when they come in.
- Returns:
If registering the new type was successful.
- Return type:
This function connects into the type handling of the
Dbusmenu.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 thatDbusmenu.Menuitem
. If not, then theDbusmenu.Client
::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.
- add_type_handler_full(type, newfunc, *user_data)¶
- Parameters:
type (
str
) – A text string that will be matched with the ‘type’ property on incoming menu itemsnewfunc (
Dbusmenu.ClientTypeHandler
) – The function that will be executed with those new items when they come in.user_data (
object
orNone
) – Data passed to newfunc when it is called
- Returns:
If registering the new type was successful.
- Return type:
This function connects into the type handling of the
Dbusmenu.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 thatDbusmenu.Menuitem
. If not, then theDbusmenu.Client
::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.
- get_icon_paths()¶
- Returns:
A
None
-terminated list of icon paths with memory managed by the client. Duplicate if you want to keep them.- Return type:
[
str
]
Gets the stored and exported icon paths from the client.
- get_root()¶
- Returns:
A
Dbusmenu.Menuitem
representing the root of menu on the server. If there is no server or there is an error receiving its layout it’ll returnNone
.- Return type:
Grabs the root node for the specified client self. 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.
- get_status()¶
- Return type:
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.
- get_text_direction()¶
- Return type:
Gets the text direction that the server is exporting. If the server is not exporting a direction then the value
Dbusmenu.TextDirection.NONE
will be returned.Return value: Text direction being exported.
Signal Details¶
- Dbusmenu.Client.signals.event_result(client, object, p0, p1, p2, p3)¶
- Signal Name:
event-result
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signalobject (
GObject.Object
) –p0 (
str
) –p1 (
GLib.Variant
) –p2 (
int
) –
- Dbusmenu.Client.signals.icon_theme_dirs_changed(client, arg1)¶
- Signal Name:
icon-theme-dirs-changed
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signal
Signaled when the theme directories are changed by the server.
- Dbusmenu.Client.signals.item_activate(client, arg1, arg2)¶
- Signal Name:
item-activate
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signalarg1 (
GObject.Object
) – TheDbusmenu.Menuitem
activatedarg2 (
int
) – A timestamp that the event happened at
Signaled when the server wants to activate an item in order to display the menu.
- Dbusmenu.Client.signals.layout_updated(client)¶
- Signal Name:
layout-updated
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signal
- Dbusmenu.Client.signals.new_menuitem(client, arg1)¶
- Signal Name:
new-menuitem
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signalarg1 (
GObject.Object
) – The newDbusmenu.Menuitem
created
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
Dbusmenu.Menuitem
::child-added
when it gets parented.
- Dbusmenu.Client.signals.root_changed(client, arg1)¶
- Signal Name:
root-changed
- Flags:
- Parameters:
client (
Dbusmenu.Client
) – The object which received the signalarg1 (
GObject.Object
) – The new rootDbusmenu.Menuitem
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.
Property Details¶
- Dbusmenu.Client.props.dbus_name¶
- Name:
dbus-name
- Type:
- Default Value:
- Flags:
Name of the DBus client we’re connecting to.
- Dbusmenu.Client.props.dbus_object¶
- Name:
dbus-object
- Type:
- Default Value:
- Flags:
The Object on the client that we’re getting our data from.