diff -aur atk-2.29.1/NEWS atk-2.29.2/NEWS --- atk-2.29.1/NEWS 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/NEWS 2018-06-19 15:54:52.000000000 +0200 @@ -1,3 +1,18 @@ +Changes in version 2.29.2 +========================= + +* Add ScrollTo and ScrollToPoint methods to AtkComponent + +* Build: + * Require a more recent version fo Meson, 0.46.0 + +* Misc: + * Documentation, introspection, and versioning fixes + +Contributors: + Samuel Thibault, Michael Catanzaro, Rico Tzschichholz, Corentin Noël, + Emmanuele Bassi + Changes in version 2.29.1 ========================= diff -aur atk-2.29.1/atk/atkcomponent.c atk-2.29.2/atk/atkcomponent.c --- atk-2.29.1/atk/atkcomponent.c 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkcomponent.c 2018-06-19 15:54:52.000000000 +0200 @@ -507,10 +507,13 @@ * @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,68 @@ return FALSE; } +/** + * atk_component_scroll_to: + * @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. + * + * Returns: whether scrolling was successful. + * + * Since: 2.30 + */ +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); + + return FALSE; +} + +/** + * atk_component_scroll_to_point: + * @component: an #AtkComponent + * @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. + * + * Returns: whether scrolling was successful. + * + * Since: 2.30 + */ +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); + + return FALSE; +} + static gboolean atk_component_real_contains (AtkComponent *component, gint x, diff -aur atk-2.29.1/atk/atkcomponent.h atk-2.29.2/atk/atkcomponent.h --- atk-2.29.1/atk/atkcomponent.h 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkcomponent.h 2018-06-19 15:54:52.000000000 +0200 @@ -29,6 +29,38 @@ G_BEGIN_DECLS +/** + *AtkScrollType: + *@ATK_SCROLL_TOP_LEFT: Scroll the object vertically and horizontally to the top + *left corner of the window. + *@ATK_SCROLL_BOTTOM_RIGHT: Scroll the object vertically and horizontally to the + *bottom right corner of the window. + *@ATK_SCROLL_TOP_EDGE: Scroll the object vertically to the top edge of the + window. + *@ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to the bottom edge of + *the window. + *@ATK_SCROLL_LEFT_EDGE: Scroll the object vertically and horizontally to the + *left edge of the window. + *@ATK_SCROLL_RIGHT_EDGE: Scroll the object vertically and horizontally to the + *right edge of the window. + *@ATK_SCROLL_ANYWHERE: Scroll the object vertically and horizontally so that + *as much as possible of the object becomes visible. The exact placement is + *determined by the application. + * + * Specifies where an object should be placed on the screen when using scroll_to. + * + * Since: 2.30 + **/ +typedef enum { + ATK_SCROLL_TOP_LEFT, + ATK_SCROLL_BOTTOM_RIGHT, + ATK_SCROLL_TOP_EDGE, + ATK_SCROLL_BOTTOM_EDGE, + ATK_SCROLL_LEFT_EDGE, + ATK_SCROLL_RIGHT_EDGE, + ATK_SCROLL_ANYWHERE +} AtkScrollType; + /* * The AtkComponent interface should be supported by any object that is * rendered on the screen. The interface provides the standard mechanism @@ -156,6 +188,18 @@ void (* bounds_changed) (AtkComponent *component, AtkRectangle *bounds); gdouble (* get_alpha) (AtkComponent *component); + + /* + * Scrolls this object so it becomes visible on the screen. + * Since ATK 2.30 + */ + gboolean (*scroll_to) (AtkComponent *component, + AtkScrollType type); + + gboolean (*scroll_to_point) (AtkComponent *component, + AtkCoordType coords, + gint x, + gint y); }; ATK_AVAILABLE_IN_ALL @@ -219,6 +263,16 @@ ATK_AVAILABLE_IN_ALL gdouble atk_component_get_alpha (AtkComponent *component); +ATK_AVAILABLE_IN_2_30 +gboolean atk_component_scroll_to (AtkComponent *component, + AtkScrollType type); + +ATK_AVAILABLE_IN_2_30 +gboolean atk_component_scroll_to_point (AtkComponent *component, + AtkCoordType coords, + gint x, + gint y); + G_END_DECLS #endif /* __ATK_COMPONENT_H__ */ diff -aur atk-2.29.1/atk/atkdocument.c atk-2.29.2/atk/atkdocument.c --- atk-2.29.1/atk/atkdocument.c 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkdocument.c 2018-06-19 15:54:52.000000000 +0200 @@ -162,7 +162,7 @@ } /** - * atk_document_get_document_type: + * atk_document_get_document_type: (virtual get_document_type) * @document: a #GObject instance that implements AtkDocumentIface * * Gets a string indicating the document type. @@ -192,7 +192,7 @@ } /** - * atk_document_get_document: + * atk_document_get_document: (virtual get_document) * @document: a #GObject instance that implements AtkDocumentIface * * Gets a %gpointer that points to an instance of the DOM. It is @@ -225,7 +225,7 @@ } /** - * atk_document_get_locale: + * atk_document_get_locale: (virtual get_document_locale) * @document: a #GObject instance that implements AtkDocumentIface * * Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale @@ -261,7 +261,7 @@ /** - * atk_document_get_attributes: + * atk_document_get_attributes: (virtual get_document_attributes) * @document: a #GObject instance that implements AtkDocumentIface * * Gets an AtkAttributeSet which describes document-wide @@ -293,7 +293,7 @@ } /** - * atk_document_get_attribute_value: + * atk_document_get_attribute_value: (virtual get_document_attribute_value) * @document: a #GObject instance that implements AtkDocumentIface * @attribute_name: a character string representing the name of the attribute * whose value is being queried. @@ -325,7 +325,7 @@ } /** - * atk_document_set_attribute_value: + * atk_document_set_attribute_value: (virtual set_document_attribute) * @document: a #GObject instance that implements AtkDocumentIface * @attribute_name: a character string representing the name of the attribute * whose value is being set. diff -aur atk-2.29.1/atk/atkobject.c atk-2.29.2/atk/atkobject.c --- atk-2.29.1/atk/atkobject.c 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkobject.c 2018-06-19 15:54:52.000000000 +0200 @@ -57,6 +57,9 @@ * */ +typedef AtkImplementorIface AtkImplementorInterface; +G_DEFINE_INTERFACE (AtkImplementor, atk_implementor, G_TYPE_OBJECT) + static GPtrArray *role_names = NULL; enum @@ -539,7 +542,7 @@ * @arg1: The index of the added or removed child. The value can be * -1. This is used if the value is not known by the implementor * when the child is added/removed or irrelevant. - * @arg2: A gpointer to the child AtkObject which was added or + * @arg2: (type AtkObject): A gpointer to the child AtkObject which was added or * removed. If the child was removed, it is possible that it is not * available for the implementor. In that case this pointer can be * NULL. @@ -581,8 +584,8 @@ /** * AtkObject::property-change: * @atkobject: the object which received the signal. - * @arg1: an #AtkPropertyValues containing the new value of the - * property which changed. + * @arg1: (type AtkPropertyValues): an #AtkPropertyValues containing the new + * value of the property which changed. * * The signal "property-change" is emitted when an object's property * value changes. @arg1 contains an #AtkPropertyValues with the name @@ -648,7 +651,7 @@ /** * AtkObject::active-descendant-changed: * @atkobject: the object which received the signal. - * @arg1: the newly focused object. + * @arg1: (type AtkObject): the newly focused object. * * The "active-descendant-changed" signal is emitted by an object * which has the state ATK_STATE_MANAGES_DESCENDANTS when the focus @@ -677,24 +680,9 @@ accessible->role = ATK_ROLE_UNKNOWN; } -GType -atk_implementor_get_type (void) +static void +atk_implementor_default_init (AtkImplementorInterface *iface) { - static GType type = 0; - - if (!type) - { - static const GTypeInfo typeInfo = - { - sizeof (AtkImplementorIface), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - } ; - - type = g_type_register_static (G_TYPE_INTERFACE, "AtkImplementorIface", &typeInfo, 0) ; - } - - return type; } /** diff -aur atk-2.29.1/atk/atkobject.h atk-2.29.2/atk/atkobject.h --- atk-2.29.1/atk/atkobject.h 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkobject.h 2018-06-19 15:54:52.000000000 +0200 @@ -678,7 +678,7 @@ }; ATK_AVAILABLE_IN_ALL -GType atk_implementor_get_type (void); +GType atk_implementor_get_type (void) G_GNUC_CONST; ATK_AVAILABLE_IN_ALL AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor); diff -aur atk-2.29.1/atk/atktext.c atk-2.29.2/atk/atktext.c --- atk-2.29.1/atk/atktext.c 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atktext.c 2018-06-19 15:54:52.000000000 +0200 @@ -1079,7 +1079,7 @@ } /** - * atk_text_get_bounded_ranges: + * atk_text_get_bounded_ranges: (virtual get_bounded_ranges) * @text: an #AtkText * @rect: An AtkTextRectangle giving the dimensions of the bounding box. * @coord_type: Specify whether coordinates are relative to the screen or widget window. diff -aur atk-2.29.1/atk/atkutil.h atk-2.29.2/atk/atkutil.h --- atk-2.29.1/atk/atkutil.h 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkutil.h 2018-06-19 15:54:52.000000000 +0200 @@ -176,15 +176,18 @@ /** *AtkCoordType: *@ATK_XY_SCREEN: specifies xy coordinates relative to the screen - *@ATK_XY_WINDOW: specifies xy coordinates relative to the widget's + *@ATK_XY_WINDOW: specifies xy coordinates relative to the widget's * top-level window + *@ATK_XY_PARENT: specifies xy coordinates relative to the widget's + * immediate parent. Since: 2.30 * *Specifies how xy coordinates are to be interpreted. Used by functions such *as atk_component_get_position() and atk_text_get_character_extents() **/ typedef enum { ATK_XY_SCREEN, - ATK_XY_WINDOW + ATK_XY_WINDOW, + ATK_XY_PARENT }AtkCoordType; ATK_DEPRECATED_IN_2_10 diff -aur atk-2.29.1/atk/atkversion.h.in atk-2.29.2/atk/atkversion.h.in --- atk-2.29.1/atk/atkversion.h.in 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/atk/atkversion.h.in 2018-06-19 15:54:52.000000000 +0200 @@ -176,6 +176,16 @@ */ #define ATK_VERSION_2_14 (G_ENCODE_VERSION (2, 14)) +/** + * ATK_VERSION_2_30: + * + * A macro that evaluates to the 2.30 version of ATK, in a format + * that can be used by the C pre-processor. + * + * Since: 2.30 + */ +#define ATK_VERSION_2_30 (G_ENCODE_VERSION (2, 30)) + /* evaluates to the current stable version; for development cycles, * this means the next stable target */ @@ -376,6 +386,20 @@ # define ATK_AVAILABLE_IN_2_14 _ATK_EXTERN #endif +#if ATK_VERSION_MIN_REQUIRED >= ATK_VERSION_2_30 +# define ATK_DEPRECATED_IN_2_30 ATK_DEPRECATED +# define ATK_DEPRECATED_IN_2_30_FOR(f) ATK_DEPRECATED_FOR(f) +#else +# define ATK_DEPRECATED_IN_2_30 _ATK_EXTERN +# define ATK_DEPRECATED_IN_2_30_FOR(f) _ATK_EXTERN +#endif + +#if ATK_VERSION_MAX_ALLOWED < ATK_VERSION_2_30 +# define ATK_AVAILABLE_IN_2_30 ATK_UNAVAILABLE(2, 30) +#else +# define ATK_AVAILABLE_IN_2_30 _ATK_EXTERN +#endif + ATK_AVAILABLE_IN_2_8 guint atk_get_major_version (void) G_GNUC_CONST; ATK_AVAILABLE_IN_2_8 diff -aur atk-2.29.1/docs/atk-sections.txt atk-2.29.2/docs/atk-sections.txt --- atk-2.29.1/docs/atk-sections.txt 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/docs/atk-sections.txt 2018-06-19 15:54:52.000000000 +0200 @@ -39,6 +39,8 @@ atk_component_set_position atk_component_set_size atk_component_get_alpha +atk_component_scroll_to +atk_component_scroll_to_point ATK_COMPONENT ATK_IS_COMPONENT @@ -211,6 +213,7 @@ ATK_IMPLEMENTOR ATK_TYPE_ROLE ATK_TYPE_LAYER +ATK_TYPE_SCROLL_TYPE atk_implementor_get_type atk_object_get_type atk_role_get_type diff -aur atk-2.29.1/meson.build atk-2.29.2/meson.build --- atk-2.29.1/meson.build 2018-04-25 08:34:55.000000000 +0200 +++ atk-2.29.2/meson.build 2018-06-19 15:54:52.000000000 +0200 @@ -1,12 +1,12 @@ project('atk', 'c', - version: '2.29.1', + version: '2.29.2', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', 'warning_level=1', 'c_std=c99', ], - meson_version : '>= 0.40.1') + meson_version : '>= 0.46.0') cc = meson.get_compiler('c') host_system = host_machine.system() @@ -65,19 +65,12 @@ endif # Check all compiler flags -foreach cflag: test_cflags - if cc.has_argument(cflag) - common_cflags += [ cflag ] - endif -endforeach +common_cflags += cc.get_supported_arguments(test_cflags) # Linker flags if host_machine.system() == 'linux' - foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] - if cc.has_argument(ldflag) - common_ldflags += [ ldflag ] - endif - endforeach + test_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ] + common_ldflags += cc.get_supported_link_arguments(test_ldflags) endif # Maintain compatibility with autotools on macOS