Dbusmenu.Server

g Dbusmenu.Server Dbusmenu.Server GObject.Object GObject.Object GObject.Object->Dbusmenu.Server

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (object)

get_icon_paths ()

get_status ()

get_text_direction ()

set_icon_paths (icon_paths)

set_root (root)

set_status (status)

set_text_direction (dir)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

dbus-object

str

r/w/co

The object that represents this set of menus on DBus

root-node

Dbusmenu.Menuitem

r/w

The base object of the menus that are served

version

int

r

The version of the DBusmenu API that we’re implementing.

Signals

Inherited:

GObject.Object (1)

Name

Short Description

item-activation-requested

This is signaled when a menuitem under this server sends its activate signal.

item-property-updated

item-updated

layout-updated

This signal is emitted any time the layout of the menuitems under this server is changed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Dbusmenu.Server(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Dbusmenu.ServerClass

A server which represents a sharing of a set of Dbusmenu.Menuitems across DBus to a Dbusmenu.Client.

classmethod new(object)
Parameters:

object (str) – The object name to show for this menu structure on DBus. May be None.

Return type:

Dbusmenu.Server

Creates a new Dbusmenu.Server object with a specific object path on DBus. If object is set to None the default object name of “/com/canonical/dbusmenu” will be used.

Return value: A brand new Dbusmenu.Server

get_icon_paths()
Returns:

A None-terminated list of icon paths with memory managed by the server. Duplicate if you want to keep them.

Return type:

[str]

Gets the stored and exported icon paths from the server.

get_status()
Return type:

Dbusmenu.Status

Gets the current statust hat the server is sending out over DBus.

Return value: The current status the server is sending

get_text_direction()
Return type:

Dbusmenu.TextDirection

Returns the value of the text direction that is being exported over DBus for this server. It should relate to the direction of the labels and other text fields that are being exported by this server.

Return value: Text direction exported for this server.

set_icon_paths(icon_paths)
Parameters:

icon_paths ([str]) –

Sets the icon paths for the server. This will replace previously set icon theme paths.

set_root(root)
Parameters:

root (Dbusmenu.Menuitem) – The new root Dbusmenu.Menuitem tree

This function contains all of the GObject.Value wrapping required to set the property Dbusmenu.Server :root-node on the server self.

set_status(status)
Parameters:

status (Dbusmenu.Status) – Status value to set on the server

Changes the status of the server.

set_text_direction(dir)
Parameters:

dir (Dbusmenu.TextDirection) – Direction of the text

Sets the text direction that should be exported over DBus for this server. If the value is set to Dbusmenu.TextDirection.NONE the default detection will be used for setting the value and exported over DBus.

Signal Details

Dbusmenu.Server.signals.item_activation_requested(server, arg1, arg2)
Signal Name:

item-activation-requested

Flags:

RUN_LAST

Parameters:
  • server (Dbusmenu.Server) – The object which received the signal

  • arg1 (int) – The ID of the parent for this update.

  • arg2 (int) – The timestamp of when the event happened

This is signaled when a menuitem under this server sends its activate signal.

Dbusmenu.Server.signals.item_property_updated(server, object, p0, p1)
Signal Name:

item-property-updated

Flags:

RUN_LAST

Parameters:
Dbusmenu.Server.signals.item_updated(server, object)
Signal Name:

item-updated

Flags:

RUN_LAST

Parameters:
Dbusmenu.Server.signals.layout_updated(server, arg1, arg2)
Signal Name:

layout-updated

Flags:

RUN_LAST

Parameters:
  • server (Dbusmenu.Server) – The object which received the signal

  • arg1 (int) – A revision number representing which revision the update represents itself as.

  • arg2 (int) – The ID of the parent for this update.

This signal is emitted any time the layout of the menuitems under this server is changed.

Property Details

Dbusmenu.Server.props.dbus_object
Name:

dbus-object

Type:

str

Default Value:

'/com/canonical/dbusmenu'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The object that represents this set of menus on DBus

Dbusmenu.Server.props.root_node
Name:

root-node

Type:

Dbusmenu.Menuitem

Default Value:

None

Flags:

READABLE, WRITABLE

The base object of the menus that are served

Dbusmenu.Server.props.version
Name:

version

Type:

int

Default Value:

3

Flags:

READABLE

The version of the DBusmenu API that we’re implementing.