Compare commits

...

12 Commits

Author SHA1 Message Date
Dandaedre bf8c57c344 Prepare Deckstride 0.1.101 release
Gitea/Deckstride/pipeline/head This commit looks good Details
2026-11-21 16:18:55 +01:00
Dandaedre 00c8ed0697 Add importable language and theme packs 2026-11-21 16:11:51 +01:00
Dandaedre 3ca73d86cd Keep preferences window size stable
Gitea/Deckstride/pipeline/head This commit looks good Details
2026-11-21 15:35:07 +01:00
Dandaedre d41b8ab614 Organize preferences into tabs
Gitea/Deckstride/pipeline/head This commit looks good Details
2026-11-21 15:28:20 +01:00
Dandaedre aad895bc61 Shorten presenter menu 2026-11-21 15:23:45 +01:00
Dandaedre 2f98df4674 Configure releases for Gitea and GitHub 2026-11-21 15:11:56 +01:00
Dandaedre 89df5c2fe8 Prepare Deckstride 0.1.96 release
Gitea/Deckstride/pipeline/head This commit looks good Details
2026-11-21 11:50:45 +01:00
Dandaedre 9fef5f12ef Rename application to Deckstride 2026-11-21 11:48:27 +01:00
Dandaedre 56672964b3 Add resilient slide autoplay controls
Gitea/Deckstride/pipeline/head This commit looks good Details
2026-11-21 11:11:58 +01:00
Dandaedre 621d9d3d51 Show portable executable path in preferences 2026-11-21 11:04:19 +01:00
Dandaedre 92e3466d47 Show source path in presenter footer 2026-11-21 10:58:09 +01:00
Dandaedre 9ca908e88d feat: add fast built-in interface languages 2026-11-21 08:27:12 +01:00
102 changed files with 4072 additions and 1057 deletions

View File

@ -1,4 +1,4 @@
# PDF Presenter
# Deckstride
Standalone Rust application foundation for multiscreen PDF presentation. Read
`AGENT_DOCUMENTATION.md` and `docs/development/plan.md` before implementing behavior.
@ -8,12 +8,12 @@ Physical display, performance, sleep and clean-machine acceptance remain open.
## Structure and intended architecture
- `crates/pdf-presenter/src/lib.rs`: tested, UI-independent presentation state.
- `crates/deckstride/src/lib.rs`: tested, UI-independent presentation state.
- `src/main.rs` in that crate: CLI/native entry point. `native.rs` owns windows, `presenter_ui.rs` controls, `studio.rs` shared state,
`document.rs` rendering, `worker.rs` supervised jobs, `output.rs` independent host/leases,
`settings.rs` persistence. `desktop.rs`/`poc.rs`/`paint.rs` retain the display diagnostic.
- `crates/pdf-presenter/tests/`: meaningful behavior tests, including boundary cases.
- `crates/pdf-presenter/assets/`: generated app artwork and provenance.
- `crates/deckstride/tests/`: meaningful behavior tests, including boundary cases.
- `crates/deckstride/assets/`: generated app artwork and provenance.
- `scripts/`, `tests/`, `Jenkinsfile`: standalone validation and badge publication.
- `docs/development/`: architecture decisions, implementation plan and CI setup.
- `docs/interfaces/`: persistent-format contracts when formats are introduced.
@ -85,7 +85,7 @@ for Windows/macOS artifacts do not authorize rebuilding them on every later task
Report platform validation that was not run accurately; do not imply it passed.
CI uses `rust_no_docker`; it archives exactly three badge SVGs and only main/non-PR
builds publish to `/mnt/assets/coverage/idle-org/pdf-presenter/main/`. No automatic
builds publish to `/mnt/assets/coverage/idle-org/deckstride/main/`. No automatic
releases, binaries or manual publication. Jenkins job creation is external setup.
Never modify another tool's badges or the shared manuals root.

110
Cargo.lock generated
View File

@ -95,6 +95,15 @@ dependencies = [
"libc",
]
[[package]]
name = "arbitrary"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"
dependencies = [
"derive_arbitrary",
]
[[package]]
name = "arrayref"
version = "0.3.9"
@ -668,6 +677,49 @@ dependencies = [
"syn 2.0.119",
]
[[package]]
name = "deckstride"
version = "0.1.101"
dependencies = [
"bytemuck",
"chrono",
"directories",
"egui",
"egui-winit",
"egui_software_backend",
"font8x8",
"hayro",
"image",
"keepawake",
"libc",
"rfd",
"serde",
"serde_json",
"sha2",
"softbuffer",
"sys-locale",
"sysinfo",
"tempfile",
"toml 0.8.23",
"wayland-client",
"wayland-protocols",
"winit",
"winresource",
"x11-dl",
"zip",
]
[[package]]
name = "derive_arbitrary"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b034bd7d5f032402a2479444dcc6f74e36a03f31854d41680fb240ef682a1ac"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
]
[[package]]
name = "derive_builder"
version = "0.20.2"
@ -2243,37 +2295,6 @@ dependencies = [
"windows-link 0.2.1",
]
[[package]]
name = "pdf-presenter"
version = "0.1.91"
dependencies = [
"bytemuck",
"chrono",
"directories",
"egui",
"egui-winit",
"egui_software_backend",
"font8x8",
"hayro",
"image",
"keepawake",
"libc",
"rfd",
"serde",
"serde_json",
"sha2",
"softbuffer",
"sys-locale",
"sysinfo",
"tempfile",
"toml 0.8.23",
"wayland-client",
"wayland-protocols",
"winit",
"winresource",
"x11-dl",
]
[[package]]
name = "peniko"
version = "0.6.1"
@ -4319,6 +4340,21 @@ dependencies = [
"syn 3.0.10",
]
[[package]]
name = "zip"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744"
dependencies = [
"arbitrary",
"crc32fast",
"crossbeam-utils",
"flate2",
"indexmap",
"memchr",
"zopfli",
]
[[package]]
name = "zlib-rs"
version = "0.6.8"
@ -4331,6 +4367,18 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
[[package]]
name = "zopfli"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11"
dependencies = [
"bumpalo",
"crc32fast",
"log",
"simd-adler32",
]
[[package]]
name = "zune-core"
version = "0.5.3"

View File

@ -1,13 +1,13 @@
[workspace]
members = ["crates/pdf-presenter"]
default-members = ["crates/pdf-presenter"]
members = ["crates/deckstride"]
default-members = ["crates/deckstride"]
resolver = "3"
[workspace.package]
version = "0.1.91"
version = "0.1.101"
edition = "2024"
license = "MIT"
repository = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter"
repository = "https://proxy.dandaedre.com/gitea/idle-org/deckstride"
[profile.dev]
debug = 0

6
Jenkinsfile vendored
View File

