Atk.Component

g Atk.Component Atk.Component GObject.GInterface GObject.GInterface GObject.GInterface->Atk.Component

Implementations:

Atk.NoOpObject, Atk.Plug, Atk.Socket

Methods

contains (x, y, coord_type)

get_alpha ()

get_extents (coord_type)

get_layer ()

get_mdi_zorder ()

get_position (coord_type)

get_size ()

grab_focus ()

ref_accessible_at_point (x, y, coord_type)

remove_focus_handler (handler_id)

scroll_to (type)

scroll_to_point (coords, x, y)

set_extents (x, y, width, height, coord_type)

set_position (x, y, coord_type)

set_size (width, height)

Virtual Methods

do_bounds_changed (bounds)

do_contains (x, y, coord_type)

do_get_alpha ()

do_get_extents (coord_type)

do_get_layer ()

do_get_mdi_zorder ()

do_get_position (coord_type)

do_get_size ()

do_grab_focus ()

do_ref_accessible_at_point (x, y, coord_type)

do_remove_focus_handler (handler_id)

do_scroll_to (type)

do_scroll_to_point (coords, x, y)

do_set_extents (x, y, width, height, coord_type)

do_set_position (x, y, coord_type)

do_set_size (width, height)

Properties

None

Signals

Name

Short Description

bounds-changed

The ‘bounds-changed” signal is emitted when the position or size of the component changes.

Fields

None

Class Details

class Atk.Component
Bases:

GObject.GInterface

Structure:

Atk.ComponentIface

The ATK interface provided by UI components which occupy a physical area on the screen. which the user can activate/interact with.

Atk.Component should be implemented by most if not all UI elements with an actual on-screen presence, i.e. components which can be said to have a screen-coordinate bounding box. Virtually all widgets will need to have Atk.Component implementations provided for their corresponding Atk.Object class. In short, only UI elements which are *not* GUI elements will omit this ATK interface.

A possible exception might be textual information with a transparent background, in which case text glyph bounding box information is provided by Atk.Text.

contains(x, y, coord_type)[source]
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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

Return type:

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.

get_alpha()[source]
Returns:

An alpha value from 0 to 1.0, inclusive.

Return type:

float

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

New in version 1.12.

get_extents(coord_type)[source]
Parameters:

coord_type (Atk.CoordType) – specifies whether the coordinates are relative to the screen or to the components top level window

Returns:

x:

address of int to put x coordinate

y:

address of int to put y coordinate

width:

address of int to put width

height:

address of int to put height

Return type:

(x: int, y: int, width: int, height: int)

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.

get_layer()[source]
Returns:

an Atk.Layer which is the layer of the component

Return type:

Atk.Layer

Gets the layer of the component.

get_mdi_zorder()[source]
Returns:

a int 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.

Return type:

int

Gets the zorder of the component. The value GObject.G_MININT will be returned if the layer of the component is not Atk.Layer.MDI or Atk.Layer.WINDOW.

get_position(coord_type)[source]
Parameters:

coord_type (Atk.CoordType) – specifies whether the coordinates are relative to the screen or to the components top level window

Returns:

x:

address of int to put x coordinate position

y:

address of int to put y coordinate position

Return type:

(x: int, y: int)

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 version 2.12: Use Atk.Component.get_extents() instead.

get_size()[source]
Returns:

width:

address of int to put width of self

height:

address of int to put height of self

Return type:

(width: int, height: int)

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 version 2.12: Use Atk.Component.get_extents() instead.

grab_focus()[source]
Returns:

True if successful, False otherwise.

Return type:

bool

Grabs focus for this self.

ref_accessible_at_point(x, y, coord_type)[source]
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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

Return type:

Atk.Object or None

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

remove_focus_handler(handler_id)[source]
Parameters:

handler_id (int) – the handler id of the focus handler to be removed from self

Remove the handler specified by handler_id from the list of functions to be executed when this object receives focus events (in or out).

Deprecated since version 2.9.4: If you need to track when an object gains or lose the focus, use the Atk.Object ::state-change “focused” notification instead.

scroll_to(type)[source]
Parameters:

type (Atk.ScrollType) – specify where the object should be made visible.

Returns:

whether scrolling was successful.

Return type:

bool

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.

New in version 2.30.

scroll_to_point(coords, x, y)[source]
Parameters:
  • coords (Atk.CoordType) – specify whether coordinates are relative to the screen or to the parent object.

  • x (int) – x-position where to scroll to

  • y (int) – y-position where to scroll to

