office-gobmx/include/vcl/vclevent.hxx
Michael Weghorn 593923ee10 tdf#160806 tdf#160837 gtk3 a11y: Drop VclEventId::ToolboxButtonStateChanged
Similar to how the previous

    Change-Id: I00e62016ced2fbb8796960671f5e58a3ceac4b29
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon May 6 14:44:36 2024 +0200

        tdf#160806 tdf#160837 gtk3 a11y: Drop handling of some VclEventIds

dropped handling for `VclEventId::WindowGetFocus`
and `VclEventId::ObjectDying` in the gtk3 a11y bridge,
do the same for `VclEventId::ToolboxButtonStateChanged`.

And drop `VclEventId::ObjectDying` completely, as the
gtk3 a11y bridge was the only place processing it.

That event and the handling had been introduced in

    commit 3b40f50234
    Author: Ivo Hinkelmann <ihi@openoffice.org>
    Date:   Tue Feb 5 11:30:51 2008 +0000

        INTEGRATION: CWS fwk83_SRC680 (1.7.186); FILE MERGED
        2008/01/30 12:40:39 obr 1.7.186.2: fix for fedora tinderbox (64bit)
        2008/01/15 23:49:28 obr 1.7.186.1: #i70872# create wrapper for toolbox items that change state

    commit a1cbbd113d
    Author: Ivo Hinkelmann <ihi@openoffice.org>
    Date:   Tue Feb 5 11:30:25 2008 +0000

        INTEGRATION: CWS fwk83_SRC680 (1.51.160); FILE MERGED
        2008/01/14 14:35:26 cd 1.51.160.1: #i70872# Added VCLEVENT_TOOLBOX_BUTTONCHANGED to notify accessibility implementation that an action happens to a toolbox button

    commit 3f1afd1788
    Author: Ivo Hinkelmann <ihi@openoffice.org>
    Date:   Tue Feb 5 11:29:57 2008 +0000

        INTEGRATION: CWS fwk83_SRC680 (1.2.262); FILE MERGED
        2008/01/14 14:35:26 cd 1.2.262.1: #i70872# Added VCLEVENT_TOOLBOX_BUTTONCHANGED to notify accessibility implementation that an action happens to a toolbox button

to ensure that an a11y object is created for toolbar
buttons whose state changes, so that the corresponding
a11y events are forwarded to the platform layer, see
the referenced OOo bug #i70872# [1] for more details.

This seems to be no longer necessary.
By now, at least the scenario of toggling the
bold/italics/underline status of text is
announced just fine by Orca 46.1-1 on Debian
testing with this change in place.

(FWIW, tdf#123864 and the corresponding commits are more
recent tickets/commits related to the topic.)

Like for the above-mentioned change,
dropping that handling addresses another case where the
work window/root pane's a11y object when walking up
the a11y hierarchy would be problematic, as it doesn't
take into account the GtkWidget hierarchy.

