Trait clutter::ClickActionExt[][src]

pub trait ClickActionExt: 'static {
Show methods fn get_button(&self) -> u32;
fn get_coords(&self) -> (f32, f32);
fn get_state(&self) -> ModifierType;
fn release(&self);
fn get_property_held(&self) -> bool;
fn get_property_long_press_duration(&self) -> i32;
fn set_property_long_press_duration(&self, long_press_duration: i32);
fn get_property_long_press_threshold(&self) -> i32;
fn set_property_long_press_threshold(&self, long_press_threshold: i32);
fn get_property_pressed(&self) -> bool;
fn connect_clicked<F: Fn(&Self, &Actor) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_long_press<F: Fn(&Self, &Actor, LongPressState) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_held_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_long_press_duration_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_long_press_threshold_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_pressed_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}

Trait containing all ClickAction methods.

Implementors

ClickAction

Required methods

fn get_button(&self) -> u32[src]

Retrieves the button that was pressed.

  • 1 - left mouse button in a right-handed configuration, or the right mouse button in a left-handed configuration
  • 2 - scroll wheel button
  • 3 - right mouse button in a right-handed configuration, or the left mouse button in a left-handed configuration

Returns

the button value

fn get_coords(&self) -> (f32, f32)[src]

Retrieves the screen coordinates of the button press.

press_x

return location for the X coordinate, or None

press_y

return location for the Y coordinate, or None

fn get_state(&self) -> ModifierType[src]

Retrieves the modifier state of the click action.

Returns

the modifier state parameter, or 0

fn release(&self)[src]

Emulates a release of the pointer button, which ungrabs the pointer and unsets the ClickAction:pressed state.

This function will also cancel the long press gesture if one was initiated.

This function is useful to break a grab, for instance after a certain amount of time has passed.

fn get_property_held(&self) -> bool[src]

Whether the clickable actor has the pointer grabbed

fn get_property_long_press_duration(&self) -> i32[src]

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the ClickAction use the value of the Settings:long-press-duration property.

fn set_property_long_press_duration(&self, long_press_duration: i32)[src]

The minimum duration of a press for it to be recognized as a long press gesture, in milliseconds.

A value of -1 will make the ClickAction use the value of the Settings:long-press-duration property.

fn get_property_long_press_threshold(&self) -> i32[src]

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the ClickAction use the value of the Settings:dnd-drag-threshold property.

fn set_property_long_press_threshold(&self, long_press_threshold: i32)[src]

The maximum allowed distance that can be covered (on both axes) before a long press gesture is cancelled, in pixels.

A value of -1 will make the ClickAction use the value of the Settings:dnd-drag-threshold property.

fn get_property_pressed(&self) -> bool[src]

Whether the clickable actor should be in “pressed” state

fn connect_clicked<F: Fn(&Self, &Actor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::clicked signal is emitted when the Actor to which a ClickAction has been applied should respond to a pointer button press and release events

actor

the Actor attached to the action

fn connect_long_press<F: Fn(&Self, &Actor, LongPressState) -> bool + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::long-press signal is emitted during the long press gesture handling.

This signal can be emitted multiple times with different states.

The LongPressState::Query state will be emitted on button presses, and its return value will determine whether the long press handling should be initiated. If the signal handlers will return true, the LongPressState::Query state will be followed either by a signal emission with the LongPressState::Activate state if the long press constraints were respected, or by a signal emission with the LongPressState::Cancel state if the long press was cancelled.

It is possible to forcibly cancel a long press detection using ClickActionExt::release.

actor

the Actor attached to the action

state

the long press state

Returns

Only the LongPressState::Query state uses the returned value of the handler; other states will ignore it

fn connect_property_held_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_long_press_duration_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_long_press_threshold_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_property_pressed_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...

Implementors

impl<O: IsA<ClickAction>> ClickActionExt for O[src]

Loading content...