Returns:

whether scrolling was successful.

Return type:

bool

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

New in version 2.30.

set_extents(x, y, width, height, coord_type)[source]
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • width (int) – width to set for self

  • height (int) – height to set for self

  • coord_type (Atk.CoordType) – 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

Return type:

bool

Sets the extents of self.

set_position(x, y, coord_type)[source]
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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

Return type:

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.

set_size(width, height)[source]
Parameters:
  • width (int) – width to set for self

  • height (int) – height to set for self

Returns:

True or False whether the size was set or not

Return type:

bool

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

do_bounds_changed(bounds) virtual
Parameters:

bounds (Atk.Rectangle) –

do_contains(x, y, coord_type) virtual
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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 component or not

Return type:

bool

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

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

do_get_alpha() virtual
Returns:

An alpha value from 0 to 1.0, inclusive.

Return type:

float

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

New in version 1.12.

do_get_extents(coord_type) virtual
Parameters:

coord_type (Atk.CoordType) – specifies whether the coordinates are relative to the screen or to the components top level window

Returns:

x:

address of int to put x coordinate

y:

address of int to put y coordinate

width:

address of int to put width

height:

address of int to put height

Return type:

(x: int, y: int, width: int, height: int)

Gets the rectangle which gives the extent of the component.

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.

do_get_layer() virtual
Returns:

an Atk.Layer which is the layer of the component

Return type:

Atk.Layer

Gets the layer of the component.

do_get_mdi_zorder() virtual
Returns:

a int 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.

Return type:

int

Gets the zorder of the component. The value GObject.G_MININT will be returned if the layer of the component is not Atk.Layer.MDI or Atk.Layer.WINDOW.

do_get_position(coord_type) virtual
Parameters:

coord_type (Atk.CoordType) – specifies whether the coordinates are relative to the screen or to the components top level window

Returns:

x:

address of int to put x coordinate position

y:

address of int to put y coordinate position

Return type:

(x: int, y: int)

Gets the position of component in the form of a point specifying component'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 version 2.12: Use Atk.Component.get_extents() instead.

do_get_size() virtual
Returns:

width:

address of int to put width of component

height:

address of int to put height of component

Return type:

(width: int, height: int)

Gets the size of the component 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 version 2.12: Use Atk.Component.get_extents() instead.

do_grab_focus() virtual
Returns:

True if successful, False otherwise.

Return type:

bool

Grabs focus for this component.

do_ref_accessible_at_point(x, y, coord_type) virtual
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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

Return type:

Atk.Object or None

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

do_remove_focus_handler(handler_id) virtual
Parameters:

handler_id (int) – the handler id of the focus handler to be removed from component

Remove the handler specified by handler_id from the list of functions to be executed when this object receives focus events (in or out).

Deprecated since version 2.9.4: If you need to track when an object gains or lose the focus, use the Atk.Object ::state-change “focused” notification instead.

do_scroll_to(type) virtual
Parameters:

type (Atk.ScrollType) – specify where the object should be made visible.

Returns:

whether scrolling was successful.

Return type:

bool

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

Contrary to Atk.Component.set_position, this does not actually move component 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.

New in version 2.30.

do_scroll_to_point(coords, x, y) virtual
Parameters:
  • coords (Atk.CoordType) – specify whether coordinates are relative to the screen or to the parent object.

  • x (int) – x-position where to scroll to

  • y (int) – y-position where to scroll to

Returns:

whether scrolling was successful.

Return type:

bool

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

New in version 2.30.

do_set_extents(x, y, width, height, coord_type) virtual
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • width (int) – width to set for component

  • height (int) – height to set for component

  • coord_type (Atk.CoordType) – 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

Return type:

bool

Sets the extents of component.

do_set_position(x, y, coord_type) virtual
Parameters:
  • x (int) – x coordinate

  • y (int) – y coordinate

  • coord_type (Atk.CoordType) – 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

Return type:

bool

Sets the position of component.

Contrary to Atk.Component.scroll_to, this does not trigger any scrolling, this just moves component in its parent.

do_set_size(width, height) virtual
Parameters:
  • width (int) – width to set for component

  • height (int) – height to set for component

Returns:

True or False whether the size was set or not

Return type:

bool

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

Signal Details

Atk.Component.signals.bounds_changed(component, arg1)
Signal Name:

bounds-changed

Flags:

RUN_LAST

Parameters:

The ‘bounds-changed” signal is emitted when the position or size of the component changes.