### Interface

# Atk Component

#### Description [src]

    interface Atk.Component : GObject.Object

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

`AtkComponent` 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 `AtkComponent` implementations provided for their corresponding `AtkObject` 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 `AtkText`.

#### Prerequisite

In order to implement Component, your type must inherit from`GObject`.

#### Implementations

- AtkNoOpObject
- AtkPlug
- AtkSocket

#### Instance methods

###### atk_component_add_focus_handler

Add the specified handler to the set of functions to be called when this object receives focus events (in or out). If the handler is already added it is not added again.

deprecated: 2.9.4

###### atk_component_contains

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

###### atk_component_get_alpha

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

since: 1.12

###### atk_component_get_extents

Gets the rectangle which gives the extent of the `component`.

###### atk_component_get_layer

Gets the layer of the component.

###### atk_component_get_mdi_zorder

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.

###### atk_component_get_position

Gets the position of `component` in the form of a point specifying `component`‘s top-left corner.

deprecated: Unknown

###### atk_component_get_size

Gets the size of the `component` in terms of width and height.

deprecated: Unknown

###### atk_component_grab_focus

Grabs focus for this `component`.

###### atk_component_ref_accessible_at_point

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

###### atk_component_remove_focus_handler

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

###### atk_component_scroll_to

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

since: 2.30

###### atk_component_scroll_to_point

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

since: 2.30

###### atk_component_set_extents

Sets the extents of `component`.

###### atk_component_set_position

Sets the position of `component`.

###### atk_component_set_size

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

#### Signals

###### Atk.Component::bounds-changed

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

#### Interface structure

    struct AtkComponentIface {
      guint (* add_focus_handler) (
        AtkComponent* component,
        AtkFocusHandler handler
      );
      gboolean (* contains) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      );
      AtkObject* (* ref_accessible_at_point) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      );
      void (* get_extents) (
        AtkComponent* component,
        gint* x,
        gint* y,
        gint* width,
        gint* height,
        AtkCoordType coord_type
      );
      void (* get_position) (
        AtkComponent* component,
        gint* x,
        gint* y,
        AtkCoordType coord_type
      );
      void (* get_size) (
        AtkComponent* component,
        gint* width,
        gint* height
      );
      gboolean (* grab_focus) (
        AtkComponent* component
      );
      void (* remove_focus_handler) (
        AtkComponent* component,
        guint handler_id
      );
      gboolean (* set_extents) (
        AtkComponent* component,
        gint x,
        gint y,
        gint width,
        gint height,
        AtkCoordType coord_type
      );
      gboolean (* set_position) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      );
      gboolean (* set_size) (
        AtkComponent* component,
        gint width,
        gint height
      );
      AtkLayer (* get_layer) (
        AtkComponent* component
      );
      gint (* get_mdi_zorder) (
        AtkComponent* component
      );
      void (* bounds_changed) (
        AtkComponent* component,
        AtkRectangle* bounds
      );
      gdouble (* get_alpha) (
        AtkComponent* component
      );
      gboolean (* scroll_to) (
        AtkComponent* component,
        AtkScrollType type
      );
      gboolean (* scroll_to_point) (
        AtkComponent* component,
        AtkCoordType coords,
        gint x,
        gint y
      );

    }

The AtkComponent interface should be supported by any object that is rendered on the screen. The interface provides the standard mechanism for an assistive technology to determine and set the graphical representation of an object.

###### Interface members

`add_focus_handler` |
    guint (* add_focus_handler) (
        AtkComponent* component,
        AtkFocusHandler handler
      )
| This virtual function is deprecated since 2.9.4 and it should not be overriden. See `atk_component_add_focus_handler()` for more information.
`contains` |
    gboolean (* contains) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      )
| No description available.
`ref_accessible_at_point` |
    AtkObject* (* ref_accessible_at_point) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      )
| No description available.
`get_extents` |
    void (* get_extents) (
        AtkComponent* component,
        gint* x,
        gint* y,
        gint* width,
        gint* height,
        AtkCoordType coord_type
      )
| No description available.
`get_position` |
    void (* get_position) (
        AtkComponent* component,
        gint* x,
        gint* y,
        AtkCoordType coord_type
      )
| This virtual function is deprecated since 2.12 and it should not be overriden. Use `AtkComponentIface`.get_extents instead.
`get_size` |
    void (* get_size) (
        AtkComponent* component,
        gint* width,
        gint* height
      )
| This virtual function is deprecated since 2.12 and it should not be overriden. Use `AtkComponentIface`.get_extents instead.
`grab_focus` |
    gboolean (* grab_focus) (
        AtkComponent* component
      )
| No description available.
`remove_focus_handler` |
    void (* remove_focus_handler) (
        AtkComponent* component,
        guint handler_id
      )
| This virtual function is deprecated since 2.9.4 and it should not be overriden. See `atk_component_remove_focus_handler()` for more information.
`set_extents` |
    gboolean (* set_extents) (
        AtkComponent* component,
        gint x,
        gint y,
        gint width,
        gint height,
        AtkCoordType coord_type
      )
| No description available.
`set_position` |
    gboolean (* set_position) (
        AtkComponent* component,
        gint x,
        gint y,
        AtkCoordType coord_type
      )
| No description available.
`set_size` |
    gboolean (* set_size) (
        AtkComponent* component,
        gint width,
        gint height
      )
| No description available.
`get_layer` |
    AtkLayer (* get_layer) (
        AtkComponent* component
      )
| No description available.
`get_mdi_zorder` |
    gint (* get_mdi_zorder) (
        AtkComponent* component
      )
| No description available.
`bounds_changed` |
    void (* bounds_changed) (
        AtkComponent* component,
        AtkRectangle* bounds
      )
| No description available.
`get_alpha` |
    gdouble (* get_alpha) (
        AtkComponent* component
      )
| No description available.
`scroll_to` |
    gboolean (* scroll_to) (
        AtkComponent* component,
        AtkScrollType type
      )
| No description available.
`scroll_to_point` |
    gboolean (* scroll_to_point) (
        AtkComponent* component,
        AtkCoordType coords,
        gint x,
        gint y
      )
| No description available.

#### Virtual methods

###### Atk.Component.add_focus_handler

Add the specified handler to the set of functions to be called when this object receives focus events (in or out). If the handler is already added it is not added again.

deprecated: 2.9.4

###### Atk.Component.bounds_changed

No description available.

###### Atk.Component.contains

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

###### Atk.Component.get_alpha

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

since: 1.12

###### Atk.Component.get_extents

Gets the rectangle which gives the extent of the `component`.

###### Atk.Component.get_layer

Gets the layer of the component.

###### Atk.Component.get_mdi_zorder

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.

###### Atk.Component.get_position

Gets the position of `component` in the form of a point specifying `component`‘s top-left corner.

deprecated: Unknown

###### Atk.Component.get_size

Gets the size of the `component` in terms of width and height.

deprecated: Unknown

###### Atk.Component.grab_focus

Grabs focus for this `component`.

###### Atk.Component.ref_accessible_at_point

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

###### Atk.Component.remove_focus_handler

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

###### Atk.Component.scroll_to

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

since: 2.30

###### Atk.Component.scroll_to_point

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

since: 2.30

###### Atk.Component.set_extents

Sets the extents of `component`.

###### Atk.Component.set_position

Sets the position of `component`.

###### Atk.Component.set_size

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