Trait ClientExt

Source
pub trait ClientExt: 'static {
    // Required methods
    fn add_type_handler_full<P: Fn(&Menuitem, &Menuitem, &Client) -> bool + 'static>(
        &self,
        type_: &str,
        newfunc: P,
    ) -> bool;
    fn icon_paths(&self) -> Vec<GString>;
    fn root(&self) -> Option<Menuitem>;
    fn status(&self) -> Status;
    fn text_direction(&self) -> TextDirection;
    fn dbus_name(&self) -> Option<GString>;
    fn dbus_object(&self) -> Option<GString>;
    fn is_group_events(&self) -> bool;
    fn set_group_events(&self, group_events: bool);
    fn connect_layout_updated<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_group_events_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Client methods.

§Implementors

Client

Required Methods§

Source

fn add_type_handler_full<P: Fn(&Menuitem, &Menuitem, &Client) -> bool + 'static>( &self, type_: &str, newfunc: P, ) -> bool

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

§type_

A text string that will be matched with the ‘type’ property on incoming menu items

§newfunc

The function that will be executed with those new items when they come in.

§Returns

If registering the new type was successful.

Source

fn icon_paths(&self) -> Vec<GString>

Gets the stored and exported icon paths from the client.

§Returns

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

Source

fn root(&self) -> Option<Menuitem>

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.

§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 None.

Source

fn status(&self) -> Status

Gets the recommended current status that the server is exporting for the menus. In situtations where the value is Status::Notice it is recommended that the client show the menus to the user an a more noticible way.

Return value: Status being exported.

Source

fn text_direction(&self) -> TextDirection

Gets the text direction that the server is exporting. If the server is not exporting a direction then the value TextDirection::None will be returned.

Return value: Text direction being exported.

Source

fn dbus_name(&self) -> Option<GString>

Source

fn dbus_object(&self) -> Option<GString>

Source

fn is_group_events(&self) -> bool

Source

fn set_group_events(&self, group_events: bool)

Source

fn connect_layout_updated<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_group_events_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<O: IsA<Client>> ClientExt for O