pub trait ComponentExt: 'static {
Show 15 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

Required Methods

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

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.

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

Gets the layer of the component.

Returns

an Layer which is the layer of the component

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.

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

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

Grabs focus for this self.

Returns

true if successful, false otherwise.

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

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.

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.

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

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

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

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

arg1

The AtkRectangle giving the new position and size.

Implementors