Sample backtrace of how the "problematic" a11y object
was created (frame 1 below is the one where the a11y object
with role root pane is created.)

    1  atk_object_wrapper_new                                              atkwrapper.cxx             983  0x7f620365672b
    2  atk_object_wrapper_ref                                              atkwrapper.cxx             948  0x7f62036560a0
    3  atk_object_wrapper_new                                              atkwrapper.cxx             1000 0x7f6203656952
    4  atk_object_wrapper_ref                                              atkwrapper.cxx             948  0x7f62036560a0
    5  atk_object_wrapper_new                                              atkwrapper.cxx             1000 0x7f6203656952
    6  atk_object_wrapper_ref                                              atkwrapper.cxx             948  0x7f62036560a0
    7  atk_object_wrapper_new                                              atkwrapper.cxx             1000 0x7f6203656952
    8  atk_object_wrapper_ref                                              atkwrapper.cxx             948  0x7f62036560a0
    9  create_wrapper_for_child                                            atkutil.cxx                359  0x7f620364c740
    10 handle_toolbox_buttonchange                                         atkutil.cxx                376  0x7f620364c1ef
    11 WindowEventHandler                                                  atkutil.cxx                438  0x7f620364bd7f
    12 Link<VclSimpleEvent&, void>::Call                                   link.hxx                   111  0x7f620dfd4ef8
    13 VclEventListeners::Call                                             vclevent.cxx               46   0x7f620dfd3f1a
    14 Application::ImplCallEventListeners                                 svapp.cxx                  725  0x7f620df96b0d
    15 vcl::Window::CallEventListeners                                     event.cxx                  225  0x7f620d59f6ee
    16 ToolBox::SetItemState                                               toolbox2.cxx               1197 0x7f620d6afd81
    17 ToolBox::CheckItem                                                  toolbox.hxx                515  0x7f6214502c53
    18 (anonymous namespace)::PopupMenuToolbarController::statusChanged    popuptoolbarcontroller.cxx 180  0x7f621454205d
    19 (anonymous namespace)::GenericPopupToolbarController::statusChanged popuptoolbarcontroller.cxx 373  0x7f6214540855
    20 SfxDispatchController_Impl::addStatusListener                       unoctitm.cxx               797  0x7f6213090e95
    21 SfxOfficeDispatch::addStatusListener                                unoctitm.cxx               279  0x7f6213090ade
    22 svt::ToolboxController::bindListener                                toolboxcontroller.cxx      558  0x7f620fe9fbce
    23 svt::ToolboxController::update                                      toolboxcontroller.cxx      235  0x7f620fe9f207
    24 framework::ToolBarManager::UpdateControllers                        toolbarmanager.cxx         726  0x7f62145b0f25
    25 framework::ToolBarManager::AsyncUpdateControllersHdl                toolbarmanager.cxx         2291 0x7f62145bdbfc
    26 framework::ToolBarManager::LinkStubAsyncUpdateControllersHdl        toolbarmanager.cxx         2278 0x7f62145aff9d
    27 Link<Timer *, void>::Call                                           link.hxx                   111  0x7f620dfbc618
    28 Timer::Invoke                                                       timer.cxx                  75   0x7f620dfbc46c
    29 Scheduler::CallbackTaskScheduling                                   scheduler.cxx              509  0x7f620df5fa08
    30 SalTimer::CallCallback                                              saltimer.hxx               54   0x7f620368b566
    31 sal_gtk_timeout_dispatch                                            gtkdata.cxx                733  0x7f620368a573
    32 ??                                                                                                  0x7f62097110d9
    33 ??                                                                                                  0x7f6209714317
    34 g_main_context_iteration                                                                            0x7f6209714930
    35 GtkSalData::Yield                                                   gtkdata.cxx                405  0x7f62036888ef
    36 GtkInstance::DoYield                                                gtkinst.cxx                435  0x7f620368dd73
    37 ImplYield                                                           svapp.cxx                  378  0x7f620df94dfc
    38 Application::Yield                                                  svapp.cxx                  466  0x7f620df9470b
    39 Application::Execute                                                svapp.cxx                  353  0x7f620df944a2
    40 desktop::Desktop::Main                                              app.cxx                    1615 0x7f62171254fc
    41 ImplSVMain                                                          svmain.cxx                 229  0x7f620dfb760e
    42 SVMain                                                              svmain.cxx                 261  0x7f620dfb9659
    43 soffice_main                                                        sofficemain.cxx            93   0x7f62171a7eb3
    44 sal_main                                                            main.c                     51   0x56162eceea5d
    45 main                                                                main.c                     49   0x56162eceea37

[1] https://bz.apache.org/ooo/show_bug.cgi?id=70872

Change-Id: I7409806071a00f32b201b08a831dc6941f072047
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167209
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-05-07 06:06:01 +02:00

220 lines
6.3 KiB
C++

