* Refactor the page cache algorithm
* Add a page preloading feature
* Add settings for number of pages to preload
* Add option to evict from page cache on page scroll (enabled by default)
In practice, evict on page scroll reduces memory consumption much more than when
having it off, so it has been enabled by default.
This commit replaced some implicit conversions with (in debug mode) checked casts.
I also had to remove some explicit type declarations, since they were wrong on ARM devices.
fixes#2514
* New translations German from Crowdin [skip ci]
* New translations Romanian from Crowdin [skip ci]
* New translations Vietnamese from Crowdin [skip ci]
* New translations Serbian (Cyrillic) from Crowdin [skip ci]
* New translations Swedish from Crowdin [skip ci]
* New translations Turkish from Crowdin [skip ci]
* New translations Ukrainian from Crowdin [skip ci]
* New translations Chinese Simplified from Crowdin [skip ci]
* New translations Chinese Traditional from Crowdin [skip ci]
* New translations English from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Portuguese from Crowdin [skip ci]
* New translations Portuguese, Brazilian from Crowdin [skip ci]
* New translations Indonesian from Crowdin [skip ci]
* New translations Thai from Crowdin [skip ci]
* New translations Croatian from Crowdin [skip ci]
* New translations Hindi from Crowdin [skip ci]
* New translations Klingon from Crowdin [skip ci]
* New translations Chinese Traditional, Hong Kong from Crowdin [skip ci]
* New translations Russian from Crowdin [skip ci]
* New translations Polish from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations Greek from Crowdin [skip ci]
* New translations Spanish from Crowdin [skip ci]
* New translations Afrikaans from Crowdin [skip ci]
* New translations Arabic from Crowdin [skip ci]
* New translations Catalan from Crowdin [skip ci]
* New translations Czech from Crowdin [skip ci]
* New translations Danish from Crowdin [skip ci]
* New translations German from Crowdin [skip ci]
* New translations Basque from Crowdin [skip ci]
* New translations Norwegian from Crowdin [skip ci]
* New translations Finnish from Crowdin [skip ci]
* New translations Hebrew from Crowdin [skip ci]
* New translations Hungarian from Crowdin [skip ci]
* New translations Italian from Crowdin [skip ci]
* New translations Japanese from Crowdin [skip ci]
* New translations Korean from Crowdin [skip ci]
* New translations Dutch from Crowdin [skip ci]
* New translations Santali from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations Chinese Simplified from Crowdin [skip ci]
* New translations Chinese Simplified from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations German from Crowdin [skip ci]
* New translations German from Crowdin [skip ci]
* New translations Czech from Crowdin [skip ci]
* New translations Czech from Crowdin [skip ci]
* New translations Romanian from Crowdin [skip ci]
* New translations Vietnamese from Crowdin [skip ci]
* New translations Serbian (Cyrillic) from Crowdin [skip ci]
* New translations Swedish from Crowdin [skip ci]
* New translations Turkish from Crowdin [skip ci]
* New translations Ukrainian from Crowdin [skip ci]
* New translations Chinese Simplified from Crowdin [skip ci]
* New translations Chinese Traditional from Crowdin [skip ci]
* New translations English from Crowdin [skip ci]
* New translations Galician from Crowdin [skip ci]
* New translations Portuguese from Crowdin [skip ci]
* New translations Portuguese, Brazilian from Crowdin [skip ci]
* New translations Indonesian from Crowdin [skip ci]
* New translations Thai from Crowdin [skip ci]
* New translations Croatian from Crowdin [skip ci]
* New translations Hindi from Crowdin [skip ci]
* New translations Klingon from Crowdin [skip ci]
* New translations Chinese Traditional, Hong Kong from Crowdin [skip ci]
* New translations Russian from Crowdin [skip ci]
* New translations Polish from Crowdin [skip ci]
* New translations French from Crowdin [skip ci]
* New translations Greek from Crowdin [skip ci]
* New translations Spanish from Crowdin [skip ci]
* New translations Afrikaans from Crowdin [skip ci]
* New translations Arabic from Crowdin [skip ci]
* New translations Catalan from Crowdin [skip ci]
* New translations Czech from Crowdin [skip ci]
* New translations Danish from Crowdin [skip ci]
* New translations German from Crowdin [skip ci]
* New translations Basque from Crowdin [skip ci]
* New translations Norwegian from Crowdin [skip ci]
* New translations Finnish from Crowdin [skip ci]
* New translations Hebrew from Crowdin [skip ci]
* New translations Hungarian from Crowdin [skip ci]
* New translations Italian from Crowdin [skip ci]
* New translations Japanese from Crowdin [skip ci]
* New translations Korean from Crowdin [skip ci]
* New translations Dutch from Crowdin [skip ci]
* New translations Santali from Crowdin [skip ci]
* New translations Japanese from Crowdin [skip ci]
This commit adds support for renaming layers in Xournalpp (and some
other small tweaks).
The features it provides are as follow:
- Ability for layer and background to have name.
- Changing the name of currently selected layer to some other name.
- Custom dialog for doing the above action.
- Saving and loading layer names from/to xopp file (including compatibility with
Xorunal).
- Lua API for renaming layers and reading layers names.
- generateConvert.php Now generates modern c++ that is compatible with
clang-format.
- Added clangd support to .gitignore.
So far, the type of background export determined extra export types.
Originally this increased the number of export types by a factor of 2,
now (with the addition of "no ruling") by a factor of 3. This is a lot
already and does not scale.
Instead, reduce the export types to those determined by the file type and
configure the background export types in the export dialog, along with
progressive mode and quality parameters (depending on file type).
In addition to a cleaner UI this makes it easier to remember the last
choice or make the default configurable (to be implemented by a future
series) rather than forcing the user to make the same choice over and
over again.
Currently, there is a choice between exporting with all background types
or with none at all:
== -p/-i
exp/bg | pdf | ruled | img
--------|-------|-------|-----
pdf | y | y | y
png | y | y | y(t)
svg | y | y | y(t)
== --export-no-background -p/-i
exp/bg | pdf | ruled | img
--------|-------|-------|-----
pdf | n | n | n
png | n(t) | n(t) | n(t)
svg | n(t) | n(t) | n(t)
y: exported
y(t): exported on transparent background
n: no export
n(t): no export and transparent background
N: not exported (wrong)
But typically, paper rulings are used for better orientation only so
that one does not wish to export them, whereas PDF and image backgrounds
are the subject of annotations. In order to allow exporting the latter
without rulings even for mixed documents (or batch exporting a mix of
files with the same option) introduce an export option
`--export-no-ruling` which does just that:
== --export-no-ruling -p/-i
exp/bg | pdf | ruled | img
--------|-------|-------|-----
pdf | y | n | y
png | y | n(t) | y(t)
svg | y | n(t) | y(t)
(Note that verifying y for pdf->svg requires an SVG 1.2 capable viewer
or direct inspection of the svg file.)
Technically, I chose to expose only these two modes on CLI and UI but
introduce an enum of export background types which can be amended
easily. On the lowest level (view.drawPage() and friends) the methods
allow to switch on/off each of the three background types individually
now so that they don't need to know about CLI/UI facing "modes" at all.
Before introducing more export options later on, refactor the current
code: turn the boolean noBackground/withoutBackground/hideBackground
into an enum ExportBackgroundType exportBackground which currently can
have two values EXPORT_BACKGROUND_ALL and EXPORT_BACKGROUND_NONE.
That way we can extend the enum later on without changing call
signatures; also, enum values are hopefully self-explaining.
No change of behaviour with this commit.
de3b57e3 ("Add support for more export options in CLI and GUI", 2020-11-27)
introduced an export option for leaving out the background. For the three
types of background (pdf, ruled, img) this resulted in the following
exports:
exp/bg | pdf | ruled | img
--------|-------|-------|-----
pdf | n | n | n
png | Y | n(t) | n(t)
svg | Y | n(t) | n(t)
n: no export
n(t): no export and transparent background
Y: exported (wrong)
(Note that verifying Y for pdf->svg requires an SVG 1.2 capable viewer
or direct inspection of the svg file.)
This commit fixes the behaviour to result in the following exports with
`export-no-background`:
exp/bg | pdf | ruled | img
--------|-------|-------|-----
pdf | n | n | n
png | n(t) | n(t) | n(t)
svg | n(t) | n(t) | n(t)