summaryrefslogtreecommitdiff
path: root/vcl/inc/unx
AgeCommit message (Collapse)Author
2022-08-30fix "g_object_weak_unref: couldn't find weak ref" warningCaolán McNamara
(soffice:3465993): GLib-GObject-WARNING **: 11:33:34.451: g_object_weak_unref: couldn't find weak ref 0x7fffe9553580(0x7fffb4014180) do the same thing for all the gestures Change-Id: I944645fc3c95fd73186cd22e71738f247d864bb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139031 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-26vcl: implement touchpad rotate gesture support on gtk backendPovilas Kanapickas
This change is enough to support both touchpad and touchscreen gestures, but currently GDK_TOUCH_MASK is not enabled, so only touchpad gestures are supported. Change-Id: Ia36b64cd891321d3a5420ea81dca236c936d9af3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-26vcl: implement touchpad zoom gesture support on gtk backendPovilas Kanapickas
Note that this does not support touchscreen gestures. Enabling support for touchscreen gestures requires enabling GDK_TOUCH_MASK which has higher regression potential for touchscreen users, so it has not been done yet. Change-Id: I1baab36804230484394e638bf8bfb8c7a7ddabe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138789 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-26freetype 2.9 was relesed in Jan 2018, drop workaround for <= 2.8Caolán McNamara
Change-Id: Iaf95faa15d56e8f26ed57cb4744b039a18223c5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138877 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-25tdf#150507 reenable slight hinting for cairo with ResolutionIndependentLayoutCaolán McNamara
it was disabled because of: tdf#150145 text appears to have a row of pixels cropped out which seems to be the same issue as https://gitlab.freedesktop.org/cairo/cairo/-/issues/390 reenable, drop CAIRO_HINT_METRICS_OFF and emulate a proposed solution of https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/235 by hacking in a route to disable CAIRO_ROUND_GLYPH_POS_ON Change-Id: I3c9f982c9737b84fe0ee6b645f507e1226807d60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138810 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-03handle scroll events in surrounding GtkSalFrame if there is oneCaolán McNamara
Change-Id: I47f71371246f6322f41b782697d4824517375c76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137760 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-01Fix typo in codeAndrea Gelmini
It passed "make check" on my laptop Change-Id: I2d231c3a8ec40b63026a4b81256b98ee4be0ae1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137660 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-26FreetypeManager::m_nMaxFontId is unusedTor Lillqvist
Change-Id: Idf50eee8dee0ad5f5e789a8554b80114c2c9f795 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137461 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-07-13loplugin:unusedmethodsNoel Grandin
Change-Id: Ifa9c3fe86e7bad6d3839fd3fdfdb8c1f7b5053c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137016 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-13clang-tidy modernize-pass-by-value in vclNoel Grandin
Change-Id: I9ddb786eb88213c53cf53067ced6899ca40ac6e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137000 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-08[API CHANGE] Drop css::accessibility::XAccessibleStateSetNoel Grandin
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>
2022-07-02Revert "tdf#137544 std::unordered_set is cheaper here"Julien Nabet
This reverts commit 8e7edc8c3620e4f733c1974a288e5a5abd29f87e. With a brand new LO profile, launch Writer and close LO, I get: 0 0x00007f76f7e752f5 in std::__uniq_ptr_impl<comphelper::SolarMutex, std::default_delete<comphelper::SolarMutex> >::_M_ptr() const (this=0x10) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:173 1 0x00007f76f7e4ade5 in std::unique_ptr<comphelper::SolarMutex, std::default_delete<comphelper::SolarMutex> >::get() const (this=0x10) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:422 2 0x00007f76f7e07249 in SalInstance::GetYieldMutex() (this=0x0) at vcl/source/app/salvtables.cxx:145 3 0x00007f76f7ed92ee in Application::GetSolarMutex() () at vcl/source/app/svapp.cxx:576 4 0x00007f76f97f4b29 in SolarMutexGuard::SolarMutexGuard() (this=0x7ffd84f3b080) at include/vcl/svapp.hxx:1368 5 0x00007f76f98161a0 in VCLXDevice::~VCLXDevice() (this=0x724c050) at toolkit/source/awt/vclxdevice.cxx:44 6 0x00007f76f98f19d4 in cppu::ImplInheritanceHelper<VCLXDevice, com::sun::star::awt::XWindow2, com::sun::star::awt::XVclWindowPeer, com::sun::star::awt::XLayoutConstrains, com::sun::star::awt::XView, com::sun::star::awt::XDockableWindow, com::sun::star::accessibility::XAccessible, com::sun::star::lang::XEventListener, com::sun::star::beans::XPropertySetInfo, com::sun::star::awt::XStyleSettingsSupplier>::~ImplInheritanceHelper() (this=0x724c050) at include/cppuhelper/implbase.hxx:155 7 0x00007f76f98cc28f in VCLXWindow::~VCLXWindow() (this=0x724c050) at toolkit/source/awt/vclxwindow.cxx:336 8 0x00007f76f980a6bd in VCLXContainer::~VCLXContainer() (this=0x724c040) at toolkit/source/awt/vclxcontainer.cxx:45 9 0x00007f76f980a719 in VCLXContainer::~VCLXContainer() (this=0x724c040) at toolkit/source/awt/vclxcontainer.cxx:44 10 0x00007f76ff5842b0 in cppu::OWeakObject::release() (this=0x724c050) at cppuhelper/source/weak.cxx:230 11 0x00007f76f980d1e9 in VCLXContainer::release() (this=0x724c040) at toolkit/inc/awt/vclxcontainer.hxx:39 12 0x00007f76e49080ae in com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>::~Reference() (this=0x8fa9710) at include/com/sun/star/uno/Reference.hxx:114 13 0x00007f76e4921486 in SwAccessibleDocumentBase::~SwAccessibleDocumentBase() (this=0x8fa9620) at sw/source/core/access/accdoc.cxx:77 14 0x00007f76e4923d1c in SwAccessibleDocument::~SwAccessibleDocument() (this=0x8fa9620) at sw/source/core/access/accdoc.cxx:374 15 0x00007f76e4923d89 in SwAccessibleDocument::~SwAccessibleDocument() (this=0x8fa9620) at sw/source/core/access/accdoc.cxx:370 16 0x00007f76ff5842b0 in cppu::OWeakObject::release() (this=0x8fa9620) at cppuhelper/source/weak.cxx:230 17 0x00007f76e490a325 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleContext, com::sun::star::accessibility::XAccessibleContext3, com::sun::star::accessibility::XAccessibleComponent, com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::lang::XServiceInfo>::release() (this=0x8fa9620) at include/cppuhelper/implbase.hxx:115 18 0x00007f76e4928495 in SwAccessibleDocument::release() (this=0x8fa9620) at sw/source/core/access/accdoc.hxx:139 19 0x00007f76ee91c11e in com::sun::star::uno::Reference<com::sun::star::uno::XInterface>::~Reference() (this=0x9012828) at include/com/sun/star/uno/Reference.hxx:114 20 0x00007f76ee9391a9 in __gnu_cxx::new_allocator<std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true> >::destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (this=0x8c9a8f8, __p=0x9012828) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/ext/new_allocator.h:168 21 0x00007f76ee9390ed in std::allocator_traits<std::allocator<std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true> > >::destroy<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >(std::allocator<std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true> >&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>*) (__a=..., __p=0x9012828) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/alloc_traits.h:535 22 0x00007f76ee9390ba in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true> > >::_M_deallocate_node(std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true>*) (this=0x8c9a8f8, __n=0x9012820) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/hashtable_policy.h:1894 23 0x00007f76ee939035 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, true>*) (this=0x8c9a8f8, __n=0x0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/hashtable_policy.h:1916 24 0x00007f76ee938f56 in std::_Hashtable<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::__detail::_Identity, std::equal_to<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::hash<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::clear() (this=0x8c9a8f8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/hashtable.h:2320 25 0x00007f76ee938ed9 in std::_Hashtable<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::__detail::_Identity, std::equal_to<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::hash<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::~_Hashtable() (this=0x8c9a8f8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/hashtable.h:1532 26 0x00007f76ee938e95 in std::__cxx1998::unordered_set<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::hash<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::equal_to<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~unordered_set() (this=0x8c9a8f8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unordered_set.h:97 27 0x00007f76ee938e6d in std::__debug::unordered_set<com::sun::star::uno::Reference<com::sun::star::uno::XInterface>, std::hash<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::equal_to<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> >, std::allocator<com::sun::star::uno::Reference<com::sun::star::uno::XInterface> > >::~unordered_set() (this=0x8c9a8d0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/debug/unordered_set:190 28 0x00007f76ee9360fb in DocumentFocusListener::~DocumentFocusListener() (this=0x8c9a8a0) at vcl/inc/unx/gtk/gtkdata.hxx:221 29 0x00007f76ee936129 in DocumentFocusListener::~DocumentFocusListener() (this=0x8c9a8a0) at vcl/inc/unx/gtk/gtkdata.hxx:221 30 0x00007f76ff5842b0 in cppu::OWeakObject::release() (this=0x8c9a8a0) at cppuhelper/source/weak.cxx:230 -Type <RET> for more, q to quit, c to continue without paging-- 31 0x00007f76ee920fb5 in cppu::WeakImplHelper<com::sun::star::accessibility::XAccessibleEventListener>::release() (this=0x8c9a8a0) at include/cppuhelper/implbase.hxx:115 32 0x00007f76ee9716ba in rtl::Reference<DocumentFocusListener>::~Reference() (this=0x1da9788) at include/rtl/ref.hxx:129 33 0x00007f76ee96f259 in GtkSalData::~GtkSalData() (this=0x1da9730) at vcl/unx/gtk3/gtkdata.cxx:372 34 0x00007f76ee96f309 in GtkSalData::~GtkSalData() (this=0x1da9730) at vcl/unx/gtk3/gtkdata.cxx:356 35 0x00007f76f7efc79c in DeInitVCL() () at vcl/source/app/svmain.cxx:609 36 0x00007f76f7efacaa in ImplSVMain() () at vcl/source/app/svmain.cxx:227 37 0x00007f76f7efc839 in SVMain() () at vcl/source/app/svmain.cxx:234 38 0x00007f7700ece163 in soffice_main() () at desktop/source/app/sofficemain.cxx:94 39 0x00000000004008dd in sal_main () at desktop/source/app/main.c:51 40 0x00000000004008b7 in main (argc=3, argv=0x7ffd84f3ba48) at desktop/source/app/main.c:49 Change-Id: Id4ac45bdab96b5afb7e9c18570ef4da4a81eca1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136666 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-06-30tdf#137544 std::unordered_set is cheaper hereNoel Grandin
when the number of on screen elements becomes rather large Change-Id: I5185c2d23db733c1587eb78108f69f31e20bd913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136661 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-21VCL expect correct frame size for native menubarsJan-Marek Glogowski
... and renove the wrong framesize hack in the Qt backend This wastes a few additional pixels in the frame backing store, actually covered by the real native menu bar, to get rid of all the hacks and eventually fix quite a bunch of bugs in Qt (and maybe other backends). This seems to work correct with Qt using either QPainter or Cairo as the painting backend. It's much simpler then my previous failed attempts to fix the Qt related bugs. I would like to convert every implementation to my interpretation of the API (at least I now documented the API). It looks like Win and Mac will just work, because Win has no native menu bar and Mac uses a global menu, so always returns the size of 0. And Gtk also seems to work, if it also lies about the menu bar size being zero. That just seems consequent, if the frame size is reduced by the menubar size. This fixes at least: tdf#64438 - Dockable panels in LibreOffice not dockable using KDE Works. tdf#130893 - XWindow::SetPosSize resizing based on XWindow::GetPosSize shrinks the window The document macro from tdf#130841 now doesn't resize the window. This is just fixed for Qt. tdf#134704 - KDE5 - unable to dock sidebar by dragging frame not fixed, because the sidebar window is now a dialog, which is not dockable. FWIW the same has happend the Navigator (F5), which also renders it non-dockable. No idea, if this is intentional. tdf#137471 - CMIS dialog advances beyond lower right corner of the screen So commit 3f8d3fd4649ef09e86c735617383a4bda0425540 ("tdf#137471 Qt return frame pos + client area size") was really not enought as a fix (at least it didn't break anything). The whole parent-based repositioning is wrong and it really depends on the correct frame size, so I'm keeping this as fixed by this patch. Change-Id: I7faeace61b456c2b0f42c7a826f58018b70d46ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135082 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-06-15Drop SalMenu::DrawMenuBar (is WIN-only)Jan-Marek Glogowski
This follow-up on commit 483f3125ecd4744cbcc2f8fd3cdf243d81a601ff ("WIN drop effectively empty ImplDrawMenuBar") should probably have been included in it. Windows was the only implementation of that API, but the API is just called for a native menubar, which Windows doesn't use (VisibleMenuBar returns false). Maybe Windows SalFrame::SetMenu should also be dropped? Change-Id: Ic3600e66c91ce9d56d7f911bce5674e0a9ee833c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135633 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-06-14Make PARTIAL_FULLSCREEN a X11SalFrame boolJan-Marek Glogowski
SalFrameStyleFlags::PARTIAL_FULLSCREEN is just ever read in X11SalFrame, so there is no need to have it as a "global" flag. Just save it as a member boolean and drop it from gtk3. FWIW: consolidating all the booleans in X11SalFrame as a bitfield (AKA reorder the fields and declare them bool myvar : 1;) might be a nice easy hack. Change-Id: I6a94310d3b734ecfd083b520d613a076b1e7670a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135805 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-06-08VCL add vcl::WindowPosSize abstract classJan-Marek Glogowski
... and use it to remove a duplicate and simplify code. Should mostly be a refactoring, which was mainly done by some larger sed calls, except for the new API calls, which helped shrinking some LOC. All data is also now private. Originally two of the "replaced" "classes" had unsigned width and height and one had signed. Noel pointed out, that during calculations, the value might get negative temporarly, so this now settles with signed values. Still the set size should never be negative and this is enforced this way. Not sure that is what Noel had in mind. This also includes: - rename WindowState => WindowData - rename WindowStateMask => WindowDataMask - rename WindowStateState => WindowState - move WindowState and WindowDataMask to vcl/windowstate.hxx - move WindowData(Mask) and WindowState into vcl namespace - readability: replace or'ed WindowState enums with "meta" enums + add "meta" WindowState enums PosSize and PosSizeState Change-Id: Icd16cfb498531aa7238ddbde83fcb0ed6d9e4f77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135426 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-05-28Move GtkSalFrame::CalcDeleteSurroundingSelection to SalFrameMichael Weghorn
It will be used for qt5/qt6 in a follow-up commit as well. Change-Id: Ic6a9351b0506519010b92e11d30962d5b105ec2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135052 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-19follow org.freedesktop.appearance.color-scheme settingCaolán McNamara
Change-Id: Id26d01fd19cc3ee12c0e14b785b3a5149d22baf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134553 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-03add o3tl::equalsAsciiNoel Grandin
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-01use string_view in WhitespaceToSpaceNoel Grandin
Change-Id: I64c63418ca51a09312083dab2432bcca0ea262a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-15Related: tdf#147237 change the SalObject background when the settings changeCaolán McNamara
which solves the problem of parts of the gtk ui remaining in the old theme when switching dark<->light Change-Id: I59060dfdf3937ca13cd706eefc9e67c133478992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133076 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-04-13vcl: move X11 drawing that uses cairo into X11CairoSalGraphicsImplTomaž Vajngerl
If cairo is available we override drawPolyPolygon and drawPolyLine with an implementation that uses cairo to draw instead of X11. This override was previously done in X11SalGraphics, but as we want to have all the drawing in backends (SalGraphicsImpl children) this also needs to be moved to one. In this case we can just derive X11SalGraphicsImpl and implement specifics there. As there is some common stuff now betwee X11SalGraphics and X11SalGraphicsImpl, also add X11Common, which includes those. Change-Id: Id1e0c5227506e03d3dd0f937e4ef50d69b17bb22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132827 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-04-12vcl: use auto delegate for X11SalGraphics and remove duplicatesTomaž Vajngerl
X11SalGraphics can derive from SalGraphicsAutoDelegateToImpl to remove many calls to the mxImpl, which can instead be done by the auto delegator. Change-Id: I7add2e824eb1be01f8d278e5af8a378a34b32671 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132826 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-04-10tdf#143148 Use pragma once instead of include guards in xlimits.hxx fileBehrad Khorram
Change-Id: Ia54dad6650e4dfd618ebf48a89c2ccd9c588fcb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132481 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-04-09sal_GlyphId is internal to VCLLuboš Luňák
And can't be put into impglyphitem.hxx, as then it would have a circular dependency with fontinstance.hxx . Change-Id: I57289fa5433851f095f7b73ce842ba5a0e8497ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132745 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-08Make comment less misleadingTor Lillqvist
Change-Id: I608abe994cc8a67c295450d836d8c423026b85d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131175 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-03-07Drop useless parameterTor Lillqvist
The parameter to PrintFontManager::countFontconfigFonts() was only written to since babf6d5e53516e80e8e3f2485796ebfaeb20e9c1. Change-Id: Ie206fdbd620f1cfc6402c1d02709c3b653140c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131097 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-01-14VCL drop m_pInstance from *nix SalDataJan-Marek Glogowski
AKA the "*nix SalData untangling" commit. The original plan was to get rid of vcl/inc/saldatabasic.hxx and even SalData for all the *nix backends. But after many backs and forths, reinspecting the code and imagining the resulting code, I decided against that plan. All these variants would have resulted in reinterpret_cast calls, I wanted to prevent. And they would have required larger renames for no benefit. An other, related idea was to include all SalData implementations in the vcl/inc/svdata.hxx header, but that seemed like an include explosion, so was also dropped. I tried to untangling iOS from using GenericUnixSalData, as it doesn't use any of it's features. The new, minimal SalData should be sufficient. I'm leaving the easier drop of mpInstance from the Windows and MacOSX backend as a minimal interesting EasyHack. Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14VCL move PrinterInfoManager into GenericUnixSalDataJan-Marek Glogowski
... and use a std::unique_ptr. PrinterInfoManager::release() was just called from ~SalData(), so this should make this more clear. Change-Id: Ic4aade2db3813fdc96ede116a50604692ef3dbec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128399 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-07VCL move platform code from mouse.cxx into pluginsJan-Marek Glogowski
... by moving it into ImplCreate(DragSource|DropTarget). The existing Create* variant now checks for headless mode and the IsRunningUnitTest flag, before creating the platform variants. There are two small helpers to initialize either X11 or Ole based UNO DnD interace implementations. Unfortunatly Windows requires to move two dtrans header files, but at least any other changes are minimal. Change-Id: Id79459ad71a26243b1c9cb1fe38ab236b0ab8fa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128049 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-17tdf#146225 Revert "Use g_get_real_time instead of g_get_current_time"Hossein
This reverts commit 489d7298d2e609ee5900f05ba0064845a7a551ce and 4812c8df39cb03b59d8c033005e8e9dc45a260dd. Change-Id: Ic537a605eedc39c6cbafab4c28a77d81edfa1e20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126998 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2021-12-11Use g_get_real_time instead of g_get_current_timeHossein
g_get_current_time() which is deprecated, is replaced by the newer function g_get_real_time() in which is available since glib 2.28. Function GLib > get_real_time https://docs.gtk.org/glib/func.get_real_time.html Change-Id: I371c2efc290e70410b84346ed47d721ae9547273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126374 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-10Revert "Re-Enable DrawTransformBitmapExDirect for render backends"Armin Le Grand
This reverts commit 7e5af164b7d293dd410710bed411e1ca64bbecf7. Reason for revert: Not the best/effective way to clear out the stuff remaining to be done, would need additional stuff Change-Id: Ia6ab90384da29a5e34eff0ab8881bad2ab49c58c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126601 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-12-07Re-Enable DrawTransformBitmapExDirect for render backendsArmin Le Grand (Allotropia)
Unfortunately the add/usage of HasFastDrawTransformedBitmap did disable the system-dependent implementations/fast-path for DrawTransformBitmapExDirect and it's implemenations, except for Skia. This means that the current backends for Windows/Mac/Cairo/headless/Qt5 have to do expensive pixel operations when a Bitmap is 'really' transformed (rotate/shear) since some time. The nine implementations using ::hasFastDrawTransformedBitmap (grep for it) all return false, except the Skia one. Since HasFastDrawTransformedBitmap() uses that and itself is used in the very central mehod OutputDevice::DrawTransformedBitmapEx(...) to decide if that fast-path shall/can be used at all, it was *no longer used* - except for Skia - what makes Skia definitely performing better with transformed Bitmaps, or the other way around - the others worse. HasFastDrawTransformedBitmap() is used in only two places, the second is in the canvas helper to decide if to try to use that fast-path for presentation rendering. A method at OutputDevice to see if that fast-path is implemented is therefore currently needed, but for the canvas helper only. Since this will/should be converted to primitive usage (hopefully) anyways, nine impementations calling these virtual functions often and the danger to produce a mismatch/ error beween implementations of hasFastDrawTransformedBitmap and drawTransformedBitmap (as happened here, but can also happen when someone adds or removes an implementation) I looked for a way to solve that differenly and more safe. Since SalGraphics::DrawTransformedBitmap anyways returns a bool to signal it's success I take this as base to implement a buffered test directly at SalGraphics, also directly set a local flag to detect that functionality if DrawTransformedBitmap is used anyways before the test is/would be needed. Combined wih that small test to check only if this was not yet used and thus tested by DrawTransformedBitmap anyways I can offer a reliable non-virtual method at OutputDevice called ImplementsFastDrawTransformedBitmap() that will be used at the single necessary location - in the canvas helper. Since that small test direcly uses one of the nine implementations of hasFastDrawTransformedBitmap it is fundamenally more reliable and probably the copy bitmap/writeBack never really used (I tested that it works) due to an earlier use of DrawTransformedBitmap did the check potentially already. I also took a look at the cairo version (since I had this one running here) and ensured that the buffering of the system-dependent form of the Bitmap as cairo surface still works. Regarding the newly introduced fAlpha parameter I want to add some remarks: - It should be called fOpacity to make clear that it describes opacity, defining that if 1.0 == fAlpha means *no* transparency. That word is used in other graphic systems and makes more clear what function it has. It is the opposite of transparency, but works the same. - Currently all implementations of ::drawTransformedBitmap - except Skia where it was implemented - do not use it, but return false. It will in most cases not be too complicated to add/implement it, e.g. for cairo anyways a transparency surface will/is created, fAlpha can just be merged in, and the criteria for buffering that may be extended to remember for which value (if at all) of fAlpha that was prepared. I strongly recommend implementing these for our main graphic backends. - The primitive renderer uses another more general way to add an extra alpha channel to paint when needed - it draws the content (any content) that needs to be transparent to a buffer and then that buffer using the intended transparency. This is discussable since may be more expensive, but more general and keeps the interface less complex. We can see here that adding that complexity to the existing interface at OutputDevice makes the implementations more complex what might be the reason his was only implemented for one of nine backends. When adding something like this and extending the complexity I would prefer that at the same time it gets also *implemented* in all or most or at least most used cases. I want to make clear that from my POV in those cases choosing possible runtime speed over complexity is not always preferable. Change-Id: I5bab59f59fca878a7b11a20094e49e8b50196063 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126480 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-11-15gtk4: implement CreateChildFrameCaolán McNamara
which gets the extension options tab pages working, e.g. "English Sentence Checking" Change-Id: Ib98f366fdcc7c51f4399372a78f78a655b3c0b86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125242 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-07forward decls go after #includeNoel Grandin
Change-Id: I54c33508639044092356eed5144720261b4f65db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-05use more DECL_DLLPRIVATE_LINKNoel Grandin
to avoid unnecessarily exporting symbols Change-Id: I6855894d0166c300ced169e36861f38811baa48d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22return weld::Builder by unique_ptrNoel Grandin
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-10gtk3: popdown context menus on toggling radio/check buttons tooCaolán McNamara
like we do for menubar menus (tdf#125803) Change-Id: Ib70b90bd9ec9b1f624b1cdff5ba6d304f75f8919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123344 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-10gtk[3|4] use set_buildable_id and get_buildable_idCaolán McNamara
Change-Id: Ia3a24d80ac56bc834c11f85a98e3b9fa1a862e41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123343 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-08vcl: test PhysicalFontCollection and move to vcl::font namespaceChris Sherlock
- tested PhysicalFontCollection, noted odd behaviour with search names and normalization - moved PhysicalFontCollection.hxx to vcl/inc/font - moved PhysicalFontCollection into vcl::font namespace Note that I needed to regenerate the pch file otherwise errors were generated. Change-Id: Ifa0c7b871c40687bd15002565d2f7a3e408218f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122036 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-05tdf#143148 - Use pragma once instead of include guardsChris Sherlock
Done in preparation for movement of PhysicalFontCollection to vcl::font namespace. Change-Id: I17f27afd3ff0763866f3b2c169f7ee100d7f26d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122406 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-05vcl: test PhysicalFontFace and move to vcl::font namespaceChris Sherlock
- moved PhysicalFontFace.hxx to vcl/inc/font - added PhysicalFontFace to vcl::font namespace - had to regenerate precompiled_vcl.hxx - tested PhysicalFontFace, with some extensive tests for IsBetterMatch() Change-Id: I860022ac244f8a827f6f9cb7ed9018c5d9c328cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121970 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-04Add sal/config.h in preparation for patchChris Sherlock
The convention is that we need to add sal/config.h to the start of files. Made in preparation of movement of PhysicalFontCollection to vcl::font namespace and test class. Change-Id: I7768d9b4c7335f0d9feeba96f0dc67aaaaf8441e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122259 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-01tdf#144846 launch gtk3 menubar menus from LibreOffice codeCaolán McNamara
rather than using the builtin gtk mechanism so we can avoid duplicate mnemonics in the sidebar getting used instead. Change-Id: I6c761ae63ae25d835de9444b0e298c63996a83a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122926 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-01loplugin:constmethodNoel Grandin
Change-Id: I3ed657c5c5e6840e38e3c8505505b4b372125df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122910 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-30loplugin:constmethod handle more casesNoel Grandin
remove some of the naming limitations, and handle pointer parameters better. I only let the plugin run up till vcl/ Change-Id: Ice916e0157031ab531c47f10778f406b07966251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-27vcl: move FontSelectPattern to own file and into vcl::font namespaceChris Sherlock
Change-Id: I2f01a8e67c52ece9b434777203aa9fbc9ac8be02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122613 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins