summaryrefslogtreecommitdiff
path: root/vcl/ios/iosinst.cxx
AgeCommit message (Collapse)Author
2024-06-06Fix a memory leakPatrick Luby
CreateNSString() expects the caller to release the returned string. Change-Id: I578488dd99c4c2737894287ab3e597ba8607669e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168040 Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 2802ba82d2ac0b9d831117dcc47375fd1dd01415) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168444 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-01Fix iOS build breakages when building on macOS SonomaPatrick Luby
Change-Id: I347e48e9da69c8c9b15581a5afa5c61cdd1d380d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157411 Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Patrick Luby <plubius@neooffice.org>
2023-01-30Fix iOS build errorsPL
Recent code reorganization and macOS changes caused the iOS build to fail. This change fixes the build errors and updates the iOS code to use the same headless data structures as other headless builds. Change-Id: I9c5329eb6376120d6789447f991c93eb9839d595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146265 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2022-06-23Revert "svp: don't directly yield in main thread"Stephan Bergmann
This reverts commit d2de55c93f94bbccff51fa7715b613341f1f4ae6 for now, because it appears to have caused a massive uptick in hung UITest_impress_tests (sd/qa/uitest/impress_tests/save_readonly_with_password.py, line 95) and UITest_writer_test6 (sw/qa/uitest/writer_tests6/save_readonly_with_password.py, line 54) tests across Jenkins, see the comments starting at <https://gerrit.libreoffice.org/c/core/+/117900/8#message-e439f5f2b9ed7a24d6f47fd640defe14dc392eb5> "svp: don't directly yield in main thread". Change-Id: Id114a0d904580024352e4acf37e2558f9f0ae6f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136250 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-22svp: don't directly yield in main threadJan-Marek Glogowski
AKA svp: always release SolarMutex on yield, v2 Implement the TODO when yielding a non-main thread: "use a SolarMutexReleaser here and drop the m_bNoYieldLock usage" This whole concept of "deferred yield" is prone to spurious "deadlocks", if DoYield spawns a nested event loop. This will not only block one yielding threads, but all indefinitly. And not releasing the SolarMutex is also not fair for any other threads waiting. That whole m_nNoYieldLock hack is just needed to defer GUI processing to the main thread without releasing the SolarMutex, the exact opposite of what yielding does. While we can't do anything for the main thread as long as the whole nested event loop concept prevails, we can prevent the yielding thread deadlock using conditionals. With all the special m_nNoYieldLock gone from SvpSalYieldMutex there isn't any reason to keep it around. Change-Id: I87c006ad36b4959f7e0dd18dda99a58c4e25032d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117900 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-17iOS+SVP convert remaining VCL plugins to salplugJan-Marek Glogowski
While this makes the preprocessor usage even larger, the code in salplug.cxx is now hopefully easier to follow. I added a comment about the main code structure at the beginning. It also includes changes to the generic plugin list to include gtk3_kde5 before gen, qt5 and qt6 after gen, but still skips the headless / svp plugin. And I explicitly excluded salplug.cxx from the externandnotdefined compiler plugin. I could have added a dummy, but that seemed not worth the effort. My try on a non-dummy with correct includes and defines made the code in salplug.cxx much harder to follow. FWIW, the iOS VCL plugin actually seems to use the osx SalData, so I think these changes to iosinst.cxx are more correct then commit 7d990aafdc363b2a12b5db78637d7f3bef7780bd ("VCL drop m_pInstance from *nix SalData"). But hard to tell without a compiler. Change-Id: I0e2944d4221ca5910fb2120cc8b24def5c5b3f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128477 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14VCL move SolarMutex (un)locking into (De)InitVCLJan-Marek Glogowski
Fixes all the backends, where SolarMutex access needs SalInstance. The ImplSVData::SalInstance is just set fron the return value of CreateSalInstance, so it can't be accessed earlier, globally. Regression from commit ad94bb5d23d9c4ecbb2ca84807f01623862de43e ("VCL drop m_pInstance from *nix SalData). Change-Id: I13259009571a9973ea7e3ded20c0ea4c660ee214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128420 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
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-14iOS+Android+SVP "merge" all SalData instancesJan-Marek Glogowski
It's always the same code. Change-Id: I2385d0bda24939b964306e27a3df99ea44356eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128401 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-07-02vcl: drop GenericUnixSalDataTypeJan-Marek Glogowski
It's just used for a singke assert and SalData is generally just used as a static cast. Change-Id: I8d74e82e511413d940a3f200f022a9204e588cd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118288 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-10-07Avoid dialog headings showing up as some serif font in the iOS appTor Lillqvist
Apparently the use of [UIFont systemFontOfSize:10] familyName] to get a default font family name is a bad idea. Presumably the return value from this, ".SF UI Text", is matched against the list of font family names enumerated from the system. (The "SF" apparently stands for "San Francisco".) That ".SF UI Text" is not among them, so maybe vcl chooses some arbitrary other font instead that happens to be a serif one? If we instead use "Helvetica", at least we get a sans-serif font, even if it doesn't match the system UI font exactly. Change-Id: I7ff39d8e7893ce3c27f3f12d227f87209bbc7952 (cherry picked from commit 685e91a7aee4a4acc60e33bf1313a394fd15b1ff) Reviewed-on: https://gerrit.libreoffice.org/79196 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit ba9f91a909cb52194178ac2ed78dc62bd61c1be3)
2019-10-07tdf#126964: Set background colours to white in IosSalFrame::UpdateSettings()Tor Lillqvist
Change-Id: I92110a7a501571d7fd707dc33502ff553f02ae5e Reviewed-on: https://gerrit.libreoffice.org/77823 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit e84c42ee32d1a23729c65b534c4418e2043f706d) Reviewed-on: https://gerrit.libreoffice.org/78994 (cherry picked from commit 1e7a3f82324c3b855c2b3c1f8d4dec73c5162806)
2019-03-14Further tweaks that affect the "tunnelled" dialogs in the iOS appTor Lillqvist
The bestmaxFrameSizeForScreenSize() function is full of magic numbers. (There originally, in OOo times, was a comment in there that said "fill in holy default values brought to us by product management" which says it all, really.) Those numbers have little or no relevance on iOS. Instead, make this function return the largest square that will fit on the display (square so that it will fit in either orientation, in case the device is rotated while a tunnelled dialog is displayed). And as a consequence the defaut font size on iOS can be bumped up a bit, to 10. Now the problematic dialogs look even better. Note that this is a cherry-pick from our vendor branch (cp-6.0). It hasn't actually been tested as the iOS app doesn't work at the moment if built from the master branches of online and core. Change-Id: I043d8f9947520adb04bd952ee49f9c7844a1fa8c
2019-03-14Use smaller default font on iOS (in practice used for dialogs in the iOS app)Tor Lillqvist
I suspected all the time that just one single-line change will be what is needed to make the dialogs look mostly sane. (Especially Format > Character... and Format > Paragraph...) No exotic hacks were needed after all, even though I experimented with more or less crazy ones for several days before I thought of changing this font size 14 to something smaller. The problem was apparently simply that with the larger default font, the dialog controls didn't fit properly in the space provided. Especially the four combo boxes on one line in the Font page were problematic. (It has three such lines of combo boxes.) Apparently the dialog machinery isn't especially good at reducing width of controls. The Size control shrunk to (almost?) zero width and was not visible, the Style control was too narrow to be usable, but the Language control was left as unnecessarily wide. Note that this is a cherry-pick from our vendor branch (cp-6.0). It hasn't actually been tested as the iOS app doesn't work at the moment if built from the master branches of online and core. (cherry picked from commit 96dce784c7971f22dcf44b66a242c22b455e32a3) Change-Id: If5675856345be2ae502346e8c097ef04216e2986
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-02Unify sal plugin loadersJan-Marek Glogowski
Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 Reviewed-on: https://gerrit.libreoffice.org/61103 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-08-27Fix iOS build after f05f4e042ca6ac8ae7f1d1e8e6bfb4cbba17a044Tor Lillqvist
Change-Id: I7b0c737b84f4528a8fba01e2998f525046834b1c
2018-02-26vcl: fix hangs in SvpSalInstanceMichael Stahl
Since commit cb8bfa9a32799bcde4e960fa56e388d5f7b2a928 the main thread will read from the timer pipe until it is empty. But evidently this introduces the problem that the poll() in another thread will not return, as the file descriptor will no longer be readable; see https://paste.debian.net/1011306/ for a reproducer of that rather under-documented poll behaviour. So other threads can get stuck forever in poll, and then the main thread can block in poll too with no other thread to wake it up. This is the problem that plagues UITest_writerperfect_epubexport. The timer pipe is difficult to fix, since the main thread can block on either the poll or the subsequent AcquireYieldMutex(). So replace the timer pipe with a condition etc. that is mostly copied from the OSX AquaSalInstance/SalYieldMutex implementation. The main thread now does something different than the other threads, and blocks on a condition_variable with a timeout, while other threads still block on acquiring the mutex. Non-main threads can poke the main thread to do a DoYield() on their behalf, and then get the result back with a blocking read from a pipe, all while holding the YieldMutex. This requires some fudging of the YieldMutex so that the main thread can borrow the ownership temporarily. Unfortunately SvpSalInstance, in addition to being directly instantiable for --headless, has a whole bunch of subclasses: * HeadlessSalInstance * AndroidSalInstance * IosSalInstance * GtkInstance (in the gtk3 case) * KDE5SalInstance Of these GtkInstance overrides everything related to the DoYield/SalYieldMutex implementation, but the others will be affected by the change. This commit will probably break IOS due to me not understanding the point of the undocumented random #ifdef IOS in svpinst.cxx. Change-Id: I1bbb143952dda89579e97ac32cd147e5b987573c Reviewed-on: https://gerrit.libreoffice.org/50237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-11-11Replace list by vector for ShowNativeDialog (vcl)Julien Nabet
Change-Id: I1101c5b5426507ce8e5fd1ed34930f385f527775 Reviewed-on: https://gerrit.libreoffice.org/44639 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-31ReleaseYieldMutex is always called with trueNoel Grandin
so drop param and rename to ReleaseYieldMutexAll Change-Id: Ic4fcee24d46405659e54363c87f21d88696b0ce1 Reviewed-on: https://gerrit.libreoffice.org/44057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-19rename SalGenericData to GenericUnixSalDataNoel Grandin
since it's generic over the various unixen, not anything else Change-Id: I994d5c9be99134b804e96bc045bf054fd9b434ef Reviewed-on: https://gerrit.libreoffice.org/42455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-19Unify SolarMutex implementationsJan-Marek Glogowski
All backends implement the SolarMutex in mostly the same way. So this consolidates this code into a GenericSolarMutex. We still need the abstract SolarMutex class for the fake AKA fascade implementation in dbaccess. The patch also replaces various places of direct mutex usage with either SolarMutexGuard or SolarMutexReleaser objects. Change-Id: Ia0146dd6c51a3b9a513cc6af34a66def58aad831 Reviewed-on: https://gerrit.libreoffice.org/42325 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-08-08loplugin:constantparamNoel Grandin
Change-Id: Ib92aba17c46a4ada75c2a0630f281759d995f32e Reviewed-on: https://gerrit.libreoffice.org/40843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-03iOS remove unused parameterjan Iversen
Removed pSys parameter from IosSalFrame Change-Id: Ib61f09448ef0c6751d4261b11d6a7b9dc45e786b
2017-04-28iOS, fixed build breaker.jan Iversen
Fast fix to build breaker from commit 3a36cf434fb4a967c9ea767cb7ac5f4da0502a0d Removing the parameter from the constructor gave ripple effects to move/copy constructors, so not done for now. Change-Id: I98e060e80946dbfe6586744e4f362ccb358a210d
2017-04-03iOS update for Rectanglejan Iversen
Updated Rectangle to tools::Rectangle Change-Id: I1577dffe8d51ac3a33bbc2e0771b338d5fdd0220
2016-10-05InfoFont/Color is not used by vcl nowCaolán McNamara
anywhere anyone wanted to Get[Font|Color] give it the Label ones instead. why this is exposed through uno is bewildering, stubbed those out for the moment Change-Id: I7a31d027287436be1c075c76a370047efd010bf3
2016-08-10gendata.hxx has movedTor Lillqvist
Change-Id: I55223078e189416c4181141a7a904e93d5c6a01e
2016-02-01Resolves: tdf#93821 assume mbNoSaveBackground as true everywhereCaolán McNamara
Change-Id: I126aa5e9b96299eb25c2240d097859b3c0756535
2016-01-20replace use of basebmp in vcl entirely nowCaolán McNamara
we're just using it to store bitmap data and to convert to preferred destination format, so we can use the preexisting vcl BitmapBuffer for that Change-Id: I0e800956d95faddfafa53d2c48b09494a7a867c0
2016-01-08cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: If1ddb112c85f127295eb55566360b066e7173ba2 Reviewed-on: https://gerrit.libreoffice.org/21245 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-12-16SvpSalFrame ctor parameter list has changedTor Lillqvist
Change-Id: Ide3457c5baab3d7f84990f6c2311975002ba9f18
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-07Make this compile for iOS againTor Lillqvist
Change-Id: Idd4a1e6d50652a879493d8411c59605ca1a53dfb
2015-10-05convert SAL_FRAME_STYLE to scoped enumNoel Grandin
Change-Id: Ic3f7fddcea36c18ffe43c4c633d415f596a58cbc Reviewed-on: https://gerrit.libreoffice.org/19094 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-06-04convert basebmp::Format to scoped enumNoel Grandin
Change-Id: I6eb213d6dcf387936967271fba9e2de3879ef479
2015-04-28allow a different notebook tab font than the rest of the uiCaolán McNamara
Change-Id: Ia41276033c1f656217bc3ae929faab001db36ca4
2015-03-24Kill dead <touch/touch.h> APITor Lillqvist
Has all been obsoleted by LibreOfficeKit. Only some MOBILE_* constant #defines are now left in touch.h, but probably those are used only by dead code. Change-Id: I646945c4408b4e6cd5510da535cfc12088dd391c
2015-01-07fdo#84938: convert VCL_INPUT_ #defines to 'enum class'Noel Grandin
Change-Id: I155e45f58974a2b946c4a7703b350bcbfbad342e
2014-11-08These constants are now in the scoped enum MouseEventModifiersTor Lillqvist
Change-Id: I73e1498198cbb55ccd969713a38b6cd678c94643
2014-10-18vcl/layout.hxx was included twiceAndras Timar
Change-Id: I03a30793e02def731cb6c8f130c48aeb325a2528
2014-09-18use vcl::FontNoel Grandin
Change-Id: I22fd5c1340ca0c646725d9fce77304c10d9eb5d5
2014-08-18Bin "temporary" code that doesn't compile any longerTor Lillqvist
Change-Id: I7550a40bab4ffd1b585ad37dceb59c38cf1e4ca3
2014-08-18ErrorBox->MessageDialogCaolán McNamara
Change-Id: I57d4e43460e40d3aff54873280eddbb18c12446b
2014-05-26No need for these fields for iOSTor Lillqvist
Change-Id: I3fff002919a1f15ae370c7d0c7f65e67108a6232
2014-04-22With tiled rendering for iOS there is no need for a "frame buffer"Tor Lillqvist
The resulting dropping of the basebmp code reduces app size by 0.7 MB. Change-Id: Id263873ed5c4bb2435d929a1319fedeedb6daa14
2014-04-20cppcheck: Prefer prefix ++/-- operators for non-primitive typesJulien Nabet
Change-Id: Ic24715d86b3f822babd236ac73c041f3a5c1d92b
2014-04-10Kill the ImplSVGDIData::mbNoXORClipping flagTor Lillqvist
Instead, act as if it was true on all platforms. Don't do XOR clipping on any platform. Simpler code is better code, and XOR tricks are generally very much out of fashion these days, I have been told. Didn't seem to have any visible ill effects on Linux at least. Change-Id: I6192006c77a4a81363ec7b3292f72d512d5e9b53 Reviewed-on: https://gerrit.libreoffice.org/8901 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-04-07For consistency, set the same "GDI" and "Win" flags for iOS as for OS XTor Lillqvist
No visible effect, though. Which is both good and bad: Good because it means that without ill effects a larger degree of idenical code paths can be used for both iOS and OS X. Bad because this change didn't help in getting rid of the annoying misrenderings on iOS of some Smart Art objects. Change-Id: I9da0f98ca90554dbac963688705b3c7955021741
2014-04-02Kill superfluous vertical whitespaceTor Lillqvist
Change-Id: I81ce8fd7022bf283db668705efdfb0666f87bde9