From fbbe7c9e3ef9e09d4ddf9f0d1f54843294643620 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Aug 2021 20:14:47 +0100 Subject: vcl/accel.hxx is not used outside vcl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6b3debabe2c927f5ce3962fe97d944c07153028b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120013 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/accel.hxx | 84 ------------------------------------- solenv/clang-format/excludelist | 2 +- vcl/inc/accel.hxx | 76 +++++++++++++++++++++++++++++++++ vcl/inc/pch/precompiled_vcl.hxx | 17 +++++--- vcl/source/treelist/treelistbox.cxx | 2 +- vcl/source/window/accel.cxx | 2 +- vcl/source/window/accmgr.cxx | 2 +- vcl/source/window/dialog.cxx | 2 +- vcl/source/window/dockwin.cxx | 2 +- vcl/source/window/syswin.cxx | 2 +- vcl/source/window/toolbox.cxx | 2 +- 11 files changed, 95 insertions(+), 98 deletions(-) delete mode 100644 include/vcl/accel.hxx create mode 100644 vcl/inc/accel.hxx diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx deleted file mode 100644 index f48c05c21ba8..000000000000 --- a/include/vcl/accel.hxx +++ /dev/null @@ -1,84 +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 . - */ - -#ifndef INCLUDED_VCL_ACCEL_HXX -#define INCLUDED_VCL_ACCEL_HXX - -#include -#include -#include -#include -#include - -class ImplAccelData; -class ImplAccelEntry; -class CommandEvent; -namespace vcl { class Window; } - -class UNLESS_MERGELIBS(VCL_DLLPUBLIC) Accelerator -{ - friend class ImplAccelManager; - -private: - std::unique_ptr mpData; - Link maActivateHdl; - Link maSelectHdl; - - // Will be set by AcceleratorManager - sal_uInt16 mnCurId; - bool* mpDel; - - SAL_DLLPRIVATE void ImplInit(); - SAL_DLLPRIVATE void ImplCopyData( ImplAccelData& rAccelData ); - SAL_DLLPRIVATE void ImplDeleteData(); - SAL_DLLPRIVATE void ImplInsertAccel( - sal_uInt16 nItemId, - const vcl::KeyCode& rKeyCode, - bool bEnable, - Accelerator* pAutoAccel ); - - SAL_DLLPRIVATE ImplAccelEntry* - ImplGetAccelData( const vcl::KeyCode& rKeyCode ) const; - -public: - Accelerator(); - Accelerator( const Accelerator& rAccel ); - ~Accelerator(); - - void Activate(); - void Select(); - - void InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ); - - sal_uInt16 GetCurItemId() const { return mnCurId; } - - sal_uInt16 GetItemCount() const; - sal_uInt16 GetItemId( sal_uInt16 nPos ) const; - - Accelerator* GetAccel( sal_uInt16 nItemId ) const; - - void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; } - void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } - - Accelerator& operator=( const Accelerator& rAccel ); -}; - -#endif // INCLUDED_VCL_ACCEL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 4a73ed236375..c78867fd03db 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6351,7 +6351,6 @@ include/vcl/ITiledRenderable.hxx include/vcl/ImageTree.hxx include/vcl/Scanline.hxx include/vcl/abstdlg.hxx -include/vcl/accel.hxx include/vcl/accessiblefactory.hxx include/vcl/accessibletable.hxx include/vcl/accessibletableprovider.hxx @@ -14433,6 +14432,7 @@ vcl/inc/ResampleKernel.hxx vcl/inc/WidgetThemeLibraryTypes.hxx vcl/inc/bitmap/bmpfast.hxx vcl/inc/accel.h +vcl/inc/accel.hxx vcl/inc/accmgr.hxx vcl/inc/brdwin.hxx vcl/inc/bubblewindow.hxx diff --git a/vcl/inc/accel.hxx b/vcl/inc/accel.hxx new file mode 100644 index 000000000000..53677cfcfb7c --- /dev/null +++ b/vcl/inc/accel.hxx @@ -0,0 +1,76 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include +#include + +class ImplAccelData; +class ImplAccelEntry; +class CommandEvent; + +class Accelerator +{ + friend class ImplAccelManager; + +private: + std::unique_ptr mpData; + Link maActivateHdl; + Link maSelectHdl; + + // Will be set by AcceleratorManager + sal_uInt16 mnCurId; + bool* mpDel; + + void ImplInit(); + void ImplCopyData( ImplAccelData& rAccelData ); + void ImplDeleteData(); + void ImplInsertAccel(sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode, + bool bEnable, Accelerator* pAutoAccel); + + ImplAccelEntry* ImplGetAccelData( const vcl::KeyCode& rKeyCode ) const; + +public: + Accelerator(); + Accelerator( const Accelerator& rAccel ); + ~Accelerator(); + + void Activate(); + void Select(); + + void InsertItem( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode ); + + sal_uInt16 GetCurItemId() const { return mnCurId; } + + sal_uInt16 GetItemCount() const; + sal_uInt16 GetItemId( sal_uInt16 nPos ) const; + + Accelerator* GetAccel( sal_uInt16 nItemId ) const; + + void SetActivateHdl( const Link& rLink ) { maActivateHdl = rLink; } + void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } + + Accelerator& operator=( const Accelerator& rAccel ); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index a7ef0ce02759..cf78b4ff9e0e 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-04-08 13:57:45 using: + Generated on 2021-08-04 20:14:15 using: ./bin/update_pch vcl vcl --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -35,11 +35,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -62,8 +62,11 @@ #if PCH_LEVEL >= 2 #include #include +#include #include +#include #include +#include #include #include #include @@ -116,6 +119,8 @@ #include #include #include +#include +#include #include #include #include @@ -180,9 +185,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -246,12 +248,14 @@ #include #include #include +#include #include #include #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #include #include +#include #include #include #include @@ -282,7 +286,6 @@ #include #include #include -#include #include #include #include @@ -302,6 +305,7 @@ #include #include #include +#include #include #include #include @@ -330,6 +334,7 @@ #include #include #include +#include #include #include #include diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 2338292820e9..ee4b01981007 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index c580679bd8b0..1a0039bd2e0c 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 5ab0279b3a10..c588bb4d8f5a 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -19,7 +19,7 @@ #include -#include +#include #include #include diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 9cb7fb142c5f..ca5298bef0e4 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -41,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 619d8fbb6093..892a1cf95727 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -29,6 +28,7 @@ #include #include +#include #include #include #include diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 3d8a2dd18a06..c1a946d04007 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include +#include #include #include #include diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 38704c2dae69..ee1359ca0491 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include #include +#include #include #include #include -- cgit