cui/source/inc/SpellDialog.hxx | 1 cui/source/inc/cuigrfflt.hxx | 1 cui/source/inc/cuitabarea.hxx | 1 cui/source/inc/grfpage.hxx | 1 cui/source/inc/measure.hxx | 1 cui/source/inc/numfmt.hxx | 1 cui/source/inc/textattr.hxx | 1 dbaccess/source/ui/app/AppIconControl.hxx | 1 include/svx/dlgctrl.hxx | 1 include/vcl/jsdialog/executor.hxx | 1 include/vcl/weld/DrawingArea.hxx | 107 ++++++++++++++++++++++++++++++ include/vcl/weld/customweld.hxx | 1 include/vcl/weld/weld.hxx | 89 ------------------------ vcl/inc/qt5/QtInstanceBuilder.hxx | 1 vcl/inc/qt5/QtInstanceDrawingArea.hxx | 1 vcl/inc/salvtables.hxx | 1 vcl/qt5/QtInstanceBuilder.cxx | 1 vcl/unx/gtk3/gtkinst.cxx | 1 18 files changed, 123 insertions(+), 89 deletions(-)
New commits: commit 840c354ed653174002cf42a44b9ab4dcb9b55ecc Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jan 14 16:08:54 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 15 01:35:52 2026 +0100 weld: Move weld::DrawingArea to own header Move the class out of weld.hxx into its own header, in order to make it easier to keep an overview and to avoid having to recompile ~all UI code when the class is modified. Change-Id: I6ab1b978da35f28bba6610b79dc6a71b723dd4ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197281 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index a496a83173c4..162c2bd28dae 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -29,6 +29,7 @@ #include <svx/weldeditview.hxx> #include <editeng/SpellPortions.hxx> #include <vcl/weld/ComboBox.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/ScrolledWindow.hxx> #include <vcl/weld/Toolbar.hxx> #include <vcl/weld/TreeView.hxx> diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx index 5fe64ed7d7da..22eb8b3fdba0 100644 --- a/cui/source/inc/cuigrfflt.hxx +++ b/cui/source/inc/cuigrfflt.hxx @@ -23,6 +23,7 @@ #include <svx/dlgctrl.hxx> #include <svx/rectenum.hxx> #include <vcl/weld/DialogController.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/MetricSpinButton.hxx> #include <vcl/weld/SpinButton.hxx> diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 2c02c54777a3..08aaf627691f 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -28,6 +28,7 @@ #include <svx/svdview.hxx> #include <vcl/hexcolorcontrol.hxx> #include <vcl/weld/ComboBox.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/MetricSpinButton.hxx> #include <vcl/weld/SpinButton.hxx> diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx index f0e5aa3492ef..48c9c19893e0 100644 --- a/cui/source/inc/grfpage.hxx +++ b/cui/source/inc/grfpage.hxx @@ -20,6 +20,7 @@ #pragma once #include <vcl/graph.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/MetricSpinButton.hxx> #include <vcl/weld/customweld.hxx> #include <sfx2/tabdlg.hxx> diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index 5a84ee78c4cf..a42da854a289 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -21,6 +21,7 @@ #include <sfx2/basedlgs.hxx> #include <svx/dlgctrl.hxx> #include <svx/measctrl.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/MetricSpinButton.hxx> #include <vcl/weld/SpinButton.hxx> diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 569170817395..218c1826fc01 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -23,6 +23,7 @@ #include <sfx2/tabdlg.hxx> #include <svx/langbox.hxx> #include <tools/color.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/SpinButton.hxx> #include <vcl/weld/TreeView.hxx> diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx index c1a13272edaa..d1986a550c52 100644 --- a/cui/source/inc/textattr.hxx +++ b/cui/source/inc/textattr.hxx @@ -20,6 +20,7 @@ #include <svx/dlgctrl.hxx> #include <svx/svdobjkind.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/MetricSpinButton.hxx> /************************************************************************* diff --git a/dbaccess/source/ui/app/AppIconControl.hxx b/dbaccess/source/ui/app/AppIconControl.hxx index 79618b75d1c5..119643df8f05 100644 --- a/dbaccess/source/ui/app/AppIconControl.hxx +++ b/dbaccess/source/ui/app/AppIconControl.hxx @@ -20,6 +20,7 @@ #include <sfx2/thumbnailview.hxx> #include <vcl/transfer.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/weld.hxx> #include <AppElementType.hxx> diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index c761e198fae2..eafdddc2512d 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -24,6 +24,7 @@ #include <svx/rectenum.hxx> #include <vcl/weld/ComboBox.hxx> #include <vcl/weld/DialogController.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/SpinButton.hxx> #include <vcl/weld/Toolbar.hxx> #include <vcl/weld/customweld.hxx> diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 053282dfa396..9d1d9b40809e 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -12,6 +12,7 @@ #include <vcl/dllapi.h> #include <vcl/uitest/uiobject.hxx> #include <vcl/weld/ComboBox.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/FormattedSpinButton.hxx> #include <vcl/weld/IconView.hxx> diff --git a/include/vcl/weld/DrawingArea.hxx b/include/vcl/weld/DrawingArea.hxx new file mode 100644 index 000000000000..243ed8469d94 --- /dev/null +++ b/include/vcl/weld/DrawingArea.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <vcl/dllapi.h> +#include <vcl/weld/weld.hxx> + +namespace weld +{ +class VCL_DLLPUBLIC DrawingArea : virtual public Widget +{ +public: + typedef std::pair<vcl::RenderContext&, const tools::Rectangle&> draw_args; + +protected: + Link<draw_args, void> m_aDrawHdl; + Link<Widget&, tools::Rectangle> m_aGetFocusRectHdl; + Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; + // if handler returns true, drag is disallowed + Link<DrawingArea&, bool> m_aDragBeginHdl; + // return position of cursor, fill OUString& with surrounding text + Link<OUString&, int> m_aGetSurroundingHdl; + // attempt to delete the range, return true if successful + Link<const Selection&, bool> m_aDeleteSurroundingHdl; + + OUString signal_query_tooltip(tools::Rectangle& rHelpArea) + { + return m_aQueryTooltipHdl.Call(rHelpArea); + } + + int signal_im_context_get_surrounding(OUString& rSurroundingText) + { + if (!m_aGetSurroundingHdl.IsSet()) + return -1; + return m_aGetSurroundingHdl.Call(rSurroundingText); + } + + bool signal_im_context_delete_surrounding(const Selection& rRange) + { + return m_aDeleteSurroundingHdl.Call(rRange); + } + +public: + void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; } + void connect_focus_rect(const Link<Widget&, tools::Rectangle>& rLink) + { + m_aGetFocusRectHdl = rLink; + } + void connect_query_tooltip(const Link<tools::Rectangle&, OUString>& rLink) + { + m_aQueryTooltipHdl = rLink; + } + void connect_drag_begin(const Link<DrawingArea&, bool>& rLink) { m_aDragBeginHdl = rLink; } + void connect_im_context_get_surrounding(const Link<OUString&, int>& rLink) + { + m_aGetSurroundingHdl = rLink; + } + void connect_im_context_delete_surrounding(const Link<const Selection&, bool>& rLink) + { + m_aDeleteSurroundingHdl = rLink; + } + virtual void queue_draw() = 0; + virtual void queue_draw_area(int x, int y, int width, int height) = 0; + + virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferable, + sal_uInt8 eDNDConstants) + = 0; + + virtual void set_cursor(PointerStyle ePointerStyle) = 0; + + virtual Point get_pointer_position() const = 0; + + virtual void set_input_context(const InputContext& rInputContext) = 0; + virtual void im_context_set_cursor_location(const tools::Rectangle& rCursorRect, + int nExtTextInputWidth) + = 0; + + // use return here just to generate matching VirtualDevices + virtual OutputDevice& get_ref_device() = 0; + + virtual rtl::Reference<comphelper::OAccessible> get_accessible_parent() = 0; + virtual a11yrelationset get_accessible_relation_set() = 0; + virtual AbsoluteScreenPixelPoint get_accessible_location_on_screen() = 0; + +private: + friend class ::LOKTrigger; + + virtual void click(const Point&) = 0; + + virtual void dblclick(const Point&){}; + + virtual void mouse_up(const Point&){}; + + virtual void mouse_down(const Point&){}; + + virtual void mouse_move(const Point&){}; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/vcl/weld/customweld.hxx b/include/vcl/weld/customweld.hxx index 7292c9b4c89c..d8d985af08a5 100644 --- a/include/vcl/weld/customweld.hxx +++ b/include/vcl/weld/customweld.hxx @@ -11,6 +11,7 @@ #include <comphelper/OAccessible.hxx> #include <vcl/weld/Builder.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/weld.hxx> class InputContext; diff --git a/include/vcl/weld/weld.hxx b/include/vcl/weld/weld.hxx index cdd4ad2ec799..92763dd1a365 100644 --- a/include/vcl/weld/weld.hxx +++ b/include/vcl/weld/weld.hxx @@ -963,95 +963,6 @@ public: void connect_expanded(const Link<Expander&, void>& rLink) { m_aExpandedHdl = rLink; } }; -class VCL_DLLPUBLIC DrawingArea : virtual public Widget -{ -public: - typedef std::pair<vcl::RenderContext&, const tools::Rectangle&> draw_args; - -protected: - Link<draw_args, void> m_aDrawHdl; - Link<Widget&, tools::Rectangle> m_aGetFocusRectHdl; - Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; - // if handler returns true, drag is disallowed - Link<DrawingArea&, bool> m_aDragBeginHdl; - // return position of cursor, fill OUString& with surrounding text - Link<OUString&, int> m_aGetSurroundingHdl; - // attempt to delete the range, return true if successful - Link<const Selection&, bool> m_aDeleteSurroundingHdl; - - OUString signal_query_tooltip(tools::Rectangle& rHelpArea) - { - return m_aQueryTooltipHdl.Call(rHelpArea); - } - - int signal_im_context_get_surrounding(OUString& rSurroundingText) - { - if (!m_aGetSurroundingHdl.IsSet()) - return -1; - return m_aGetSurroundingHdl.Call(rSurroundingText); - } - - bool signal_im_context_delete_surrounding(const Selection& rRange) - { - return m_aDeleteSurroundingHdl.Call(rRange); - } - -public: - void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; } - void connect_focus_rect(const Link<Widget&, tools::Rectangle>& rLink) - { - m_aGetFocusRectHdl = rLink; - } - void connect_query_tooltip(const Link<tools::Rectangle&, OUString>& rLink) - { - m_aQueryTooltipHdl = rLink; - } - void connect_drag_begin(const Link<DrawingArea&, bool>& rLink) { m_aDragBeginHdl = rLink; } - void connect_im_context_get_surrounding(const Link<OUString&, int>& rLink) - { - m_aGetSurroundingHdl = rLink; - } - void connect_im_context_delete_surrounding(const Link<const Selection&, bool>& rLink) - { - m_aDeleteSurroundingHdl = rLink; - } - virtual void queue_draw() = 0; - virtual void queue_draw_area(int x, int y, int width, int height) = 0; - - virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferable, - sal_uInt8 eDNDConstants) - = 0; - - virtual void set_cursor(PointerStyle ePointerStyle) = 0; - - virtual Point get_pointer_position() const = 0; - - virtual void set_input_context(const InputContext& rInputContext) = 0; - virtual void im_context_set_cursor_location(const tools::Rectangle& rCursorRect, - int nExtTextInputWidth) - = 0; - - // use return here just to generate matching VirtualDevices - virtual OutputDevice& get_ref_device() = 0; - - virtual rtl::Reference<comphelper::OAccessible> get_accessible_parent() = 0; - virtual a11yrelationset get_accessible_relation_set() = 0; - virtual AbsoluteScreenPixelPoint get_accessible_location_on_screen() = 0; - -private: - friend class ::LOKTrigger; - - virtual void click(const Point&) = 0; - - virtual void dblclick(const Point&){}; - - virtual void mouse_up(const Point&){}; - - virtual void mouse_down(const Point&){}; - - virtual void mouse_move(const Point&){}; -}; - enum class Placement { Under, diff --git a/vcl/inc/qt5/QtInstanceBuilder.hxx b/vcl/inc/qt5/QtInstanceBuilder.hxx index b46a85da956d..19627d0fe908 100644 --- a/vcl/inc/qt5/QtInstanceBuilder.hxx +++ b/vcl/inc/qt5/QtInstanceBuilder.hxx @@ -19,6 +19,7 @@ #include <vcl/weld/Assistant.hxx> #include <vcl/weld/Builder.hxx> #include <vcl/weld/ComboBox.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/EntryTreeView.hxx> #include <vcl/weld/FormattedSpinButton.hxx> diff --git a/vcl/inc/qt5/QtInstanceDrawingArea.hxx b/vcl/inc/qt5/QtInstanceDrawingArea.hxx index 1975d2c63144..04503e348855 100644 --- a/vcl/inc/qt5/QtInstanceDrawingArea.hxx +++ b/vcl/inc/qt5/QtInstanceDrawingArea.hxx @@ -12,6 +12,7 @@ #include "QtInstanceWidget.hxx" #include <comphelper/OAccessible.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <QtWidgets/QLabel> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 3ee33a7b0434..37af5460a424 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -13,6 +13,7 @@ #include <vcl/weld/Builder.hxx> #include <vcl/weld/ComboBox.hxx> #include <vcl/weld/DialogController.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/Entry.hxx> #include <vcl/weld/EntryTreeView.hxx> #include <vcl/weld/FormattedSpinButton.hxx> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index cf498e9338d4..e664bd8eec03 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -36,6 +36,7 @@ #include <vcl/sysdata.hxx> #include <vcl/transfer.hxx> #include <vcl/toolkit/floatwin.hxx> +#include <vcl/weld/DrawingArea.hxx> #include <vcl/weld/FormattedSpinButton.hxx> #include <vcl/weld/MetricSpinButton.hxx> #include <vcl/weld/Paned.hxx> commit 5deeadbd2e7f0c79c39d0d71db5abd5ee6712dc7 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jan 14 15:33:02 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 15 01:35:43 2026 +0100 tdf#130857 qt weld: Support "Export Basic library" dialog This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. The dialog can be triggered like this: * start Writer * "Tools" -> "Macros" -> "Organize Macros" -> "Basic" * press the "Organizer..." button * switch to the "Libraries" tab * press "New" button, type any name and confirm with "OK" * with the newly created library selected, press the "Export" button Change-Id: I111f6172e3ab79067da814aaa3b6bcde18c42c1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197279 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index e338eadb564b..94facee0f54a 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -130,6 +130,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"filter/ui/xmlfiltertabpagetransformation.ui"_ustr, u"filter/ui/xmlfiltersettings.ui"_ustr, u"filter/ui/xsltfilterdialog.ui"_ustr, + u"modules/BasicIDE/ui/exportdialog.ui"_ustr, u"modules/BasicIDE/ui/gotolinedialog.ui"_ustr, u"modules/BasicIDE/ui/newlibdialog.ui"_ustr, u"modules/scalc/ui/conditionalformatdialog.ui"_ustr,
