diff options
Diffstat (limited to 'atk/atkcomponent.c')
-rw-r--r-- | atk/atkcomponent.c | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/atk/atkcomponent.c b/atk/atkcomponent.c index f0beb10..dd3895d 100644 --- a/atk/atkcomponent.c +++ b/atk/atkcomponent.c @@ -507,10 +507,13 @@ atk_component_set_extents (AtkComponent *component, * @x: x coordinate * @y: y coordinate * @coord_type: specifies whether the coordinates are relative to the screen - * or to the components top level window + * or to the component's top level window + * + * Sets the position of @component. + * + * Contrary to atk_component_scroll_to, this does not trigger any scrolling, + * this just moves @component in its parent. * - * Sets the postition of @component. - * * Returns: %TRUE or %FALSE whether or not the position was set or not **/ gboolean @@ -556,6 +559,63 @@ atk_component_set_size (AtkComponent *component, return FALSE; } +/** + * atk_component_scroll_to (AtkComponent *accessible, AtkScrollType type) + * @component: an #AtkComponent + * @type: specify where the object should be made visible. + * + * 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. + * + * Since: 2.30 + * + * Returns: whether scrolling was successful. + */ +gboolean +atk_component_scroll_to (AtkComponent *component, AtkScrollType type) +{ + AtkComponentIface *iface = NULL; + g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE); + + iface = ATK_COMPONENT_GET_IFACE (component); + + if (iface->scroll_to) + return (iface->scroll_to) (component, type); + else + return FALSE; +} + +/** + * atk_component_scroll_to_point (AtkComponent *accessible, AtkScrollType type, gint x, gint y) + * @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 + * + * Makes an object visible on the screen at a given position by scrolling all + * necessary parents. + * + * Since: 2.30 + * + * Returns: whether scrolling was successful. + */ +gboolean +atk_component_scroll_to_point (AtkComponent *component, AtkCoordType coords, gint x, gint y) +{ + AtkComponentIface *iface = NULL; + g_return_val_if_fail (ATK_IS_COMPONENT (component), FALSE); + + iface = ATK_COMPONENT_GET_IFACE (component); + + if (iface->scroll_to_point) + return (iface->scroll_to_point) (component, coords, x, y); + else + return FALSE; +} + static gboolean atk_component_real_contains (AtkComponent *component, gint x, |