/* -*- 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 .
*/
#ifndef INCLUDED_VCL_VCLEVENT_HXX
#define INCLUDED_VCL_VCLEVENT_HXX
#include <vcl/dllapi.h>
#include <vcl/vclptr.hxx>
class Menu;
namespace com::sun::star::accessibility {
class XAccessible;
}
namespace vcl
{
class Window;
}
enum class VclEventId
{
NONE,
ApplicationDataChanged, // pData = DataChangedEvent*
ButtonClick,
CheckboxToggle,
ComboboxDeselect,
ComboboxDoubleClick,
ComboboxItemAdded, // pData = itempos
ComboboxItemRemoved, // pData = itempos, -1=All
ComboboxSelect,
ComboboxSetText,
ControlGetFocus,
ControlLoseFocus,
DropdownClose,
DropdownOpen,
DropdownPreOpen,
DropdownSelect,
EditCaretChanged,
EditModify,
EditSelectionChanged,
ExtTextInput,
EndExtTextInput,
ItemCollapsed,
ItemExpanded,
ListboxDoubleClick,
ListboxFocus,
ListboxItemAdded, // pData = itempos
ListboxItemRemoved, // pData = itempos, -1=All
ListboxScrolled,
ListboxSelect,
ListboxTreeFocus,
ListboxTreeSelect,
MenuAccessibleNameChanged,
MenuActivate,
MenuDeactivate,
MenuDehighlight,
MenuDisable,
MenuEnable,
MenuHide,
MenuHighlight,
MenuInsertItem,
MenuItemChecked,
MenuItemRoleChanged,
MenuItemTextChanged,
MenuItemUnchecked,
MenuRemoveItem,
MenuSelect,
MenuShow,
MenuSubmenuActivate,
MenuSubmenuChanged,
MenuSubmenuDeactivate,
ObjectDying,
PushbuttonToggle,
RadiobuttonToggle,
RoadmapItemSelected,
ScrollbarEndScroll,
ScrollbarScroll,
SpinbuttonDown,
SpinbuttonUp,
SpinfieldDown,
SpinfieldFirst,
SpinfieldLast,
SpinfieldUp,
StatusbarAllItemsRemoved,
StatusbarDrawItem, // pData = itemid
StatusbarHideItem, // pData = itemid
StatusbarItemAdded, // pData = itemid
StatusbarItemRemoved, // pData = itemid
StatusbarNameChanged, // pData = itemid
StatusbarShowItem, // pData = itemid
TabbarPageActivated, // pData = pageid
TabbarPageDeactivated, // pData = pageid
TabbarPageInserted, // pData = pageid
TabbarPageMoved, // pData = Pair( pagepos_old, pagepos_new )
TabbarPageRemoved, // pData = pageid
TabbarPageSelected, // pData = pageid
TabbarPageTextChanged, // pData = pageid
TableRowSelect,
TabpageActivate, // pData = pageid
TabpageDeactivate, // pData = pageid
TabpageInserted, // pData = pageid
TabpagePageTextChanged, // pData = pageid
TabpageRemoved, // pData = pageid
TabpageRemovedAll,
ToolboxActivate,
ToolboxAllItemsChanged,
ToolboxClick,
ToolboxDeactivate,
ToolboxDoubleClick,
ToolboxFormatChanged, // request new layout
ToolboxHighlight,
ToolboxHighlightOff, // pData = itempos
ToolboxItemAdded, // pData = itempos
ToolboxItemDisabled, // pData = itempos
ToolboxItemEnabled, // pData = itempos
ToolboxItemRemoved, // pData = itempos
ToolboxItemTextChanged, // pData = itempos
ToolboxItemUpdated,
ToolboxItemWindowChanged,
ToolboxSelect,
WindowActivate,
WindowChildDestroyed, // pData = vcl::Window*
WindowClose,
WindowCommand, // pData = CommandEvent*
WindowDataChanged, // pData = DataChangedEvent*
WindowDeactivate, // pData = vcl::Window* = pPrevActiveWindow
WindowDisabled,
WindowDocking,
WindowEnabled,
WindowEndDocking, // pData = EndDockingData
WindowEndPopupMode, // pData = EndPopupModeData
WindowFrameTitleChanged,// pData = OUString* = oldTitle
WindowGetFocus,
WindowHide,
WindowKeyInput, // pData = KeyEvent*
WindowKeyUp, // pData = KeyEvent*
WindowLoseFocus,
WindowMenubarAdded, // pData = pMenuBar
WindowMenubarRemoved, // pData = pMenuBar
WindowMinimize,
WindowMouseButtonDown, // pData = MouseEvent*
WindowMouseButtonUp, // pData = MouseEvent*
WindowMouseMove, // pData = MouseEvent*
WindowMove,
WindowNormalize,
WindowPaint, // pData = Rectangle*
WindowPrepareToggleFloating, // pData = bool
WindowResize,
WindowShow,
WindowStartDocking, // pData = DockingData
WindowToggleFloating,
WindowGestureEvent,
};
class VCL_DLLPUBLIC VclSimpleEvent
{
private:
VclEventId nId;
VclSimpleEvent(VclSimpleEvent const &) = delete;
VclSimpleEvent& operator =(VclSimpleEvent const &) = delete;
public:
VclSimpleEvent( VclEventId n ) { nId = n; }
virtual ~VclSimpleEvent() {}
VclEventId GetId() const { return nId; }
};
class VCL_DLLPUBLIC VclWindowEvent final : public VclSimpleEvent
{
private:
VclPtr<vcl::Window> pWindow;
void* pData;
public:
VclWindowEvent( vcl::Window* pWin, VclEventId n, void* pDat );
virtual ~VclWindowEvent() override;
vcl::Window* GetWindow() const { return pWindow; }
void* GetData() const { return pData; }
};
class VCL_DLLPUBLIC VclMenuEvent final : public VclSimpleEvent
{
private:
VclPtr<Menu> pMenu;
sal_uInt16 mnPos;
VclMenuEvent(VclMenuEvent const &) = delete;
VclMenuEvent& operator =(VclMenuEvent const &) = delete;
public:
VclMenuEvent( Menu* pM, VclEventId n, sal_uInt16 nPos );
virtual ~VclMenuEvent() override;
Menu* GetMenu() const;
sal_uInt16 GetItemPos() const { return mnPos; }
};
#endif // INCLUDED_VCL_VCLEVENT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */