DBusMenuModel

GDBusMenuModel is an implementation of GMenuModel that can be used as a proxy for a menu model that is exported over D-Bus with g_dbus_connection_export_menu_model().

Constructors

this
this(GDBusMenuModel* gDBusMenuModel)

Sets our main struct and passes it to the parent class

this
this(DBusConnection connection, string busName, string objectPath)

Members

Functions

getDBusMenuModelStruct
GDBusMenuModel* getDBusMenuModelStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

gDbusMenuModelGet
DBusMenuModel gDbusMenuModelGet(DBusConnection connection, string busName, string objectPath)

Obtains a GDBusMenuModel for the menu model which is exported at the given bus_name and object_path. The thread default main context is taken at the time of this call. All signals on the menu model (and any linked models) are reported with respect to this context. All calls on the returned menu model (and linked models) must also originate from this same context, with the thread default main context unchanged. Since 2.32

Variables

gDBusMenuModel
GDBusMenuModel* gDBusMenuModel;

the main Gtk struct

Inherited Members

From MenuModel

gMenuModel
GMenuModel* gMenuModel;

the main Gtk struct

getMenuModelStruct
GMenuModel* getMenuModelStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
connectedSignals
int[string] connectedSignals;
onItemsChangedListeners
void delegate(gint, gint, gint, MenuModel)[] onItemsChangedListeners;
Undocumented in source.
addOnItemsChanged
void addOnItemsChanged(void delegate(gint, gint, gint, MenuModel) dlg, ConnectFlags connectFlags)

Emitted when a change has occured to the menu. The only changes that can occur to a menu is that items are removed or added. Items may not change (except by being removed and added back in the same location). This signal is capable of describing both of those changes (at the same time). The signal means that starting at the index position, removed items were removed and added items were added in their place. If removed is zero then only items were added. If added is zero then only items were removed. As an example, if the menu contains items a, b, c, d (in that order) and the signal (2, 1, 3) occurs then the new composition of the menu will be a, b, _, _, _, d (with each _ representing some new item). Signal handlers may query the model (particularly the added items) and expect to see the results of the modification that is being reported. The signal is emitted after the modification. See Also GActionGroup

callBackItemsChanged
void callBackItemsChanged(GMenuModel* modelStruct, gint position, gint removed, gint added, MenuModel _menuModel)
Undocumented in source. Be warned that the author may not have intended to support it.
isMutable
int isMutable()

Queries if model is mutable. An immutable GMenuModel will never emit the "items-changed" signal. Consumers of the model may make optimisations accordingly. Since 2.32

getNItems
int getNItems()

Query the number of items in model. Since 2.32

getItemAttributeValue
Variant getItemAttributeValue(int itemIndex, string attribute, VariantType expectedType)

Queries the item at position item_index in model for the attribute specified by attribute. If expected_type is non-NULL then it specifies the expected type of the attribute. If it is NULL then any type will be accepted. If the attribute exists and matches expected_type (or if the expected type is unspecified) then the value is returned. If the attribute does not exist, or does not match the expected type then NULL is returned. Since 2.32

getItemLink
MenuModel getItemLink(int itemIndex, string link)

Queries the item at position item_index in model for the link specified by link. If the link exists, the linked GMenuModel is returned. If the link does not exist, NULL is returned. Since 2.32

iterateItemAttributes
MenuAttributeIter iterateItemAttributes(int itemIndex)

Creates a GMenuAttributeIter to iterate over the attributes of the item at position item_index in model. You must free the iterator with g_object_unref() when you are done. Since 2.32

iterateItemLinks
MenuLinkIter iterateItemLinks(int itemIndex)

Creates a GMenuLinkIter to iterate over the links of the item at position item_index in model. You must free the iterator with g_object_unref() when you are done. Since 2.32

itemsChanged
void itemsChanged(int position, int removed, int added)

Requests emission of the "items-changed" signal on model. This function should never be called except by GMenuModel subclasses. Any other calls to this function will very likely lead to a violation of the interface of the model. The implementation should update its internal representation of the menu before emitting the signal. The implementation should further expect to receive queries about the new state of the menu (and particularly added menu items) while signal handlers are running. The implementation must dispatch this call directly from a mainloop entry and not in response to calls -- particularly those from the GMenuModel API. Said another way: the menu must not change while user code is running without returning to the mainloop. Since 2.32

Meta