Method

GioDBusConnectionexport_menu_model

since: 2.32

Declaration [src]

guint
g_dbus_connection_export_menu_model (
  GDBusConnection* connection,
  const gchar* object_path,
  GMenuModel* menu,
  GError** error
)

Description [src]

Exports menu on connection at object_path.

The implemented D-Bus API should be considered private. It is subject to change in the future.

An object path can only have one menu model exported on it. If this constraint is violated, the export will fail and 0 will be returned (with error set accordingly).

Exporting menus with sections containing more than G_MENU_EXPORTER_MAX_SECTION_SIZE items is not supported and results in undefined behavior.

You can unexport the menu model using g_dbus_connection_unexport_menu_model() with the return value of this function.

Available since: 2.32

Parameters

object_path

Type: const gchar*

A D-Bus object path.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
menu

Type: GMenuModel

A GMenuModel.

The data is owned by the caller of the method.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: guint

The ID of the export (never zero), or 0 in case of failure.