# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # $(eval $(call gb_JunitTest_JunitTest,starmath_unoapi)) $(eval $(call gb_JunitTest_set_unoapi_test_defaults,starmath_unoapi,,sm.sce)) # vim: set noet sw=4 ts=4: fier` [1] for macOS/NSAccessibility by retrieving the accessible ID via `XAccessibleContext2::getAccessibleId` if that interface is implemented. This is the macOS equivalent of commit c64b823b74cbd3063d6e87643bd68ea5343b2f54 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Jul 16 13:57:41 2024 +0200 tdf#155447 qt a11y: Report accessible ID [1] https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol/1527792-accessibilityidentifier Change-Id: I43c40f5309467ddb00911297fadb6716500c2dcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170624 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Implement `accessibilityIdentifier` [1] for
macOS/NSAccessibility by retrieving the accessible ID
via `XAccessibleContext2::getAccessibleId` if that
interface is implemented.

This is the macOS equivalent of

    commit c64b823b74cbd3063d6e87643bd68ea5343b2f54
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Tue Jul 16 13:57:41 2024 +0200

        tdf#155447 qt a11y: Report accessible ID

[1] https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol/1527792-accessibilityidentifier

Change-Id: I43c40f5309467ddb00911297fadb6716500c2dcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170624
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Related tdf#158914: fix memory leaks by calling (auto)release selectors 2024-05-26T07:52:41+00:00 Patrick Luby guibmacdev@gmail.com 2024-05-25T00:26:23+00:00 0735a4306da86c6fa0390b85f1f391ec404b2699 Found the following memory leaks using Xcode's Instruments application: 1. Posting an NSAccessibilityUIElementDestroyedNotification notification causes [ AquaA11yWrapper isAccessibilityElement ] to be called on the object so mark the object as disposed before posting the destroyed notification and test for disposed in all of the standard NSAccessibility selectors to prevent any calls to likely disposed C++ accessibility objects. 2. In [ AquaA11yWrapper accessibilityHitTest: ], [ AquaA11yFactory wrapperForAccessibleContext: ] already retains the returned object so retaining it until the next call to this selector can lead to a memory leak when dragging selected cells in Calc to a new location. So autorelease the object so that transient objects stay alive but not past the next clearing of the autorelease pool. 3. [ AquaA11ySelectionWrapper selectedChildrenAttributeForElement: ] is expected to return an autoreleased object. 4. [ AquaA11yFactory wrapperForAccessible: ] is not a getter. It expects the caller to release the returned object. 5. CreateNSString() is not a getter. It expects the caller to release the returned string. Change-Id: I824740d7e3851b0c3e31e2c009860aa822c94222 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168034 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Found the following memory leaks using Xcode's Instruments application:

1. Posting an NSAccessibilityUIElementDestroyedNotification
   notification causes [ AquaA11yWrapper isAccessibilityElement ]
   to be called on the object so mark the object as disposed
   before posting the destroyed notification and test for disposed
   in all of the standard NSAccessibility selectors to prevent
   any calls to likely disposed C++ accessibility objects.

2. In [ AquaA11yWrapper accessibilityHitTest: ],
   [ AquaA11yFactory wrapperForAccessibleContext: ] already retains
   the returned object so retaining it until the next call to this
   selector can lead to a memory leak when dragging selected cells
   in Calc to a new location. So autorelease the object so that
   transient objects stay alive but not past the next clearing of
   the autorelease pool.

3. [ AquaA11ySelectionWrapper selectedChildrenAttributeForElement: ] is
   expected to return an autoreleased object.

4. [ AquaA11yFactory wrapperForAccessible: ] is not a getter. It
   expects the caller to release the returned object.

5. CreateNSString() is not a getter. It expects the caller to
   release the returned string.

Change-Id: I824740d7e3851b0c3e31e2c009860aa822c94222
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168034
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Partial fix tdf#155376 use NSAccessibilityElement instead of NSView 2023-06-07T19:48:54+00:00 Patrick Luby plubius@neooffice.org 2023-06-07T17:53:39+00:00 75dc3a54fca8b2dc775ba007190d8c2e188f1c0a On macOS, accessibility is implemented by creating a native NSView for each C++ accessible element. The problem with using an NSView for each element is that NSViews are very slow to add to or remove from an NSWindow once the number of NSViews is more than a thousand or so. Fortunately, Apple added a protocol that allows adding a native accessible element using the lightweight NSAccessiblityElement class. The topmost NSAccessiblityElement elements are connected to the single SalFrameView in each NSWindow but since NSAccessiblityElements are not NSViews, they are not connected to any of NSWindow's event or draw dispatching. This makes NSAccessiblityElements significantly faster to add to or remove from an NSWindow with no apparent loss in functionality. Note: this change is a subset of the LibreOffice 4.4 code changes that I wrote for NeoOffice. Change-Id: I408108d57217db407512dfa3457fe26d2ab455de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <plubius@neooffice.org>
On macOS, accessibility is implemented by creating a native NSView
for each C++ accessible element. The problem with using an NSView
for each element is that NSViews are very slow to add to or remove from
an NSWindow once the number of NSViews is more than a thousand or so.

Fortunately, Apple added a protocol that allows adding a native
accessible element using the lightweight NSAccessiblityElement class.
The topmost NSAccessiblityElement elements are connected to the single
SalFrameView in each NSWindow but since NSAccessiblityElements are not
NSViews, they are not connected to any of NSWindow's event or draw
dispatching. This makes NSAccessiblityElements significantly faster to
add to or remove from an NSWindow with no apparent loss in functionality.

Note: this change is a subset of the LibreOffice 4.4 code changes that I
wrote for NeoOffice.

Change-Id: I408108d57217db407512dfa3457fe26d2ab455de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152717
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Patrick Luby <plubius@neooffice.org>
reduce memory overhead of AquaA11yWrapper 2023-06-02T06:03:00+00:00 Noel Grandin noel.grandin@collabora.co.uk 2023-06-01T12:24:41+00:00 7acc7660a752497a546263d28e82a2e8f61fd702 we can allocate this internally, which reduces the number of heap allocations we need to do Change-Id: Id5298e70b6816cd65d8285ceea846dc8e9e4b39d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152489 Reviewed-by: Patrick Luby <plubius@neooffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
we can allocate this internally, which reduces the number of
heap allocations we need to do

Change-Id: Id5298e70b6816cd65d8285ceea846dc8e9e4b39d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152489
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
tdf#143148: Use pragma once instead of include guards 2021-08-11T13:17:11+00:00 Zeynep Yavuz zeynepyavuz2001@hotmail.com 2021-08-10T19:28:42+00:00 b0a75847738060266ed1b0d5c046132b97e4e158 Change-Id: I483d494a11b951fd415a314fddd4823db11dcb44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120295 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I483d494a11b951fd415a314fddd4823db11dcb44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120295
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>