Skip to main content

ComponentExt

Trait ComponentExt 

Source
pub trait ComponentExt:
    IsA<Component>
    + Sealed
    + 'static {
Show 15 methods // Provided methods fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool { ... } fn alpha(&self) -> f64 { ... } fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32) { ... } fn layer(&self) -> Layer { ... } fn mdi_zorder(&self) -> i32 { ... } fn position(&self, coord_type: CoordType) -> (i32, i32) { ... } fn size(&self) -> (i32, i32) { ... } fn grab_focus(&self) -> bool { ... } fn ref_accessible_at_point( &self, x: i32, y: i32, coord_type: CoordType, ) -> Option<Object> { ... } fn scroll_to(&self, type_: ScrollType) -> bool { ... } fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool { ... } fn set_extents( &self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType, ) -> bool { ... } fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool { ... } fn set_size(&self, width: i32, height: i32) -> bool { ... } fn connect_bounds_changed<F: Fn(&Self, &Rectangle) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Component methods.

§Implementors

Component, NoOpObject, Plug, Socket

Provided Methods§

Source

fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> bool

Checks whether the specified point is within the extent of the self.

Toolkit implementor note: ATK provides a default implementation for this virtual method. In general there are little reason to re-implement it.

§x

x coordinate

§y

y coordinate

§coord_type

specifies whether the coordinates are relative to the screen or to the components top level window

§Returns

true or false indicating whether the specified point is within the extent of the self or not

Source

fn alpha(&self) -> f64

Returns the alpha value (i.e. the opacity) for this self, on a scale from 0 (fully transparent) to 1.0 (fully opaque).

§Returns

An alpha value from 0 to 1.0, inclusive.

Source

fn extents(&self, coord_type: CoordType) -> (i32, i32, i32, i32)

Gets the rectangle which gives the extent of the self.

If the extent can not be obtained (e.g. a non-embedded plug or missing support), all of x, y, width, height are set to -1.

§coord_type

specifies whether the coordinates are relative to the screen or to the components top level window

§Returns
§x

address of gint to put x coordinate

§y

address of gint to put y coordinate

§width

address of gint to put width

§height

address of gint to put height

Source

fn layer(&self) -> Layer

Gets the layer of the component.

§Returns

an Layer which is the layer of the component

Source

fn mdi_zorder(&self) -> i32

Gets the zorder of the component. The value G_MININT will be returned if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.

§Returns

a gint which is the zorder of the component, i.e. the depth at which the component is shown in relation to other components in the same container.

Source

fn position(&self, coord_type: CoordType) -> (i32, i32)

Gets the position of self in the form of a point specifying self’s top-left corner.

If the position can not be obtained (e.g. a non-embedded plug or missing support), x and y are set to -1.

§Deprecated

Since 2.12. Use extents() instead.

§coord_type

specifies whether the coordinates are relative to the screen or to the components top level window

§Returns
§x

address of gint to put x coordinate position

§y

address of gint to put y coordinate position

Source

fn size(&self) -> (i32, i32)

Gets the size of the self in terms of width and height.

If the size can not be obtained (e.g. a non-embedded plug or missing support), width and height are set to -1.

§Deprecated

Since 2.12. Use extents() instead.

§Returns
§width

address of gint to put width of self

§height

address of gint to put height of self

Source

fn grab_focus(&self) -> bool

Grabs focus for this self.

§Returns

true if successful, false otherwise.

Source

fn ref_accessible_at_point( &self, x: i32, y: i32, coord_type: CoordType, ) -> Option<Object>

Gets a reference to the accessible child, if one exists, at the coordinate point specified by x and y.

§x

x coordinate

§y

y coordinate

§coord_type

specifies whether the coordinates are relative to the screen or to the components top level window

§Returns

a reference to the accessible child, if one exists

Source

fn scroll_to(&self, type_: ScrollType) -> bool

Available on crate feature v2_30 only.

Makes self visible on the screen by scrolling all necessary parents.

Contrary to atk_component_set_position, this does not actually move self in its parent, this only makes the parents scroll so that the object shows up on the screen, given its current position within the parents.

§type_

specify where the object should be made visible.

§Returns

whether scrolling was successful.

Source

fn scroll_to_point(&self, coords: CoordType, x: i32, y: i32) -> bool

Available on crate feature v2_30 only.

Move the top-left of self to a given position of the screen by scrolling all necessary parents.

§coords

specify whether coordinates are relative to the screen or to the parent object.

§x

x-position where to scroll to

§y

y-position where to scroll to

§Returns

whether scrolling was successful.

Source

fn set_extents( &self, x: i32, y: i32, width: i32, height: i32, coord_type: CoordType, ) -> bool

Sets the extents of self.

§x

x coordinate

§y

y coordinate

§width

width to set for self

§height

height to set for self

§coord_type

specifies whether the coordinates are relative to the screen or to the components top level window

§Returns

true or false whether the extents were set or not

Source

fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> bool

Sets the position of self.

Contrary to atk_component_scroll_to, this does not trigger any scrolling, this just moves self in its parent.

§x

x coordinate

§y

y coordinate

§coord_type

specifies whether the coordinates are relative to the screen or to the component’s top level window

§Returns

true or false whether or not the position was set or not

Source

fn set_size(&self, width: i32, height: i32) -> bool

Set the size of the self in terms of width and height.

§width

width to set for self

§height

height to set for self

§Returns

true or false whether the size was set or not

Source

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

The ’bounds-changed“ signal is emitted when the bposition or size of the component changes.

§arg1

The AtkRectangle giving the new position and size.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§