@ -12,7 +12,7 @@ pipeline {
PYTHONUNBUFFERED = '1'
PYTHONDONTWRITEBYTECODE = '1'
NO_COLOR = '1'
PDF_PRESENTER_HEADLESS_CI = '1'
DECKSTRIDE_HEADLESS_CI = '1'
CARGO_TERM_COLOR = 'never'
BADGE_ROOT = '/mnt/assets/coverage'
}
@ -60,7 +60,7 @@ pipeline {
sh '''
set -eu
uv run --no-project --python ">=3.11" python -m unittest discover -s tests -v
unset PDF_PRESENTER_GUI_TESTS
unset DECKSTRIDE_GUI_TESTS
cargo test --locked --workspace --all-features
cargo build --locked --workspace --all-features
uv run --no-project --python ">=3.11" python scripts/ci.py tests-passed
@ -72,7 +72,7 @@ pipeline {
steps {
sh '''
set -eu
unset PDF_PRESENTER_GUI_TESTS
unset DECKSTRIDE_GUI_TESTS
uv run --no-project --python ">=3.11" python scripts/ci.py coverage
'''
}

View File

@ -1,23 +1,23 @@
<p align="center">
<img src="crates/pdf-presenter/assets/app-icon.png" width="96" height="96" alt="PDF Presenter icon">
<img src="crates/deckstride/assets/app-icon.png" width="96" height="96" alt="Deckstride icon">
</p>
<h1 align="center">PDF Presenter</h1>
<h1 align="center">Deckstride</h1>
<p align="center"><strong>A fast, portable presenter for PDFs and picture folders.</strong></p>
<p align="center">Fullscreen slides for the room. Notes, previews and controls for you.</p>
<p align="center">
<a href="docs/changelog.md"><img src="https://assets.dandaedre.com/coverage/idle-org/pdf-presenter/main/version.svg" alt="Version"></a>
<a href="docs/development/ci.md"><img src="https://assets.dandaedre.com/coverage/idle-org/pdf-presenter/main/test.svg" alt="Tests"></a>
<a href="docs/development/ci.md"><img src="https://assets.dandaedre.com/coverage/idle-org/pdf-presenter/main/coverage.svg" alt="Coverage"></a>
<a href="docs/changelog.md"><img src="https://assets.dandaedre.com/coverage/idle-org/deckstride/main/version.svg" alt="Version"></a>
<a href="docs/development/ci.md"><img src="https://assets.dandaedre.com/coverage/idle-org/deckstride/main/test.svg" alt="Tests"></a>
<a href="docs/development/ci.md"><img src="https://assets.dandaedre.com/coverage/idle-org/deckstride/main/coverage.svg" alt="Coverage"></a>
</p>
<p align="center">
<a href="https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter/releases"><strong>Download PDF Presenter</strong></a> ·
<a href="https://proxy.dandaedre.com/gitea/idle-org/deckstride/releases"><strong>Download Deckstride</strong></a> ·
<a href="docs/user-guide.md">User guide</a> ·
<a href="https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter/issues">Report an issue</a>
<a href="https://proxy.dandaedre.com/gitea/idle-org/deckstride/issues">Report an issue</a>
</p>
PDF Presenter gives each connected screen a job: **Presenter**, **Slides**, or
Deckstride gives each connected screen a job: **Presenter**, **Slides**, or
**Unused**. Keep the current slide, next slide, notes and timers in front of you
while one or more other screens show only the presentation. You can also mirror the
Presenter view, rehearse on one monitor, or change the arrangement during a session.
@ -43,8 +43,9 @@ slow document operation does not have to freeze navigation.
| **Shared zoom** | Opt in to zoom, pan or fit a page to width from Presenter or Slides. Both views stay on the same part of the page. |
| **Safe slide browsing** | Browse resizable thumbnails without changing the live slide. Double-click to preview, or enable **Change on click** when direct switching is useful. |
| **Notes that belong to the presentation** | Read notes from a sidecar or the PDF, import TXT/Markdown, and double-click the notes pane to edit the current slide. Notes automatically fit the available space. |
| **Presentation-aware desktop behavior** | PDF Presenter asks supported operating systems to keep the display awake and reports whether protection is active. Closing Presenter also closes its Slides windows. |
| **Presentation-aware desktop behavior** | Deckstride asks supported operating systems to keep the display awake and reports whether protection is active. Closing Presenter also closes its Slides windows. |
| **Portable by design** | The release binaries include the PDF renderer and application dependencies. Keep the extracted folder anywhere convenient; no Rust or separate PDF software is required. |
| **Themes and languages** | Choose from 20 built-in palettes and seven interface languages, or import bounded offline language/theme packs. |
On Windows, multi-screen output, per-screen layouts, zoom, tools, and unplugging then
reconnecting displays have been tested in extended use. Linux and macOS use the same
@ -53,16 +54,16 @@ on the machines that will run the show.
## Download and run
Open the [release page](https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter/releases)
Open the [release page](https://proxy.dandaedre.com/gitea/idle-org/deckstride/releases)
and download the archive for your computer.
| Platform | Recommended download | Start after extracting |
| --- | --- | --- |
| Windows x86_64 | `pdf-presenter-portable-x86_64-pc-windows-gnu-v….zip` | `pdf-presenter.exe` |
| Linux x86_64 | `pdf-presenter-portable-x86_64-unknown-linux-gnu-v….tgz` | `./pdf-presenter` |
| Linux ARM64 | `pdf-presenter-portable-aarch64-unknown-linux-musl-v….tgz` | `./pdf-presenter` |
| Apple Silicon macOS 13+ | `pdf-presenter-portable-aarch64-apple-darwin-v….tgz` | Follow the release-page macOS instructions |
| Intel macOS 13+ | `pdf-presenter-portable-x86_64-apple-darwin-v….tgz` | Follow the release-page macOS instructions |
| Windows x86_64 | `deckstride-portable-x86_64-pc-windows-gnu-v….zip` | `deckstride.exe` |
| Linux x86_64 | `deckstride-portable-x86_64-unknown-linux-gnu-v….tgz` | `./deckstride` |
| Linux ARM64 | `deckstride-portable-aarch64-unknown-linux-musl-v….tgz` | `./deckstride` |
| Apple Silicon macOS 13+ | `deckstride-portable-aarch64-apple-darwin-v….tgz` | Follow the release-page macOS instructions |
| Intel macOS 13+ | `deckstride-portable-x86_64-apple-darwin-v….tgz` | Follow the release-page macOS instructions |
Windows and macOS builds are currently unsigned. Releases are ready for normal use;
test the actual computer, adapters and display arrangement before a live event.
@ -70,15 +71,14 @@ macOS artifacts are cross-built on Linux and have not yet had native Mac runtime
testing. [Installation and update details →](docs/user-guide.md#install-and-update)
If you already have [cargo-binstall](https://github.com/cargo-bins/cargo-binstall)
installed, you can install a prebuilt release directly:
installed, install the prebuilt release directly:
```sh
cargo binstall pdf-presenter --git https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter --version 0.1.91 --strategies crate-meta-data
cargo binstall deckstride --git https://proxy.dandaedre.com/gitea/idle-org/deckstride --version 0.1.96 --strategies crate-meta-data
```
Replace `0.1.91` with the published version you want from the release page. This
uses the repository's release archives and requires an available build for your
platform. Then run `pdf-presenter`.
Replace `0.1.96` with another published Deckstride version when needed. Then run
`deckstride`.
## Set up a show
@ -91,7 +91,7 @@ platform. Then run `pdf-presenter`.
4. **Present.** Use Left/Right, Page Up/Page Down or Space. Type a slide number and
press Enter to jump directly to it. Press B to blank or restore Slides.
PDF Presenter shows Slides by default after a document opens. Entering or leaving
Deckstride shows Slides by default after a document opens. Entering or leaving
fullscreen and changing screen assignments preserve that choice. Header and footer
controls can auto-hide; move the pointer near their edge or right-click to recover
them.
@ -142,9 +142,22 @@ Useful controls:
[Notes file formats →](docs/interfaces/presentation-notes.md) ·
[Preparation, cache and RAM behavior →](docs/user-guide.md#preparation-processed-slides-and-ram)
## Add languages and themes
Open **Preferences → General → Appearance** and choose **Import language pack…**
or **Import theme pack…**. Imported choices appear in the existing Language and
Theme selectors without restarting Deckstride. Packs stay offline and contain data
only.
Editable examples and ready-to-import ZIPs:
- [Language pack example](docs/packs/deckstride-language-pack.zip)
- [Theme pack example](docs/packs/deckstride-theme-pack.zip)
- [Pack format and limits](docs/packs/README.md)
## Open source
PDF Presenter is independent open-source software under the [MIT license](LICENSE).
Deckstride is independent open-source software under the [MIT license](LICENSE).
Development includes LLM-generated or LLM-assisted work with human review. The
project is used in professional settings, while physical acceptance work remains
documented rather than hidden.

View File

@ -1,9 +1,14 @@
PDF Presenter — locked dependency and font notices
Deckstride — locked dependency and font notices
Generated by scripts/notices.py. Includes target/build-only dependencies;
the presence of a package here does not mean it is linked on every OS.
Unmodified source packages are available at https://crates.io.
For alternative licenses, permissive MIT/Apache alternatives are selected.
Noto Sans CJK 2.004
License expression: OFL-1.1
Source: https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004
assets/fonts/OFL.txt: text 5c0af63904410dcf
ab_glyph 0.2.32
License expression: Apache-2.0
Source: https://github.com/alexheretic/ab-glyph
@ -60,6 +65,12 @@ Source: https://github.com/nical/android_system_properties
LICENSE-APACHE: text 216486f29671a426
LICENSE-MIT: text 80f275e90d799911
arbitrary 1.5.0
License expression: MIT OR Apache-2.0
Source: https://github.com/rust-fuzz/arbitrary/
LICENSE-APACHE: text a60eea8175145316
LICENSE-MIT: text 15656cc11a8331f2
arrayref 0.3.9
License expression: BSD-2-Clause
Source: https://github.com/droundy/arrayref
@ -396,6 +407,12 @@ License expression: MIT
Source: https://github.com/TedDriggs/darling
LICENSE: text 8ea93490d74a5a1b
derive_arbitrary 1.5.0
License expression: MIT OR Apache-2.0
Source: https://github.com/rust-fuzz/arbitrary
LICENSE-APACHE: text a60eea8175145316
LICENSE-MIT: text 15656cc11a8331f2
derive_builder 0.20.2
License expression: MIT OR Apache-2.0
Source: https://github.com/colin-kiegel/rust-derive-builder
@ -2458,6 +2475,11 @@ License expression: Unicode-3.0
Source: https://github.com/unicode-org/icu4x
LICENSE: text f367c1b8e1aa2624
zip 2.6.1
License expression: MIT
Source: https://github.com/zip-rs/zip2.git
LICENSE: text 04dc52136d82400b
zlib-rs 0.6.8
License expression: Zlib
Source: https://github.com/trifectatechfoundation/zlib-rs
@ -2468,6 +2490,11 @@ License expression: MIT
Source: https://github.com/dtolnay/zmij
LICENSE-MIT: text 23f18e03dc49df91
zopfli 0.8.4
License expression: Apache-2.0
Source: https://github.com/zopfli-rs/zopfli
COPYING: text 018b1cb87efdf7a0
zune-core 0.5.3
License expression: MIT OR Apache-2.0 OR Zlib
Source: https://github.com/etemesi254/zune-image
@ -2499,6 +2526,210 @@ Source: https://github.com/z-galaxy/zbus/
LICENSE TEXTS
=== 018b1cb87efdf7a0 ===
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2011 Google Inc.
Licensed 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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=== 01c266bced4a434d ===
This project is dual-licensed under the Unlicense and MIT licenses.
@ -2816,6 +3047,32 @@ SOFTWARE.
=== 04dc52136d82400b ===
The MIT License (MIT)
Copyright (c) 2014 Mathijs van de Nes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Some files in the "tests/data" subdirectory of this repository are under other
licences; see files named LICENSE.*.txt for details.
=== 04ea4849dba9dcae ===
Apache License
Version 2.0, January 2004
@ -3692,6 +3949,36 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=== 15656cc11a8331f2 ===
MIT License
Copyright (c) 2019 Manish Goregaokar
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
=== 1847e0e0698142ed ===
MIT License
@ -7121,6 +7408,106 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=== 5c0af63904410dcf ===
Noto Sans: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
Noto Sans CJK: Copyright 2014-2021 Adobe (http://www.adobe.com/).
Noto Sans Devanagari: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/devanagari)
Noto Sans Thai: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/thai)
This Font Software is licensed under the SIL Open Font License,
Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
=== 5cc390ab5e5e6507 ===
MIT License

View File

@ -1,5 +1,5 @@
[package]
name = "pdf-presenter"
name = "deckstride"
version.workspace = true
edition.workspace = true
license.workspace = true
@ -27,6 +27,7 @@ hayro = "=0.9.0"
chrono = "0.4"
rfd = "=0.15.4"
sysinfo = { version = "=0.37.2", default-features = false, features = ["system"] }
zip = { version = "2", default-features = false, features = ["deflate"] }
[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))'.dependencies]
keepawake = "=0.6.1"

View File

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

View File

@ -0,0 +1,97 @@
Noto Sans: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
Noto Sans CJK: Copyright 2014-2021 Adobe (http://www.adobe.com/).
Noto Sans Devanagari: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/devanagari)
Noto Sans Thai: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/thai)
This Font Software is licensed under the SIL Open Font License,
Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,13 @@
# Embedded CJK font
`NotoSansCJK-Regular.ttc` is the unmodified Noto Sans CJK 2.004 collection used by
Canvas Pilot, under the included [SIL Open Font License 1.1](OFL.txt). Upstream:
<https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004>.
SHA-256: `b76b0433203017ca80401b2ee0dd69350349871c4b19d504c34dbdd80541690a`.
Deckstride uses collection index 0 for Japanese and index 2 for Simplified
Chinese. The collection is embedded in the executable; no runtime font lookup or
download occurs. Font definitions are installed only when a CJK interface language
is active and only when the language selection changes. Other interface languages
retain egui's existing embedded fonts.

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -16,8 +16,8 @@ pub(crate) fn window_attributes() -> WindowAttributes {
let attributes = {
use winit::platform::{wayland::WindowAttributesExtWayland, x11::WindowAttributesExtX11};
let attributes =
WindowAttributesExtWayland::with_name(attributes, "pdf-presenter", "pdf-presenter");
WindowAttributesExtX11::with_name(attributes, "pdf-presenter", "pdf-presenter")
WindowAttributesExtWayland::with_name(attributes, "deckstride", "deckstride");
WindowAttributesExtX11::with_name(attributes, "deckstride", "deckstride")
};
attributes
}

View File

@ -210,13 +210,13 @@ impl App {
if self.presenter.is_none() {
self.presenter = Some(NativeWindow::create(
event_loop,
"PDF Presenter - presenter controls",
"Deckstride - presenter controls",
)?);
}
if self.audience.is_none() {
self.audience = Some(NativeWindow::create(
event_loop,
"PDF Presenter - mock audience output",
"Deckstride - mock audience output",
)?);
}
self.place();

View File

@ -82,6 +82,8 @@ pub mod studio;
/// Presenter interface language.
pub mod localization;
/// Bounded runtime language and theme packs.
pub mod packs;
/// Standalone presenter palettes.
pub mod theme;

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
windows_subsystem = "windows"
)]
use pdf_presenter::{native, poc::Options};
use deckstride::{native, poc::Options};
fn main() {
if std::env::args().nth(1).as_deref() == Some("--licenses") {
@ -11,7 +11,7 @@ fn main() {
return;
}
if std::env::args().nth(1).as_deref() == Some("--worker") {
if let Err(e) = pdf_presenter::worker::run() {
if let Err(e) = deckstride::worker::run() {
eprintln!("{e}");
std::process::exit(1);
}
@ -25,7 +25,7 @@ fn main() {
return;
}
if std::env::args().nth(1).as_deref() == Some("--keep-awake") {
let _ = pdf_presenter::output::keep_awake();
let _ = deckstride::output::keep_awake();
return;
}
let mut args = std::env::args().skip(1).collect::<Vec<_>>();
@ -53,11 +53,11 @@ fn main() {
};
if options.help {
println!(
"PDF Presenter {} — native PDF and picture-folder presenter\n\
Usage: pdf-presenter [--open PDF_OR_FOLDER] [--windowed]\n\
pdf-presenter --list-monitors\n\
pdf-presenter --presenter N --audience N\n\
pdf-presenter --smoke-test\n\
"Deckstride {} — native PDF and picture-folder presenter\n\
Usage: deckstride [--open PDF_OR_FOLDER] [--windowed]\n\
deckstride --list-monitors\n\
deckstride --presenter N --audience N\n\
deckstride --smoke-test\n\
Both roles start fullscreen. Select/mirror screens from Displays.\n\
Keys: arrows/space navigate, number + Enter jumps, B blanks.\n\
Escape/Ctrl+Q request quit confirmation; Escape first reverts a display trial.\n\
@ -70,12 +70,12 @@ PDF/image decoding runs in supervised workers; no external PDF backend needed.",
return;
}
let result = if proof {
pdf_presenter::desktop::run(options)
deckstride::desktop::run(options)
} else {
native::run(options, path)
};
if let Err(error) = result {
eprintln!("PDF Presenter could not start/continue: {error}");
eprintln!("Deckstride could not start/continue: {error}");
std::process::exit(1);
}
}

View File

@ -193,15 +193,19 @@ struct NativeWindow {
zoom_watch: crate::zoom::PerformanceWatch,
zoom_slow: bool,
presentation_base: Option<PresentationBase>,
applied_theme: Option<crate::theme::Theme>,
applied_theme_pack: Option<Option<String>>,
applied_language: Option<crate::localization::Language>,
applied_language_pack: Option<Option<String>>,
#[cfg(target_os = "linux")]
browser_parent: Option<WindowId>,
}
impl NativeWindow {
fn create(el: &ActiveEventLoop, role: Role, monitor: String) -> Result<Self, Failure> {
let title = match role {
Role::Presenter => "PDF Presenter — Presenter",
Role::Browser => "PDF Presenter — All slides",
Role::Presentation => "PDF Presenter — Slides",
Role::Presenter => "Deckstride — Presenter",
Role::Browser => "Deckstride — All slides",
Role::Presentation => "Deckstride — Slides",
};
let attributes = crate::artwork::window_attributes()
.with_title(title)
@ -253,6 +257,10 @@ impl NativeWindow {
zoom_watch: Default::default(),
zoom_slow: false,
presentation_base: None,
applied_theme: None,
applied_theme_pack: None,
applied_language: None,
applied_language_pack: None,
#[cfg(target_os = "linux")]
browser_parent: None,
})
@ -336,8 +344,28 @@ impl NativeWindow {
return Err("Display exceeds 40 megapixels".into());
}
if let Some(s) = studio.as_ref() {
s.settings.theme.apply(&self.ctx);
crate::localization::apply(&self.ctx, &s.settings.language);
if self.applied_theme != Some(s.settings.theme)
|| self.applied_theme_pack.as_ref() != Some(&s.settings.theme_pack)
{
crate::theme::apply_selected(
&self.ctx,
s.settings.theme,
s.settings.theme_pack.as_deref(),
);
self.applied_theme = Some(s.settings.theme);
self.applied_theme_pack = Some(s.settings.theme_pack.clone());
}
if self.applied_language != Some(s.settings.language)
|| self.applied_language_pack.as_ref() != Some(&s.settings.language_pack)
{
crate::localization::apply_selected(
&self.ctx,
&s.settings.language,
s.settings.language_pack.as_deref(),
);
self.applied_language = Some(s.settings.language);
self.applied_language_pack = Some(s.settings.language_pack.clone());
}
}
let input = self.input.take_egui_input(&self.window);
let role = self.role;
@ -1161,7 +1189,11 @@ impl App {
#[cfg(target_os = "windows")]
if matches!(
action,
Action::Pick(_) | Action::PickNotes | Action::PickBlankPicture
Action::Pick(_)
| Action::PickNotes
| Action::PickBlankPicture
| Action::PickLanguagePack
| Action::PickThemePack
) && !s.dialog_busy
{
use winit::raw_window_handle::{HasWindowHandle, RawWindowHandle};
@ -2016,7 +2048,7 @@ mod buffer_tests {
#[cfg(target_os = "linux")]
#[test]
fn three_native_windows_render_without_clicks_and_reset_placement_on_topology_change() {
if std::env::var_os("PDF_PRESENTER_GUI_TESTS").is_none() {
if std::env::var_os("DECKSTRIDE_GUI_TESTS").is_none() {
return;
}
use winit::platform::x11::EventLoopBuilderExtX11;

View File

@ -306,8 +306,8 @@ pub fn keep_awake() -> Result<(), String> {
let guard = keepawake::Builder::default()
.display(true)
.idle(true)
.reason("PDF Presenter presentation")
.app_name("PDF Presenter")
.reason("Deckstride presentation")
.app_name("Deckstride")
.app_reverse_domain("com.beffroi.pdfpresenter")
.create();
#[cfg(not(any(target_os = "linux", target_os = "windows", target_os = "macos")))]

View File

@ -0,0 +1,698 @@
//! Bounded, data-only language and theme packs compatible with Canvas Pilot manifests.
use crate::theme::Palette;
use egui::Color32;
use serde::Deserialize;
use sha2::{Digest, Sha256};
use std::{
collections::{BTreeMap, BTreeSet},
io::Read,
path::{Path, PathBuf},
sync::{LazyLock, RwLock},
};
const MAX_ARCHIVE: u64 = 2 * 1024 * 1024;
const MAX_EXPANDED: u64 = 4 * 1024 * 1024;
const MAX_PACKS: usize = 32;
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
struct LanguageManifest {
version: u32,
id: String,
revision: u64,
languages: Vec<LanguageDescription>,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct LanguageDescription {
pub locale: String,
pub name: String,
pub native_name: String,
}
#[derive(Clone, Debug)]
pub struct InstalledLanguagePack {
pub id: String,
pub revision: u64,
pub languages: Vec<LanguageDescription>,
}
#[derive(Clone)]
struct LanguagePack {
manifest: LanguageManifest,
catalogs: BTreeMap<String, BTreeMap<String, &'static str>>,
path: PathBuf,
fingerprint: [u8; 32],
}
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
struct ThemeManifest {
version: u32,
id: String,
revision: u64,
themes: Vec<ThemeDescription>,
#[serde(default)]
notices: String,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ThemeDescription {
pub id: String,
pub name: String,
pub light: bool,
colors: ThemeColors,
}
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
struct ThemeColors {
canvas: String,
banner: String,
grid: String,
layer: String,
bg: String,
panel: String,
field: String,
line: String,
text: String,
muted: String,
cyan: String,
amber: String,
purple: String,
pattern: [String; 2],
}
#[derive(Clone, Debug)]
pub struct InstalledThemePack {
pub id: String,
pub revision: u64,
pub themes: Vec<ThemeDescription>,
pub notices: String,
}
#[derive(Clone)]
struct ThemePack {
manifest: ThemeManifest,
path: PathBuf,
fingerprint: [u8; 32],
}
static LANGUAGE_PACKS: LazyLock<RwLock<Vec<LanguagePack>>> =
LazyLock::new(|| RwLock::new(Vec::new()));
static THEME_PACKS: LazyLock<RwLock<Vec<ThemePack>>> = LazyLock::new(|| RwLock::new(Vec::new()));
#[derive(Default)]
struct InternPool {
values: BTreeMap<String, &'static str>,
bytes: usize,
}
static INTERNED: LazyLock<RwLock<InternPool>> = LazyLock::new(Default::default);
pub fn valid_id(id: &str) -> bool {
!id.is_empty()
&& id.len() <= 63
&& id
.bytes()
.all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit() || byte == b'-')
&& !id.starts_with('-')
&& !id.ends_with('-')
}
pub fn valid_theme_choice(id: &str) -> bool {
id.split_once('/')
.is_some_and(|(pack, theme)| valid_id(pack) && valid_id(theme))
}
fn bounded_read(path: &Path) -> Result<Vec<u8>, String> {
let mut bytes = Vec::new();
std::fs::File::open(path)
.map_err(|error| error.to_string())?
.take(MAX_ARCHIVE + 1)
.read_to_end(&mut bytes)
.map_err(|error| error.to_string())?;
if bytes.len() as u64 > MAX_ARCHIVE {
return Err("Pack exceeds 2 MiB".into());
}
Ok(bytes)
}
fn fingerprint(bytes: &[u8]) -> [u8; 32] {
Sha256::digest(bytes).into()
}
fn intern(text: String) -> Result<&'static str, String> {
let mut pool = INTERNED.write().unwrap();
if let Some(value) = pool.values.get(&text) {
return Ok(value);
}
if pool.bytes.saturating_add(text.len()) > 32 * 1024 * 1024 {
return Err(
"Runtime language-pack text limit reached; restart before importing more".into(),
);
}
let leaked = Box::leak(text.clone().into_boxed_str());
pool.bytes += text.len();
pool.values.insert(text, leaked);
Ok(leaked)
}
fn parse_language(bytes: &[u8], path: PathBuf) -> Result<LanguagePack, String> {
if bytes.len() as u64 > MAX_ARCHIVE {
return Err("Language pack exceeds 2 MiB".into());
}
let mut zip = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| e.to_string())?;
if zip.is_empty() || zip.len() > 17 {
return Err("Expected manifest.json and at most 16 catalogs".into());
}
let mut entries = BTreeMap::new();
let mut expanded = 0_u64;
for index in 0..zip.len() {
let mut entry = zip.by_index(index).map_err(|e| e.to_string())?;
let name = entry.name().to_owned();
if name.contains(['/', '\\'])
|| !name.ends_with(".json")
|| entry.is_dir()
|| entry
.unix_mode()
.is_some_and(|mode| mode & 0o170000 == 0o120000)
{
return Err("Pack entries must be regular JSON files at the ZIP root".into());
}
let mut data = Vec::new();
(&mut entry)
.take(MAX_EXPANDED.saturating_sub(expanded) + 1)
.read_to_end(&mut data)
.map_err(|e| e.to_string())?;
expanded += data.len() as u64;
if expanded > MAX_EXPANDED {
return Err("Expanded language pack exceeds 4 MiB".into());
}
if entries.insert(name, data).is_some() {
return Err("Duplicate ZIP entry".into());
}
}
let manifest: LanguageManifest = serde_json::from_slice(
&entries
.remove("manifest.json")
.ok_or("Missing manifest.json")?,
)
.map_err(|e| e.to_string())?;
if manifest.version != 2
|| manifest.revision == 0
|| !valid_id(&manifest.id)
|| manifest.languages.is_empty()
|| manifest.languages.len() > 16
{
return Err("Invalid language-pack manifest or unsupported version".into());
}
let builtins = ["system", "en", "fr", "es", "ja", "zh-cn", "de", "pt-br"];
let mut locales = BTreeSet::new();
let mut catalogs = BTreeMap::new();
for language in &manifest.languages {
if !valid_id(&language.locale)
|| builtins.contains(&language.locale.as_str())
|| !locales.insert(language.locale.clone())
{
return Err("Invalid, duplicate, or built-in locale identifier".into());
}
for name in [&language.name, &language.native_name] {
if name.trim().is_empty() || name.len() > 160 || name.chars().any(char::is_control) {
return Err("Invalid language display name".into());
}
}
let messages: BTreeMap<String, String> = serde_json::from_slice(
&entries
.remove(&format!("{}.json", language.locale))
.ok_or("Missing language catalog")?,
)
.map_err(|e| e.to_string())?;
if messages.is_empty() || messages.len() > 4096 {
return Err("Language catalog is empty or too large".into());
}
let mut checked = BTreeMap::new();
for (key, value) in messages {
if key.trim().is_empty()
|| key.len() > 16_384
|| key.chars().any(char::is_control)
|| value.trim().is_empty()
|| value.len() > 16_384
|| value
.chars()
.any(|c| c.is_control() && c != '\n' && c != '\t')
{
return Err("Invalid translation key or text".into());
}
checked.insert(key, intern(value)?);
}
catalogs.insert(language.locale.clone(), checked);
}
if !entries.is_empty() {
return Err("Unexpected files in language pack".into());
}
Ok(LanguagePack {
manifest,
catalogs,
path,
fingerprint: fingerprint(bytes),
})
}
fn color(text: &str) -> Result<Color32, String> {
if text.len() != 7
|| !text.starts_with('#')
|| !text[1..].bytes().all(|byte| byte.is_ascii_hexdigit())
{
return Err(format!("Expected opaque #RRGGBB color: {text}"));
}
let value = u32::from_str_radix(&text[1..], 16).map_err(|e| e.to_string())?;
Ok(Color32::from_rgb(
(value >> 16) as u8,
(value >> 8) as u8,
value as u8,
))
}
impl ThemeColors {
fn palette(&self) -> Result<Palette, String> {
Ok(Palette {
canvas: color(&self.canvas)?,
banner: color(&self.banner)?,
grid: color(&self.grid)?,
layer: color(&self.layer)?,
bg: color(&self.bg)?,
panel: color(&self.panel)?,
field: color(&self.field)?,
line: color(&self.line)?,
text: color(&self.text)?,
muted: color(&self.muted)?,
cyan: color(&self.cyan)?,
amber: color(&self.amber)?,
purple: color(&self.purple)?,
pattern: [color(&self.pattern[0])?, color(&self.pattern[1])?],
})
}
}
fn parse_theme(bytes: &[u8], path: PathBuf) -> Result<ThemePack, String> {
if bytes.len() as u64 > MAX_ARCHIVE {
return Err("Theme pack exceeds 2 MiB".into());
}
let mut zip = zip::ZipArchive::new(std::io::Cursor::new(bytes)).map_err(|e| e.to_string())?;
if zip.len() != 1 {
return Err("Expected only manifest.json in the theme pack".into());
}
let mut entry = zip.by_index(0).map_err(|e| e.to_string())?;
if entry.name() != "manifest.json"
|| entry.is_dir()
|| entry
.unix_mode()
.is_some_and(|mode| mode & 0o170000 == 0o120000)
{
return Err("Expected a regular manifest.json at the ZIP root".into());
}
let mut data = Vec::new();
(&mut entry)
.take(MAX_EXPANDED + 1)
.read_to_end(&mut data)
.map_err(|e| e.to_string())?;
if data.len() as u64 > MAX_EXPANDED {
return Err("Expanded theme pack exceeds 4 MiB".into());
}
let manifest: ThemeManifest = serde_json::from_slice(&data).map_err(|e| e.to_string())?;
if manifest.version != 1
|| manifest.revision == 0
|| !valid_id(&manifest.id)
|| manifest.themes.is_empty()
|| manifest.themes.len() > 16
|| manifest.notices.len() > 65_536
|| manifest
.notices
.chars()
.any(|c| c.is_control() && !matches!(c, '\n' | '\r' | '\t'))
{
return Err("Invalid theme-pack manifest or unsupported version".into());
}
let mut ids = BTreeSet::new();
for theme in &manifest.themes {
if !valid_id(&theme.id)
|| !ids.insert(theme.id.clone())
|| theme.name.trim().is_empty()
|| theme.name.len() > 160
|| theme.name.chars().any(char::is_control)
{
return Err("Invalid or duplicate theme identifier/name".into());
}
theme.colors.palette()?;
}
Ok(ThemePack {
manifest,
path,
fingerprint: fingerprint(bytes),
})
}
fn zip_paths(directory: &Path) -> Result<Vec<PathBuf>, String> {
let entries = match std::fs::read_dir(directory) {
Ok(entries) => entries,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(Vec::new()),
Err(error) => return Err(error.to_string()),
};
let mut paths: Vec<_> = entries
.filter_map(Result::ok)
.map(|entry| entry.path())
.filter(|path| path.extension().is_some_and(|extension| extension == "zip"))
.collect();
paths.sort();
if paths.len() > MAX_PACKS {
return Err("Too many packs (maximum 32)".into());
}
Ok(paths)
}
pub fn load(root: &Path) -> Vec<String> {
let mut errors = Vec::new();
let mut languages = Vec::new();
match zip_paths(&root.join("language-packs")) {
Ok(paths) => {
for path in paths {
match bounded_read(&path).and_then(|bytes| parse_language(&bytes, path.clone())) {
Ok(pack)
if !languages.iter().any(|old: &LanguagePack| {
old.manifest.id == pack.manifest.id
|| old.manifest.languages.iter().any(|old_language| {
pack.manifest
.languages
.iter()
.any(|new| new.locale == old_language.locale)
})
}) =>
{
languages.push(pack)
}
Ok(_) => errors.push(format!("{}: duplicate pack or locale", path.display())),
Err(error) => errors.push(format!("{}: {error}", path.display())),
}
}
}
Err(error) => errors.push(error),
}
let mut themes = Vec::new();
match zip_paths(&root.join("theme-packs")) {
Ok(paths) => {
for path in paths {
match bounded_read(&path).and_then(|bytes| parse_theme(&bytes, path.clone())) {
Ok(pack)
if !themes
.iter()
.any(|old: &ThemePack| old.manifest.id == pack.manifest.id) =>
{
themes.push(pack)
}
Ok(_) => errors.push(format!("{}: duplicate pack identifier", path.display())),
Err(error) => errors.push(format!("{}: {error}", path.display())),
}
}
}
Err(error) => errors.push(error),
}
*LANGUAGE_PACKS.write().unwrap() = languages;
*THEME_PACKS.write().unwrap() = themes;
errors
}
fn install_bytes(
directory: &Path,
id: &str,
revision: u64,
previous: Option<(PathBuf, u64, [u8; 32])>,
bytes: &[u8],
) -> Result<PathBuf, String> {
let destination = previous
.as_ref()
.map(|(path, _, _)| path.clone())
.unwrap_or_else(|| directory.join(format!("{id}.zip")));
if let Some((_, old_revision, _)) = &previous
&& revision <= *old_revision
{
return Err(format!(
"Installed revision {old_revision} is not older than revision {revision}"
));
}
if previous.is_none() && destination.exists() {
return Err("Pack destination already exists; remove or rename it before importing".into());
}
if let Some((_, _, expected)) = previous
&& fingerprint(&bounded_read(&destination)?) != expected
{
return Err("Installed pack changed on disk; restart before updating it".into());
}
if !destination.exists() && zip_paths(directory).is_ok_and(|paths| paths.len() >= MAX_PACKS) {
return Err("Too many packs (maximum 32)".into());
}
crate::settings::atomic_write(&destination, bytes)?;
Ok(destination)
}
pub fn install_language(root: &Path, source: &Path) -> Result<String, String> {
let bytes = bounded_read(source)?;
let parsed = parse_language(&bytes, PathBuf::new())?;
let installed = LANGUAGE_PACKS.read().unwrap().clone();
for old in &installed {
if old.manifest.id != parsed.manifest.id
&& old.manifest.languages.iter().any(|old_language| {
parsed
.manifest
.languages
.iter()
.any(|new| new.locale == old_language.locale)
})
{
return Err(format!(
"Locale belongs to installed pack {}",
old.manifest.id
));
}
}
let previous = installed
.iter()
.find(|pack| pack.manifest.id == parsed.manifest.id)
.map(|pack| (pack.path.clone(), pack.manifest.revision, pack.fingerprint));
let directory = root.join("language-packs");
let path = install_bytes(
&directory,
&parsed.manifest.id,
parsed.manifest.revision,
previous,
&bytes,
)?;
let id = parsed.manifest.id.clone();
let parsed = parse_language(&bytes, path)?;
let mut packs = LANGUAGE_PACKS.write().unwrap();
packs.retain(|pack| pack.manifest.id != id);
packs.push(parsed);
packs.sort_by(|a, b| a.manifest.id.cmp(&b.manifest.id));
Ok(id)
}
pub fn install_theme(root: &Path, source: &Path) -> Result<String, String> {
let bytes = bounded_read(source)?;
let parsed = parse_theme(&bytes, PathBuf::new())?;
let installed = THEME_PACKS.read().unwrap().clone();
let previous = installed
.iter()
.find(|pack| pack.manifest.id == parsed.manifest.id)
.map(|pack| (pack.path.clone(), pack.manifest.revision, pack.fingerprint));
let directory = root.join("theme-packs");
let path = install_bytes(
&directory,
&parsed.manifest.id,
parsed.manifest.revision,
previous,
&bytes,
)?;
let id = parsed.manifest.id.clone();
let parsed = parse_theme(&bytes, path)?;
let mut packs = THEME_PACKS.write().unwrap();
packs.retain(|pack| pack.manifest.id != id);
packs.push(parsed);
packs.sort_by(|a, b| a.manifest.id.cmp(&b.manifest.id));
Ok(id)
}
pub fn language_packs() -> Vec<InstalledLanguagePack> {
LANGUAGE_PACKS
.read()
.unwrap()
.iter()
.map(|pack| InstalledLanguagePack {
id: pack.manifest.id.clone(),
revision: pack.manifest.revision,
languages: pack.manifest.languages.clone(),
})
.collect()
}
pub fn theme_packs() -> Vec<InstalledThemePack> {
THEME_PACKS
.read()
.unwrap()
.iter()
.map(|pack| InstalledThemePack {
id: pack.manifest.id.clone(),
revision: pack.manifest.revision,
themes: pack.manifest.themes.clone(),
notices: pack.manifest.notices.clone(),
})
.collect()
}
pub fn translation(locale: &str, source: &str) -> Option<&'static str> {
LANGUAGE_PACKS
.read()
.unwrap()
.iter()
.find_map(|pack| pack.catalogs.get(locale)?.get(source).copied())
}
pub fn language_name(locale: &str) -> Option<String> {
LANGUAGE_PACKS.read().unwrap().iter().find_map(|pack| {
pack.manifest
.languages
.iter()
.find(|language| language.locale == locale)
.map(|language| format!("{} — {}", language.native_name, language.name))
})
}
pub fn theme_choices() -> Vec<(String, String)> {
THEME_PACKS
.read()
.unwrap()
.iter()
.flat_map(|pack| {
pack.manifest.themes.iter().map(|theme| {
(
format!("{}/{}", pack.manifest.id, theme.id),
theme.name.clone(),
)
})
})
.collect()
}
pub fn packed_theme(choice: &str) -> Option<(Palette, bool, String)> {
let (pack_id, theme_id) = choice.split_once('/')?;
THEME_PACKS.read().unwrap().iter().find_map(|pack| {
if pack.manifest.id != pack_id {
return None;
}
let theme = pack
.manifest
.themes
.iter()
.find(|theme| theme.id == theme_id)?;
Some((
theme.colors.palette().ok()?,
theme.light,
theme.name.clone(),
))
})
}
pub fn pack_root(settings_path: &Path) -> Result<&Path, String> {
settings_path
.parent()
.ok_or("Settings directory unavailable".into())
}
#[cfg(test)]
mod tests {
use super::*;
use std::io::Write;
fn archive(files: &[(&str, &[u8])]) -> Vec<u8> {
let mut writer = zip::ZipWriter::new(std::io::Cursor::new(Vec::new()));
for (name, bytes) in files {
writer
.start_file(*name, zip::write::SimpleFileOptions::default())
.unwrap();
writer.write_all(bytes).unwrap();
}
writer.finish().unwrap().into_inner()
}
#[test]
fn example_packs_install_load_and_resolve() {
let temp = tempfile::tempdir().unwrap();
let language = temp.path().join("language.zip");
let theme = temp.path().join("theme.zip");
std::fs::write(
&language,
include_bytes!("../../../docs/packs/deckstride-language-pack.zip"),
)
.unwrap();
std::fs::write(
&theme,
include_bytes!("../../../docs/packs/deckstride-theme-pack.zip"),
)
.unwrap();
assert_eq!(
install_language(temp.path(), &language).unwrap(),
"example-language"
);
assert_eq!(translation("eo-example", "Close"), Some("Fermi"));
assert_eq!(install_theme(temp.path(), &theme).unwrap(), "example-theme");
assert!(packed_theme("example-theme/night").is_some());
assert!(load(temp.path()).is_empty());
assert_eq!(language_packs()[0].revision, 1);
assert_eq!(theme_packs()[0].revision, 1);
let ctx = egui::Context::default();
crate::localization::apply_selected(
&ctx,
&crate::localization::Language::En,
Some("eo-example"),
);
assert_eq!(crate::localization::tr(&ctx, "Close"), "Fermi");
crate::theme::apply_selected(
&ctx,
crate::theme::Theme::Midra,
Some("example-theme/night"),
);
assert_eq!(
ctx.global_style().visuals.panel_fill,
color("#101820").unwrap()
);
let mut manifest: serde_json::Value = serde_json::from_str(include_str!(
"../../../docs/packs/language-example/manifest.json"
))
.unwrap();
manifest["revision"] = 2.into();
let updated = archive(&[
("manifest.json", &serde_json::to_vec(&manifest).unwrap()),
(
"eo-example.json",
include_bytes!("../../../docs/packs/language-example/eo-example.json"),
),
]);
std::fs::write(
temp.path().join("language-packs/example-language.zip"),
b"changed",
)
.unwrap();
std::fs::write(&language, updated).unwrap();
assert!(
install_language(temp.path(), &language)
.unwrap_err()
.contains("changed on disk")
);
}
#[test]
fn malformed_and_traversing_archives_are_rejected() {
let bad = archive(&[("../manifest.json", b"{}")]);
assert!(parse_language(&bad, PathBuf::new()).is_err());
assert!(parse_theme(&bad, PathBuf::new()).is_err());
}
}

View File

@ -1,4 +1,4 @@
use crate::localization::tr;
use crate::localization::{display_revert_countdown, tr};
// Native controls for the approved presenter layout and safe slide browser.
use crate::{
settings::{Layout, TimerMode, TimerPosition},
@ -12,6 +12,7 @@ use std::{
time::{Duration, Instant},
};
const BROWSER_SCROLL_HANDLE: Color32 = Color32::from_rgb(70, 210, 175);
const PRESENTER_FOOTER_HEIGHT: f32 = 112.;
/// Composite a fitted slide over independent page and padding colors in every view.
pub fn paint_slide(
painter: &egui::Painter,
@ -904,13 +905,7 @@ fn presenter_view(
background.context_menu(|ui| {
if !s.presentation_started
&& s.route_trial.is_none()
&& ui
.button(if s.settings.language.french() {
"Inverser les écrans…"
} else {
"Swap displays…"
})
.clicked()
&& ui.button(tr(&locale, "Swap displays…")).clicked()
{
s.actions.push(Action::SwapRoutes);
ui.close();
@ -958,7 +953,7 @@ fn presenter_view(
body.min.y += header_height;
}
if view.layout.footer {
body.max.y -= 90.;
body.max.y -= PRESENTER_FOOTER_HEIGHT;
}
if view.layout.slide_progress {
let height = view
@ -1272,21 +1267,11 @@ fn presenter_view(
.show(|ui| {
egui::ScrollArea::vertical()
.max_height(
(screen.bottom() - trigger.rect.bottom() - 16.)
.clamp(80., 720.),
(screen.bottom() - trigger.rect.bottom() - 16.).max(80.),
)
.show(ui, |ui| menu(ui, s, &mut view.preferences_open));
});
view.menu_open = menu_open;
ui.add_sized(
[100., 20.],
egui::Label::new(
s.deck
.as_ref()
.map_or("PDF Presenter", |d| d.title.as_str()),
)
.truncate(),
);
if ui.button(tr(&locale, "Displays")).clicked() {
s.begin_display_edit();
}
@ -1352,8 +1337,8 @@ fn presenter_view(
}
if footer {
let rect = Rect::from_min_size(
Pos2::new(screen.left(), screen.bottom() - 90.),
Vec2::new(screen.width(), 90.),
Pos2::new(screen.left(), screen.bottom() - PRESENTER_FOOTER_HEIGHT),
Vec2::new(screen.width(), PRESENTER_FOOTER_HEIGHT),
);
ui.painter().rect_filled(rect, 0., ui.visuals().window_fill);
ui.scope_builder(egui::UiBuilder::new().max_rect(rect.shrink(8.)), |ui| {
@ -1407,6 +1392,28 @@ fn presenter_view(
.desired_height(4.),
);
}
if let Some(deck) = &s.deck {
let path = deck.path.display().to_string();
let name = deck
.path
.file_name()
.and_then(|name| name.to_str())
.unwrap_or(&path);
ui.horizontal(|ui| {
ui.strong(name).on_hover_text(&path);
ui.separator();
ui.add_sized(
[ui.available_width(), 18.],
egui::Label::new(
egui::RichText::new(&path)
.small()
.color(ui.visuals().weak_text_color()),
)
.truncate(),
)
.on_hover_text(&path);
});
}
});
}
let compact_preparation = s.loading
@ -1443,17 +1450,9 @@ fn presenter_view(
egui::Frame::popup(ui.style()).show(ui, |ui| {
ui.label(format!(
"{} {} · {}",
if s.settings.language.french() {
"Diapositive"
} else {
"Go to slide"
},
tr(&locale, "Go to slide"),
s.jump,
if s.settings.language.french() {
"Entrée : diffuser · Retour arrière : effacer"
} else {
"Enter to show · Backspace to clear"
}
tr(&locale, "Enter to show · Backspace to clear")
));
});
});
@ -1465,39 +1464,22 @@ fn presenter_view(
.as_secs()
+ 1;
egui::Modal::new(egui::Id::new("confirm-displays")).show(&ctx, |ui| {
ui.heading(if s.settings.language.french() {
"Conserver ces écrans ?"
} else {
"Keep these display settings?"
});
ui.label(if s.settings.language.french() {
"Une seule confirmation suffit pour tous les écrans."
} else {
"Confirm once on any screen to apply to all displays."
});
ui.label(if s.settings.language.french() {
format!("Retour automatique dans {seconds} s. Échap pour annuler.")
} else {
format!("Automatically reverts in {seconds} seconds. Escape to revert.")
});
ui.heading(tr(&locale, "Keep these display settings?"));
ui.label(tr(
&locale,
"Confirm once on any screen to apply to all displays.",
));
ui.label(display_revert_countdown(&locale, seconds));
ui.horizontal(|ui| {
button(
ui,
if s.settings.language.french() {
"Conserver"
} else {
"Keep changes"
},
tr(&locale, "Keep changes"),
Action::KeepRoutes,
&mut s.actions,
);
button(
ui,
if s.settings.language.french() {
"Annuler"
} else {
"Revert now"
},
tr(&locale, "Revert now"),
Action::RevertRoutes,
&mut s.actions,
);
@ -1552,11 +1534,7 @@ fn presenter_view(
ui.visuals_mut().slider_trailing_fill = true;
if display.is_some() {
ui.horizontal(|ui| {
ui.strong(if s.settings.language.french() {
"Modifier la disposition de"
} else {
"Edit layout for"
});
ui.strong(tr(&locale, "Edit layout for"));
let selected = selected_layout_display
.as_ref()
.and_then(|selected| {
@ -1578,11 +1556,10 @@ fn presenter_view(
}
});
});
ui.label(if s.settings.language.french() {
"Disposition et sauvegardes propres à cet écran. Le fonctionnement du minuteur reste partagé."
} else {
"Layout and saves apply to this display. Timer behavior is shared."
});
ui.label(tr(
&locale,
"Layout and saves apply to this display. Timer behavior is shared.",
));
}
ui.label(tr(
&locale,
@ -1713,14 +1690,8 @@ fn presenter_view(
});
layout_section(ui, tr(&locale, "Header and footer"), |ui| {
ui.horizontal_wrapped(|ui| {
ui.checkbox(
&mut layout.header,
tr(&locale, "Keep header visible"),
);
ui.checkbox(
&mut layout.footer,
tr(&locale, "Keep footer visible"),
);
ui.checkbox(&mut layout.header, tr(&locale, "Keep header visible"));
ui.checkbox(&mut layout.footer, tr(&locale, "Keep footer visible"));
});
ui.small(tr(
&locale,
@ -1735,14 +1706,27 @@ fn presenter_view(
button(
ui,
tr(&locale, "Save layout · This project"),
rendered_layout_display.as_deref().map_or(Action::SaveProject, |display| Action::SaveDisplayLayout { display: display.into(), project: true, layout: layout.clone() }),
rendered_layout_display.as_deref().map_or(
Action::SaveProject,
|display| Action::SaveDisplayLayout {
display: display.into(),
project: true,
layout: layout.clone(),
},
),
&mut s.actions,
);
});
button(
ui,
tr(&locale, "Save layout · All projects"),
rendered_layout_display.as_deref().map_or(Action::SaveGlobal, |display| Action::SaveDisplayLayout { display: display.into(), project: false, layout: layout.clone() }),
rendered_layout_display
.as_deref()
.map_or(Action::SaveGlobal, |display| Action::SaveDisplayLayout {
display: display.into(),
project: false,
layout: layout.clone(),
}),
&mut s.actions,
);
});
@ -1751,7 +1735,11 @@ fn presenter_view(
button(
ui,
tr(&locale, "Use all-projects default"),
rendered_layout_display.as_deref().map_or(Action::UseGlobal, |display| Action::UseDisplayDefault(display.into())),
rendered_layout_display
.as_deref()
.map_or(Action::UseGlobal, |display| {
Action::UseDisplayDefault(display.into())
}),
&mut s.actions,
);
});
@ -1889,11 +1877,7 @@ fn presenter_view(
);
button(
ui,
if s.settings.language.french() {
"Appliquer les modifications"
} else {
"Apply changes"
},
tr(&locale, "Apply changes"),
Action::ApplyRoutes,
&mut s.actions,
);
@ -2274,37 +2258,21 @@ pub fn browser(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
ui.add_space(4.);
ui.label(format!(
"{} {} · {} {}",
if s.settings.language.french() {
"Sélection"
} else {
"Selected"
},
tr(&locale, "Selected"),
if s.count() == 0 {
0
} else {
s.browser_selected + 1
},
if s.settings.language.french() {
"Actuelle"
} else {
"Current"
},
tr(&locale, "Current"),
if s.count() == 0 { 0 } else { s.requested + 1 },
));
if !s.jump.is_empty() {
ui.label(format!(
"{} {} — {}",
if s.settings.language.french() {
"Diapositive"
} else {
"Go to slide"
},
tr(&locale, "Go to slide"),
s.jump,
if s.settings.language.french() {
"Entrée : diffuser, Retour arrière : effacer"
} else {
"Enter to show; Backspace to clear"
}
tr(&locale, "Enter to show; Backspace to clear")
));
}
// Reserve a stable gutter, so neither thumbnail sizing nor scrollbar placement
@ -2437,6 +2405,331 @@ pub fn browser(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
quit_confirmation(ui.ctx(), s);
}
fn appearance_preferences(ui: &mut Ui, s: &mut Studio) {
let locale = ui.ctx().clone();
layout_section(ui, tr(&locale, "Appearance"), |ui| {
let mut changed = false;
egui::Grid::new("preferences-appearance-grid")
.num_columns(2)
.spacing(Vec2::new(12., 8.))
.show(ui, |ui| {
ui.label(tr(&locale, "Theme"));
egui::ComboBox::from_id_salt("preferences-theme")
.selected_text(match s.settings.theme_pack.as_deref() {
Some(choice) => crate::packs::packed_theme(choice)
.map_or_else(|| format!("{choice} (unavailable)"), |(_, _, name)| name),
None => s.settings.theme.name().to_owned(),
})
.show_ui(ui, |ui| {
for theme in crate::theme::Theme::ALL {
if ui
.selectable_label(
s.settings.theme_pack.is_none() && s.settings.theme == theme,
theme.name(),
)
.clicked()
{
s.settings.theme = theme;
s.settings.theme_pack = None;
changed = true;
}
}
let packed = crate::packs::theme_choices();
if !packed.is_empty() {
ui.separator();
}
for (choice, name) in packed {
if ui
.selectable_label(
s.settings.theme_pack.as_deref() == Some(choice.as_str()),
name,
)
.clicked()
{
s.settings.theme_pack = Some(choice);
changed = true;
}
}
});
ui.end_row();
ui.label(tr(&locale, "Language"));
egui::ComboBox::from_id_salt("preferences-language")
.selected_text(match s.settings.language_pack.as_deref() {
Some(locale) => crate::packs::language_name(locale)
.unwrap_or_else(|| format!("{locale} (unavailable)")),
None => s.settings.language.name().to_owned(),
})
.show_ui(ui, |ui| {
for language in crate::localization::Language::ALL {
if ui
.selectable_label(
s.settings.language_pack.is_none()
&& s.settings.language == language,
language.name(),
)
.clicked()
{
s.settings.language = language;
s.settings.language_pack = None;
changed = true;
}
}
let packed: Vec<_> = crate::packs::language_packs()
.into_iter()
.flat_map(|pack| pack.languages)
.collect();
if !packed.is_empty() {
ui.separator();
}
for language in packed {
let name = format!("{} — {}", language.native_name, language.name);
if ui
.selectable_label(
s.settings.language_pack.as_deref()
== Some(language.locale.as_str()),
name,
)
.clicked()
{
s.settings.language_pack = Some(language.locale);
changed = true;
}
}
});
ui.end_row();
});
ui.horizontal_wrapped(|ui| {
if ui
.add_enabled(
s.initialized && !s.dialog_busy,
egui::Button::new(tr(&locale, "Import language pack…")),
)
.clicked()
{
s.actions.push(Action::PickLanguagePack);
}
if ui
.add_enabled(
s.initialized && !s.dialog_busy,
egui::Button::new(tr(&locale, "Import theme pack…")),
)
.clicked()
{
s.actions.push(Action::PickThemePack);
}
});
let language_packs = crate::packs::language_packs();
let theme_packs = crate::packs::theme_packs();
if !language_packs.is_empty() || !theme_packs.is_empty() {
egui::CollapsingHeader::new(tr(&locale, "Installed packs"))
.id_salt("installed-appearance-packs")
.show(ui, |ui| {
for pack in language_packs {
ui.label(format!(
"{} · r{} · {} language(s)",
pack.id,
pack.revision,
pack.languages.len()
));
}
for pack in theme_packs {
ui.label(format!(
"{} · r{} · {} theme(s)",
pack.id,
pack.revision,
pack.themes.len()
));
}
});
}
ui.separator();
for (label, color) in [
(
"Page background",
&mut s.settings.slide_colors.page_background,
),
(
"Fit padding color",
&mut s.settings.slide_colors.fit_padding,
),
] {
ui.horizontal(|ui| {
ui.label(tr(&locale, label));
changed |= ui.color_edit_button_srgb(color).changed();
});
}
ui.small(tr(
&locale,
"Page background fills transparency; fit padding fills space around the slide.",
));
if changed {
s.new_output = true;
s.save_preferences();
crate::theme::apply_selected(
&locale,
s.settings.theme,
s.settings.theme_pack.as_deref(),
);
crate::localization::apply_selected(
&locale,
&s.settings.language,
s.settings.language_pack.as_deref(),
);
ui.ctx().request_repaint();
}
});
}
#[derive(Clone, Copy, Default, PartialEq, Eq)]
enum PreferencesTab {
#[default]
General,
Performance,
Storage,
}
fn general_preferences(ui: &mut Ui, s: &mut Studio) {
let locale = ui.ctx().clone();
appearance_preferences(ui, s);
ui.add_space(8.);
layout_section(ui, tr(&locale, "Blank Slides image"), |ui| {
ui.label(if s.settings.blank_picture {
tr(&locale, "Custom picture selected")
} else {
tr(&locale, "Solid black")
});
ui.horizontal_wrapped(|ui| {
if ui
.add_enabled(
s.initialized && !s.dialog_busy && !s.blank_busy,
egui::Button::new(tr(&locale, "Choose picture…")),
)
.clicked()
{
s.actions.push(Action::PickBlankPicture);
}
if ui
.add_enabled(
s.initialized && !s.dialog_busy && (s.settings.blank_picture || s.blank_busy),
egui::Button::new(tr(&locale, "Use solid black")),
)
.clicked()
{
s.actions.push(Action::ClearBlankPicture);
}
if s.blank_busy {
ui.spinner();
}
});
ui.small(tr(
&locale,
"A copy is saved and fitted to all Slides screens against a black background.",
));
});
#[cfg(target_os = "windows")]
{
ui.add_space(8.);
layout_section(ui, tr(&locale, "Default PDF application"), |ui| {
ui.label(tr(
&locale,
"Register Deckstride and its icon for PDF files in your Windows account.",
));
if ui.button(tr(&locale, "Set as default PDF app…")).clicked() {
s.actions.push(Action::RegisterPdfAssociation);
}
ui.small(tr(
&locale,
"Windows will open Default Apps; select Deckstride for .pdf to confirm.",
));
});
}
}
fn performance_preferences(ui: &mut Ui, s: &mut Studio) {
let locale = ui.ctx().clone();
layout_section(ui, tr(&locale, "Memory and cache"), |ui| {
ui.label(tr(
&locale,
"RAM budget per process (presenter + output each use this allowance):",
));
if ui
.add(egui::Slider::new(&mut s.settings.buffer_mib, 64..=16384).text("MiB"))
.changed()
{
s.remember_buffer_budget();
}
ui.small(tr(
&locale,
"Raise only within available RAM; OS paging can cause delays. Screen rendering is capped at 4096 px.",
));
ui.separator();
let mut changed = false;
ui.horizontal_wrapped(|ui| {
ui.label(tr(&locale, "Maximum total size (MiB)"));
changed |= ui
.add(
egui::DragValue::new(&mut s.settings.disk_cache.max_mib)
.range(64..=1048576)
.speed(64),
)
.changed();
});
ui.horizontal_wrapped(|ui| {
ui.label(tr(&locale, "Expire after (days since rendering)"));
changed |= ui
.add(egui::DragValue::new(&mut s.settings.disk_cache.max_days).range(1..=3650))
.changed();
});
if changed {
s.remember_cache_policy();
}
ui.small(tr(
&locale,
"Oldest files are removed first. Active decks are protected and may exceed the limit. Automatic cleanup runs once at startup, after loading and preparation finish.",
));
if ui
.add_enabled(
!s.cache_busy && !s.loading && s.initialized,
egui::Button::new(tr(&locale, "Expunge unused cache now")),
)
.clicked()
{
s.clean_cache(true);
}
if s.cache_busy {
ui.spinner();
}
ui.small(&s.cache_status);
});
}
fn storage_preferences(ui: &mut Ui, s: &Studio) {
let locale = ui.ctx().clone();
layout_section(ui, tr(&locale, "Storage and preparation"), |ui| {
ui.label(s.preparation_status());
ui.separator();
ui.label(egui::RichText::new(tr(&locale, "Application executable")).strong());
let executable = s.executable_path().display().to_string();
ui.add(
egui::Label::new(egui::RichText::new(&executable).monospace())
.selectable(true)
.wrap(),
)
.on_hover_text(&executable);
ui.small(tr(
&locale,
"This is the running portable executable. Use its containing folder to find or remove the application.",
));
ui.separator();
ui.label(format!(
"{}: {}",
tr(&locale, "Processed slides"),
s.cache_path.display()
));
ui.label(format!("Configuration: {}", s.settings_path.display()));
});
}
fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
let locale = ctx.clone();
let mut window_open = true;
@ -2447,186 +2740,38 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
.open(&mut window_open)
.collapsible(false)
.resizable(true)
.default_size(Vec2::new(620., 640.).min(screen - Vec2::splat(32.)))
.default_size(Vec2::new(620., 760.).min(screen - Vec2::splat(32.)))
.min_size(Vec2::new(360., 320.))
.max_size((screen - Vec2::splat(24.)).max(Vec2::splat(1.)))
.show(ctx, |ui| {
ui.spacing_mut().item_spacing = Vec2::new(8., 8.);
let scroll_height = (ui.available_height() - 52.).max(180.);
let tab_id = egui::Id::new("preferences-tab");
let mut tab = ctx
.data(|data| data.get_temp::<PreferencesTab>(tab_id))
.unwrap_or_default();
ui.horizontal(|ui| {
ui.selectable_value(&mut tab, PreferencesTab::General, tr(&locale, "General"));
ui.selectable_value(
&mut tab,
PreferencesTab::Performance,
tr(&locale, "Performance"),
);
ui.selectable_value(&mut tab, PreferencesTab::Storage, tr(&locale, "Storage"));
});
ctx.data_mut(|data| data.insert_temp(tab_id, tab));
ui.separator();
// Reserve the close row, separator and both surrounding item gaps. If
// this is short by even one gap, the body asks the resizable window to
// grow again on every repaint.
let scroll_height = (ui.available_height() - 60.).max(180.);
egui::ScrollArea::vertical()
.id_salt("preferences-scroll")
.id_salt(("preferences-scroll", tab as u8))
.auto_shrink([false, false])
.max_height(scroll_height)
.show(ui, |ui| {
layout_section(
ui,
if s.settings.language.french() {
"Image des diapositives masquées"
} else {
"Blank Slides image"
},
|ui| {
ui.label(if s.settings.blank_picture {
if s.settings.language.french() {
"Image personnalisée sélectionnée"
} else {
"Custom picture selected"
}
} else if s.settings.language.french() {
"Écran noir"
} else {
"Solid black"
});
ui.horizontal_wrapped(|ui| {
if ui
.add_enabled(
s.initialized && !s.dialog_busy && !s.blank_busy,
egui::Button::new(if s.settings.language.french() {
"Choisir une image…"
} else {
"Choose picture…"
}),
)
.clicked()
{
s.actions.push(Action::PickBlankPicture);
}
if ui
.add_enabled(
s.initialized
&& !s.dialog_busy
&& (s.settings.blank_picture || s.blank_busy),
egui::Button::new(if s.settings.language.french() {
"Utiliser un écran noir"
} else {
"Use solid black"
}),
)
.clicked()
{
s.actions.push(Action::ClearBlankPicture);
}
if s.blank_busy {
ui.spinner();
}
});
ui.small(if s.settings.language.french() {
"Une copie est conservée et ajustée à tous les écrans de diapositives, sur fond noir."
} else {
"A copy is saved and fitted to all Slides screens against a black background."
});
},
);
#[cfg(target_os = "windows")]
{
ui.add_space(8.);
layout_section(
ui,
if s.settings.language.french() {
"Application PDF par défaut"
} else {
"Default PDF application"
},
|ui| {
ui.label(if s.settings.language.french() {
"Enregistre PDF Presenter et son icône pour les fichiers PDF de votre compte Windows."
} else {
"Register PDF Presenter and its icon for PDF files in your Windows account."
});
if ui
.button(if s.settings.language.french() {
"Définir comme application PDF par défaut…"
} else {
"Set as default PDF app…"
})
.clicked()
{
s.actions.push(Action::RegisterPdfAssociation);
}
ui.small(if s.settings.language.french() {
"Windows ouvrira Applications par défaut : sélectionnez PDF Presenter pour .pdf afin de confirmer."
} else {
"Windows will open Default Apps; select PDF Presenter for .pdf to confirm."
});
},
);
}
ui.add_space(8.);
layout_section(ui, tr(&locale, "Memory and cache"), |ui| {
ui.label(tr(
&locale,
"RAM budget per process (presenter + output each use this allowance):",
));
if ui
.add(
egui::Slider::new(&mut s.settings.buffer_mib, 64..=16384)
.text("MiB"),
)
.changed()
{
s.remember_buffer_budget();
}
ui.small(tr(
&locale,
"Raise only within available RAM; OS paging can cause delays. Screen rendering is capped at 4096 px.",
));
ui.separator();
let mut changed = false;
ui.horizontal_wrapped(|ui| {
ui.label(tr(&locale, "Maximum total size (MiB)"));
changed |= ui
.add(
egui::DragValue::new(&mut s.settings.disk_cache.max_mib)
.range(64..=1048576)
.speed(64),
)
.changed();
});
ui.horizontal_wrapped(|ui| {
ui.label(tr(&locale, "Expire after (days since rendering)"));
changed |= ui
.add(
egui::DragValue::new(&mut s.settings.disk_cache.max_days)
.range(1..=3650),
)
.changed();
});
if changed {
s.remember_cache_policy();
}
ui.small(tr(
&locale,
"Oldest files are removed first. Active decks are protected and may exceed the limit. Automatic cleanup runs once at startup, after loading and preparation finish.",
));
if ui
.add_enabled(
!s.cache_busy && !s.loading && s.initialized,
egui::Button::new(tr(&locale, "Expunge unused cache now")),
)
.clicked()
{
s.clean_cache(true);
}
if s.cache_busy {
ui.spinner();
}
ui.small(&s.cache_status);
});
ui.add_space(8.);
layout_section(ui, tr(&locale, "Storage and preparation"), |ui| {
ui.label(s.preparation_status());
ui.separator();
ui.label(format!(
"{}: {}",
if s.settings.language.french() {
"Diapositives préparées"
} else {
"Processed slides"
},
s.cache_path.display()
));
ui.label(format!("Configuration: {}", s.settings_path.display()));
});
.show(ui, |ui| match tab {
PreferencesTab::General => general_preferences(ui, s),
PreferencesTab::Performance => performance_preferences(ui, s),
PreferencesTab::Storage => storage_preferences(ui, s),
});
ui.separator();
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
@ -2675,72 +2820,34 @@ fn menu(ui: &mut Ui, s: &mut Studio, preferences_open: &mut bool) {
},
);
ui.separator();
button(
ui,
tr(&locale, "All slides"),
Action::OpenBrowser,
&mut s.actions,
);
ui.menu_button(tr(&locale, "Appearance"), |ui| {
ui.with_layout(egui::Layout::top_down(egui::Align::Min), |ui| {
ui.set_min_width(250.);
let mut changed = false;
ui.label(
egui::RichText::new(tr(&locale, "Theme"))
.small()
.strong()
.color(ui.visuals().weak_text_color()),
);
ui.menu_button(s.settings.theme.name().to_owned(), |ui| {
for theme in crate::theme::Theme::ALL {
let name = theme.name();
changed |= ui
.selectable_value(&mut s.settings.theme, theme.clone(), name)
.changed();
}
});
ui.add_space(6.);
ui.separator();
ui.add_space(4.);
ui.label(
egui::RichText::new(tr(&locale, "Language"))
.small()
.strong()
.color(ui.visuals().weak_text_color()),
);
ui.menu_button(s.settings.language.name(), |ui| {
for language in crate::localization::Language::ALL {
changed |= ui
.selectable_value(&mut s.settings.language, language, language.name())
.changed();
}
});
ui.separator();
for (label, color) in [
(
"Page background",
&mut s.settings.slide_colors.page_background,
),
(
"Fit padding color",
&mut s.settings.slide_colors.fit_padding,
),
] {
ui.horizontal(|ui| {
ui.label(tr(&locale, label));
changed |= ui.color_edit_button_srgb(color).changed();
});
}
ui.small(tr(
&locale,
"Page background fills transparency; fit padding fills space around the slide.",
));
if changed {
s.new_output = true;
s.save_preferences();
ui.ctx().request_repaint();
}
ui.menu_button(tr(&locale, "Autoplay"), |ui| {
ui.set_min_width(250.);
let mut changed = ui
.checkbox(
&mut s.settings.autoplay_enabled,
tr(&locale, "Play automatically"),
)
.changed();
ui.horizontal(|ui| {
ui.label(tr(&locale, "Timing"));
changed |= ui
.add(
egui::DragValue::new(&mut s.settings.autoplay_seconds)
.range(0.25..=3600.0)
.speed(0.25)
.max_decimals(2)
.suffix(" s"),
)
.changed();
});
changed |= ui
.checkbox(&mut s.settings.autoplay_loop, tr(&locale, "Loop"))
.changed();
ui.small(tr(&locale, "Timing starts when the slide is visible."));
if changed {
s.autoplay_settings_changed();
ui.ctx().request_repaint();
}
});
ui.separator();
ui.label(
@ -2883,7 +2990,7 @@ fn startup_single_screen(ctx: &Context, s: &mut Studio) {
}
egui::Modal::new(egui::Id::new("startup-single-screen")).show(ctx, |ui| {
ui.heading(tr(ctx, "Use single-screen mode?"));
ui.label(tr(ctx, "PDF Presenter is intended for a presenter setup with separate Presenter and Slides screens."));
ui.label(tr(ctx, "Deckstride is intended for a presenter setup with separate Presenter and Slides screens."));
ui.label(tr(ctx, "Only one screen was connected at startup. Single-screen mode shows slides with controls revealed at the top and bottom edges."));
ui.horizontal_wrapped(|ui| {
button(ui, tr(ctx, "Keep Presenter view"), Action::StartupSingleScreen(false), &mut s.actions);

View File

@ -279,11 +279,16 @@ pub struct Settings {
pub buffer_mib: u32,
pub disk_cache: crate::cache::Policy,
pub auto_show: bool,
pub autoplay_enabled: bool,
pub autoplay_seconds: f32,
pub autoplay_loop: bool,
pub blank_picture: bool,
pub zoom_enabled: bool,
pub zoom_keep_fitted_area: bool,
pub theme: crate::theme::Theme,
pub theme_pack: Option<String>,
pub language: crate::localization::Language,
pub language_pack: Option<String>,
}
/// Choose a per-process decoded-frame budget from available physical RAM.
/// Prefer 15%, with a soft 512 MiB floor that never exceeds 20% (except the
@ -327,11 +332,16 @@ impl Default for Settings {
buffer_mib: default_buffer_mib(),
disk_cache: Default::default(),
auto_show: true,
autoplay_enabled: false,
autoplay_seconds: 5.0,
autoplay_loop: false,
blank_picture: false,
zoom_enabled: false,
zoom_keep_fitted_area: false,
theme: Default::default(),
theme_pack: None,
language: Default::default(),
language_pack: None,
}
}
}
@ -340,10 +350,24 @@ impl Settings {
if self.version != 1 {
return Err(format!("Unsupported settings version {}", self.version));
}
if self
.theme_pack
.as_deref()
.is_some_and(|choice| !crate::packs::valid_theme_choice(choice))
|| self
.language_pack
.as_deref()
.is_some_and(|locale| !crate::packs::valid_id(locale))
{
return Err("Invalid language or theme pack choice".into());
}
self.disk_cache.validate()?;
if !(64..=16384).contains(&self.buffer_mib) {
return Err("RAM buffer must be 64–16384 MiB per process".into());
}
if !self.autoplay_seconds.is_finite() || !(0.25..=3600.0).contains(&self.autoplay_seconds) {
return Err("Autoplay timing must be 0.25–3600 seconds".into());
}
if self.projects.len() > 4096 || !(100. ..=400.).contains(&self.thumbnail_size) {
return Err("Invalid settings limits".into());
}
@ -391,19 +415,54 @@ impl Settings {
self.projects.get(key).unwrap_or(&self.layout).clone()
}
}
fn select_renamed_paths(
settings: PathBuf,
cache: PathBuf,
legacy_settings: PathBuf,
legacy_cache: PathBuf,
) -> (PathBuf, PathBuf) {
if !settings.exists()
&& legacy_settings.is_file()
&& let Ok(value) = read(&legacy_settings)
{
let _ = write(&settings, &value);
}
let settings = if settings.exists() || !legacy_settings.is_file() {
settings
} else {
legacy_settings
};
let cache = if cache.exists() || !legacy_cache.exists() {
cache
} else {
legacy_cache
};
(settings, cache)
}
pub fn paths() -> Result<(PathBuf, PathBuf), String> {
let dirs = directories::ProjectDirs::from("com", "Beffroi", "PdfPresenter")
let dirs = directories::ProjectDirs::from("com", "Beffroi", "Deckstride")
.ok_or("No user configuration directory")?;
let legacy_dirs = directories::ProjectDirs::from("com", "Beffroi", "PdfPresenter")
.ok_or("No user configuration directory")?;
#[cfg(target_os = "linux")]
let config = directories::BaseDirs::new()
.ok_or("No user configuration directory")?
.config_dir()
.join("pdf-presenter");
let (config, legacy_config) = {
let base = directories::BaseDirs::new().ok_or("No user configuration directory")?;
(
base.config_dir().join("deckstride"),
base.config_dir().join("pdf-presenter"),
)
};
#[cfg(not(target_os = "linux"))]
let config = dirs.config_dir().to_path_buf();
Ok((
let (config, legacy_config) = (
dirs.config_dir().to_path_buf(),
legacy_dirs.config_dir().to_path_buf(),
);
Ok(select_renamed_paths(
config.join("settings.toml"),
dirs.cache_dir().join("slides-v1"),
legacy_config.join("settings.toml"),
legacy_dirs.cache_dir().join("slides-v1"),
))
}
pub fn read(path: &Path) -> Result<Settings, String> {
@ -450,3 +509,31 @@ pub fn atomic_write(path: &Path, bytes: &[u8]) -> Result<(), String> {
pub fn project_key(path: &Path) -> String {
format!("{:x}", Sha256::digest(path.as_os_str().as_encoded_bytes()))
}
#[cfg(test)]
mod rename_tests {
use super::*;
#[test]
fn renamed_paths_copy_settings_and_reuse_a_warm_cache() {
let temp = tempfile::tempdir().unwrap();
let settings = temp.path().join("new/settings.toml");
let cache = temp.path().join("new/cache");
let legacy_settings = temp.path().join("legacy/settings.toml");
let legacy_cache = temp.path().join("legacy/cache");
write(&legacy_settings, &Settings::default()).unwrap();
std::fs::create_dir_all(&legacy_cache).unwrap();
let selected = select_renamed_paths(
settings.clone(),
cache,
legacy_settings,
legacy_cache.clone(),
);
assert_eq!(selected, (settings.clone(), legacy_cache));
let migrated = read(&settings).unwrap();
assert_eq!(migrated.version, 1);
assert_eq!(migrated.layout, Layout::default());
}
}

View File

@ -23,6 +23,8 @@ pub enum Action {
Pick(bool),
PickNotes,
PickBlankPicture,
PickLanguagePack,
PickThemePack,
SetBlankPicture(PathBuf),
ClearBlankPicture,
#[cfg(target_os = "windows")]
@ -161,6 +163,8 @@ pub struct Studio {
pub cache_status: String,
startup_cache_pending: bool,
navigation_settle: Option<Instant>,
autoplay_deadline: Option<Instant>,
autoplay_finished: bool,
pub fg: Bridge,
pub bg: Bridge,
pub io: Bridge,
@ -207,7 +211,7 @@ impl Studio {
let (mut settings_path, mut cache_path) = settings::paths().unwrap_or_else(|_| {
(
PathBuf::from("settings.toml"),
std::env::temp_dir().join("pdf-presenter-cache"),
std::env::temp_dir().join("deckstride-cache"),
)
});
let smoke_dir = if smoke {
@ -219,6 +223,14 @@ impl Studio {
settings_path = dir.path().join("settings.toml");
cache_path = dir.path().join("cache");
}
let pack_errors = if smoke {
Vec::new()
} else {
settings_path
.parent()
.map(crate::packs::load)
.unwrap_or_else(|| vec!["Settings directory unavailable for packs".into()])
};
let io = Bridge::with_program(Duration::from_secs(10), worker_program.clone());
io.submit(0, 0, Request::LoadSettings(settings_path.clone()));
Self {
@ -245,7 +257,14 @@ impl Studio {
blank_picture: None,
blank_busy: false,
blank_loader: Bridge::with_program(Duration::from_secs(15), worker_program.clone()),
status: "Ready — open a PDF or picture folder, or drop it here.".into(),
status: if pack_errors.is_empty() {
"Ready — open a PDF or picture folder, or drop it here.".into()
} else {
format!(
"Some language/theme packs were skipped: {}",
pack_errors.join("; ")
)
},
awake_status: "Sleep protection starting…".into(),
generation: 0,
frames: HashMap::new(),
@ -281,6 +300,8 @@ impl Studio {
cache_status: String::new(),
startup_cache_pending: true,
navigation_settle: None,
autoplay_deadline: None,
autoplay_finished: false,
fg: Bridge::with_program(Duration::from_secs(30), worker_program.clone()),
bg: Bridge::with_program(Duration::from_secs(30), worker_program.clone()),
io,
@ -324,6 +345,9 @@ impl Studio {
.as_ref()
.map_or_else(|| "empty".into(), |d| d.key.clone())
}
pub fn executable_path(&self) -> &std::path::Path {
&self.worker_program
}
pub fn frame(&self, page: usize) -> Option<Arc<Frame>> {
[self.target_edge, 512, 1280, 320]
.iter()
@ -497,6 +521,63 @@ impl Studio {
pub fn presentation_action(&mut self) {
self.timer
.presentation_action(Instant::now(), self.layout.timer_autostart);
self.restart_autoplay();
}
fn restart_autoplay(&mut self) {
self.autoplay_deadline = None;
self.autoplay_finished = false;
}
pub fn autoplay_settings_changed(&mut self) {
self.restart_autoplay();
self.save_preferences();
}
fn poll_autoplay_at(&mut self, now: Instant) -> bool {
let paused = !self.settings.autoplay_enabled
|| !self.initialized
|| self.loading
|| self.pending_open.is_some()
|| self.blanked
|| self.dialog_busy
|| self.route_trial.is_some()
|| self.startup_single_offer()
|| self.notes_editor.is_some()
|| self.notes_import.is_some()
|| self.quit_confirmation
|| self.count() == 0;
if paused {
self.autoplay_deadline = None;
return false;
}
if self.autoplay_finished {
return false;
}
let visible = self.displayed == Some(self.requested)
|| (self.routes.presentation.is_empty() && self.frame(self.requested).is_some());
if !visible {
self.autoplay_deadline = None;
return false;
}
let deadline = self
.autoplay_deadline
.get_or_insert_with(|| now + Duration::from_secs_f32(self.settings.autoplay_seconds));
if now < *deadline {
return false;
}
let next = if self.requested + 1 < self.count() {
Some(self.requested + 1)
} else if self.settings.autoplay_loop && self.count() > 1 {
Some(0)
} else {
None
};
self.autoplay_deadline = None;
if let Some(next) = next {
self.execute(Action::Go(next));
true
} else {
self.autoplay_finished = true;
false
}
}
pub fn execute(&mut self, action: Action) {
match action {
@ -546,8 +627,8 @@ impl Studio {
#[cfg(target_os = "windows")]
Action::RegisterPdfAssociation => {
self.status = match crate::windows_integration::register_pdf_association() {
Ok(()) => "Choose PDF Presenter for .pdf in Windows Default Apps. PDF files will then use its icon.".into(),
Err(error) => format!("Could not register PDF Presenter: {error}"),
Ok(()) => "Choose Deckstride for .pdf in Windows Default Apps. PDF files will then use its icon.".into(),
Err(error) => format!("Could not register Deckstride: {error}"),
};
}
Action::PickNotes => {
@ -567,6 +648,25 @@ impl Studio {
self.status = "Choose a TXT or Markdown notes file.".into();
}
}
pack_action @ (Action::PickLanguagePack | Action::PickThemePack) => {
if self.initialized && !self.dialog_busy {
let language = matches!(pack_action, Action::PickLanguagePack);
self.dialog_busy = self.dialog.submit(
0,
if language { 3 } else { 4 },
Request::PickPack {
language,
owner: self.dialog_owner,
},
);
self.status = if language {
"Choose a Deckstride language-pack ZIP."
} else {
"Choose a Deckstride theme-pack ZIP."
}
.into();
}
}
Action::ImportNotes(import) => {
if self.loading
|| self.notes_editor.is_some()
@ -675,6 +775,7 @@ impl Studio {
return;
}
if page < self.count() {
self.restart_autoplay();
if page != self.requested
&& self.fg_busy
&& !self.loading
@ -1248,6 +1349,19 @@ impl Studio {
if let Some(path) = p.reply.picked {
if c.tag == 2 {
self.execute(Action::SetBlankPicture(path));
} else if c.tag == 3 || c.tag == 4 {
let result =
crate::packs::pack_root(&self.settings_path).and_then(|root| {
if c.tag == 3 {
crate::packs::install_language(root, &path)
.map(|id| format!("Installed language pack {id}."))
} else {
crate::packs::install_theme(root, &path)
.map(|id| format!("Installed theme pack {id}."))
}
});
self.status = result
.unwrap_or_else(|error| format!("Could not install pack: {error}"));
} else if c.tag == 1 {
if c.generation == self.generation {
self.execute(Action::ImportNotes(path));
@ -1335,6 +1449,7 @@ impl Studio {
self.requested = 0;
self.presentation_started = false;
self.timer = crate::timer::Timer::default();
self.restart_autoplay();
self.displayed = None;
self.layout = self.settings.for_project(&info.key);
self.presenter_views.clear();
@ -1528,6 +1643,7 @@ impl Studio {
{
self.clean_cache(false);
}
self.poll_autoplay_at(Instant::now());
}
fn schedule(&mut self, page: usize, edge: u32, foreground: bool) {
// Reserve both worker slots before admission, including progressive previews.
@ -1832,6 +1948,57 @@ impl Studio {
mod tests {
use super::*;
#[test]
fn autoplay_times_visible_slides_pauses_and_loops_safely() {
let mut s = Studio::new(true, None);
s.initialized = true;
s.deck = Some(DeckInfo {
path: "test.pdf".into(),
key: "test".into(),
title: "Test".into(),
names: vec![String::new(); 3],
notes: vec![],
warnings: vec![],
sha256: String::new(),
});
s.settings.autoplay_enabled = true;
s.settings.autoplay_seconds = 2.0;
s.blanked = false;
s.displayed = Some(0);
let start = Instant::now();
assert!(!s.poll_autoplay_at(start));
assert!(!s.poll_autoplay_at(start + Duration::from_millis(1999)));
assert!(s.poll_autoplay_at(start + Duration::from_secs(2)));
assert_eq!(s.requested, 1);
// A render/output delay never consumes the new slide's interval.
assert!(!s.poll_autoplay_at(start + Duration::from_secs(20)));
assert_eq!(s.requested, 1);
s.displayed = Some(1);
assert!(!s.poll_autoplay_at(start + Duration::from_secs(20)));
assert!(s.poll_autoplay_at(start + Duration::from_secs(22)));
assert_eq!(s.requested, 2);
s.displayed = Some(2);
assert!(!s.poll_autoplay_at(start + Duration::from_secs(22)));
assert!(!s.poll_autoplay_at(start + Duration::from_secs(24)));
assert_eq!(s.requested, 2, "autoplay stops at the final slide");
s.settings.autoplay_loop = true;
s.autoplay_settings_changed();
assert!(!s.poll_autoplay_at(start + Duration::from_secs(30)));
assert!(s.poll_autoplay_at(start + Duration::from_secs(32)));
assert_eq!(s.requested, 0);
s.displayed = Some(0);
s.blanked = true;
assert!(!s.poll_autoplay_at(start + Duration::from_secs(40)));
s.blanked = false;
assert!(!s.poll_autoplay_at(start + Duration::from_secs(50)));
assert!(s.poll_autoplay_at(start + Duration::from_secs(52)));
assert_eq!(s.requested, 1, "unblanking starts a fresh interval");
}
#[test]
fn repeated_navigation_coalesces_rendering_and_clamps_without_blanking() {
let mut s = Studio::new(true, None);

View File

@ -9,7 +9,7 @@ const MUTED: Color32 = Color32::from_rgb(165, 181, 201);
const CYAN: Color32 = Color32::from_rgb(102, 219, 239);
const AMBER: Color32 = Color32::from_rgb(246, 197, 119);
const PURPLE: Color32 = Color32::from_rgb(102, 85, 217);
#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Theme {
#[default]
@ -53,6 +53,12 @@ pub struct Palette {
pub purple: Color32,
}
#[derive(Clone, Debug, PartialEq, Eq)]
enum AppliedTheme {
Builtin(Theme),
Pack(String),
}
impl Theme {
pub const ALL: [Self; 20] = [
Self::Midra,
@ -76,7 +82,7 @@ impl Theme {
Self::VerdantRebel,
Self::WeicatIndustrial,
];
pub fn name(&self) -> &str {
pub fn name(&self) -> &'static str {
match self {
Self::Midra => "Midra Dark",
Self::HighContrast => "High Contrast",
@ -276,49 +282,78 @@ impl Theme {
}
}
pub fn apply(&self, ctx: &egui::Context) {
let p = self.palette();
let mut v = if self.is_light() {
egui::Visuals::light()
} else {
egui::Visuals::dark()
};
v.override_text_color = Some(p.text);
v.panel_fill = p.bg;
v.window_fill = p.panel;
v.extreme_bg_color = p.field;
v.faint_bg_color = p.bg;
v.hyperlink_color = p.cyan;
v.warn_fg_color = p.amber;
v.error_fg_color = if self.is_light() {
Color32::from_rgb(165, 30, 40)
} else {
Color32::LIGHT_RED
};
v.window_stroke = egui::Stroke::new(1_f32, p.line);
v.selection.bg_fill = p.purple;
v.selection.stroke.color = p.text;
for (w, fill) in [
(&mut v.widgets.noninteractive, p.panel),
(&mut v.widgets.inactive, p.field),
(&mut v.widgets.hovered, p.panel.lerp_to_gamma(p.text, 0.08)),
(&mut v.widgets.active, p.purple),
(&mut v.widgets.open, p.panel),
] {
w.bg_fill = fill;
w.weak_bg_fill = fill;
w.bg_stroke = egui::Stroke::new(
if *self == Self::HighContrast {
2_f32
} else {
1_f32
},
p.line,
);
w.fg_stroke = egui::Stroke::new(1_f32, p.text);
}
ctx.set_visuals(v);
apply_palette(
ctx,
AppliedTheme::Builtin(*self),
self.palette(),
self.is_light(),
*self == Self::HighContrast,
);
}
}
pub fn apply_selected(ctx: &egui::Context, builtin: Theme, packed: Option<&str>) {
if let Some(choice) = packed
&& let Some((palette, light, _)) = crate::packs::packed_theme(choice)
{
apply_palette(
ctx,
AppliedTheme::Pack(choice.to_owned()),
palette,
light,
false,
);
} else {
builtin.apply(ctx);
}
}
fn apply_palette(
ctx: &egui::Context,
choice: AppliedTheme,
p: Palette,
light: bool,
high_contrast: bool,
) {
let applied = egui::Id::new("deckstride-theme");
if ctx.data(|data| data.get_temp::<AppliedTheme>(applied)) == Some(choice.clone()) {
return;
}
let mut v = if light {
egui::Visuals::light()
} else {
egui::Visuals::dark()
};
v.override_text_color = Some(p.text);
v.panel_fill = p.bg;
v.window_fill = p.panel;
v.extreme_bg_color = p.field;
v.faint_bg_color = p.bg;
v.hyperlink_color = p.cyan;
v.warn_fg_color = p.amber;
v.error_fg_color = if light {
Color32::from_rgb(165, 30, 40)
} else {
Color32::LIGHT_RED
};
v.window_stroke = egui::Stroke::new(1_f32, p.line);
v.selection.bg_fill = p.purple;
v.selection.stroke.color = p.text;
for (w, fill) in [
(&mut v.widgets.noninteractive, p.panel),
(&mut v.widgets.inactive, p.field),
(&mut v.widgets.hovered, p.panel.lerp_to_gamma(p.text, 0.08)),
(&mut v.widgets.active, p.purple),
(&mut v.widgets.open, p.panel),
] {
w.bg_fill = fill;
w.weak_bg_fill = fill;
w.bg_stroke = egui::Stroke::new(if high_contrast { 2_f32 } else { 1_f32 }, p.line);
w.fg_stroke = egui::Stroke::new(1_f32, p.text);
}
ctx.set_visuals(v);
ctx.data_mut(|data| data.insert_temp(applied, choice));
}
fn sotv_palette(colors: [u32; 8], light: bool) -> Palette {
let [bg, panel, field, layer, text, subtle, accent, line] =
colors.map(|hex| Color32::from_rgb((hex >> 16) as u8, (hex >> 8) as u8, hex as u8));
@ -350,3 +385,19 @@ fn sotv_palette(colors: [u32; 8], light: bool) -> Palette {
pattern: [layer, panel],
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn repeated_theme_application_keeps_the_existing_style() {
let ctx = egui::Context::default();
Theme::Midra.apply(&ctx);
let first = ctx.global_style();
Theme::Midra.apply(&ctx);
assert!(std::sync::Arc::ptr_eq(&first, &ctx.global_style()));
Theme::CorporateLight.apply(&ctx);
assert!(!std::sync::Arc::ptr_eq(&first, &ctx.global_style()));
}
}

View File

@ -105,39 +105,39 @@ pub fn register_pdf_association() -> Result<(), String> {
let command = open_command(&executable);
let values = [
(
r"Software\Classes\PDFPresenter.Document",
r"Software\Classes\Deckstride.Document",
None,
"PDF Presenter document",
"Deckstride document",
),
(
r"Software\Classes\PDFPresenter.Document\DefaultIcon",
r"Software\Classes\Deckstride.Document\DefaultIcon",
None,
icon.as_str(),
),
(
r"Software\Classes\PDFPresenter.Document\shell\open\command",
r"Software\Classes\Deckstride.Document\shell\open\command",
None,
command.as_str(),
),
(
r"Software\PDF Presenter\Capabilities",
r"Software\Deckstride\Capabilities",
Some("ApplicationName"),
"PDF Presenter",
"Deckstride",
),
(
r"Software\PDF Presenter\Capabilities",
r"Software\Deckstride\Capabilities",
Some("ApplicationDescription"),
"Fast multi-screen PDF presenter",
),
(
r"Software\PDF Presenter\Capabilities\FileAssociations",
r"Software\Deckstride\Capabilities\FileAssociations",
Some(".pdf"),
"PDFPresenter.Document",
"Deckstride.Document",
),
(
r"Software\RegisteredApplications",
Some("PDF Presenter"),
r"Software\PDF Presenter\Capabilities",
Some("Deckstride"),
r"Software\Deckstride\Capabilities",
),
];
for (subkey, name, value) in values {
@ -174,8 +174,8 @@ mod tests {
#[test]
fn association_command_quotes_executable_and_document() {
assert_eq!(
open_command(Path::new(r"C:\Portable Apps\pdf-presenter.exe")),
r#"\"C:\Portable Apps\pdf-presenter.exe\" --open \"%1\""#
open_command(Path::new(r"C:\Portable Apps\deckstride.exe")),
r#"\"C:\Portable Apps\deckstride.exe\" --open \"%1\""#
);
}
}

View File

@ -56,6 +56,10 @@ pub enum Request {
PickNotes {
owner: Option<isize>,
},
PickPack {
language: bool,
owner: Option<isize>,
},
PrepareNotes {
path: PathBuf,
cache: PathBuf,
@ -277,6 +281,23 @@ pub fn run() -> Result<(), String> {
.add_filter("Notes (TXT, Markdown)", &["txt", "md"])
.pick_file();
}
Request::PickPack { language, owner } => {
reply.picked = picker_dialog(owner)?
.set_title(if language {
"Import language pack"
} else {
"Import theme pack"
})
.add_filter(
if language {
"Language pack"
} else {
"Theme pack"
},
&["zip"],
)
.pick_file();
}
Request::PrepareNotes {
path,
cache,

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::{
use deckstride::{
blank,
studio::{Action, Studio},
};
@ -50,7 +50,7 @@ fn worker_import_failure_and_clear_preserve_blank_state() {
let dir = tempfile::tempdir().unwrap();
let source = dir.path().join("picture.png");
common::image(&source, [20, 50, 90, 255]);
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
until(&mut s, |s| s.initialized);
s.blanked = true;
s.execute(Action::SetBlankPicture(source.clone()));
@ -63,9 +63,9 @@ fn worker_import_failure_and_clear_preserve_blank_state() {
assert_eq!(s.blank_picture.as_ref().unwrap().info.sha256, hash);
assert!(s.blanked);
let encoded = toml::to_string(&s.settings).unwrap();
let decoded: pdf_presenter::settings::Settings = toml::from_str(&encoded).unwrap();
let decoded: deckstride::settings::Settings = toml::from_str(&encoded).unwrap();
assert!(decoded.blank_picture);
s.execute(Action::ClearBlankPicture);
assert!(s.blanked && s.blank_picture.is_none() && !s.settings.blank_picture);
assert!(!pdf_presenter::settings::Settings::default().blank_picture);
assert!(!deckstride::settings::Settings::default().blank_picture);
}

View File

@ -1,6 +1,6 @@
#[test]
fn executable_identifies_its_actual_status() {
let output = std::process::Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
let output = std::process::Command::new(env!("CARGO_BIN_EXE_deckstride"))
.arg("--help")
.output()
.unwrap();

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::{
use deckstride::{
cache::{self, Policy},
document::Document,
settings,
@ -142,7 +142,7 @@ fn manual_worker_cleanup_preserves_live_document_and_regenerates_after_expunging
let root = temp.path().join("cache");
let doc = Document::open(&images, root.clone()).unwrap();
let frame = doc.render(0, 512).unwrap();
let mut studio = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut studio = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
studio.cache_path = root.clone();
studio.initialized = true;
let clean = |s: &mut Studio| {
@ -175,7 +175,7 @@ fn startup_cleanup_runs_once_and_manual_errors_are_reported() {
let root = temp.path().join("cache");
let expired = entry(&root, 1, 0, 30, 40);
let fresh = entry(&root, 1, 1, 30, 0);
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
s.cache_path = root;
s.initialized = true;
let deadline = Instant::now() + Duration::from_secs(10);
@ -218,11 +218,7 @@ fn startup_cleanup_waits_for_initial_deck_preparation() {
}
let root = temp.path().join("cache");
let expired = entry(&root, 1, 0, 30, 40);
let mut s = Studio::with_program(
true,
Some(images),
env!("CARGO_BIN_EXE_pdf-presenter").into(),
);
let mut s = Studio::with_program(true, Some(images), env!("CARGO_BIN_EXE_deckstride").into());
s.cache_path = root;
s.poll();
assert!(!s.cache_busy, "Initial open must precede cleanup");

View File

@ -1,11 +1,11 @@
use pdf_presenter::{
use deckstride::{
studio::{Action, Studio},
worker::{Completion, Job, Reply, Request, ResultPacket},
};
use std::sync::mpsc::{self, Receiver, SyncSender};
fn controlled_chooser() -> (Studio, Receiver<Job>, SyncSender<Completion>) {
let mut studio = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut studio = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
let (requests, jobs) = mpsc::sync_channel(4);
let (results, replies) = mpsc::sync_channel(4);
// Replace only the chooser transport: no native dialog or renderer is opened.

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::{
use deckstride::{
document::{Document, natural_cmp, read_frame, validate_frame},
settings,
};

View File

@ -5,7 +5,7 @@ use std::{
};
fn run_native(args: &[&str]) -> Output {
let mut child = Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
let mut child = Command::new(env!("CARGO_BIN_EXE_deckstride"))
.args(args)
.stdin(Stdio::null())
.stdout(Stdio::piped())
@ -31,10 +31,8 @@ fn run_native(args: &[&str]) -> Output {
#[test]
fn native_windows_smoke_when_requested() {
if std::env::var_os("PDF_PRESENTER_GUI_TESTS").is_none() {
eprintln!(
"Native smoke not requested; set PDF_PRESENTER_GUI_TESTS=1 with a display server."
);
if std::env::var_os("DECKSTRIDE_GUI_TESTS").is_none() {
eprintln!("Native smoke not requested; set DECKSTRIDE_GUI_TESTS=1 with a display server.");
return;
}
let listed = run_native(&["--list-monitors"]);
@ -65,7 +63,7 @@ fn native_windows_smoke_when_requested() {
#[test]
fn invalid_cli_fails_cleanly() {
let result = Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
let result = Command::new(env!("CARGO_BIN_EXE_deckstride"))
.arg("--bad-option")
.output()
.unwrap();
@ -75,10 +73,10 @@ fn invalid_cli_fails_cleanly() {
#[test]
fn independent_output_acknowledges_frames_and_blanking() {
if std::env::var_os("PDF_PRESENTER_GUI_TESTS").is_none() {
if std::env::var_os("DECKSTRIDE_GUI_TESTS").is_none() {
return;
}
use pdf_presenter::{
use deckstride::{
document::Document,
output::{Ack, HostState},
worker::{read_json, write_json},
@ -109,7 +107,7 @@ fn independent_output_acknowledges_frames_and_blanking() {
}
let doc = Document::open(temp.path(), temp.path().join("cache")).unwrap();
let frames: Vec<_> = (0..8).map(|page| doc.render(page, 320).unwrap()).collect();
let blank_picture = pdf_presenter::blank::prepare(
let blank_picture = deckstride::blank::prepare(
Some(&temp.path().join("slide0.png")),
&temp.path().join("blank-picture.rgba"),
)
@ -122,7 +120,7 @@ fn independent_output_acknowledges_frames_and_blanking() {
}
}
let mut child = ChildGuard(
Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
Command::new(env!("CARGO_BIN_EXE_deckstride"))
.arg("--presentation-host")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
@ -209,9 +207,9 @@ fn independent_output_acknowledges_frames_and_blanking() {
write_json(
&mut input,
&HostState {
zoom: pdf_presenter::zoom::Sync {
zoom: deckstride::zoom::Sync {
enabled: true,
view: pdf_presenter::zoom::View {
view: deckstride::zoom::View {
scale: 2.,
center: [0.5; 2],
},
@ -250,9 +248,9 @@ fn independent_output_acknowledges_frames_and_blanking() {
zoom_only: true,
generation: 99,
page,
zoom: pdf_presenter::zoom::Sync {
zoom: deckstride::zoom::Sync {
enabled: true,
view: pdf_presenter::zoom::View {
view: deckstride::zoom::View {
scale: 4.,
center: [0.4, 0.6],
},
@ -297,10 +295,10 @@ fn independent_output_acknowledges_frames_and_blanking() {
#[cfg(target_os = "linux")]
#[test]
fn orphaned_output_holds_until_closed_then_exits_on_close_or_escape() {
if std::env::var_os("PDF_PRESENTER_GUI_TESTS").is_none() {
if std::env::var_os("DECKSTRIDE_GUI_TESTS").is_none() {
return;
}
use pdf_presenter::{output::HostState, worker::write_json};
use deckstride::{output::HostState, worker::write_json};
use x11_dl::xlib;
let x = xlib::Xlib::open().unwrap();
// A private X11 connection is used only by this test thread.
@ -424,7 +422,7 @@ fn orphaned_output_holds_until_closed_then_exits_on_close_or_escape() {
}
}
let mut child = ChildGuard(
Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
Command::new(env!("CARGO_BIN_EXE_deckstride"))
.env("WINIT_UNIX_BACKEND", "x11")
.arg("--presentation-host")
.stdin(Stdio::piped())
@ -535,13 +533,13 @@ fn orphaned_output_holds_until_closed_then_exits_on_close_or_escape() {
#[cfg(target_os = "linux")]
#[test]
fn wayland_browser_parents_to_presenter_before_first_buffer() {
if std::env::var_os("PDF_PRESENTER_GUI_TESTS").is_none()
if std::env::var_os("DECKSTRIDE_GUI_TESTS").is_none()
|| std::env::var_os("WAYLAND_DISPLAY").is_none()
{
return;
}
let trace = tempfile::NamedTempFile::new().unwrap();
let mut child = Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
let mut child = Command::new(env!("CARGO_BIN_EXE_deckstride"))
.arg("--smoke-test")
.env("WAYLAND_DEBUG", "client")
.stdout(Stdio::null())
@ -577,8 +575,8 @@ fn wayland_browser_parents_to_presenter_before_first_buffer() {
.next()
.unwrap()
};
let presenter = top("PDF Presenter — Presenter");
let browser = top("PDF Presenter — All slides");
let presenter = top("Deckstride — Presenter");
let browser = top("Deckstride — All slides");
assert_ne!(browser, presenter);
let parent_at = log
.find(&format!("{browser}.set_parent({presenter})"))
@ -621,7 +619,7 @@ fn wayland_browser_parents_to_presenter_before_first_buffer() {
fn unsupported_sleep_backend_reports_unavailable_and_exits_on_parent_eof() {
let output = run_native(&["--keep-awake"]);
assert!(output.status.success());
let status: String = pdf_presenter::worker::read_json(&mut output.stdout.as_slice()).unwrap();
let status: String = deckstride::worker::read_json(&mut output.stdout.as_slice()).unwrap();
assert!(status.starts_with("Sleep protection unavailable:"));
assert!(status.contains(std::env::consts::OS));
}
@ -629,8 +627,8 @@ fn unsupported_sleep_backend_reports_unavailable_and_exits_on_parent_eof() {
#[test]
fn keep_awake_status_uses_private_length_prefixed_json() {
let mut framed = Vec::new();
pdf_presenter::worker::write_json(&mut framed, &"Sleep protection test").unwrap();
deckstride::worker::write_json(&mut framed, &"Sleep protection test").unwrap();
assert!(serde_json::from_slice::<String>(&framed).is_err());
let decoded: String = pdf_presenter::worker::read_json(&mut framed.as_slice()).unwrap();
let decoded: String = deckstride::worker::read_json(&mut framed.as_slice()).unwrap();
assert_eq!(decoded, "Sleep protection test");
}

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::{
use deckstride::{
document::Document,
notes,
studio::{Action, Studio},
@ -195,7 +195,7 @@ fn editor_worker_saves_captured_page_and_keeps_draft_after_conflict() {
common::pdf(&source);
let cache = temp.path().join("cache");
let info = Document::open(&source, cache.clone()).unwrap().info;
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
s.cache_path = cache;
s.deck = Some(info);
s.initialized = true;
@ -393,7 +393,7 @@ fn worker_import_review_save_and_failure_keep_presentation_running() {
let info = Document::open(&source, cache.clone()).unwrap().info;
let input = temp.path().join("notes.txt");
std::fs::write(&input, "Imported").unwrap();
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_pdf-presenter").into());
let mut s = Studio::with_program(true, None, env!("CARGO_BIN_EXE_deckstride").into());
s.cache_path = cache;
s.initialized = true;
s.execute(Action::ImportNotes(input.clone()));

View File

@ -1,4 +1,4 @@
use pdf_presenter::{
use deckstride::{
paint,
poc::{Action, Display, Model, Options, SLIDES, window_rect},
};

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::studio::{Action, Monitor, Studio};
use deckstride::studio::{Action, Monitor, Studio};
use std::{
path::{Path, PathBuf},
time::{Duration, Instant},
@ -8,7 +8,7 @@ fn studio(path: &Path, cache: &Path) -> Studio {
let mut s = Studio::with_program(
true,
Some(path.to_owned()),
env!("CARGO_BIN_EXE_pdf-presenter").into(),
env!("CARGO_BIN_EXE_deckstride").into(),
);
s.cache_path = cache.to_owned();
s.set_monitors(
@ -273,11 +273,10 @@ fn rolling_buffer_finishes_processing_and_reloads_evicted_slides_without_churn()
}
#[test]
#[ignore = "manual stress test: set PDF_PRESENTER_STRESS_PDF to an authorized local PDF"]
#[ignore = "manual stress test: set DECKSTRIDE_STRESS_PDF to an authorized local PDF"]
fn real_pdf_exceeds_budget_and_keeps_navigating() {
let path = PathBuf::from(
std::env::var_os("PDF_PRESENTER_STRESS_PDF").expect("PDF_PRESENTER_STRESS_PDF"),
);
let path =
PathBuf::from(std::env::var_os("DECKSTRIDE_STRESS_PDF").expect("DECKSTRIDE_STRESS_PDF"));
let temp = tempfile::tempdir().unwrap();
let mut s = studio(&path, &temp.path().join("cache"));
s.monitors[0].size = (1920, 1080);

View File

@ -1,4 +1,4 @@
use pdf_presenter::Presentation;
use deckstride::Presentation;
use std::num::NonZeroUsize;
#[test]

View File

@ -1,9 +1,9 @@
use egui::{Context, Pos2, RawInput, Rect, Vec2};
use pdf_presenter::{
use deckstride::{
document::{DeckInfo, Frame, FrameInfo},
presenter_ui::{self, UiState},
studio::{Action, Monitor, Studio},
};
use egui::{Context, Pos2, RawInput, Rect, Vec2};
use std::{collections::HashMap, sync::Arc};
fn studio() -> Studio {
let mut s = Studio::new(true, None);
@ -173,7 +173,7 @@ fn lost_operator_screen_never_becomes_notes_on_previous_public_output() {
#[test]
fn palettes_and_languages_apply_to_presenter_browser_and_popups() {
use pdf_presenter::{
use deckstride::{
localization::{Language, apply, tr},
theme::Theme,
};
@ -321,7 +321,7 @@ fn display_changes_require_confirmation_and_timeout_restores_previous_setup() {
#[test]
fn recovery_commands_are_scoped_to_the_current_trial_and_startup() {
use pdf_presenter::output::DisplayAction;
use deckstride::output::DisplayAction;
let mut s = studio();
s.settings.routes = s.routes.clone();
let original = s.routes.clone();
@ -434,7 +434,7 @@ fn output_recovery_buttons_dispatch_without_presenter_data() {
action = presenter_ui::output_display_recovery(ui, true, trial);
});
}
use pdf_presenter::output::DisplayAction;
use deckstride::output::DisplayAction;
assert!(matches!(
(label, action),
("Keep changes", Some(DisplayAction::Keep))
@ -476,7 +476,7 @@ fn quick_settings_and_preferences_window_remain_interactive() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
let mut native = UiState::default();
let mut frame = |s: &mut Studio, events| {
let mut raw = input(Vec2::new(1920., 1080.));
@ -505,22 +505,35 @@ fn quick_settings_and_preferences_window_remain_interactive() {
}
};
click(&mut s, "Menu");
click(&mut s, "Appearance");
click(&mut s, "Midra Dark");
click(&mut s, "Quit");
assert!(
s.menu_open,
"Opening a theme selector must keep its parents open"
s.actions
.iter()
.any(|action| matches!(action, Action::Exit)),
"Quit should be directly reachable without scrolling at 1080p"
);
assert!(!s.menu_open);
s.actions.clear();
click(&mut s, "Menu");
click(&mut s, "Autoplay");
click(&mut s, "Play automatically");
assert!(s.settings.autoplay_enabled);
assert!(s.menu_open);
click(&mut s, "Loop");
assert!(s.settings.autoplay_loop);
assert!(s.menu_open);
click(&mut s, "Menu");
click(&mut s, "Menu");
click(&mut s, "Preferences…");
assert!(s.preferences_open);
assert!(!s.menu_open);
click(&mut s, "Midra Dark");
click(&mut s, "High Contrast");
assert_eq!(s.settings.theme, pdf_presenter::theme::Theme::HighContrast);
assert!(s.menu_open);
click(&mut s, "English");
click(&mut s, "System / Système");
assert_eq!(
s.settings.language,
pdf_presenter::localization::Language::System
);
assert!(s.menu_open);
assert_eq!(s.settings.theme, deckstride::theme::Theme::HighContrast);
assert!(s.preferences_open);
click(&mut s, "Close");
assert!(!s.preferences_open);
click(&mut s, "Menu");
let zoom_enabled = s.settings.zoom_enabled;
click(&mut s, "Enable page zoom");
assert_eq!(s.settings.zoom_enabled, !zoom_enabled);
@ -536,6 +549,7 @@ fn quick_settings_and_preferences_window_remain_interactive() {
click(&mut s, "Preferences…");
assert!(s.preferences_open);
assert!(!s.menu_open);
click(&mut s, "Performance");
click(&mut s, "Expunge unused cache now");
assert!(s.cache_busy, "The Preferences window must submit cleanup");
assert!(s.preferences_open);
@ -552,7 +566,7 @@ fn quick_settings_and_preferences_window_remain_interactive() {
click(&mut s, "Pause timer");
assert!(!s.timer.running(std::time::Instant::now(), s.timer_limit()));
click(&mut s, "Menu");
click(&mut s, "Demo");
click(&mut s, "demo.pdf");
assert!(!s.menu_open, "Outside click should dismiss the dropdown");
click(&mut s, "Menu");
frame(
@ -570,7 +584,7 @@ fn quick_settings_and_preferences_window_remain_interactive() {
#[test]
fn timer_presets_reserve_space_and_progress_tracks_navigation() {
use pdf_presenter::settings::TimerPosition;
use deckstride::settings::TimerPosition;
fn text_rect(shapes: &[egui::epaint::ClippedShape], label: &str) -> Option<Rect> {
fn find(shape: &egui::Shape, label: &str) -> Option<Rect> {
match shape {
@ -694,7 +708,7 @@ fn end_of_slides_is_only_a_presenter_next_preview_not_a_page() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
let mut native = UiState::default();
for (total, requested, next_visible, expected) in [
(3, 0, true, 0),
@ -917,11 +931,17 @@ fn browser_thumbnails_fill_resized_window_without_stretching_tiles() {
#[test]
fn floating_windows_can_grow_and_shrink_after_content_is_drawn() {
for id in ["layout-window", "displays-window", "slide-preview"] {
for id in [
"layout-window",
"displays-window",
"preferences-window",
"slide-preview",
] {
let ctx = Context::default();
let mut s = studio();
s.layout_open = id == "layout-window";
s.displays_open = id == "displays-window";
s.preferences_open = id == "preferences-window";
if id == "slide-preview" {
s.browser_preview = Some((s.generation, 0));
}
@ -941,6 +961,22 @@ fn floating_windows_can_grow_and_shrink_after_content_is_drawn() {
frame(vec![]);
}
let rect = || ctx.memory(|m| m.area_rect(egui::Id::new(id))).unwrap();
if id == "preferences-window" {
let before = rect();
for offset in [
Vec2::new(20., 20.),
Vec2::new(-40., 80.),
Vec2::new(100., -60.),
Vec2::new(-120., -90.),
] {
frame(vec![egui::Event::PointerMoved(before.center() + offset)]);
}
let after = rect();
assert!(
(after.size() - before.size()).length() < 1.,
"Preferences must not resize on mouse movement: {before:?} -> {after:?}"
);
}
for delta in [Vec2::new(120., 80.), Vec2::new(-180., -180.)] {
let before = rect();
let start = before.right_bottom() - Vec2::splat(2.);
@ -1018,7 +1054,7 @@ fn timer_waits_for_activity_reset_rearms_and_pause_stays_paused() {
s.execute(Action::ResetTimer);
assert!(!s.timer.running(Instant::now(), s.timer_limit()));
s.settings.zoom_enabled = true;
s.set_zoom_from_action(pdf_presenter::zoom::View {
s.set_zoom_from_action(deckstride::zoom::View {
scale: 2.,
center: [0.5; 2],
});
@ -1114,6 +1150,54 @@ fn hidden_footer_hides_routine_rolling_buffer_status() {
);
}
#[test]
fn source_name_and_path_are_in_the_footer_instead_of_the_header() {
fn contains_exact(shape: &egui::Shape, expected: &str) -> bool {
match shape {
egui::Shape::Text(text) => text.galley.text() == expected,
egui::Shape::Vec(shapes) => shapes.iter().any(|shape| contains_exact(shape, expected)),
_ => false,
}
}
let ctx = Context::default();
let mut s = studio();
let path = std::path::PathBuf::from("shows").join("conference.pdf");
s.deck.as_mut().unwrap().path = path.clone();
s.layout.header = true;
s.layout.footer = true;
let mut native = UiState::default();
let visible = ctx.run_ui(input(Vec2::new(1280., 900.)), |ui| {
presenter_ui::presenter(ui, &mut s, &mut native)
});
for expected in ["conference.pdf", &path.display().to_string()] {
assert!(
visible
.shapes
.iter()
.any(|shape| contains_exact(&shape.shape, expected)),
"missing {expected}"
);
}
assert!(
!visible
.shapes
.iter()
.any(|shape| contains_exact(&shape.shape, "Demo"))
);
s.layout.footer = false;
native.footer_until = std::time::Instant::now() - std::time::Duration::from_secs(1);
let hidden = ctx.run_ui(input(Vec2::new(1280., 900.)), |ui| {
presenter_ui::presenter(ui, &mut s, &mut native)
});
assert!(
!hidden
.shapes
.iter()
.any(|shape| contains_exact(&shape.shape, &path.display().to_string()))
);
}
#[test]
fn fullscreen_and_routing_changes_preserve_explicit_output_visibility() {
for blanked in [false, true] {
@ -1196,13 +1280,13 @@ fn double_click_notes_opens_editor_and_editor_keeps_unsaved_draft() {
}
assert!(s.actions.iter().any(|a| matches!(a, Action::EditNotes)));
s.actions.clear();
s.notes_editor = Some(pdf_presenter::studio::NotesEditor {
s.notes_editor = Some(deckstride::studio::NotesEditor {
page: 0,
text: "Saved".into(),
saved_text: "Saved".into(),
busy: false,
error: None,
snapshot: Some(pdf_presenter::notes::Snapshot {
snapshot: Some(deckstride::notes::Snapshot {
path: "demo.notes.toml".into(),
revision: "test".into(),
notes: vec!["Saved".into()],
@ -1250,10 +1334,10 @@ fn notes_import_review_requires_explicit_save_and_cancel_discards_preview() {
let ctx = Context::default();
let mut s = studio();
let original = s.deck.as_ref().unwrap().notes.clone();
s.notes_import = Some(pdf_presenter::studio::NotesImport {
s.notes_import = Some(deckstride::studio::NotesImport {
busy: false,
error: None,
preview: Some(pdf_presenter::notes::ImportPreview {
preview: Some(deckstride::notes::ImportPreview {
path: "demo.notes.toml".into(),
revision: Some("revision".into()),
sections: vec!["New first note".into(), "".into()],
@ -1309,13 +1393,13 @@ fn zoom_is_opt_in_resets_on_slide_change_and_does_not_blank_output() {
let mut s = studio();
assert!(!s.settings.zoom_enabled);
s.blanked = false;
s.set_zoom(pdf_presenter::zoom::View {
s.set_zoom(deckstride::zoom::View {
scale: 4.,
center: [0.3, 0.6],
});
assert_eq!(s.zoom.view.scale, 1.);
s.enable_zoom(true);
s.set_zoom(pdf_presenter::zoom::View {
s.set_zoom(deckstride::zoom::View {
scale: 4.,
center: [0.3, 0.6],
});
@ -1332,7 +1416,7 @@ fn zoom_is_opt_in_resets_on_slide_change_and_does_not_blank_output() {
assert_eq!(s.zoom.view.scale, 1.);
assert!(s.zoom.epoch > epoch);
assert!(!s.blanked);
s.set_zoom(pdf_presenter::zoom::View {
s.set_zoom(deckstride::zoom::View {
scale: 8.,
center: [0.5; 2],
});
@ -1349,7 +1433,7 @@ fn zoom_is_opt_in_resets_on_slide_change_and_does_not_blank_output() {
#[test]
fn zoom_preview_matches_reference_output_crop_and_tracks_window_shape() {
use pdf_presenter::{output::OutputViewport, zoom::View};
use deckstride::{output::OutputViewport, zoom::View};
let mut s = studio();
s.settings.zoom_enabled = true;
s.set_zoom(View {
@ -1413,7 +1497,7 @@ fn held_navigation_buttons_accelerate_and_release_without_an_extra_step() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.layout.footer = true;
s.blanked = false;
let mut native = UiState::default();
@ -1449,7 +1533,7 @@ fn held_navigation_buttons_accelerate_and_release_without_an_extra_step() {
],
);
assert_eq!(s.requested, 1);
native.navigation_hold = Some(pdf_presenter::navigation::Hold::new(
native.navigation_hold = Some(deckstride::navigation::Hold::new(
1,
std::time::Instant::now() - std::time::Duration::from_secs(6),
));
@ -1624,9 +1708,9 @@ fn presenter_layouts_are_display_scoped_and_save_actions_keep_the_origin() {
second.layout_open = true;
second.layout.notes.show = false;
second.layout.current.size = 180.;
second.layout.clock_position = pdf_presenter::settings::TimerPosition::LeftOfSlides;
second.layout.clock_position = deckstride::settings::TimerPosition::LeftOfSlides;
s.presenter_views.insert("two".into(), second);
s.layout.timer_mode = pdf_presenter::settings::TimerMode::Countdown;
s.layout.timer_mode = deckstride::settings::TimerMode::Countdown;
s.layout.countdown_seconds = 99;
let contexts = [Context::default(), Context::default()];
let mut natives = [UiState::default(), UiState::default()];
@ -1740,12 +1824,68 @@ fn preferences_window_stays_on_the_presenter_that_opened_it() {
output
.shapes
.iter()
.any(|shape| contains(&shape.shape, "Memory and cache"))
.any(|shape| contains(&shape.shape, "Appearance"))
};
assert!(render(0, "one"));
assert!(!render(1, "two"));
}
#[test]
fn preferences_show_the_running_executable_path() {
fn find(shape: &egui::Shape, text: &str) -> Option<Pos2> {
match shape {
egui::Shape::Text(label) if label.galley.text() == text => {
Some(label.pos + label.galley.size() * 0.5)
}
egui::Shape::Vec(shapes) => shapes.iter().find_map(|shape| find(shape, text)),
_ => None,
}
}
let ctx = Context::default();
let mut s = studio();
s.preferences_open = true;
let expected = s.executable_path().display().to_string();
let mut ui = UiState::default();
let mut output = ctx.run_ui(input(Vec2::new(1280., 900.)), |root| {
presenter_ui::presenter(root, &mut s, &mut ui)
});
for _ in 0..2 {
output = ctx.run_ui(input(Vec2::new(1280., 900.)), |root| {
presenter_ui::presenter(root, &mut s, &mut ui)
});
}
let storage = output
.shapes
.iter()
.find_map(|shape| find(&shape.shape, "Storage"))
.expect("Preferences should expose a Storage tab");
for pressed in [true, false] {
let mut raw = input(Vec2::new(1280., 900.));
raw.events = vec![
egui::Event::PointerMoved(storage),
egui::Event::PointerButton {
pos: storage,
button: egui::PointerButton::Primary,
pressed,
modifiers: Default::default(),
},
];
output = ctx.run_ui(raw, |root| presenter_ui::presenter(root, &mut s, &mut ui));
}
assert!(
output
.shapes
.iter()
.any(|shape| find(&shape.shape, "Application executable").is_some())
);
assert!(
output
.shapes
.iter()
.any(|shape| find(&shape.shape, &expected).is_some())
);
}
#[test]
fn any_presenter_can_edit_and_save_another_presenter_layout() {
fn find(shape: &egui::Shape, label: &str) -> Option<Pos2> {
@ -1855,7 +1995,7 @@ fn explicit_swap_during_show_preserves_visibility_and_uses_reversible_trial() {
#[test]
fn screen_overrides_survive_global_commands_swap_and_hotplug_and_require_confirmation() {
use pdf_presenter::settings::ScreenMode::{AlwaysFullscreen, AlwaysWindowed};
use deckstride::settings::ScreenMode::{AlwaysFullscreen, AlwaysWindowed};
for blanked in [false, true] {
let mut s = studio();
s.blanked = blanked;
@ -1917,7 +2057,7 @@ fn displays_dropdown_edits_only_selected_screen_until_applied() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.begin_display_edit();
let mut native = UiState::default();
let mut frame = |s: &mut Studio, events| {
@ -1952,7 +2092,7 @@ fn displays_dropdown_edits_only_selected_screen_until_applied() {
}
assert_eq!(
s.draft_screen_modes.get("one"),
Some(&pdf_presenter::settings::ScreenMode::AlwaysWindowed)
Some(&deckstride::settings::ScreenMode::AlwaysWindowed)
);
assert!(!s.draft_screen_modes.contains_key("two"));
assert!(s.settings.screen_modes.is_empty());
@ -1966,9 +2106,9 @@ fn output_viewport_accepts_screen_override_instead_of_global_mode() {
let mut s = studio();
s.settings.screen_modes.insert(
"two".into(),
pdf_presenter::settings::ScreenMode::AlwaysWindowed,
deckstride::settings::ScreenMode::AlwaysWindowed,
);
s.output_viewport = Some(pdf_presenter::output::OutputViewport {
s.output_viewport = Some(deckstride::output::OutputViewport {
monitor: "two".into(),
fullscreen: false,
size: [800, 600],
@ -1988,7 +2128,7 @@ fn quit_confirmation_requires_explicit_confirmation_and_protects_notes() {
s.execute(Action::CancelExit);
s.execute(Action::ConfirmExit);
assert!(!s.quit_confirmation && !s.close_requested);
s.notes_editor = Some(pdf_presenter::studio::NotesEditor {
s.notes_editor = Some(deckstride::studio::NotesEditor {
page: 0,
text: "Unsaved".into(),
saved_text: "Saved".into(),
@ -2005,7 +2145,7 @@ fn quit_confirmation_requires_explicit_confirmation_and_protects_notes() {
s.execute(Action::ConfirmExit);
assert!(!s.close_requested);
s.notes_editor = None;
s.notes_import = Some(pdf_presenter::studio::NotesImport {
s.notes_import = Some(deckstride::studio::NotesImport {
preview: None,
busy: true,
error: None,
@ -2030,7 +2170,7 @@ fn quit_modal_buttons_work_in_presenter_and_browser() {
for label in ["Cancel", "Quit presentation"] {
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.execute(Action::Exit);
let mut native = UiState::default();
let mut frame = |s: &mut Studio, events| {
@ -2171,7 +2311,7 @@ fn single_screen_renders_only_slide_reuses_texture_and_keeps_geometry_under_menu
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.settings.single_screens = vec!["one".into()];
let original = s.settings.for_display("one", &s.project());
let mut native = UiState::default();
@ -2260,7 +2400,7 @@ fn displays_can_select_single_screen_without_changing_audience_role() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.begin_display_edit();
let mut native = UiState::default();
let mut frame = |s: &mut Studio, events| {
@ -2309,7 +2449,7 @@ fn displays_can_select_single_screen_without_changing_audience_role() {
fn startup_single_prompt_explains_presenter_intent_and_saved_mode_does_not_reoffer() {
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
let one = s.monitors[0].clone();
s.observe_startup_displays(1, Some("one"));
s.set_monitors(vec![one], 0);
@ -2329,7 +2469,10 @@ fn startup_single_prompt_explains_presenter_intent_and_saved_mode_does_not_reoff
presenter_ui::presenter(ui, &mut s, &mut native)
});
}
assert!(result.shapes.iter().any(|shape| has_text(&shape.shape, "PDF Presenter is intended for a presenter setup with separate Presenter and Slides screens.")));
assert!(result.shapes.iter().any(|shape| has_text(
&shape.shape,
"Deckstride is intended for a presenter setup with separate Presenter and Slides screens."
)));
s.settings.single_screens = vec!["one".into()];
assert!(!s.startup_single_offer());
s.poll();
@ -2347,7 +2490,7 @@ fn single_screen_bottom_controls_reveal_and_hide_without_pinning_layout() {
}
let ctx = Context::default();
let mut s = studio();
s.settings.language = pdf_presenter::localization::Language::En;
s.settings.language = deckstride::localization::Language::En;
s.settings.single_screens = vec!["one".into()];
let mut native = UiState::default();
let render = |s: &mut Studio, native: &mut UiState, pos| {

View File

@ -1,4 +1,19 @@
use pdf_presenter::settings::{self, Layout, Routes, Settings};
use deckstride::settings::{self, Layout, Routes, Settings};
#[test]
fn every_interface_language_round_trips_through_settings_v1() {
let temp = tempfile::tempdir().unwrap();
for language in deckstride::localization::Language::ALL {
let path = temp.path().join(format!("{language:?}.toml"));
let settings = Settings {
language,
..Default::default()
};
settings::write(&path, &settings).unwrap();
assert_eq!(settings::read(&path).unwrap().language, language);
}
}
#[test]
fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
let temp = tempfile::tempdir().unwrap();
@ -8,8 +23,10 @@ fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
settings.layout.notes.size = 42.;
settings.buffer_mib = 2048;
settings.auto_show = false;
settings.theme = pdf_presenter::theme::Theme::CorporateLight;
settings.language = pdf_presenter::localization::Language::Fr;
settings.theme = deckstride::theme::Theme::CorporateLight;
settings.theme_pack = Some("example-theme/night".into());
settings.language = deckstride::localization::Language::Fr;
settings.language_pack = Some("eo-example".into());
let mut project = Layout::default();
project.previous.show = true; // Explicit opt-in survives saving and loading.
project.current.show = false;
@ -31,7 +48,9 @@ fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
assert_eq!(loaded.buffer_mib, 2048);
assert!(!loaded.auto_show);
assert_eq!(loaded.theme, settings.theme);
assert_eq!(loaded.theme_pack, settings.theme_pack);
assert_eq!(loaded.language, settings.language);
assert_eq!(loaded.language_pack, settings.language_pack);
let bytes = std::fs::read(&path).unwrap();
settings.version = 2;
assert!(settings::write(&path, &settings).is_err());
@ -144,11 +163,11 @@ fn slide_colors_migrate_roundtrip_and_reject_invalid_channels() {
};
settings::write(&path, &s).unwrap();
assert_eq!(settings::read(&path).unwrap().slide_colors, s.slide_colors);
let state = pdf_presenter::output::HostState {
let state = deckstride::output::HostState {
slide_colors: s.slide_colors,
..Default::default()
};
let restored: pdf_presenter::output::HostState =
let restored: deckstride::output::HostState =
serde_json::from_slice(&serde_json::to_vec(&state).unwrap()).unwrap();
assert_eq!(restored.slide_colors, s.slide_colors);
for value in [
@ -339,9 +358,35 @@ fn screen_modes_migrate_validate_and_roundtrip() {
assert!(s.validate().is_ok());
}
#[test]
fn autoplay_settings_migrate_validate_and_round_trip() {
let legacy: Settings = toml::from_str("version = 1").unwrap();
assert!(!legacy.autoplay_enabled);
assert_eq!(legacy.autoplay_seconds, 5.0);
assert!(!legacy.autoplay_loop);
let mut settings = legacy;
settings.autoplay_enabled = true;
settings.autoplay_seconds = 12.5;
settings.autoplay_loop = true;
let temp = tempfile::tempdir().unwrap();
let path = temp.path().join("settings.toml");
settings::write(&path, &settings).unwrap();
let loaded = settings::read(&path).unwrap();
assert!(loaded.autoplay_enabled);
assert_eq!(loaded.autoplay_seconds, 12.5);
assert!(loaded.autoplay_loop);
for invalid in [0.0, 0.24, 3600.01, f32::INFINITY, f32::NAN] {
let mut invalid_settings = loaded.clone();
invalid_settings.autoplay_seconds = invalid;
assert!(invalid_settings.validate().is_err());
}
}
#[test]
fn output_screen_modes_roundtrip_and_fall_back_to_global() {
use pdf_presenter::output::HostState;
use deckstride::output::HostState;
let state = HostState {
fullscreen: true,
screen_fullscreen: [("one".into(), false), ("two".into(), true)].into(),

View File

@ -1,7 +1,7 @@
mod common;
use deckstride::{document::Document, presenter_ui::paint_slide, settings::SlideColors};
use egui::{Context, Pos2, RawInput, Rect, TextureOptions, Vec2};
use egui_software_backend::{BufferMutRef, ColorFieldOrder, EguiSoftwareRender};
use pdf_presenter::{document::Document, presenter_ui::paint_slide, settings::SlideColors};
#[test]
fn transparent_pdf_composites_on_white_or_custom_page_with_independent_padding() {

View File

@ -1,4 +1,4 @@
use pdf_presenter::timer::Timer;
use deckstride::timer::Timer;
use std::time::{Duration, Instant};
#[test]

View File

@ -1,8 +1,8 @@
use egui::{Pos2, Rect, Vec2};
use pdf_presenter::{
use deckstride::{
output::{HostState, coalesce},
tools::{MAX_MARKS, Mark, MarkKind, Overlay, Toolbox, screen_to_page},
};
use egui::{Pos2, Rect, Vec2};
#[test]
fn overlay_input_is_bounded_and_normalized() {
@ -33,7 +33,7 @@ fn overlay_input_is_bounded_and_normalized() {
#[test]
fn toolbox_discards_oldest_mark_and_maps_visible_crop() {
let mut tools = Toolbox::default();
tools.select(pdf_presenter::tools::Tool::Arrow);
tools.select(deckstride::tools::Tool::Arrow);
for index in 0..MAX_MARKS + 1 {
assert!(tools.begin_mark([index as f32 / 100., 0.5]));
tools.end_mark();
@ -89,7 +89,7 @@ fn overlay_update_coalesces_without_losing_full_output_state() {
generation: 9,
page: 3,
zoom_only: true,
zoom: pdf_presenter::zoom::Sync {
zoom: deckstride::zoom::Sync {
enabled: true,
..Default::default()
},

View File

@ -1,5 +1,5 @@
mod common;
use pdf_presenter::worker::{Reply, Request, read_json, write_json};
use deckstride::worker::{Reply, Request, read_json, write_json};
use std::{
io::Read,
process::{Command, Stdio},
@ -10,7 +10,7 @@ fn worker_protocol_loads_renders_and_keeps_previous_document_after_failure() {
let path = temp.path().join("sample.pdf");
common::pdf(&path);
let cache = temp.path().join("cache");
let mut child = Command::new(env!("CARGO_BIN_EXE_pdf-presenter"))
let mut child = Command::new(env!("CARGO_BIN_EXE_deckstride"))
.arg("--worker")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
@ -79,9 +79,9 @@ fn protocol_rejects_oversized_and_malformed_messages() {
#[test]
fn supervisor_kills_a_stuck_worker_and_recovers() {
use std::time::{Duration, Instant};
let bridge = pdf_presenter::worker::Bridge::with_program(
let bridge = deckstride::worker::Bridge::with_program(
Duration::from_millis(300),
env!("CARGO_BIN_EXE_pdf-presenter").into(),
env!("CARGO_BIN_EXE_deckstride").into(),
);
let start = Instant::now();
assert!(bridge.submit(7, 1, Request::SleepTest(5000)));
@ -97,7 +97,7 @@ fn supervisor_kills_a_stuck_worker_and_recovers() {
#[test]
fn output_diagnostics_are_distinct_from_explicit_blanking() {
use pdf_presenter::output::Ack;
use deckstride::output::Ack;
let old: Ack =
serde_json::from_str(r#"{"sequence":0,"page":null,"status":"host restarted","awake":""}"#)
.unwrap();

View File

@ -1,10 +1,10 @@
use egui::{Context, Pos2, RawInput, Rect, TextureOptions, Vec2};
use egui_software_backend::{BufferMutRef, ColorFieldOrder, EguiSoftwareRender};
use pdf_presenter::{
use deckstride::{
output::{HostState, coalesce},
settings::Settings,
zoom::{PerformanceWatch, Sync, View},
};
use egui::{Context, Pos2, RawInput, Rect, TextureOptions, Vec2};
use egui_software_backend::{BufferMutRef, ColorFieldOrder, EguiSoftwareRender};
use std::time::{Duration, Instant};
#[test]
fn crop_anchor_pan_and_limits() {
@ -153,7 +153,7 @@ fn zoom_paints_existing_texture_crop_with_constant_geometry_and_no_new_uploads()
..Default::default()
},
|ui| {
pdf_presenter::presenter_ui::paint_slide_zoomed(
deckstride::presenter_ui::paint_slide_zoomed(
ui.painter(),
rect,
texture.id(),
@ -225,7 +225,7 @@ fn buffered_zoom_drawing_measurement() {
..Default::default()
},
|ui| {
pdf_presenter::presenter_ui::paint_slide_adapted(
deckstride::presenter_ui::paint_slide_adapted(
ui.painter(),
rect,
texture.id(),
@ -276,7 +276,7 @@ fn wheel_drag_and_double_click_operate_in_slide_coordinates() {
..Default::default()
},
|ui| {
view = pdf_presenter::presenter_ui::zoom_gestures(ui, target, view).0;
view = deckstride::presenter_ui::zoom_gestures(ui, target, view).0;
},
);
view
@ -358,7 +358,7 @@ fn optimized_crop_matches_general_renderer_with_alpha_clipping_and_dpi() {
},
|ui| {
let painter = ui.painter().with_clip_rect(rect.shrink(20.));
pdf_presenter::presenter_ui::paint_slide_zoomed(
deckstride::presenter_ui::paint_slide_zoomed(
&painter,
rect,
texture.id(),
@ -415,7 +415,7 @@ fn parallel_crop_bands_have_no_seams_at_fractional_boundaries() {
..Default::default()
},
|ui| {
pdf_presenter::presenter_ui::paint_slide_zoomed(
deckstride::presenter_ui::paint_slide_zoomed(
ui.painter(),
rect,
texture.id(),
@ -450,7 +450,7 @@ fn parallel_crop_bands_have_no_seams_at_fractional_boundaries() {
#[test]
fn portrait_zoom_fills_screen_without_stretching_or_out_of_bounds_pixels() {
use pdf_presenter::presenter_ui::zoom_geometry;
use deckstride::presenter_ui::zoom_geometry;
for size in [
Vec2::new(1920., 1080.),
Vec2::new(1080., 1920.),
@ -499,7 +499,7 @@ fn adapted_portrait_pixels_fill_padding_without_uploading_another_texture() {
..Default::default()
},
|ui| {
pdf_presenter::presenter_ui::paint_slide_adapted(
deckstride::presenter_ui::paint_slide_adapted(
ui.painter(),
rect,
texture.id(),
@ -552,14 +552,9 @@ fn portrait_screen_adapting_gestures_pan_visible_area_and_reset() {
..Default::default()
},
|ui| {
view = pdf_presenter::presenter_ui::zoom_gestures_in(
ui,
target,
[210, 297],
view,
false,
)
.0;
view =
deckstride::presenter_ui::zoom_gestures_in(ui, target, [210, 297], view, false)
.0;
},
);
view
@ -604,11 +599,11 @@ fn portrait_screen_adapting_gestures_pan_visible_area_and_reset() {
#[test]
fn double_click_fits_width_near_target_then_resets_without_stretching() {
use pdf_presenter::presenter_ui::{zoom_geometry, zoom_gestures_in};
use deckstride::presenter_ui::{zoom_geometry, zoom_gestures_in};
for (dimensions, expected) in [([210, 297], 2.8285716), ([400, 100], 1.), ([10, 1000], 8.)] {
let ctx = Context::default();
let target = Rect::from_min_size(Pos2::new(40., 40.), Vec2::new(400., 200.));
let page = pdf_presenter::presenter_ui::fitted_slide(target, dimensions);
let page = deckstride::presenter_ui::fitted_slide(target, dimensions);
let click_position = Pos2::new(page.center().x, page.top() + page.height() * 0.95);
let mut view = View::default();
let mut time = 0.;
@ -666,7 +661,7 @@ fn double_click_fits_width_near_target_then_resets_without_stretching() {
#[test]
fn fit_width_uses_output_shape_even_with_a_narrow_presenter_pane() {
use pdf_presenter::presenter_ui::{fitted_slide, zoom_geometry};
use deckstride::presenter_ui::{fitted_slide, zoom_geometry};
let output = Rect::from_min_size(Pos2::ZERO, Vec2::new(1920., 1080.));
let pane = Rect::from_min_size(Pos2::ZERO, Vec2::new(300., 600.));
let preview = fitted_slide(pane, [1920, 1080]);

View File

@ -1,304 +0,0 @@
//! Interface catalog; diagnostic messages from workers remain in their original language.
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Language {
#[default]
System,
En,
Fr,
}
impl Language {
pub const ALL: [Self; 3] = [Self::System, Self::En, Self::Fr];
pub fn name(self) -> &'static str {
match self {
Self::System => "System / Système",
Self::En => "English",
Self::Fr => "Français",
}
}
pub fn french(self) -> bool {
match self {
Self::Fr => true,
Self::En => false,
Self::System => system_french(),
}
}
}
fn system_french() -> bool {
static FRENCH: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*FRENCH.get_or_init(|| {
sys_locale::get_locale().is_some_and(|s| s.to_ascii_lowercase().starts_with("fr"))
})
}
pub fn apply(ctx: &egui::Context, language: &Language) {
ctx.data_mut(|d| d.insert_temp(egui::Id::new("french"), language.french()));
}
pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
if !ctx.data(|d| d.get_temp::<bool>(egui::Id::new("french")).unwrap_or(false)) {
return text;
}
match text {
"Disk cache" => "Cache disque",
"Maximum total size (MiB)" => "Taille totale maximale (Mio)",
"Expire after (days since rendering)" => "Expiration (jours depuis le rendu)",
"Oldest files are removed first. Active decks are protected and may exceed the limit. Automatic cleanup runs once at startup, after loading and preparation finish." => {
"Les fichiers les plus anciens sont supprimés en premier. Les présentations actives sont protégées et peuvent dépasser la limite. Nettoyage automatique une fois au démarrage, après le chargement et la préparation."
}
"Expunge unused cache now" => "Purger le cache inutilisé maintenant",
"Keep fitted page area when zooming" => {
"Conserver la zone ajustée de la page pendant le zoom"
}
"By default, zoom expands the page to fill the screen without stretching. Enable this option to keep the original page-shaped area." => {
"Par défaut, le zoom agrandit la page pour remplir l’écran sans déformation. Activez cette option pour conserver la zone initiale de la page."
}
"Enable page zoom" => "Activer le zoom des diapositives",
"Page zoom" => "Zoom de la diapositive",
"Reset zoom" => "Réinitialiser le zoom",
"Disable zoom" => "Désactiver le zoom",
"Keep zoom enabled" => "Garder le zoom activé",
"Zoom performance" => "Performances du zoom",
"Scroll to zoom · drag to pan · double-click to fit width / reset" => {
"Molette pour zoomer · glisser pour déplacer · double-clic pour ajuster à la largeur / réinitialiser"
}
"Use the current slide preview or a Slides screen. Changing slides resets zoom." => {
"Utilisez l’aperçu actuel ou un écran de présentation. Changer de diapositive réinitialise le zoom."
}
"Zoom reuses buffered images: no extra PDF rendering or image memory. Enlarged slides may look softer. Software drawing can slow down on large or multiple displays." => {
"Le zoom réutilise les images en mémoire, sans rendu PDF ni mémoire d’image supplémentaires. Les diapositives agrandies peuvent être moins nettes. Le dessin logiciel peut ralentir sur des écrans grands ou multiples."
}
"Zoomed frames are taking over 33 ms to draw. Panning may feel slow on this display. Reset or disable zoom to return to normal viewing." => {
"Les images zoomées prennent plus de 33 ms à dessiner. Le déplacement peut sembler lent sur cet écran. Réinitialisez ou désactivez le zoom pour revenir à l’affichage normal."
}
"Cancel" => "Annuler",
"Preview (first 3 slides)" => "Aperçu (3 premières diapositives)",
"Import notes…" => "Importer des notes…",
"Import notes" => "Importer des notes",
"Processing notes…" => "Traitement des notes…",
"Slides to update" => "Diapositives à modifier",
"Sections replace notes starting at slide 1. Remaining slides keep their notes." => {
"Les sections remplacent les notes à partir de la diapositive 1. Les suivantes conservent leurs notes."
}
"Update existing notes file" => "Mettre à jour le fichier de notes existant",
"Create notes file" => "Créer le fichier de notes",
"Empty note" => "Note vide",
"Import and save notes" => "Importer et enregistrer les notes",
"File chooser already open" => "Sélecteur de fichiers déjà ouvert",
"Page background" => "Fond de page",
"Fit padding color" => "Couleur des marges",
"Page background fills transparency; fit padding fills space around the slide." => {
"Le fond de page remplit les zones transparentes ; les marges remplissent l’espace autour de la diapositive."
}
"Appearance" => "Apparence",
"Preferences" => "Préférences",
"Preferences…" => "Préférences…",
"Quick settings" => "Réglages rapides",
"Memory and cache" => "Mémoire et cache",
"Storage and preparation" => "Stockage et préparation",
"Storage locations" => "Emplacements de stockage",
"Preparing slide…" => "Préparation de la diapositive…",
"Slide ready" => "Diapositive prête",
"Cached · loads when nearby" => "En cache · chargée à proximité",
"Queued for preparation" => "En attente de préparation",
"Could not load slide" => "Échec du chargement",
"Loading into memory…" => "Chargement en mémoire…",
"On disk · loads nearby" => "Sur disque · chargée à proximité",
"Not loaded · waiting" => "Non chargée · en attente",
"No slide" => "Aucune diapositive",
"End of slides" => "Fin des diapositives",
"Size" => "Taille",
"Tools" => "Outils",
"Off" => "Désactivé",
"Pointer" => "Pointeur",
"Arrow" => "Flèche",
"Highlighter" => "Surligneur",
"Color" => "Couleur",
"Undo" => "Annuler",
"Clear" => "Effacer",
"Pointer follows the current slide. Drag to place arrows or highlights. Up to 64 vector marks; slide images are never rerendered." => {
"Le pointeur suit la diapositive actuelle. Glissez pour placer des flèches ou des surlignages. Jusqu’à 64 tracés vectoriels ; les images ne sont jamais recalculées."
}
"Keep header visible" => "Garder l’en-tête visible",
"Keep footer visible" => "Garder le pied de page visible",
"Show both" => "Afficher les deux",
"Layout…" => "Disposition…",
"PREVIOUS" => "PRÉCÉDENTE",
"CURRENT" => "ACTUELLE",
"NEXT" => "SUIVANTE",
"PRESENTER NOTES · AUTO-FIT" => "NOTES · TAILLE AUTOMATIQUE",
"No notes for this slide" => "Aucune note pour cette diapositive",
"Header" => "En-tête",
"Above slides" => "Au-dessus des diapositives",
"Below notes" => "Sous les notes",
"Left of notes" => "À gauche des notes",
"Right of notes" => "À droite des notes",
"Left of slides" => "À gauche des diapositives",
"Right of slides" => "À droite des diapositives",
"Elapsed time position" => "Position du temps écoulé",
"Clock position" => "Position de l’horloge",
"Slide progress bar" => "Barre de progression des diapositives",
"Slide" => "Diapositive",
"Auto-hide header" => "Masquer automatiquement l’en-tête",
"Auto-hide footer" => "Masquer automatiquement le pied de page",
"Menu" => "Menu",
"Displays" => "Écrans",
"All slides" => "Toutes les diapositives",
"Layout" => "Disposition",
"Show slides" => "Afficher les diapositives",
"Blank slides" => "Masquer les diapositives",
"Previous" => "Précédente",
"Next" => "Suivante",
"NO OUTPUT DISPLAYED" => "AUCUNE SORTIE AFFICHÉE",
"PRESENTING" => "EN DIFFUSION",
"PREPARING OUTPUT" => "PRÉPARATION DE LA SORTIE",
"Presenter layout" => "Disposition du présentateur",
"Balanced" => "Équilibrée",
"Slide focus" => "Diapositive seule",
"Notes first" => "Priorité aux notes",
"Hidden bars reveal near edges. Right-click to restore." => {
"Approchez des bords pour voir les barres. Clic droit pour les rétablir."
}
"Previous slide" => "Diapositive précédente",
"Current slide" => "Diapositive actuelle",
"Next slide" => "Diapositive suivante",
"Double-click to edit this slide’s notes" => {
"Double-cliquez pour modifier les notes de cette diapositive"
}
"Edit notes" => "Modifier les notes",
"Saving notes…" => "Enregistrement des notes…",
"Loading all notes and preparing sidecar…" => {
"Lecture des notes et préparation du fichier…"
}
"The file contains all slides. Save changes only this slide." => {
"Le fichier contient toutes les diapositives. Seule celle-ci sera modifiée."
}
"Note exceeds 256 KiB" => "La note dépasse 256 Kio",
"Save notes" => "Enregistrer les notes",
"Discard changes and close" => "Abandonner les modifications et fermer",
"Reload (discard edits)" => "Recharger (abandonner les modifications)",
"Retry" => "Réessayer",
"Notes" => "Notes",
"Elapsed time" => "Temps écoulé",
"Time · HH:MM" => "Heure · HH:MM",
"Save layout · This project" => "Enregistrer · Ce projet",
"Save layout · All projects" => "Enregistrer · Tous les projets",
"Use all-projects default" => "Utiliser la disposition globale",
"Project layouts override the default." => {
"La disposition du projet prime sur la disposition globale."
}
"Each screen has one role; repeat a role to mirror it." => {
"Un rôle par écran. Répétez un rôle pour le dupliquer."
}
"Unused" => "Inutilisé",
"Presenter" => "Présentateur",
"Slides" => "Diapositives",
"Single screen" => "Écran unique",
"Use single-screen mode?" => "Utiliser le mode écran unique ?",
"PDF Presenter is intended for a presenter setup with separate Presenter and Slides screens." => {
"PDF Presenter est conçu pour une présentation avec des écrans Présentateur et Diapositives séparés."
}
"Only one screen was connected at startup. Single-screen mode shows slides with controls revealed at the top and bottom edges." => {
"Un seul écran était connecté au démarrage. Le mode écran unique affiche les diapositives avec des commandes apparaissant aux bords supérieur et inférieur."
}
"Keep Presenter view" => "Garder la vue Présentateur",
"Use single-screen mode" => "Utiliser le mode écran unique",
"Window mode" => "Mode de fenêtre",
"Follow global" => "Suivre le réglage global",
"Always fullscreen" => "Toujours en plein écran",
"Always windowed" => "Toujours en fenêtre",
"Always fullscreen/windowed overrides global fullscreen commands for this screen." => {
"Le mode toujours plein écran/fenêtre ignore les commandes globales pour cet écran."
}
"Swap groups" => "Inverser les groupes",
"Window positioning can be unreliable in windowed mode, especially on Linux. Switch back to fullscreen if you experience positioning issues." => {
"Le positionnement des fenêtres peut être peu fiable en mode fenêtré, surtout sous Linux. Revenez au plein écran si vous rencontrez des problèmes de positionnement."
}
"Presenter fullscreen" => "Présentateur en plein écran",
"Slides fullscreen" => "Diapositives en plein écran",
"Apply and remember" => "Appliquer et mémoriser",
"Output visibility is preserved while previewing display changes." => {
"La visibilité de la sortie est conservée pendant l’aperçu des changements."
}
"Open a PDF or picture folder to browse slides." => {
"Ouvrez un PDF ou un dossier d’images pour parcourir les diapositives."
}
"Close" => "Fermer",
"Slide preview" => "Aperçu de la diapositive",
"Preview only — presentation unchanged" => "Aperçu uniquement — présentation inchangée",
"Show on screen" => "Afficher sur l’écran",
"Fit more slides or inspect larger previews." => {
"Afficher plus de diapositives ou agrandir les aperçus."
}
"Choose where this slide browser opens." => "Choisir l’écran où s’ouvre ce navigateur.",
"Compact" => "Compact",
"Large" => "Grand",
"Safe browsing" => "Navigation sans diffusion",
"Live browsing" => "Navigation en direct",
"Click to select. Double-click to preview. Show selected to present." => {
"Cliquer pour sélectionner. Double-cliquer pour prévisualiser. Diffuser la sélection pour présenter."
}
"Changes appear immediately. Save to reuse this layout." => {
"Les modifications sont immédiates. Enregistrez pour réutiliser cette disposition."
}
"Start with a preset" => "Choisir un préréglage",
"Slides and notes" => "Diapositives et notes",
"Hide anything you do not need to give the rest more room." => {
"Masquez les éléments inutiles pour libérer de l’espace."
}
"Relative size" => "Taille relative",
"Space (%)" => "Espace (%)",
"Text size" => "Taille du texte",
"Timers and progress" => "Horloges et progression",
"Header and footer" => "En-tête et pied de page",
"Remember this layout" => "Enregistrer cette disposition",
"Preview size" => "Taille des aperçus",
"Change on click" => "Diffuser au clic",
"Presenter screen" => "Écran du présentateur",
"Show selected" => "Diffuser la sélection",
"Click changes presentation" => "Le clic change la présentation",
"Click only selects — browse safely" => "Le clic sélectionne sans diffuser",
" · CURRENT" => " · ACTUELLE",
"Open PDF…" => "Ouvrir un PDF…",
"Open picture folder…" => "Ouvrir un dossier d’images…",
"Reset timer" => "Réinitialiser le chronomètre",
"Start timer" => "Démarrer le chronomètre",
"Pause timer" => "Mettre en pause",
"Countdown" => "Compte à rebours",
"Duration" => "Durée",
"Start on first action" => "Démarrer à la première action",
"Start begins immediately. Reset waits for the next presentation action." => {
"Démarrer lance immédiatement. Réinitialiser attend la prochaine action de présentation."
}
"Running" => "En cours",
"Stopped" => "Arrêté",
"Waiting for first action" => "En attente de la première action",
"Time is up" => "Temps écoulé",
"Bar height" => "Hauteur de la barre",
"Exit fullscreen" => "Quitter le plein écran",
"Enter fullscreen" => "Passer en plein écran",
"RAM budget per process (presenter + output each use this allowance):" => {
"Budget RAM par processus (présentateur et sortie disposent chacun de ce budget) :"
}
"Raise only within available RAM; OS paging can cause delays. Screen rendering is capped at 4096 px." => {
"Restez dans la RAM disponible : la mémoire virtuelle peut ralentir l’affichage. Rendu limité à 4096 px."
}
"Show slides automatically when opening a document" => {
"Afficher automatiquement les diapositives à l’ouverture d’un document"
}
"Quit" => "Quitter",
"Quit presentation?" => "Quitter la présentation ?",
"Quit presentation" => "Quitter la présentation",
"This closes Presenter and all Slides windows." => {
"Ferme le présentateur et toutes les fenêtres de diapositives."
}
"Wait for notes import to finish before closing." => {
"Attendez la fin de l’importation des notes avant de quitter."
}
"Save or discard notes before closing the presentation." => {
"Enregistrez ou abandonnez les notes avant de quitter la présentation."
}
"Theme" => "Thème",
"Language" => "Langue",
_ => text,
}
}

View File

@ -2,6 +2,87 @@
## Unreleased
### 0.1.101
- Import bounded, data-only language and theme ZIP packs from Preferences. Packs use
Canvas Pilot-compatible manifests, persist beside settings, load offline at startup
and appear in the existing selectors without restarting.
- Add editable example packs, ready-to-import ZIPs and pack-format documentation.
- Publish the full five-target release with Linux x86_64, Linux ARM64, Windows x86_64,
Apple Silicon macOS and Intel macOS portable and cargo-binstall archives; see the
[release notes](development/release-notes/v0.1.101.md).
### 0.1.100
- Keep the Preferences window size stable while the pointer moves by removing a
self-referential width constraint and reserving the full footer spacing.
### 0.1.99
- Organize Preferences into General, Performance and Storage tabs. Each tab has its
own small-screen scroll position, and every Presenter remembers its selected tab.
### 0.1.98
- Shorten the Presenter menu by removing its duplicate All slides command and moving
theme, language and slide colors into the Preferences window. Keep zoom, fitted
zoom behavior, automatic Slides output and Autoplay available directly.
- Keep the menu vertically scrollable on small screens while leaving Quit visible
without scrolling at ordinary Presenter window sizes.
### 0.1.97
- Publish future release assets to both Gitea and GitHub from one reviewed build,
using a separate named token for each service.
### 0.1.96
- Rename the application, crate, executable, repository links, desktop identity,
CI publication paths and future packages to Deckstride. Existing releases remain
unchanged; valid settings migrate to the new location and warm rendered-slide
caches remain available after the rename.
- Retain the established application icon for the Deckstride release.
- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests and 13 Python
helper tests pass. Windows and macOS runtime acceptance remains native testing.
### 0.1.95
- Add an Autoplay menu with persistent Play automatically, per-slide timing and
loop controls. Timing starts only once the requested slide is visible; transient
dialogs and safety states pause playback, while manual interaction restarts the
interval.
- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests, build and
13 Python helper tests pass. Full GUI coverage is 83.94% against the 75% floor.
### 0.1.94
- Show the full, selectable path of the running portable executable under
**Preferences → Storage and preparation**, with guidance for finding its folder
when updating or removing the application.
- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests, build and
13 Python helper tests pass. Full GUI coverage is 83.83% against the 75% floor.
### 0.1.93
- Move the open source name out of the Presenter header and into a dedicated bottom
footer row with its full canonical path. Long paths truncate to the available
width and remain available on hover; hiding the footer hides the source details.
### 0.1.92
- Extend the existing Canvas Pilot-inspired appearance menu with Spanish, Japanese,
Simplified Chinese, German and Brazilian Portuguese alongside English and French;
System follows supported native locales and safely falls back to English.
- Embed the OFL-licensed Noto Sans CJK collection for standalone Japanese and Chinese
interface rendering. Catalog lookup is compiled and allocation-free; CJK fonts are
installed only when selected and never read from disk at runtime.
- Stop rebuilding theme visuals and locale/font state on every frame. Both now update
only when their selection changes, keeping slide preparation, navigation and output
rendering paths unchanged.
- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests, optimized build,
13 Python helper tests and the native-window smoke pass. Full GUI coverage is
83.89% against the 75% floor.
### 0.1.91
- Promote releases from preview status and add recurring Linux ARM64, Apple Silicon
@ -838,7 +919,7 @@
### 0.1.0
- Prepared the standalone PDF Presenter repository with a tested navigation/blanking
- Prepared the standalone Deckstride repository with a tested navigation/blanking
core, an explicit bootstrap executable, agent guidance and implementation plan.
- Added Jenkins validation, whole-workspace coverage and isolated three-badge
publication, plus generated application/repository artwork. PDF rendering and

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ dual-screen, startup and responsiveness requirements.
- [Persistent interfaces](../interfaces/README.md)
- [Changelog](../changelog.md)
Run `cargo run --locked -p pdf-presenter` for the native mock-window test.
Run `cargo run --locked -p deckstride` for the native mock-window test.
See the [dual-screen proof guide](dual-screen-poc.md) for controls, limits and the
physical acceptance still required. PDF loading and release bundles remain pending.

View File

@ -1,6 +1,6 @@
# CI and Jenkins setup
Create a Jenkins Multibranch Pipeline for `idle-org/pdf-presenter`, using the root
Create a Jenkins Multibranch Pipeline for `idle-org/deckstride`, using the root
`Jenkinsfile`, SCM credentials and the existing `rust_no_docker` worker. Repository
upload does not create a Jenkins job. Configure branch discovery and a Gitea webhook
in Jenkins/Gitea when connecting the job.
@ -19,7 +19,7 @@ worker and other headless tests still run. The pipeline installs cargo-llvm-cov
and the rustfmt, Clippy and llvm-tools-preview components.
The temporary Jenkins coverage floor is **60%**, selected explicitly by
`PDF_PRESENTER_HEADLESS_CI=1` and `headless-line-floor` in `coverage.toml`. The normal
`DECKSTRIDE_HEADLESS_CI=1` and `headless-line-floor` in `coverage.toml`. The normal
local full-GUI floor remains **75%**. Both measure all production code, including
GUI code; tool/test failures still fail the build and badges report the actual
measurement. Restore full native testing and the 75% Jenkins floor when a display
@ -33,7 +33,7 @@ cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
cargo test --locked --workspace --all-features
cargo build --locked --workspace --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --all-features --no-deps
PDF_PRESENTER_GUI_TESTS=1 uv run --no-project --python ">=3.11" python scripts/ci.py coverage
DECKSTRIDE_GUI_TESTS=1 uv run --no-project --python ">=3.11" python scripts/ci.py coverage
```
Coverage measures the entire Rust workspace with the selected floor. Add all future
@ -42,7 +42,7 @@ Canvas Pilot and have tests for invalid/stale reports and isolated publication.
Cleanup archives exactly `coverage/version.svg`, `coverage/test.svg` and
`coverage/coverage.svg`. Only main builds without CHANGE_ID publish badges under
`/mnt/assets/coverage/idle-org/pdf-presenter/main/`, including honest failed-test
`/mnt/assets/coverage/idle-org/deckstride/main/`, including honest failed-test
or unavailable-coverage status. No shared asset root is synchronized or deleted.
There is no release job or binary upload in this pipeline.
Separate local packaging uses [rust_realease](releases.md).
@ -52,7 +52,7 @@ worker configuration or prove the remote pipeline has run.
The coverage command above needs a usable desktop session. On a headless POSIX host with Xvfb installed,
run `uv run --no-project --python ">=3.11" python scripts/gui_ci.py python scripts/ci.py coverage` instead. To include
native smoke in local workspace tests, set `PDF_PRESENTER_GUI_TESTS=1`. Without it,
native smoke in local workspace tests, set `DECKSTRIDE_GUI_TESTS=1`. Without it,
the ordinary tests remain headless and explicitly skip native-window smoke. CI uses
neither the flag nor the virtual-display wrapper. Xvfb tests cannot
validate actual monitor routing, compositor policy, macOS Spaces or Windows desktop

View File

@ -7,20 +7,20 @@ explicitly activates mock output; the production document model still starts bla
## Run and test
Build with `cargo build --locked --release`, then run `target/release/pdf-presenter`
(or `pdf-presenter.exe` on Windows). The executable contains the mock data and bitmap
Build with `cargo build --locked --release`, then run `target/release/deckstride`
(or `deckstride.exe` on Windows). The executable contains the mock data and bitmap
font. It needs only normal OS desktop libraries; no PDF renderer, font download,
configuration file or sibling repository is required. Each OS/architecture needs
its own build; a Linux executable is not a Windows/macOS executable.
```sh
cargo run --locked -p pdf-presenter
cargo run --locked -p deckstride
# Inspect display numbering without opening the two windows:
cargo run --locked -p pdf-presenter -- --list-monitors
cargo run --locked -p deckstride -- --list-monitors
# Explicit selection (one-based display numbers from the listing):
cargo run --locked -p pdf-presenter -- --presenter 1 --audience 2
cargo run --locked -p deckstride -- --presenter 1 --audience 2
# Keep both windows decorated for troubleshooting:
cargo run --locked -p pdf-presenter -- --windowed
cargo run --locked -p deckstride -- --windowed
```
With one detected display, fullscreen views overlap. Use `--windowed` to open
@ -79,7 +79,7 @@ The bitmap UI is test instrumentation, not the final presenter design. There is
Tests cover monitor assignment/invalid selection, navigation bounds, blanking,
topology invalidation, negative-coordinate geometry, scaled pointer hit testing and
software frames. `PDF_PRESENTER_GUI_TESTS=1 cargo test --locked --workspace` also opens
software frames. `DECKSTRIDE_GUI_TESTS=1 cargo test --locked --workspace` also opens
real native windows, exercises mock controls/fullscreen transitions and checks frames
were presented to both surfaces. `--smoke-test` exposes that short automatic check.
A virtual display proves native rendering/lifecycle only, not physical placement.

View File

@ -2,8 +2,8 @@
"tool": "built-in image_gen",
"use_case": "logo-brand",
"date": "2026-11-19",
"asset": "crates/pdf-presenter/assets/app-icon.png",
"prompt": "Use case: logo-brand\nAsset type: PDF Presenter desktop app icon and repository avatar, part of the beffroi-tools family.\nInput images: three reference icons showing the exact family style: dark charcoal rounded-square tile, softly beveled silver and bright turquoise objects, gentle 3D depth, subtle teal rim highlight. Use these as style references, not edit targets.\nPrimary request: Create a NEW matching family icon for a multiscreen PDF presenter. Inside the dark rounded-square tile, use a silver folded-corner document in front of a turquoise outlined presentation screen, and a simple bright turquoise play triangle on the document. Crisp bold uncluttered geometry, tactile satin metallic silver, very restrained dimensional shading. Distinct from the existing icons yet obviously in the same set.\nComposition: square, centered tile nearly fills frame, generous clear margins around the inner emblem, readable at 32px. Transparent exterior outside the tile, true alpha. No text, no letters, no watermark, no red, no blue, no photorealistic monitors, no elaborate background.",
"asset": "crates/deckstride/assets/app-icon.png",
"prompt": "Use case: logo-brand\nAsset type: Deckstride desktop app icon and repository avatar, part of the beffroi-tools family.\nInput images: three reference icons showing the exact family style: dark charcoal rounded-square tile, softly beveled silver and bright turquoise objects, gentle 3D depth, subtle teal rim highlight. Use these as style references, not edit targets.\nPrimary request: Create a NEW matching family icon for a multiscreen PDF presenter. Inside the dark rounded-square tile, use a silver folded-corner document in front of a turquoise outlined presentation screen, and a simple bright turquoise play triangle on the document. Crisp bold uncluttered geometry, tactile satin metallic silver, very restrained dimensional shading. Distinct from the existing icons yet obviously in the same set.\nComposition: square, centered tile nearly fills frame, generous clear margins around the inner emblem, readable at 32px. Transparent exterior outside the tile, true alpha. No text, no letters, no watermark, no red, no blue, no photorealistic monitors, no elaborate background.",
"references": [
"beffroi-tools/crates/pptx-reporter/assets/app-icon.png",
"beffroi-tools/crates/rundown-converter/assets/app-icon.png",

View File

@ -90,6 +90,28 @@ This includes pipe transfer to the measurement process, not optical display late
One sample under concurrent build load is diagnostic evidence, not a p95/worst-case
benchmark or comparison against Pympress. The source PDF remains untracked and unchanged.
## 0.1.92 themes and interface languages
The existing 20 built-in Canvas Pilot-inspired palettes remain compile-time data.
English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
Portuguese are selectable, with supported native locales resolved once per process.
Translations use static match tables: there is no catalog parsing, runtime file I/O
or translation allocation. Detailed worker and operating-system diagnostics retain
their original wording.
Theme application and locale/font setup now short-circuit when the selected value is
already active. Japanese and Simplified Chinese share one embedded Noto Sans CJK
collection; the appropriate face is installed once when a CJK language is selected
and egui's default embedded fonts are restored when leaving it. This work does not
change the independent output process, prepared-frame navigation, PDF workers or
slide texture path.
Linux workspace/native tests, formatting, warnings-denied Clippy/rustdoc, optimized
build and 13 Python helper tests pass. Whole-application GUI coverage is 83.89%
against the 75% floor. CJK tests exercise both selected font faces and every theme/
language combination renders the Presenter, browser and popups. This does not replace
native Japanese/Chinese visual review or physical multi-display acceptance.
## Remaining acceptance and hardening
- User physical Windows/macOS/Linux X11/Wayland matrix: routing, swap, mixed DPI,
@ -228,7 +250,7 @@ memory remains additional. The source SHA-256 was unchanged after the test.
Reproduce explicitly with an authorized local deck (never a CI/private fixture upload):
```sh
PDF_PRESENTER_STRESS_PDF=/path/to/Ravenous.pdf cargo test --locked --release \
DECKSTRIDE_STRESS_PDF=/path/to/Ravenous.pdf cargo test --locked --release \
--test preparation real_pdf_exceeds_budget_and_keeps_navigating -- --ignored --nocapture
```
@ -315,7 +337,7 @@ only Linux development checks were run for this subject.
The software renderer is bundled with a narrow cropped-quad optimization; see
[`vendor/egui_software_backend/PDF-PRESENTER-PATCH.md`](../../vendor/egui_software_backend/PDF-PRESENTER-PATCH.md)
[`vendor/egui_software_backend/DECKSTRIDE-PATCH.md`](../../vendor/egui_software_backend/DECKSTRIDE-PATCH.md)
for provenance and the precise changes. Fixed-point bilinear scanlines reuse two
filtered rows and bounded coordinate tables. Large crops use four disjoint bands
on a lazily initialized pool capped at four CPU threads per native process. This

View File

@ -0,0 +1,52 @@
# Deckstride 0.1.101
This release adds installable language and theme packs while keeping Deckstride's
fast, portable presentation workflow intact. Packs are ordinary data-only ZIP files:
they work offline, are validated before installation, and appear in Preferences as
soon as they are imported.
## Highlights since 0.1.96
- Import language packs and theme packs from **Preferences → General → Appearance**.
Installed choices persist globally and load without network access.
- Use the included documented example packs as templates for a new translation or
visual theme. Pack sizes, paths, identifiers, revisions and expanded contents are
bounded and validated before Deckstride accepts them.
- Reorganize Preferences into clearer General, Presentation, Performance and Storage
sections, while keeping the presentation controls that need quick access in the
main menu.
- Keep the Preferences window stable instead of resizing as the pointer moves.
Deckstride continues to provide independent Presenter and Slides windows, flexible
multi-monitor routing and mirroring, per-screen layouts, buffered PDF rendering,
notes, zoom, pointer and drawing tools, automatic playback, and display recovery.
## Downloads
Portable packages and cargo-binstall archives are provided for:
- Linux x86_64 GNU
- Linux ARM64 musl
- Windows x86_64 GNU
- Apple Silicon macOS 13+
- Intel macOS 13+
Windows and macOS packages are unsigned. On macOS, extract the archive and run:
```sh
xattr -dr com.apple.quarantine /path/to/deckstride
chmod +x /path/to/deckstride
```
Rehearse Deckstride on the actual presentation computer, adapters and display
arrangement before a live event.
## Validation
Linux formatting, warnings-denied Clippy and rustdoc, the Rust workspace tests,
native GUI smoke and Python helper tests pass. The coverage runner completed its
tests but could not satisfy the configured whole-application floor because LLVM
profiles from intentionally terminated worker processes are incomplete. All five
release targets are built and packaged from the tagged commit. Windows multi-screen
behavior has been extensively tested in earlier releases; native runtime testing of
each newly built archive remains appropriate before use in a live show.

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.17 preview
# Deckstride 0.1.17 preview
Portable PDF and image-folder presenter with fullscreen presenter/presentation
views, monitor routing/mirroring, notes, slide browser, themes and English/French.

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.24 preview
# Deckstride 0.1.24 preview
Portable PDF and image-folder presenter for Linux and Windows x86_64, with separate
fullscreen presenter/presentation views, monitor routing/mirroring, notes, slide

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.33 preview
# Deckstride 0.1.33 preview
Portable PDF and image-folder presenter for Linux and Windows x86_64. This preview
includes the changes since 0.1.24:

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.68 preview
# Deckstride 0.1.68 preview
This preview adds live presentation tools while preserving the buffered rendering
path. Open **Tools** in the presenter header for a low-latency pointer, straight

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.71 preview
# Deckstride 0.1.71 preview
This preview adds disk-cache controls in **Menu → Preferences → Disk cache**.
Set a maximum total size (default **10 GiB**) and lifetime (default **30 days since

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.75 preview
# Deckstride 0.1.75 preview
This preview includes the monitor and navigation fixes since 0.1.71:
@ -19,7 +19,7 @@ remain included.
## Windows testing
Use the Windows x86_64 standalone executable or extract the portable ZIP and run
**pdf-presenter.exe**. No Rust toolchain or separately installed PDF backend is
**deckstride.exe**. No Rust toolchain or separately installed PDF backend is
required. The executable is unsigned.
Please exercise three displays with two presenters and one audience output:

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.77 preview
# Deckstride 0.1.77 preview
This preview adds two features since 0.1.75:
@ -18,7 +18,7 @@ navigation fixes from 0.1.75 remain included.
## Windows testing
Download the Windows x86_64 standalone executable, or extract the portable ZIP
and run **pdf-presenter.exe**. No Rust toolchain or separately installed PDF
and run **deckstride.exe**. No Rust toolchain or separately installed PDF
backend is required. The executable is unsigned.
With two presenters and an audience display, customize the presenters differently,

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.78 preview
# Deckstride 0.1.78 preview
This preview focuses on Windows presentation responsiveness and desktop integration:
@ -11,21 +11,21 @@ This preview focuses on Windows presentation responsiveness and desktop integrat
so opening it does not create a terminal window. Audience windows are created
without activation and the presenter explicitly requests focus when first shown.
- **PDF file icon and association.** Use **Menu → Preferences → Windows integration
→ Choose as PDF app…**. PDF Presenter registers its executable, open command and
→ Choose as PDF app…**. Deckstride registers its executable, open command and
embedded icon for the current user, refreshes Explorer and opens Default Apps.
Windows requires you to confirm the default PDF application there. Keep the
portable folder in a permanent location and repeat this action after moving it.
## Windows testing
Extract the Windows x86_64 portable ZIP and run **pdf-presenter.exe**. Confirm that
Extract the Windows x86_64 portable ZIP and run **deckstride.exe**. Confirm that
no terminal appears and that the presenter accepts keyboard input immediately while
the audience window remains on the selected output. On a high-resolution audience
display, compare pointer, arrow and highlighter tracking with 0.1.77, including zoom
and mirrored audience outputs.
Register PDF Presenter in Preferences, select it for `.pdf` in Default Apps, then
check that Explorer shows the PDF Presenter icon and double-clicking a PDF opens it.
Register Deckstride in Preferences, select it for `.pdf` in Default Apps, then
check that Explorer shows the Deckstride icon and double-clicking a PDF opens it.
The executable is unsigned, and the association is per user without administrator
rights.

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.81 preview
# Deckstride 0.1.81 preview
This preview makes multi-Presenter layouts clearer and improves Windows desktop
integration.
@ -20,13 +20,13 @@ integration.
## Windows testing
Extract the Windows x86_64 portable ZIP and run **pdf-presenter.exe**. Confirm that
Extract the Windows x86_64 portable ZIP and run **deckstride.exe**. Confirm that
the Presenter accepts Left/Right immediately after launch, including with two or
more fullscreen displays. Repeat from Explorer, a PDF file association and a pinned
shortcut. Open All slides during startup and confirm that it retains focus.
In Preferences, choose **Set as default PDF app…**, select PDF Presenter for `.pdf`
in Windows Default Apps, then verify that Explorer uses the PDF Presenter icon and
In Preferences, choose **Set as default PDF app…**, select Deckstride for `.pdf`
in Windows Default Apps, then verify that Explorer uses the Deckstride icon and
double-clicking a PDF opens it. Registration is per user and requires no
administrator rights. Keep the portable folder in a permanent location.

View File

@ -1,4 +1,4 @@
# PDF Presenter 0.1.83 preview
# Deckstride 0.1.83 preview
This preview improves settings organization and makes presentation tools easier to
judge across Presenter previews and high-resolution Slides screens.

View File

@ -1,10 +1,10 @@
# PDF Presenter 0.1.90 preview
# Deckstride 0.1.90 preview
This preview adds display controls and an optional single-screen presentation view.
- **Single-screen view.** Select Single screen in Displays for full-window slides
with controls revealed at the top and bottom edges. The app offers this mode
only when it starts with exactly one screen, explaining that PDF Presenter is
only when it starts with exactly one screen, explaining that Deckstride is
intended for separate Presenter and Slides screens. Later disconnects never
trigger the offer. Saved Presenter layouts and the independent audience host
remain separate; controls overlay the slide without resizing it.

View File

@ -1,6 +1,6 @@
# PDF Presenter 0.1.91
# Deckstride 0.1.91
PDF Presenter releases are now regular releases rather than previews. The version
Deckstride releases are now regular releases rather than previews. The version
remains below 1.0 while the project continues to refine platform integration and
physical-display acceptance.

View File

@ -0,0 +1,44 @@
# Deckstride 0.1.96
This is the first release under the **Deckstride** name. The application, executable,
portable archives, desktop integration and repository now use the new identity. The
established application icon remains unchanged.
## What changed since 0.1.91
- Add automatic playback with a configurable slide interval and optional looping.
Playback waits until the requested slide is visible and pauses for dialogs and
safety states.
- Add built-in Spanish, Japanese, Simplified Chinese, German and Brazilian Portuguese
alongside English and French, with offline system-language detection.
- Show the open PDF or picture-folder path in the Presenter footer and show the
running portable executable path in Preferences.
- Preserve existing user settings during the Deckstride rename and continue using
an existing warm rendered-slide cache instead of forcing every presentation to
render again.
The existing multiscreen routing, mirrored Presenter or Slides outputs, per-screen
layouts, buffered rendering, notes, zoom, pointer tools and display recovery remain
the core of the release.
## Downloads
Portable packages and cargo-binstall archives are provided for:
- Linux x86_64 GNU
- Linux ARM64 musl
- Windows x86_64 GNU
- Apple Silicon macOS 13+
- Intel macOS 13+
Windows and macOS packages are unsigned. The macOS packages are cross-built on Linux
and include the release-page command for opening an unsigned application. Rehearse on
the actual presentation computer, adapters and display arrangement before a live
event.
## Validation
Linux formatting, warnings-denied Clippy and rustdoc, the complete Rust workspace
test suite, and all 13 Python CI/launcher tests pass. Windows multi-screen behavior
has been extensively tested in earlier releases; native runtime testing of these new
archives remains appropriate before use in a live show.

View File

@ -10,7 +10,7 @@ Build local artifacts without a token or contacting Gitea:
```sh
CROSS_CONTAINER_ENGINE=podman ../rust_realease/target/release/rust_realease . \
--package pdf-presenter --compile-only
--package deckstride --compile-only
```
Use the installed `rust_realease` command instead if preferred. Cross must have
@ -37,11 +37,16 @@ Publication is a separate explicit action: create the version tag at the reviewe
commit, push that commit/tag, then run:
```sh
rust_realease . --package pdf-presenter \
rust_realease . --package deckstride \
--message-file docs/development/release-notes/vVERSION.md \
--token-file ../gitea-token.txt
--token-file ../release-tokens.json
```
`release-tokens.json` is an untracked JSON object with `gitea` and `github`
keys. The matching tokens need repository read and release write access. As an
alternative, set `GITEA_TOKEN` and `GITHUB_TOKEN` in the release environment.
The publisher uploads and verifies the same artifacts on both services.
`--dry-run` previews without remote mutation. Before tagging, its missing-tag
prerequisite is expected. Do not use automatic tag/push options as part of local
preparation. Never put credentials in configuration, artifacts or Git.
@ -49,7 +54,7 @@ preparation. Never put credentials in configuration, artifacts or Git.
## Local validation for 0.1.33
Built Linux x86_64 GNU and Windows x86_64 GNU from commit `6bba0c4` with
`CROSS_CONTAINER_ENGINE=podman rust_realease . --package pdf-presenter --compile-only`.
`CROSS_CONTAINER_ENGINE=podman rust_realease . --package deckstride --compile-only`.
Artifacts are in `dist/release-oTFW9Q/`. The installed tool is 0.1.6-rc.2: it builds
raw binaries and binstall archives but does not implement the configured portable
bundles. Those two bundles were assembled from the same binaries using exactly the

View File

@ -2,6 +2,9 @@ version = 1
# Optional slide-first view on an operator-owned route (0.1.89+).
single_screens = ["Primary#1"]
auto_show = true
autoplay_enabled = false
autoplay_seconds = 5.0
autoplay_loop = false
blank_picture = false
zoom_enabled = false
zoom_keep_fitted_area = false

View File

@ -1,7 +1,7 @@
# HTML concept layout storage — version 1
Applies only to `docs/design/presenter-menu.html`, not the native application.
The page uses browser localStorage key `pdf-presenter.menu-layouts.v1`. Storage is
The page uses browser localStorage key `deckstride.menu-layouts.v1`. Storage is
scoped by the browser to the page origin; file-URL handling is browser-dependent.
It is not the native global configuration or a file saved alongside a PDF.

View File

@ -1,9 +1,12 @@
# Native settings, version 1
`settings.toml` is stored in `$XDG_CONFIG_HOME/pdf-presenter` (otherwise
`~/.config/pdf-presenter`) on Linux. `directories::ProjectDirs` with qualifier `com`,
organization `Beffroi`, application `PdfPresenter` supplies other platforms' standard
per-user config/cache directories. The UI reports the actual configuration path.
`settings.toml` is stored in `$XDG_CONFIG_HOME/deckstride` (otherwise
`~/.config/deckstride`) on Linux. `directories::ProjectDirs` with qualifier `com`,
organization `Beffroi`, application `Deckstride` supplies other platforms' standard
per-user config/cache directories. On first start after the rename, Deckstride
copies valid settings from the former application directory when the new file does
not exist. It keeps using an existing warm slide cache until the new cache has been
populated, avoiding a forced rerender. The UI reports the actual configuration path.
There is no separate project file or source-side settings write.
The top-level `version = 1` is mandatory semantically (omitted defaults to 1).
@ -33,15 +36,33 @@ flushed temporary file. Unknown fields are ignored and not preserved on round tr
document open; false starts/opens blanked. Manual navigation preserves blanking.
Since 0.1.51, display topology/fullscreen changes and host recovery preserve
the current output visibility; only explicit blank controls change it.
- `autoplay_enabled`: boolean, default false; `autoplay_seconds`: finite floating
seconds from 0.25 through 3600, default 5; and `autoplay_loop`: boolean, default
false (0.1.95). The interval begins only after the requested slide is visible on
Slides, so rendering delays do not consume a slide's display time. With no Slides
route, a ready Presenter/single-screen frame counts as visible. Manual navigation,
zoom and blank/unblank restart the interval. Blanking, loading, display trials,
startup recovery, file dialogs, notes editing/import and quit confirmation pause
autoplay and resume with a fresh interval. At the final slide autoplay stops unless
loop is enabled; a one-slide deck never repeatedly navigates. The enabled state,
timing and loop preference are global and saved immediately. Runtime deadlines and
final-slide state are transient. Older v1 files use the defaults; older binaries
ignore and discard these additive fields on resave.
- `theme`: built-in palette enum in snake_case, default `midra` (0.1.14). Values:
`midra`, `high_contrast`, `foxified_dark`, `corporate_light`, `bluecore`,
`dupont_monsanto`, `eden_green`, `foxified_light`, `hci`, `iron_docks`, `peaceframe`,
`rebel`, `sirius_mind`, `solarized`, `sons_of_banard`, `storm_pilot`,
`tessier_ashpol`, `ustf`, `verdant_rebel`, `weicat_industrial`.
- `language`: `system` (default), `en` or `fr` (0.1.14). Native OS locale selects
French for `fr*`, English otherwise. Unknown theme/language values are rejected.
- `language`: `system` (default), `en`, `fr`, `es`, `ja`, `zh_cn`, `de` or `pt_br`.
Spanish, Japanese, Simplified Chinese, German and Brazilian Portuguese were added
in 0.1.92. Native OS locale selects a supported language by language/script and
region; Traditional Chinese and unsupported Portuguese regions fall back to
English rather than silently selecting a different written standard.
Unknown theme/language values are rejected.
Missing new fields in older v1 files use these defaults; no migration is required.
Theme, language and automatic-output changes persist asynchronously, globally.
Catalog lookup is compiled, allocation-free and never reads files on the input or
render path. Theme and font state is rebuilt only when the selection changes.
- `layout`: `previous`, `current`, `next`, `notes`, `elapsed`, `clock`, each with
boolean `show` and finite floating `size`; plus boolean `header`/`footer`.
Previous/next sizes are relative weights 30–160, current 60–200; notes size

29
docs/packs/README.md Normal file
View File

@ -0,0 +1,29 @@
# Deckstride language and theme packs
Install either example from **Preferences → General → Appearance**. Packs remain
ZIP files and are copied into Deckstride's configuration directory; they contain
data only and are never extracted or executed.
## Language pack
`deckstride-language-pack.zip` uses the same version-2 manifest shape as Canvas
Pilot: `manifest.json` and one root `<locale>.json` per language. Catalog keys are
Deckstride's exact visible English source strings, and missing keys fall back to
English. A pack may contain 1–16 languages. Pack/locale IDs use lowercase ASCII
letters, digits and hyphens. Increase the positive `revision` to publish an update.
Limits: 2 MiB ZIP, 4 MiB expanded data, 32 installed packs, 4,096 messages per
catalog, and no paths, directories, symlinks or unexpected files.
## Theme pack
`deckstride-theme-pack.zip` is a Canvas Pilot format-1 theme pack containing one
root `manifest.json`. It can contain 1–16 complete themes. Colors are opaque
`#RRGGBB` values using the shared Canvas Pilot roles. `light` selects egui's light
or dark base behavior. Keep license and attribution text in `notices`.
Limits: 2 MiB ZIP, 4 MiB manifest, 32 installed packs, and no executable content.
Higher revisions replace an installed pack with the same ID. Equal or older
revisions are rejected, preventing accidental downgrades. Invalid packs are skipped
at startup and reported in the Presenter status line.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
{
"Preferences": "Agordoj",
"General": "Ĝenerala",
"Performance": "Rendimento",
"Storage": "Konservejo",
"Theme": "Etoso",
"Language": "Lingvo",
"Close": "Fermi",
"Menu": "Menuo",
"Presenter": "Prezentanto",
"Slides": "Lumbildoj",
"Previous": "Antaŭa",
"Next": "Sekva",
"Show slides": "Montri lumbildojn",
"Blank slides": "Kaŝi lumbildojn"
}

View File

@ -0,0 +1,12 @@
{
"version": 2,
"id": "example-language",
"revision": 1,
"languages": [
{
"locale": "eo-example",
"name": "Example Esperanto",
"native_name": "Ekzempla Esperanto"
}
]
}

View File

@ -0,0 +1,29 @@
{
"version": 1,
"id": "example-theme",
"revision": 1,
"themes": [
{
"id": "night",
"name": "Example Night",
"light": false,
"colors": {
"canvas": "#15202b",
"banner": "#203040",
"grid": "#3e5870",
"layer": "#26394a",
"pattern": ["#24384a", "#182634"],
"bg": "#101820",
"panel": "#192733",
"field": "#0d151c",
"line": "#42627d",
"text": "#eef7ff",
"muted": "#aec7d9",
"cyan": "#65d9ef",
"amber": "#f0c674",
"purple": "#554b9a"
}
}
],
"notices": "Original example palette for Deckstride. CC0-1.0; attribution is not required."
}

View File

@ -1,11 +1,11 @@
PDF Presenter — preview release
Deckstride — portable release
Windows: extract the ZIP and run pdf-presenter.exe. Its icon is embedded.
Linux: extract the tarball and run ./pdf-presenter. Optional menu/taskbar
Windows: extract the ZIP and run deckstride.exe. Its icon is embedded.
Linux: extract the tarball and run ./deckstride. Optional menu/taskbar
integration: keep the extracted folder in a permanent location, then run
python3 install-linux-launcher.py. No root privileges are needed. Python is
only needed for this optional installer, never for running PDF Presenter.
To remove integration delete ~/.local/share/applications/pdf-presenter.desktop
only needed for this optional installer, never for running Deckstride.
To remove integration delete ~/.local/share/applications/deckstride.desktop
(or the corresponding file under your XDG_DATA_HOME).
Wayland shells use that desktop entry to resolve the application icon.
@ -15,5 +15,5 @@ Linux uses the system desktop services and X11/Wayland libraries.
Run --licenses for bundled dependency notices. Open PDFs or picture folders
from Menu. Both Presenter and Slides windows start fullscreen.
Physical display, sleep prevention and clean-machine acceptance remain open.
This is a preview for testing, not a claim of production readiness.
Rehearse on the actual presentation computer, adapters and display arrangement
before a live event.

View File

@ -1,11 +1,11 @@
# Using PDF Presenter
# Using Deckstride
## Install and update
Download the latest version from the [releases page](https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter/releases).
Download the latest version from the [releases page](https://proxy.dandaedre.com/gitea/idle-org/deckstride/releases).
Choose the portable ZIP for Windows x86_64 or the portable `.tgz` matching Linux
x86_64, Linux ARM64, Apple Silicon macOS or Intel macOS. Extract the whole archive,
then run `pdf-presenter.exe` or `./pdf-presenter` as directed on the release page.
then run `deckstride.exe` or `./deckstride` as directed on the release page.
No Rust toolchain, Python or separate PDF renderer is needed to run the application.
Linux uses the system desktop services and X11/Wayland libraries. Windows binaries
are unsigned; macOS packages are unsigned and require the release-page workaround.
@ -17,16 +17,19 @@ folder in a permanent location and run `python3 install-linux-launcher.py` there
Python is only needed for this optional installer; no administrator privileges
are required.
On Windows, use **Menu → Preferences… → Set as default PDF app…** to register the
On Windows, use **Menu → Preferences… → General → Set as default PDF app…** to register the
portable executable for the current user. Windows opens
Default Apps for the required confirmation. Once PDF Presenter is selected for
`.pdf`, Explorer uses the icon embedded in `pdf-presenter.exe` for PDF files. Keep
Default Apps for the required confirmation. Once Deckstride is selected for
`.pdf`, Explorer uses the icon embedded in `deckstride.exe` for PDF files. Keep
the extracted folder in a permanent location; repeat the action after moving it.
To update, close PDF Presenter, download and extract the new portable release,
To update, close Deckstride, download and extract the new portable release,
and run its executable. Settings and saved layouts live in your user configuration
directory, outside the extracted folder. If you installed the Linux launcher, rerun
its installer from the new location so it points to the updated binary.
**Menu → Preferences… → Storage** shows the full path of the
currently running executable, so you can find its portable folder when updating or
removing the application.
Physical display routing, sleep prevention and clean-machine compatibility still
need broader acceptance testing. Rehearse on the displays you plan to use before a
@ -44,10 +47,15 @@ do not queue additional dialogs.
A single connected monitor starts presenter-only rehearsal; `--windowed` disables
fullscreen for the session. `--list-monitors` lists CLI display numbers.
Use **Menu → Autoplay** to enable automatic slide changes, choose the time each
visible slide remains on screen, and optionally loop from the final slide back to
the first. Slow preparation never shortens a slide's display time. Manual navigation,
zooming or blanking restarts the interval; dialogs and display confirmation pause it.
## Screens and presentation safety
When the application starts with exactly one connected screen, it offers
**Single-screen mode** and explains that PDF Presenter is intended for a presenter
**Single-screen mode** and explains that Deckstride is intended for a presenter
setup with separate Presenter and Slides screens. Choose **Keep Presenter view**
to continue with the usual controls, or **Use single-screen mode**, then **Keep
changes** to save it. This prompt is only offered at startup; disconnecting screens
@ -214,14 +222,15 @@ fit; separate copies for every smaller resolution would waste RAM. The current
renderer limit is 4096 pixels per side, shown in the Preferences window. Resolution changes start a
new preparation pass with a new buffer identity.
Processed frames are kept in the application's persistent cache; **Menu → Preferences… → Storage and preparation** shows its
Processed frames are kept in the application's persistent cache; **Menu → Preferences… → Storage** shows its
location. Reopening with unchanged source contents, resolution and renderer reuses
those frames without PDF rasterization or image decoding. It still verifies source
identity/checksums and reads frames into RAM: a restart cannot literally take zero
time. A warm full-size cached frame appears directly, without an unnecessary preview
render. Sources and their folders remain unchanged.
The footer shows the active operation, slides prepared/total, cache reuse, decoded
The footer shows the open PDF or picture-folder name and full source path, along
with the active operation, slides prepared/total, cache reuse, decoded
RAM usage, and an approximate ETA once there are enough completed slides. It also
shows output-process buffering separately. A compact progress notification remains
visible during initial preparation if the footer is hidden. Routine rolling-buffer
@ -234,7 +243,7 @@ Navigation then performs no application slide-file reads, PDF rendering or image
decoding. Raster composition still happens, and the OS can page memory under pressure.
The entire deck stays resident when it fits the configured RAM budget.
**Menu → Preferences… → Memory and cache** controls the decoded-slide allowance for **each process**, default
**Menu → Preferences… → Performance** controls the decoded-slide allowance for **each process**, default
15% of available RAM, with a soft 512 MiB minimum that yields when it would
exceed 20% of available RAM. The adjustable range is 64–16384 MiB. Saved budgets
are preserved; the automatic default is chosen when no budget has been saved. Presenter and output can each consume
@ -291,13 +300,26 @@ The numbered screen rectangles in **Displays** reflect each monitor’s pixel as
ratio, so portrait, standard and ultrawide displays are easier to distinguish.
They represent proportions, not physical screen size.
Menu → Appearance → Theme offers the same 20 built-in palettes as Canvas Pilot, including light,
dark and High Contrast. Menu → Appearance → Language offers System, English and Français. System
uses the native OS locale and falls back to English for other languages. Choices are
saved globally and apply to all presenter/browser windows; slides are never recolored.
The controls and preparation progress are translated; detailed worker/OS diagnostics
remain verbatim. Additional Canvas Pilot languages and external theme/language packs
are not included in this version.
**Preferences → General → Appearance** offers the same 20 built-in palettes as
Canvas Pilot, including light, dark and High Contrast. Its Language selector offers
System, English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
Portuguese. System uses the native OS locale when it matches one of these choices and
otherwise falls back to English. Traditional Chinese is not silently treated as
Simplified Chinese. Choices are saved globally and apply to all presenter/browser
windows; slides are never recolored.
Choose **Import language pack…** or **Import theme pack…** in the same section to
install a bounded ZIP. Installed languages and themes join the selectors immediately
and load offline on later starts. Higher revisions update a pack; equal or older
revisions are rejected. The ZIP is copied beside settings and is never extracted or
executed. The [pack guide](packs/README.md) includes editable sources and
ready-to-import examples.
Built-in translations need no runtime file reads; imported catalogs are read once at
startup and retained in memory. Japanese and Chinese use the bundled Noto Sans CJK
font, loaded only when one of those built-in languages is active. Theme styles and
language fonts are rebuilt only when their selection changes. Detailed worker and
operating-system diagnostics remain verbatim.
All slides opens a windowed browser above fullscreen windows and requests focus.
Opening it again restores/focuses the existing browser. Its Close button dismisses it; Escape requests application quit confirmation.
@ -360,7 +382,7 @@ If your Niri rules still tile it, you can add this optional rule to your own con
```kdl
window-rule {
match app-id="^pdf-presenter$" title="^PDF Presenter — All slides$"
match app-id="^deckstride$" title="^Deckstride — All slides$"
open-floating true
}
```
@ -384,7 +406,7 @@ its embedded notes. For an image folder, the named file sits beside the folder a
uses image filenames as keys. See the [notes format](interfaces/presentation-notes.md).
**Double-click the notes pane** to edit that slide. If the named notes file does not
exist, PDF Presenter creates it with all notes found across the presentation before
exist, Deckstride creates it with all notes found across the presentation before
opening the editable text. Creation and saving happen in the background.
Choose **Save notes** to update this page and its auto-fit presenter text. Other
@ -453,7 +475,7 @@ output. It cannot predict compositor/hardware delays or guarantee a frame rate.
### Disk cache cleanup
In **Menu → Preferences… → Memory and cache**, set the maximum total size in MiB and
In **Menu → Preferences… → Performance**, set the maximum total size in MiB and
lifetime in days since rendering (defaults: 10 GiB and 30 days). Automatic cleanup runs once at startup, after initial document loading and slide
preparation complete, deleting expired files and then the oldest files to meet the
size target. Changing limits takes effect at the next startup; manual expunge remains
@ -463,7 +485,7 @@ background. Active decks are protected and may temporarily exceed either limit.
The cleanup report shows removed and remaining data; deleted slides regenerate
when reopened. Source documents and presenter notes are preserved.
Choose **Menu → Preferences… → Blank Slides image → Choose picture…** to replace the
Choose **Menu → Preferences… → General → Blank Slides image → Choose picture…** to replace the
black blanking screen with your own picture on every Slides screen. The app
saves a copy, fits the whole image against black, and remembers it across restarts.
The original may then be moved or removed. Use **Use solid black** to reset.

View File

@ -1,6 +1,18 @@
[release]
tag-prefix = "v"
[[release.endpoints]]
name = "gitea"
provider = "gitea"
repository = "https://proxy.dandaedre.com/gitea/idle-org/deckstride"
token-env = "GITEA_TOKEN"
[[release.endpoints]]
name = "github"
provider = "github"
repository = "https://github.com/idle-org/Deckstride"
token-env = "GITHUB_TOKEN"
[build]
targets = [
"x86_64-unknown-linux-gnu",
@ -34,15 +46,12 @@ archive-name = "{name}-{bundle}-{target}-v{version}"
root = "{name}-{bundle}-{target}-v{version}"
cargo-binaries = "all"
files = [
{ source = "assets/window-icon.png", destination = "pdf-presenter.png" },
{ source = "assets/window-icon.png", destination = "deckstride.png" },
{ source = "scripts/install-linux-launcher.py", destination = "install-linux-launcher.py", workspace-relative = true },
{ source = "LICENSE", destination = "LICENSE.txt", workspace-relative = true },
{ source = "docs/portable-quickstart.txt", destination = "README.txt", workspace-relative = true },
]
[[repository.fallbacks]]
origin = "https://git.dandaedre.com/idle-org/pdf-presenter"
fallback-url = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter"
[gitea]
token-env = "GITEA_TOKEN"
origin = "https://git.dandaedre.com/idle-org/deckstride"
fallback-url = "https://proxy.dandaedre.com/gitea/idle-org/deckstride"

View File

@ -28,7 +28,7 @@ def config():
def coverage_floor():
key = "headless-line-floor" if os.environ.get("PDF_PRESENTER_HEADLESS_CI") == "1" else "line-floor"
key = "headless-line-floor" if os.environ.get("DECKSTRIDE_HEADLESS_CI") == "1" else "line-floor"
return config()[key]

View File

@ -30,7 +30,7 @@ def run(command):
if not number.isdecimal() or len(number) > 5:
log.seek(0)
raise RuntimeError("Xvfb startup failed: " + log.read(2048).decode(errors="replace"))
env = dict(os.environ, DISPLAY=f":{number}", PDF_PRESENTER_GUI_TESTS="1")
env = dict(os.environ, DISPLAY=f":{number}", DECKSTRIDE_GUI_TESTS="1")
env.pop("WAYLAND_DISPLAY", None)
env.pop("WAYLAND_SOCKET", None)
return subprocess.run(command, env=env, timeout=1800).returncode

View File

@ -12,24 +12,24 @@ def desktop_entry(binary, icon):
command = str(binary).replace("%", "%%")
for char in ("\\", '"', "`", "$"):
command = command.replace(char, "\\" + char)
return ('[Desktop Entry]\nType=Application\nName=PDF Presenter\n'
return ('[Desktop Entry]\nType=Application\nName=Deckstride\n'
'Comment=Multiscreen PDF and picture presenter\n'
f'Exec="{string(command)}" %f\nIcon={string(icon)}\n'
'Terminal=false\nCategories=Office;Presentation;\n'
'MimeType=application/pdf;\nStartupWMClass=pdf-presenter\n')
'MimeType=application/pdf;\nStartupWMClass=deckstride\n')
def main():
if not sys.platform.startswith("linux"):
raise SystemExit("This optional launcher is for Linux only.")
root = Path(__file__).resolve().parent
binary, icon = root / "pdf-presenter", root / "pdf-presenter.png"
binary, icon = root / "deckstride", root / "deckstride.png"
if not binary.is_file() or not icon.is_file():
raise SystemExit("Run this script from the extracted portable Linux bundle.")
data = Path(os.environ.get("XDG_DATA_HOME") or Path.home() / ".local/share")
if not data.is_absolute():
raise SystemExit("XDG_DATA_HOME must be absolute.")
target = data / "applications/pdf-presenter.desktop"
target = data / "applications/deckstride.desktop"
target.parent.mkdir(parents=True, exist_ok=True)
target.write_text(desktop_entry(binary, icon), encoding="utf-8")
print(f"Installed {target}. Keep the portable folder at {root}.")

View File

@ -32,7 +32,15 @@ def main():
f"License expression: {package['license']}\n"
f"Source: {package.get('repository') or 'https://crates.io/crates/' + package['name']}\n"
+ "\n".join(notices))
header = ("PDF Presenter — locked dependency and font notices\n"
font_license = ROOT / "crates/deckstride/assets/fonts/OFL.txt"
font_text = font_license.read_text()
font_digest = hashlib.sha256(font_text.encode()).hexdigest()[:16]
texts[font_digest] = font_text
entries.insert(0, "Noto Sans CJK 2.004\n"
"License expression: OFL-1.1\n"
"Source: https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004\n"
f" assets/fonts/OFL.txt: text {font_digest}")
header = ("Deckstride — locked dependency and font notices\n"
"Generated by scripts/notices.py. Includes target/build-only dependencies;\n"
"the presence of a package here does not mean it is linked on every OS.\n"
"Unmodified source packages are available at https://crates.io.\n"

View File

@ -15,7 +15,7 @@ for name do
[ -f "$src" ] && [ -s "$src" ] && [ ! -L "$src" ] || { echo "Invalid badge source: $src" >&2; exit 2; }
done
dest=$root
for component in idle-org pdf-presenter; do
for component in idle-org deckstride; do
dest="$dest/$component"
[ ! -L "$dest" ] || { echo "Refusing directory symlink: $dest" >&2; exit 2; }
if [ -e "$dest" ]; then

View File

@ -89,15 +89,15 @@ class BadgeTests(unittest.TestCase):
public = self.root / "public"
public.mkdir(exist_ok=True)
self.assertEqual(self.publish(public, "version", "test", "coverage").returncode, 0)
self.assertEqual((public / "idle-org/pdf-presenter/main/coverage.svg").read_bytes(), measured)
self.assertEqual((public / "idle-org/deckstride/main/coverage.svg").read_bytes(), measured)
self.assertFalse(Path("coverage/.coverage-ready-42").exists())
self.assertIn("failing", Path("coverage/test.svg").read_text())
def test_headless_floor_is_explicit_and_still_enforces_threshold_and_tool_errors(self):
for enabled, floor in [("", 75), ("0", 75), ("1", 60)]:
with patch.dict(os.environ, {"PDF_PRESENTER_HEADLESS_CI": enabled}):
with patch.dict(os.environ, {"DECKSTRIDE_HEADLESS_CI": enabled}):
self.assertEqual(ci.coverage_floor(), floor)
with patch.dict(os.environ, {"PDF_PRESENTER_HEADLESS_CI": "1"}):
with patch.dict(os.environ, {"DECKSTRIDE_HEADLESS_CI": "1"}):
for covered, status, expected in [(6521, 0, 0), (6000, 0, 0), (5999, 0, 1), (6521, 7, 7)]:
with self.subTest(covered=covered, status=status), contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(ci.measure(self.report(covered), ci.coverage_floor(), status), expected)
@ -148,7 +148,7 @@ class BadgeTests(unittest.TestCase):
public = self.root / "public"
public.mkdir()
self.assertEqual(self.publish(public, "version", "test", "coverage").returncode, 0)
destination = public / "idle-org/pdf-presenter/main"
destination = public / "idle-org/deckstride/main"
for directory in (public / "idle-org", destination.parent, destination):
self.assertEqual(stat.S_IMODE(directory.stat().st_mode), 0o755)
for path in destination.iterdir():
@ -174,7 +174,7 @@ class BadgeTests(unittest.TestCase):
def test_readme_urls_and_exact_archive_selection(self):
text = (ROOT / "README.md").read_text()
for kind in ("version", "test", "coverage"):
self.assertEqual(text.count(f"https://assets.dandaedre.com/coverage/idle-org/pdf-presenter/main/{kind}.svg"), 1)
self.assertEqual(text.count(f"https://assets.dandaedre.com/coverage/idle-org/deckstride/main/{kind}.svg"), 1)
self.assertIn("artifacts: 'coverage/version.svg,coverage/test.svg,coverage/coverage.svg'",
(ROOT / "Jenkinsfile").read_text())

View File

@ -25,7 +25,7 @@ class GuiCiTests(unittest.TestCase):
server = Path(directory) / "Xvfb"
server.write_text(f"#!{sys.executable}\nimport os,sys,signal\nos.write(int(sys.argv[2]),b'47\\n')\nsignal.pause()\n")
server.chmod(0o700)
command = [sys.executable, "-c", "import os,sys; assert os.environ['DISPLAY']==':47'; assert os.environ['PDF_PRESENTER_GUI_TESTS']=='1'; assert 'WAYLAND_DISPLAY' not in os.environ; sys.exit(7)"]
command = [sys.executable, "-c", "import os,sys; assert os.environ['DISPLAY']==':47'; assert os.environ['DECKSTRIDE_GUI_TESTS']=='1'; assert 'WAYLAND_DISPLAY' not in os.environ; sys.exit(7)"]
with patch.object(gui.shutil, "which", return_value=str(server)):
self.assertEqual(gui.run(command), 7)
# Invalid readiness cannot run the requested command.

View File

@ -14,11 +14,11 @@ spec.loader.exec_module(launcher)
class LauncherTests(unittest.TestCase):
def test_exec_escapes_field_codes_and_shell_characters(self):
entry = launcher.desktop_entry('/tmp/a b%f/$x`y"/pdf-presenter', '/tmp/icon.png')
entry = launcher.desktop_entry('/tmp/a b%f/$x`y"/deckstride', '/tmp/icon.png')
self.assertIn('%%f', entry)
self.assertIn('\\\\$', entry)
self.assertIn('\\\\`', entry)
self.assertIn('StartupWMClass=pdf-presenter', entry)
self.assertIn('StartupWMClass=deckstride', entry)
self.assertIn('" %f\n', entry)
@unittest.skipUnless(sys.platform.startswith("linux"), "Linux launcher integration")
@ -29,17 +29,17 @@ class LauncherTests(unittest.TestCase):
bundle.mkdir()
script = bundle / SCRIPT.name
script.write_bytes(SCRIPT.read_bytes())
(bundle / 'pdf-presenter').touch()
(bundle / 'pdf-presenter.png').touch()
(bundle / 'deckstride').touch()
(bundle / 'deckstride.png').touch()
env = dict(os.environ, XDG_DATA_HOME=str(root / 'data'))
result = subprocess.run(
[sys.executable, str(script)], env=env, capture_output=True, text=True
)
self.assertEqual(result.returncode, 0, result.stderr)
installed = root / 'data/applications/pdf-presenter.desktop'
installed = root / 'data/applications/deckstride.desktop'
self.assertEqual(installed.read_text(), launcher.desktop_entry(
bundle / 'pdf-presenter', bundle / 'pdf-presenter.png'))
(bundle / 'pdf-presenter').unlink()
bundle / 'deckstride', bundle / 'deckstride.png'))
(bundle / 'deckstride').unlink()
result = subprocess.run(
[sys.executable, str(script)], env=env, capture_output=True, text=True
)

Some files were not shown because too many files have changed in this diff Show More