Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Atk::Component Class Reference

An AtkComponent C++ wrapper class. More...

`#include <inti/atk/component.h>`

Inheritance diagram for Inti::Atk::Component:

List of all members.

## Public Member Functions

Accessors

- AtkComponent * atk_component () const
    Get a pointer to the AtkComponent structure.
- AtkComponentIface * atk_component_iface () const
    Get a pointer to the AtkComponentIface structure.
- operator AtkComponent * () const
    Conversion operator; safely converts a Component to an AtkComponent pointer.
- Object * ref_accessible_at_point (int x, int y, CoordType coord_type) const
    Gets the accessible child, if one exists, at the coordinate point specified by x and y.
- void get_extents (int *x, int *y, int *width, int *height, CoordType coord_type) const
    Gets the rectangle which gives the extent of the component.
- void get_position (int *x, int *y, CoordType coord_type) const
    Gets the position of component in the form of a point specifying the component's top-left corner.
- void get_size (int *width, int *height) const
    Gets the size of the component in terms of width and height.
- Layer get_layer () const
    Gets the layer of the component.
- int get_mdi_zorder () const
    Gets the zorder of the component.

Methods

- unsigned int add_focus_handler (AtkFocusHandler handler)
    Add the specified handler to the set of functions to be called when the component receives focus events (in or out).
- bool contains (int x, int y, CoordType coord_type) const
    Checks whether the specified point is within the extent of the component.
- bool grab_focus ()
    Grabs the focus for the component.
- void remove_focus_handler (unsigned int handler_id)
    Remove the handler specified by handler_id from the list of functions to be executed when the component receives focus events (in or out).
- bool set_extents (int x, int y, int width, int height, CoordType coord_type)
    Sets the extents of the component.
- bool set_position (int x, int y, CoordType coord_type)
    Sets the postition of the component.
- bool set_size (int width, int height)
    Set the size of the component in terms of width and height.

## Protected Member Functions

Constructors

- virtual ~Component ()=0
    Destructor.

## Detailed Description

An AtkComponent C++ wrapper class.

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 Component implementations provided for their corresponding 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 Text.

## Member Function Documentation

unsigned int Inti::Atk::Component::add_focus_handler | ( | AtkFocusHandler | handler | ) |

Add the specified handler to the set of functions to be called when the component receives focus events (in or out).

Parameters:

  handler | The AtkFocusHandler to be attached to the component.

Returns:
  A handler id which can be used in remove_focus_handler(), or zero if the handler was already added.

If the handler is already added it is not added again.

bool Inti::Atk::Component::contains | ( | int | x,
|  | int | y,
|  | CoordType | coord_type
| ) | const

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

Parameters:

  x | The X coordinate.
  y | The Y coordinate.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window.

Returns:
  true if the specified point is within the extent of the component, false if not.

void Inti::Atk::Component::get_extents | ( | int * | x,
|  | int * | y,
|  | int * | width,
|  | int * | height,
|  | CoordType | coord_type
| ) | const

Gets the rectangle which gives the extent of the component.

Parameters:

  x | The return location to store the x coordinate of the component.
  y | The return location to store the y coordinate of the component.
  width | The return location for the width of the component.
  height | The return location for the height of the component.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window

Layer Inti::Atk::Component::get_layer | ( |  | ) | const

Gets the layer of the component.

Returns:
  A Layer which is the layer of the component.

int Inti::Atk::Component::get_mdi_zorder | ( |  | ) | const

Gets the zorder of the component.

Returns:
  An integer 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.

The value G_MININT will be returned if the layer of the component is not LAYER_MDI or LAYER_WINDOW.

void Inti::Atk::Component::get_position | ( | int * | x,
|  | int * | y,
|  | CoordType | coord_type
| ) | const

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

Parameters:

  x | The return location to store the x coordinate of the component.
  y | The return location to store the y coordinate of the component.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window.

void Inti::Atk::Component::get_size | ( | int * | width,
|  | int * | height
| ) | const

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

Parameters:

  width | The return location for the width of the component.
  height | The return location for the height of the component.

bool Inti::Atk::Component::grab_focus | ( |  | ) |

Grabs the focus for the component.

Returns:
  true if successful, false otherwise.

Object* Inti::Atk::Component::ref_accessible_at_point | ( | int | x,
|  | int | y,
|  | CoordType | coord_type
| ) | const

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

Parameters:

  x | The X coordinate.
  y | The Y coordinate.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window.

Returns:
  A pointer to the accessible child, if one exists.

void Inti::Atk::Component::remove_focus_handler | ( | unsigned int | handler_id | ) |

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

Parameters:

  handler_id | The id of the focus handler to be removed from the component.

bool Inti::Atk::Component::set_extents | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | CoordType | coord_type
| ) |

Sets the extents of the component.

Parameters:

  x | The X coordinate.
  y | The Y coordinate.
  width | The width to set for the component.
  height | The height to set for the component.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window.

Returns:
  true if the extents were set, false if not.

bool Inti::Atk::Component::set_position | ( | int | x,
|  | int | y,
|  | CoordType | coord_type
| ) |

Sets the postition of the component.

Parameters:

  x | The X coordinate.
  y | The Y coordinate.
  coord_type | Specifies whether the coordinates are relative to the screen or to the components top level window.

Returns:
  true if the position was set, false if not.

bool Inti::Atk::Component::set_size | ( | int | width,
|  | int | height
| ) |

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

Parameters:

  width | The width to set for the component.
  height | The height to set for the component.

Returns:
  true if the size was set, false if not.

The documentation for this class was generated from the following file:

- component.h

Main Page - Footer