diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-07-03 20:29:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-08 10:10:11 +0200 |
commit | 8d8e6c84e512c1a8b33aac75965b84481d1a1d13 (patch) | |
tree | 9ed209d057081d4283eb44b51c0d9af18f976eab /offapi | |
parent | 911ac42485b690df5cbbff6e3c04b111c1723aca (diff) |
[API CHANGE] Drop css::accessibility::XAccessibleStateSet
which is internal API, unused (as far as I can tell) by external
users.
This state is purely a bitset
(as implemented by utl::AccessibleStateSetHelper)
so we can just return it as a 64-bit value.
This shaves significant time off the performance profiles
of code that loads very complex shapes, because this state
is frequently used, and we no longer need to allocate a return
value on the heap for every call.
Change-Id: Icf1b3bd367c256646ae9015f9127025f59459c2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136786
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'offapi')
6 files changed, 44 insertions, 138 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 4ed97c8e5ddb..e8163212b5ea 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -1650,7 +1650,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/accessibility,\ XAccessibleMultiLineText \ XAccessibleRelationSet \ XAccessibleSelection \ - XAccessibleStateSet \ XAccessibleTable \ XAccessibleTableSelection \ XAccessibleText \ diff --git a/offapi/com/sun/star/accessibility/AccessibleStateType.idl b/offapi/com/sun/star/accessibility/AccessibleStateType.idl index 26923b75c192..099dd6510901 100644 --- a/offapi/com/sun/star/accessibility/AccessibleStateType.idl +++ b/offapi/com/sun/star/accessibility/AccessibleStateType.idl @@ -32,52 +32,56 @@ module com { module sun { module star { module accessibility { include future extensions to the set of roles we have to use constants here.</p> + <p>These states are giving values corresponding to the bits of a 64-bit + value, since we OR them together to create bitsets to represent the + combinated state of an accessibility object .</p> + @since OOo 1.1.2 */ constants AccessibleStateType { /** Indicates an invalid state. */ - const short INVALID = 0; + const hyper INVALID = 0; /** Indicates a window is currently the active window. */ - const short ACTIVE = 1; + const hyper ACTIVE = 1; /** Indicates that the object is armed. */ - const short ARMED = 2; + const hyper ARMED = 2; /** Indicates the current object is busy. */ - const short BUSY = 3; + const hyper BUSY = 4; /** Indicates this object is currently checked. */ - const short CHECKED = 4; + const hyper CHECKED = 8; /** User interface object corresponding to this object no longer exists. <p>Indicates the user interface object corresponding to this object no longer exists.</p> */ - const short DEFUNC = 5; + const hyper DEFUNC = 16; /** Indicates the user can change the contents of this object. */ - const short EDITABLE = 6; + const hyper EDITABLE = 32; /** Indicates this object is enabled. */ - const short ENABLED = 7; + const hyper ENABLED = 64; /** Indicates this object allows progressive disclosure of its children. */ - const short EXPANDABLE = 8; + const hyper EXPANDABLE = 128; /** Indicates this object is expanded. */ - const short EXPANDED = 9; + const hyper EXPANDED = 256; /** Object can accept the keyboard focus. @@ -85,27 +89,27 @@ constants AccessibleStateType events resulting from typing on the keyboard will normally be passed to it when it has focus.</p> */ - const short FOCUSABLE = 10; + const hyper FOCUSABLE = 512; /** Indicates this object currently has the keyboard focus. */ - const short FOCUSED = 11; + const hyper FOCUSED = 1024; /** Indicates the orientation of this object is horizontal. */ - const short HORIZONTAL = 12; + const hyper HORIZONTAL = 2048; /** Indicates this object is minimized and is represented only by an icon. */ - const short ICONIFIED = 13; + const hyper ICONIFIED = 4096; /** Sometimes UI elements can have a state indeterminate. This can happen e.g. if a check box reflects the bold state of text in a text processor. When the current selection contains text which is bold and also text which is not bold, the state is indeterminate. */ - const short INDETERMINATE = 14; + const hyper INDETERMINATE = 8192; /** Indicates the most (all) children are transient and it is not necessary to add listener to the children. Only the active descendant @@ -119,38 +123,38 @@ constants AccessibleStateType children to add listener. Only the active descendant should get listener if it is not transient. */ - const short MANAGES_DESCENDANTS = 15; + const hyper MANAGES_DESCENDANTS = 16384; /** Object is modal. <p>Indicates something must be done with this object before the user can interact with an object in a different window.</p> */ - const short MODAL = 16; + const hyper MODAL = 32768; /** Indicates this (text) object can contain multiple lines of text */ - const short MULTI_LINE = 17; + const hyper MULTI_LINE = 65536; /** More than one child may be selected at the same time. <p>Indicates this object allows more than one of its children to be selected at the same time.</p> */ - const short MULTI_SELECTABLE = 18; + const hyper MULTI_SELECTABLE = 131072; /** Indicates this object paints every pixel within its rectangular region. */ - const short OPAQUE = 19; + const hyper OPAQUE = 262144; /** Indicates this object is currently pressed. */ - const short PRESSED = 20; + const hyper PRESSED = 524288; /** Indicates the size of this object is not fixed. */ - const short RESIZABLE = 21; + const hyper RESIZABLE = 1048576; /** Object is selectable. @@ -158,7 +162,7 @@ constants AccessibleStateType children to be selected, and that this child is one of those children that can be selected.</p> */ - const short SELECTABLE = 22; + const hyper SELECTABLE = 2097152; /** Object is selected. @@ -166,11 +170,11 @@ constants AccessibleStateType children to be selected, and that this child is one of those children that has been selected.</p> */ - const short SELECTED = 23; + const hyper SELECTED = 4194304; /** Indicates this object is sensitive. */ - const short SENSITIVE = 24; + const hyper SENSITIVE = 8388608; /** Object is displayed on the screen. @@ -180,26 +184,26 @@ constants AccessibleStateType though, not necessarily visible on the screen because it may be occluded by other objects.</p> */ - const short SHOWING = 25; + const hyper SHOWING = 16777216; /** Indicates this (text) object can contain only a single line of text */ - const short SINGLE_LINE = 26; + const hyper SINGLE_LINE = 33554432; /** Object information is stale and might not be up to date <p>Indicates that the information that is returned from this object might be out of sync with the application.</p> */ - const short STALE = 27; + const hyper STALE = 67108864; /** Indicates this object is transient. */ - const short TRANSIENT= 28; + const hyper TRANSIENT= 134217728; /** Indicates the orientation of this object is vertical. */ - const short VERTICAL = 29; + const hyper VERTICAL = 268435456; /** Object wants to be displayed on the screen. @@ -209,31 +213,31 @@ constants AccessibleStateType set the VISIBLE state and the object lies at least partly in the visible area of its parent.</p> */ - const short VISIBLE = 30; + const hyper VISIBLE = 536870912; // The following constants have been introduced with the IA2 CWS: // MOVEABLE only exists in MSAA/IA2, but not in ATK/JAA/NSAccessibility. /** Indicates the position of the object is not fixed. */ - const short MOVEABLE = 31; + const hyper MOVEABLE = 1073741824; // DEFAULT exists in MSAA/IA2, and now also in ATK and NSAccessibility. /** Indicates the object is the default button in a window */ - const short DEFAULT = 32; + const hyper DEFAULT = 2147483648; // OFFSCREEN only exists in MSAA/IA2, but not in ATK/JAA/NSAccessibility. // MT: Shouldn't this be the same like !SHOWING in UAA/ATK? /** Indicates the object is outside of the screen area */ - const short OFFSCREEN = 33; + const hyper OFFSCREEN = 4294967296; // COLLAPSED exists in MSAA/IA2, and now also in JAA, but not in ATK/NSAccessibility. In NSAccessibility, there is a notification for collapse. // In opposite to MSAA, UAA has EXPANDABLE, so EXPANDABLE && !EXPANDED should be the same like COLLAPSED. /** Indicates that the object is collapsed */ - const short COLLAPSE = 34; + const hyper COLLAPSE = 8589934592; }; diff --git a/offapi/com/sun/star/accessibility/XAccessibleContext.idl b/offapi/com/sun/star/accessibility/XAccessibleContext.idl index c400e6b1abdf..deab36ea4f08 100644 --- a/offapi/com/sun/star/accessibility/XAccessibleContext.idl +++ b/offapi/com/sun/star/accessibility/XAccessibleContext.idl @@ -22,7 +22,6 @@ module com { module sun { module star { module accessibility { interface XAccessible; interface XAccessibleRelationSet; interface XAccessibleSelection; - interface XAccessibleStateSet; /** Implement this interface for exposing various aspects of a class's content. @@ -153,18 +152,12 @@ interface XAccessibleContext : ::com::sun::star::uno::XInterface /** Returns the set of states that are currently active for this object. - <p>The returned state set is a copy: Changing the returned state set - will not be reflected by changing the object's set of states. See - the documentation of XAccessibleStateSet for a + <p>See the documentation of XAccessibleStateType for a description of the individual states.</p> - @return - A reference to this object's state set or an empty reference if - states are not supported. - - @see XAccessibleStateSet + @see XAccessibleStateType */ - XAccessibleStateSet getAccessibleStateSet (); + hyper getAccessibleStateSet (); /** Returns the locale of the component. diff --git a/offapi/com/sun/star/accessibility/XAccessibleStateSet.idl b/offapi/com/sun/star/accessibility/XAccessibleStateSet.idl deleted file mode 100644 index f3b9ea0b7f7d..000000000000 --- a/offapi/com/sun/star/accessibility/XAccessibleStateSet.idl +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -module com { module sun { module star { module accessibility { - - interface XAccessible; - -/** Implement this interface to represent a set of states. - - <p>The interface XAccessibleStateSet represents a set of - states of an accessible object. It can hold any combination of states - defined by the constants collection - AccessibleStateType.</p> - - @since OOo 1.1.2 -*/ -interface XAccessibleStateSet : ::com::sun::star::uno::XInterface -{ - /** Checks whether the current state set is empty. - - @return - Returns `TRUE` if there is no state in this state set and - `FALSE` if there is at least one set state in it. - */ - boolean isEmpty (); - - /** Checks if the given state is a member of the state set of the called - object. - - @param aState - The state for which to check membership. This has to be one of - the constants of AccessibleStateType. - - @return - Returns `TRUE` if the given state is a member of this object's - state set and `FALSE` otherwise. - */ - boolean contains ([in] short aState); - - /** Checks if all of the given states are in the state set of the called - object. - - @param aStateSet - This sequence of states is interpreted as set and every of its - members, duplicates are ignored, is checked for membership in - this object's state set. Each state has to be one of the - constants of AccessibleStateType. - - @return - Returns `TRUE` if all states of the given state set are members - of this object's state set. `FALSE` is returned if at least - one of the states in the given state is not a member of this - object's state set. - */ - boolean containsAll ([in] sequence<short> aStateSet); - - /** Get all currently set states as a sequence of state ids. - - <p>The purpose of this function is to reduce the communication - between accessibility objects and AT. Without this function an - AT-Tool had to call contains() for every state - type. Now a single call is sufficient.</p> - - @return - The returned sequence contains one entry for every currently set - state. This entry is the id of that state. The order of the - states in the sequence is undefined. - */ - sequence<short> getStates (); -}; - -}; }; }; }; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/drawing/AccessibleImageBullet.idl b/offapi/com/sun/star/drawing/AccessibleImageBullet.idl index cea13ef222cc..69e310ba36ea 100644 --- a/offapi/com/sun/star/drawing/AccessibleImageBullet.idl +++ b/offapi/com/sun/star/drawing/AccessibleImageBullet.idl @@ -47,7 +47,7 @@ service AccessibleImageBullet within this bullet appears. <li>There are no relations. <li>The following states are supported by the - ::com::sun::star::accessibility::XAccessibleStateSet returned by + accessible state bitset returned by ::com::sun::star::accessibility::XAccessibleContext::getAccessibleStateSet(). <ul> <li>::com::sun::star::accessibility::AccessibleStateType::DEFUNC diff --git a/offapi/com/sun/star/text/AccessibleParagraphView.idl b/offapi/com/sun/star/text/AccessibleParagraphView.idl index b636be55e889..4b5a9d23e457 100644 --- a/offapi/com/sun/star/text/AccessibleParagraphView.idl +++ b/offapi/com/sun/star/text/AccessibleParagraphView.idl @@ -61,7 +61,7 @@ service AccessibleParagraphView the paragraph. <li>There are no relations. <li>The following states are supported by the - ::com::sun::star::accessibility::XAccessibleStateSet returned by + accessible state bitset returned by ::com::sun::star::accessibility::XAccessibleContext::getAccessibleStateSet(). <ul> <li>::com::sun::star::accessibility::AccessibleStateType::DEFUNC |