Contract stubs: p4-app

Written by a Codex stage agent; committed by bin/codex-stubs (the sandbox keeps .git read-only).
This commit is contained in:
Dylan M. Taylor committed 2026-11-26 18:46:25 +00:00
1 parent f8023e17c0
commit 6b4b3ed87f
60 files changed
+906 -134

No files matched your search

+2 -1
View File
@@ -171,7 +171,8 @@ impl Host for BrowserHost {
}
if let Some(popup) = state.popup.clone() {
let token = state.token.clone();
let sent = self.images.send(snapshot, &token, state.refresh_images, |delta, current_changed, next_changed| {
// P3(show-w8): ss.A11
let sent = self.images.send_base(snapshot, &token, state.refresh_images, |delta, current_changed, next_changed| {
send(
&popup,
&self.origin,
+22 -3
View File
@@ -85,13 +85,13 @@ pub fn specs() -> Vec<CommandSpec> {
has_doc,
header_footer
),
cmd!(noundo "view.slideMaster", "Slide Master", ["View", "Master Views"], None, "{master?: index, layout?: index}", has_doc, master_view),
cmd!(noundo "view.slideMaster", "Slide Master", ["View", "Master Views"], None, "{master?: index, layout?: index, toggle?: bool}", has_doc, master_view),
cmd!(
"view.handoutMaster",
"Handout Master",
["View", "Master Views"],
None,
"{} (creates the handout master with header, date, footer and page number if the deck has none)",
"{toggle?: bool} (creates the handout master with header, date, footer and page number if the deck has none)",
has_doc,
handout_view
),
@@ -109,7 +109,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Notes Master",
["View", "Master Views"],
None,
"{} (creates the notes master with header, date, slide image, notes body, footer and page number if the deck has none)",
"{toggle?: bool} (creates the notes master with header, date, slide image, notes body, footer and page number if the deck has none)",
has_doc,
notes_view
),
@@ -308,3 +308,22 @@ mod tests;
#[cfg(test)]
mod browse_theme_tests;
/// A master view whose shown state is shared by commands and the ribbon.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MasterView {
/// Any master view.
Slide,
/// The handout master view.
Handout,
/// The notes master view.
Notes,
}
/// Reports whether the requested master view is shown, or false without a document.
pub fn master_view_shown(s: &Session, which: MasterView) -> bool {
let _ = (s, which);
todo!("rb.A24")
}
/// The supported slide dimensions in points.
pub const SLIDE_SIZE_RANGE: std::ops::RangeInclusive<f64> = 72.0..=4032.0;
+18
View File
@@ -856,3 +856,21 @@ mod tests {
let _ = std::fs::remove_dir_all(&dir);
}
}
/// Reads through the common validated transport callbacks and parses the presentation.
/// Maps transport failures to the engine error type.
pub fn read_presentation_file_with<M, R>(path: &str, metadata: M, read: R) -> crate::Result<LoadedFile>
where
M: FnOnce(&str) -> std::result::Result<(bool, u64), String>,
R: FnOnce(&str) -> std::result::Result<Vec<u8>, String>,
{
let _ = (path, metadata, read);
todo!("sh.A27")
}
/// Records the serialized snapshot as the saved state of its originating document.
/// Leaves later edits dirty and never switches or redirects a closed document.
pub fn mark_saved_snapshot(s: &mut Session, uid: u64, snapshot: std::sync::Arc<deckcraft_model::Presentation>, path: Option<String>) -> Result<()> {
let _ = (s, uid, snapshot, path);
todo!("sh.A23")
}
+6
View File
@@ -601,3 +601,9 @@ mod tests {
assert_eq!(s.doc().unwrap().history.undo.len(), n);
}
}
/// The supported paragraph spacing in points.
pub const PARAGRAPH_PT_RANGE: std::ops::RangeInclusive<f64> = 0.0..=1584.0;
/// The supported text column counts.
pub const COLUMN_COUNT_RANGE: std::ops::RangeInclusive<u32> = 1..=16;
+11
View File
@@ -150,3 +150,14 @@ mod tests {
let _ = std::fs::remove_dir_all(&base);
}
}
/// Checks read access and regular-file metadata before reading through the callbacks.
/// Rejects metadata or returned bytes over 2 GiB, retaining the path in errors.
pub fn read_file_with<M, R>(path: &str, metadata: M, read: R) -> Result<Vec<u8>, String>
where
M: FnOnce(&str) -> Result<(bool, u64), String>,
R: FnOnce(&str) -> Result<Vec<u8>, String>,
{
let _ = (path, metadata, read);
todo!("sh.A26")
}
+58
View File
@@ -915,3 +915,61 @@ mod soak_tests;
mod tests;
#[cfg(test)]
mod tests_keys;
/// The kind of atomic replacement in the current edited text body.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TextReplaceKind {
/// Typed input, including typed AutoCorrect.
Typed,
/// Live composition input.
Composing,
/// Committed composition input.
Committed,
/// Pasted text.
Pasted,
/// Deleted surrounding text, preserving live composition.
Deleted,
}
/// The actual flattened inserted range and authoritative selection after replacement.
#[derive(Clone, Debug, PartialEq)]
pub struct TextReplaceResult {
/// The resulting inserted or marked character range.
pub range: std::ops::Range<usize>,
/// The complete authoritative text selection.
pub selection: TextSel,
}
impl Session {
/// Atomically replaces character offsets in the current flattened edited body.
/// Restores text, selection, composition and history on error.
pub fn replace_text_range(&mut self, range: std::ops::Range<usize>, text: &str, kind: TextReplaceKind) -> Result<TextReplaceResult> {
let _ = (range, text, kind);
todo!("cv.A11")
}
}
impl Session {
/// Opens an idempotent text edit boundary for the current document and target.
/// Includes any original composition snapshot without adding an undo entry.
pub fn begin_text_edit_session(&mut self) -> Result<()> {
todo!("cv.A12")
}
}
impl Session {
/// Finishes the current text edit boundary, optionally restoring only its edits.
/// Never crosses a sealed document or target boundary.
pub fn finish_text_edit_session(&mut self, cancel: bool) -> Result<()> {
let _ = cancel;
todo!("cv.A12")
}
}
impl Session {
/// Returns the generation of actual active-document transitions.
/// Same-active and invalid requests leave the generation unchanged.
pub fn active_generation(&self) -> u64 {
todo!("sh.A20")
}
}
+9
View File
@@ -601,3 +601,12 @@ impl Session {
self.active().and_then(|d| d.shape(id)).is_some_and(|s| matches!(s.kind, ShapeKind::Picture { .. } | ShapeKind::Media(_)))
}
}
impl Session {
/// Uses the canonical canvas transform hit for hover and press gestures.
/// Keeps ordinary document hits while suppressing transform re-hits on this route.
pub fn pointer_with_hit(&mut self, ev: crate::tools::PointerEvent, transform_hit: Option<crate::tools::Hit>) -> crate::Result<serde_json::Value> {
let _ = (ev, transform_hit);
todo!("cv.A13")
}
}
+73 -4
View File
@@ -7,9 +7,49 @@ use super::state::{FilePlace, FilePurpose, ImeDescriptorKey, ImeDestination, Ime
#[cfg(not(target_arch = "wasm32"))]
use super::updates_ui;
use super::{
AnimPreview, ControlRequest, FileTarget, HashMap, ImeCancelled, ImeComposition, ImeResetPhase, ImeTerminalPending, InputTarget, Mods,
PendingFile, Perf, Receiver, Session, SlideApp, Target, UI_COMMANDS, UiRequest, Value, backstage, canvas, capture, dialogs, doc_window,
eyedropper, json, media, menus, notes, panes, preview, qat, ribbon, selpane, show, sorter, status, textures, theme, thumbs, toast, uifonts,
AnimPreview,
ControlRequest,
FileTarget,
HashMap,
ImeCancelled,
ImeComposition,
ImeResetPhase,
ImeTerminalPending,
InputTarget,
Mods,
// P3(shell-w11): sh.A8
PendingFileBase,
Perf,
Receiver,
Session,
SlideApp,
Target,
UI_COMMANDS,
UiRequest,
Value,
backstage,
canvas,
capture,
dialogs,
doc_window,
eyedropper,
json,
media,
menus,
notes,
panes,
preview,
qat,
ribbon,
selpane,
show,
sorter,
status,
textures,
theme,
thumbs,
toast,
uifonts,
};
mod clipboard;
@@ -76,6 +116,7 @@ impl SlideApp {
// P3(shell-w11): sh.A8
clock: Default::default(),
// P3(shell-w11): sh.A8
#[cfg(not(target_arch = "wasm32"))]
opening_jobs: Default::default(),
// P3(shell-w11): dl.A1
dialogs: Default::default(),
@@ -181,6 +222,8 @@ impl SlideApp {
twisting: false,
next_file_id: 1,
pending_files: Vec::new(),
// P3(shell-w11): sh.A8
pending_files_base: Vec::new(),
host_start: None,
ime_tracker: egui::ime_context::ImeContextTracker::new(),
ime_pending: None,
@@ -500,8 +543,34 @@ impl crate::SlideApp {
impl SlideApp {
/// Installs the runtime, app icons, fonts and looks, and opens the platform settings store.
/// Keeps the installed host and builds spelling jobs over its shared job service.
pub fn new(ctx: &egui::Context, platform: crate::Platform) -> Result<SlideApp, craft::ui::runtime::InstallError> {
pub fn new(ctx: &egui::Context, platform: crate::Platform) -> Result<SlideApp, AppError> {
let _ = (ctx, platform);
todo!("sh.A2")
}
}
/// A startup failure while installing the runtime or building the command catalogue.
#[derive(Debug)]
#[non_exhaustive]
pub enum AppError {
/// The runtime could not be installed.
Install(craft::ui::runtime::InstallError),
/// The initial command catalogue could not be built.
Catalog(String),
}
impl From<craft::ui::runtime::InstallError> for AppError {
fn from(error: craft::ui::runtime::InstallError) -> Self {
let _ = error;
todo!("sh.A2")
}
}
impl std::fmt::Display for AppError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let _ = f;
todo!("sh.A2")
}
}
impl std::error::Error for AppError {}
pub(crate) use files::FileOperation;
+1 -1
View File
@@ -31,7 +31,7 @@ pub(crate) static DEFAULT_CHORDS: &[DefaultChord] = &[];
/// Builds the app command catalogue and its defaults.
#[allow(dead_code)] // P3(shell-w4): sh.A15
pub(crate) fn build(session: &Session, generation: u64) -> AppCatalog {
pub(crate) fn build(session: &Session, generation: u64) -> Result<AppCatalog, String> {
let _ = (session, generation);
todo!("sh.A15")
}
+2 -2
View File
@@ -297,8 +297,8 @@ impl SlideApp {
impl crate::SlideApp {
/// Runs a fired command, including app save and palette actions.
#[allow(dead_code)] // P3(shell-w4): sh.A16
pub(crate) fn fire(&mut self, fired: &craft::ui::runtime::commands::Fired) {
let _ = fired;
pub(crate) fn fire(&mut self, ctx: &egui::Context, fired: &craft::ui::runtime::commands::Fired) {
let _ = (ctx, fired);
todo!("sh.A16")
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ use crate::control;
impl SlideApp {
/// Drain pending control requests, executing ordinary requests and admitting screenshots for
/// later saving and reply.
pub(super) fn drain_control(&mut self, ctx: &egui::Context) {
pub(crate) fn drain_control(&mut self, ctx: &egui::Context) {
let Some(rx) = self.control_rx.take() else { return };
while let Ok(req) = rx.try_recv() {
// A request whose sender gave up waiting (reply timeout) must not run late (#719).
+51 -7
View File
@@ -1,6 +1,20 @@
use super::{
FilePlace, FilePurpose, FileTarget, InboxEvent, LocatedPlace, PendingFile, RECENT_MAX, SlideApp, Target, UiRequest, Value, ViewMode, dialogs,
json, media,
// P3(shell-w6): sh.A8
FilePlace,
FilePurpose,
FileTarget,
InboxEvent,
LocatedPlace,
PendingFileBase,
RECENT_MAX,
SlideApp,
Target,
UiRequest,
Value,
ViewMode,
dialogs,
json,
media,
};
#[derive(Default)]
@@ -449,7 +463,8 @@ impl SlideApp {
let id = self.begin_external_file(purpose);
// Change Picture: the picture that arrives replaces the selected one (#115).
if cmd == "picture.change"
&& let Some(r) = self.pending_files.iter_mut().find(|r| r.id == id)
// P3(shell-w6): sh.A8
&& let Some(r) = self.pending_files_base.iter_mut().find(|r| r.id == id)
{
r.purpose = FilePurpose::ChangePicture;
}
@@ -630,7 +645,8 @@ impl SlideApp {
};
for event in events {
match event {
InboxEvent::Cancelled { id } => self.pending_files.retain(|r| r.id != id),
// P3(shell-w6): sh.A8
InboxEvent::Cancelled { id } => self.pending_files_base.retain(|r| r.id != id),
InboxEvent::File(file) => self.apply_external_file(file.id, &file.name, &file.bytes),
}
}
@@ -643,7 +659,9 @@ impl SlideApp {
pub fn begin_external_file(&mut self, purpose: &str) -> u64 {
let id = self.next_file_id;
self.next_file_id = self.next_file_id.wrapping_add(1).max(1);
self.pending_files.push(PendingFile { id, purpose: purpose_of(purpose), target: self.capture_file_target() });
// P3(shell-w6): sh.A8
// P3(shell-w6): sh.A8
self.pending_files_base.push(PendingFileBase { id, purpose: purpose_of(purpose), target: self.capture_file_target() });
id
}
@@ -701,8 +719,10 @@ impl SlideApp {
}
fn apply_external_file(&mut self, id: u64, name: &str, bytes: &[u8]) {
let Some(pos) = self.pending_files.iter().position(|r| r.id == id) else { return };
let req = self.pending_files.remove(pos);
// P3(shell-w6): sh.A8
let Some(pos) = self.pending_files_base.iter().position(|r| r.id == id) else { return };
// P3(shell-w6): sh.A8
let req = self.pending_files_base.remove(pos);
let cmd = match command_for(req.purpose, name, bytes) {
Ok(cmd) => cmd,
Err(e) => {
@@ -915,3 +935,27 @@ impl crate::SlideApp {
todo!("dl.A8")
}
}
/// The operation and captured intent completed by a file pick.
#[allow(dead_code)] // P3(shell-w6): sh.A23
pub(crate) struct FileOperation;
impl SlideApp {
/// Saves or exports with close intent for the originating Backstage instance.
/// Deferred success closes only that still-open instance for the captured document.
#[allow(dead_code)] // P3(shell-w6): sh.A23
pub(crate) fn backstage_save_as(&mut self, format: &str, instance: std::sync::Arc<()>) -> SaveOutcome {
let _ = (format, instance);
todo!("sh.A23")
}
}
impl SlideApp {
/// Saves or exports with close intent for the originating Backstage instance.
/// Deferred success closes only that still-open instance for the captured document.
#[allow(dead_code)] // P3(shell-w6): sh.A23
pub(crate) fn backstage_export_as(&mut self, format: &str, extra: Value, instance: std::sync::Arc<()>) -> SaveOutcome {
let _ = (format, extra, instance);
todo!("sh.A23")
}
}
+21 -6
View File
@@ -4,7 +4,8 @@ impl SlideApp {
/// What a queued synthetic event is meant for. The control protocol hands out window
/// coordinates, so a document, slide, view, zoom or canvas-layout change between queueing and
/// the next UI pass makes the event stale.
pub(crate) fn input_target(&self) -> InputTarget {
// P3(shell-w5): sh.A21
pub(crate) fn input_target_base(&self) -> InputTarget {
let bits = |v: f32| if v.is_finite() { v.to_bits() } else { 0 };
InputTarget {
documents: self.session.documents().len(),
@@ -28,7 +29,8 @@ impl SlideApp {
/// Queue one synthetic control-channel event. The target is recorded when the batch starts,
/// before any host command in the same logic pass can change the document.
pub fn queue_input(&mut self, event: egui::Event) {
let target = self.input_target();
// P3(shell-w5): sh.A21
let target = self.input_target_base();
// A batch that was already injected keeps the target it was injected for until its UI
// pass consumes it or retracts it. New events queued meanwhile belong to the current
// target, so they wait in a separate batch instead of joining the old one and being
@@ -139,7 +141,8 @@ impl SlideApp {
if !self.synthetic_pending {
return;
}
let current = self.input_target();
// P3(shell-w5): sh.A21
let current = self.input_target_base();
let focus = ctx.memory(|m| m.focused());
if self.synthetic_target == Some(current) && focus == self.synthetic_focus {
return;
@@ -213,7 +216,8 @@ impl SlideApp {
}
let focus = ctx.memory(|m| m.focused());
if self.synthetic_pending {
let current = self.input_target();
// P3(shell-w5): sh.A21
let current = self.input_target_base();
if self.synthetic_target != Some(current) || focus != self.synthetic_focus {
// eframe keeps the whole RawInput from a logic-only pass in `pending_raw_input`
// and appends the next host input to it. The events are already in `raw.events`;
@@ -234,7 +238,8 @@ impl SlideApp {
if self.synthetic_pending || self.synthetic.is_empty() {
return;
}
let current = self.input_target();
// P3(shell-w5): sh.A21
let current = self.input_target_base();
if self.synthetic_target != Some(current) {
// The batch was queued for a document/slide/canvas that has since changed.
self.synthetic.clear();
@@ -273,7 +278,8 @@ impl SlideApp {
impl crate::SlideApp {
/// Records injected input for the current target.
#[allow(dead_code)] // P3(shell-w5): sh.A21
pub(crate) fn note_injected(&mut self) {
pub(crate) fn note_injected(&mut self, ctx: &egui::Context) {
let _ = ctx;
todo!("sh.A21")
}
}
@@ -286,3 +292,12 @@ impl crate::SlideApp {
todo!("sh.A21")
}
}
impl SlideApp {
/// Reads the current injected-input target from the current framework context.
#[allow(dead_code)] // P3(shell-w5): sh.A21
pub(crate) fn input_target(&self, ctx: &egui::Context) -> InputTarget {
let _ = ctx;
todo!("sh.A21")
}
}
+12 -2
View File
@@ -38,7 +38,7 @@ const BACK_H: f32 = 46.0;
const CONTENT_W: f32 = 1180.0;
/// A page of the File tab.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Page {
Home,
New,
@@ -110,7 +110,7 @@ impl Page {
}
/// A side-menu entry: a page, or an action that runs at once.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Nav {
Page(Page),
Save,
@@ -166,11 +166,17 @@ pub enum ExportTask {
/// The File tab's state while it is open.
#[derive(Clone, Debug)]
pub struct Backstage {
/// Identity of this File view, preserved across page changes.
#[allow(dead_code)] // P3(shell-w7): sh.A24
pub(crate) instance: std::sync::Arc<()>,
pub page: Page,
/// The open presentations (count, active) when it opened: a change closes it.
pub docs: (usize, Option<u64>),
/// Keyboard focus in the side menu (an index into [`entries`], top then bottom).
pub focus: Option<usize>,
/// Requests focus on the shown entry for the next File view pass.
#[allow(dead_code)] // P3(shell-w7): sh.A24
pub(crate) focus_shown: bool,
/// Search text on Home, New and Open.
pub query: String,
/// Info: property drafts while a field is being edited.
@@ -199,9 +205,13 @@ impl Backstage {
/// can be detected.
pub fn new(page: Page, docs: (usize, Option<u64>)) -> Backstage {
Backstage {
// P3(shell-w7): sh.A24
instance: Default::default(),
page,
docs,
focus: None,
// P3(shell-w7): sh.A24
focus_shown: Default::default(),
query: String::new(),
props: vec![String::new(); PROPERTIES.len()],
print_scope: PrintScope::All,
+2 -2
View File
@@ -1,6 +1,6 @@
/// Paints animation preview overlays.
#[allow(dead_code)] // P3(canvas-w9): cv.A3
pub(crate) fn paint(draw: &craft::ui::primitives::Draw<'_>, view: &craft::behavior::CanvasView, app: &crate::SlideApp) {
let _ = (draw, view, app);
pub(crate) fn paint(draw: &craft::ui::primitives::Draw<'_>, cx: &craft::ui::canvas::ToolContext<'_>, app: &crate::SlideApp) {
let _ = (draw, cx, app);
todo!("cv.A3")
}
+2 -1
View File
@@ -366,9 +366,10 @@ impl crate::SlideApp {
#[allow(dead_code)] // P3(dialogs-w4): dl.A4
pub(crate) struct FormSpec {
pub open: fn(&SlideApp, &Context, &Value) -> HostedParamDialog,
pub finish: fn(&mut SlideApp, &ParamResult) -> Result<(), String>,
pub finish: fn(&mut SlideApp, &ParamResult, &mut DialogHost) -> Result<(), String>,
pub held: bool,
pub each_pass: Option<fn(&mut SlideApp, &Context, &mut HostedParamDialog)>,
pub action: Option<fn(&mut SlideApp, &str) -> Result<(), String>>,
}
/// The hosted form registry.
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w12): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w12): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -35,7 +35,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w12): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w12): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w10): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w10): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w14): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w14): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+49 -1
View File
@@ -9,7 +9,55 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w7): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
pub(crate) mod setup_show {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod paste_special {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
+13
View File
@@ -23,6 +23,9 @@ pub(crate) struct Closing {
guard: craft::quit::CloseGuard<u64>,
scope: craft::quit::CloseScope,
asked: bool,
pending_uid: Option<u64>,
completion: Option<(u64, super::super::app::files::SaveOutcome)>,
reason: Option<String>,
}
impl crate::SlideApp {
@@ -41,3 +44,13 @@ impl crate::SlideApp {
todo!("dl.A11")
}
}
impl Closing {
/// Records a terminal save outcome for the closing pump.
/// Pending outcomes do not settle a close.
#[allow(dead_code)] // P3(dialogs-w5): dl.A11
pub(crate) fn settle(&mut self, uid: u64, outcome: crate::app::files::SaveOutcome) {
let _ = (uid, outcome);
todo!("dl.A11")
}
}
+3 -1
View File
@@ -66,7 +66,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w8): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w8): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -94,7 +94,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w10): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w10): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -71,7 +71,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w12): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w12): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -174,7 +174,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w11): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w11): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+7 -1
View File
@@ -48,7 +48,13 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w8): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w8): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
/// The supported grid spacing in points.
#[allow(dead_code)] // P3(dialogs-w7): dl.A15
pub(crate) const GRID_SPACING_RANGE: std::ops::RangeInclusive<f64> = 1.0..=288.0;
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w8): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w8): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+187 -1
View File
@@ -9,7 +9,193 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w7): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
pub(crate) mod table {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod comment {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod outline {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod rename_section {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod rename_shape {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod rename_layout {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod equation {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
pub(crate) mod smartart {
/// Opens this hosted form with the supplied parameters.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn open(
app: &crate::SlideApp,
ctx: &egui::Context,
params: &serde_json::Value,
) -> craft::ui::patterns::form_dialogs::HostedParamDialog {
let _ = (app, ctx, params);
todo!("dl.A9")
}
/// Applies an accepted form result through the pump dialog host.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(
app: &mut crate::SlideApp,
result: &craft::ui::patterns::form_dialogs::ParamResult,
host: &mut craft::ui::dialog::DialogHost,
) -> Result<(), String> {
let _ = (app, result, host);
todo!("dl.A9")
}
}
+3 -1
View File
@@ -38,7 +38,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w10): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w10): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -350,7 +350,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w13): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w13): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+12
View File
@@ -79,3 +79,15 @@ pub(crate) fn write(app: &mut crate::SlideApp, draft: &PrefDraft) {
let _ = (app, draft);
todo!("dl.A14")
}
/// Opens nested AutoCorrect while retaining its Preferences parent.
#[allow(dead_code)] // P3(dialogs-w17): dl.A10
pub(crate) fn open_autocorrect(
app: &mut crate::SlideApp,
ctx: &egui::Context,
host: &mut craft::ui::dialog::DialogHost,
params: &serde_json::Value,
) -> Result<Option<craft::ui::dialog::DialogId>, String> {
let _ = (app, ctx, host, params);
todo!("dl.A10")
}
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w11): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w11): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -9,7 +9,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w14): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w14): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -217,7 +217,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w9): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w9): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -39,7 +39,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w8): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w8): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+10 -1
View File
@@ -9,7 +9,16 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w10): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w10): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
/// Runs an action delivered by the Symbol form.
#[allow(dead_code)] // P3(dialogs-w12): dl.A9
pub(crate) fn action(app: &mut crate::SlideApp, id: &str) -> Result<(), String> {
let _ = (app, id);
todo!("dl.A9")
}
+3 -1
View File
@@ -105,7 +105,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w13): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w13): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -125,7 +125,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w11): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w11): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -107,7 +107,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w8): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w8): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+3 -1
View File
@@ -94,7 +94,9 @@ pub(crate) fn open(app: &crate::SlideApp, ctx: &egui::Context, params: &serde_js
/// Applies an accepted form result.
#[allow(dead_code)] // P3(dialogs-w7): dl.A9
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult) -> Result<(), String> {
pub(crate) fn finish(app: &mut crate::SlideApp, result: &ParamResult, host: &mut craft::ui::dialog::DialogHost) -> Result<(), String> {
// P3(dialogs-w7): dl.A9
let _ = host;
let _ = (app, result);
todo!("dl.A9")
}
+16 -3
View File
@@ -57,7 +57,7 @@ pub mod panels;
mod services;
mod state;
pub use app::key_name;
pub use app::{AppError, key_name};
#[cfg(test)]
use app::{OBJECTS_MARKER, system_clipboard_text, web_image_files};
use canvas::preview;
@@ -90,7 +90,8 @@ enum FileTarget {
},
}
struct PendingFile {
// P3(shell-w11): sh.A8
struct PendingFileBase {
id: u64,
purpose: FilePurpose,
target: FileTarget,
@@ -251,7 +252,8 @@ pub struct SlideApp {
clock: craft::platform::clock::Clock,
/// Opening jobs.
#[allow(dead_code)] // P3(shell-w11): sh.A8
opening_jobs: Option<craft::host::queue::JobQueue<u64, Result<deckcraft_engine::cmd::file::LoadedFile, String>>>,
#[cfg(not(target_arch = "wasm32"))]
opening_jobs: opening::OpeningJobs,
/// Dialogs.
#[allow(dead_code)] // P3(shell-w11): dl.A1
pub(crate) dialogs: dialogs::DialogState,
@@ -425,7 +427,10 @@ pub struct SlideApp {
/// Next cancellation identity for a browser pick or a dropped file.
next_file_id: u64,
/// Picks and drops whose bytes have not arrived yet.
#[allow(dead_code)] // P3(shell-w11): sh.A8
pending_files: Vec<PendingFile>,
// P3(shell-w11): sh.A8
pending_files_base: Vec<PendingFileBase>,
/// The empty presentation host mode starts with ([`SlideApp::start_for_host`]), until the
/// first file the page sends takes its place.
host_start: Option<u64>,
@@ -596,3 +601,11 @@ pub mod thumb_source;
#[cfg(test)]
pub(crate) mod test_harness;
/// A file pick with its captured operation and target.
#[allow(dead_code)] // P3(shell-w11): sh.A8
struct PendingFile {
ticket: craft::host::PickId,
operation: app::FileOperation,
target: FileTarget,
}
+9
View File
@@ -317,3 +317,12 @@ mod tests {
std::fs::remove_file(&path).ok();
}
}
/// The native open queue and its monotonic attempt-key allocator.
#[cfg(not(target_arch = "wasm32"))]
#[allow(dead_code)] // P3(shell-w3): sh.A8
#[derive(Default)]
pub(crate) struct OpeningJobs {
queue: Option<craft::host::queue::JobQueue<u64, Result<LoadedFile, String>>>,
next_key: u64,
}
+50 -12
View File
@@ -41,6 +41,8 @@ impl Preview {
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Snapshot {
/// Document slide aspect used by both shown and pending presenter pictures.
pub aspect: f32,
pub slide: usize,
pub total: usize,
pub ended: bool,
@@ -69,7 +71,8 @@ pub struct DeltaCache {
token: String,
}
impl DeltaCache {
pub fn send<E>(
// P3(show-w8): ss.A11
pub fn send_base<E>(
&mut self,
mut snapshot: Snapshot,
token: &str,
@@ -348,6 +351,8 @@ mod tests {
fn snapshot() -> Snapshot {
Snapshot {
// P3(show-w8): ss.A11
aspect: Default::default(),
slide: 0,
total: 2,
ended: false,
@@ -370,21 +375,24 @@ mod tests {
fn failed_transport_retries_images_and_only_success_deduplicates() {
let mut cache = DeltaCache::default();
let first = snapshot();
let failed = cache.send(first.clone(), "session", false, |delta, current, next| {
// P3(show-w8): ss.A11
let failed = cache.send_base(first.clone(), "session", false, |delta, current, next| {
assert!(current && next);
assert_eq!(delta.current, first.current);
assert_eq!(delta.next, first.next);
Err("serialization or postMessage failed")
});
assert!(failed.is_err());
let sent = cache.send(first.clone(), "session", false, |delta, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(first.clone(), "session", false, |delta, current, next| {
assert!(current && next, "a failed initial send must not suppress either image");
assert_eq!(delta.current, first.current);
assert_eq!(delta.next, first.next);
Ok::<_, ()>(())
});
assert!(sent.is_ok());
let sent = cache.send(first.clone(), "session", false, |delta, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(first.clone(), "session", false, |delta, current, next| {
assert!(!current && !next);
assert!(delta.current.is_none() && delta.next.is_none());
Ok::<_, ()>(())
@@ -392,12 +400,14 @@ mod tests {
assert!(sent.is_ok());
let mut changed = first.clone();
changed.current.as_mut().unwrap().rgba = vec![42; 4];
let failed = cache.send(changed.clone(), "session", false, |_, current, next| {
// P3(show-w8): ss.A11
let failed = cache.send_base(changed.clone(), "session", false, |_, current, next| {
assert!(current && !next);
Err(())
});
assert!(failed.is_err());
let sent = cache.send(changed.clone(), "session", false, |delta, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(changed.clone(), "session", false, |delta, current, next| {
assert!(current && !next, "unchanged retry after a failed changed-image send");
assert_eq!(delta.current, changed.current);
Ok::<_, ()>(())
@@ -409,20 +419,23 @@ mod tests {
fn transport_refreshes_new_sessions_reloads_and_clears_previews() {
let mut cache = DeltaCache::default();
for (token, refresh) in [("first", false), ("second", false), ("second", true)] {
let sent = cache.send(snapshot(), token, refresh, |delta, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(snapshot(), token, refresh, |delta, current, next| {
assert!(current && next);
assert!(delta.current.is_some() && delta.next.is_some());
Ok::<_, ()>(())
});
assert!(sent.is_ok());
}
let failed = cache.send(snapshot(), "second", true, |_, current, next| {
// P3(show-w8): ss.A11
let failed = cache.send_base(snapshot(), "second", true, |_, current, next| {
assert!(current && next);
Err(())
});
// BrowserHost retains refresh_images after failure, even when the token is unchanged.
let refresh_images = failed.is_err();
let sent = cache.send(snapshot(), "second", refresh_images, |_, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(snapshot(), "second", refresh_images, |_, current, next| {
assert!(current && next, "reload refresh must survive a failed send");
Ok::<_, ()>(())
});
@@ -430,18 +443,21 @@ mod tests {
let mut cleared = snapshot();
cleared.current = None;
cleared.next = None;
let failed = cache.send(cleared.clone(), "second", false, |_, current, next| {
// P3(show-w8): ss.A11
let failed = cache.send_base(cleared.clone(), "second", false, |_, current, next| {
assert!(current && next);
Err(())
});
assert!(failed.is_err());
let sent = cache.send(cleared.clone(), "second", false, |delta, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(cleared.clone(), "second", false, |delta, current, next| {
assert!(current && next, "clearing images is retried too");
assert!(delta.current.is_none() && delta.next.is_none());
Ok::<_, ()>(())
});
assert!(sent.is_ok());
let sent = cache.send(cleared, "second", false, |_, current, next| {
// P3(show-w8): ss.A11
let sent = cache.send_base(cleared, "second", false, |_, current, next| {
assert!(!current && !next);
Ok::<_, ()>(())
});
@@ -489,6 +505,8 @@ mod tests {
fn popup_input_is_forwarded_once_without_advancing_its_own_state() {
use egui_kittest::kittest::Queryable;
let snapshot = Snapshot {
// P3(show-w8): ss.A11
aspect: Default::default(),
slide: 0,
total: 3,
ended: false,
@@ -599,3 +617,23 @@ pub fn merge(previous: Option<&Snapshot>, delta: SnapshotDelta) -> Snapshot {
let _ = (previous, delta);
todo!("ss.A11")
}
impl DeltaCache {
/// Sends a delta inside the link envelope without owning transport identity.
/// A failed post leaves the next send requiring a full snapshot.
pub fn send<E>(&mut self, snapshot: Snapshot, refresh: bool, send: impl FnOnce(Snapshot, bool, bool) -> Result<(), E>) -> Result<(), E> {
let _ = (snapshot, refresh, send);
todo!("ss.A11")
}
}
impl SnapshotDelta {
/// Reads the delta envelope with real booleans distinguishing omitted and cleared pictures.
pub fn from_payload(text: &str) -> Option<SnapshotDelta> {
let _ = text;
todo!("ss.A11")
}
/// Writes the presenter delta envelope inside the link payload.
pub fn to_payload(&self) -> String {
todo!("ss.A11")
}
}
+2
View File
@@ -22,6 +22,8 @@ pub enum NextPic<'a> {
/// The audience state displayed by the presenter window.
pub struct PresenterModel<'a> {
/// Document slide aspect, falling back to 16:9 for invalid values.
pub aspect: f32,
/// Slide.
pub slide: usize,
/// Total.
+7
View File
@@ -526,3 +526,10 @@ pub(crate) mod fonts;
pub(crate) mod states;
pub use galleries::preset_outline;
/// Reads the root ribbon scroll authority, including pending jumps.
#[allow(dead_code)] // P3(ribbon-w4): rb.A1
pub(crate) fn scroll_position(ctx: &egui::Context) -> craft::behavior::ScrollPos {
let _ = ctx;
todo!("rb.A1")
}
@@ -30,3 +30,12 @@ pub(crate) fn thumbnails(ctx: &egui::Context) -> Thumbnails<u64> {
let _ = ctx;
todo!("rb.A17")
}
impl DiagramThumbs<'_> {
/// Keys the layout by its style, colours, outline and every drawn node field.
#[allow(dead_code)] // P3(ribbon-w5): rb.A17
pub(crate) fn key(&self, kind: &str, outline: bool) -> u64 {
let _ = (kind, outline);
todo!("rb.A17")
}
}
+11 -4
View File
@@ -401,8 +401,8 @@ fn paint_freeform_icon(p: &egui::Painter, r: Rect, name: &str, ink: Color32) {
/// Shows the line style menu.
#[allow(dead_code)] // P3(ribbon-w5): rb.A16
pub(crate) fn line_menu(app: &mut SlideApp, ui: &mut Ui, cx: &mut craft::ui::contract::BodyCx<'_>) {
let _ = (app, ui, cx);
pub(crate) fn line_menu(app: &mut SlideApp, ui: &mut Ui, cx: &mut craft::ui::contract::BodyCx<'_>, key: &str) {
let _ = (app, ui, cx, key);
todo!("rb.A16")
}
@@ -421,7 +421,14 @@ pub fn preset_outline(r: Rect, name: &str) -> Vec<Vec<egui::Pos2>> {
/// Shows the outline menu; a pick runs its command and closes the menu.
#[allow(dead_code)] // P3(ribbon-w5): rb.A16
pub fn outline_menu(app: &mut SlideApp, ui: &mut Ui, cx: &mut craft::ui::contract::BodyCx<'_>) {
let _ = (app, ui, cx);
pub fn outline_menu(app: &mut SlideApp, ui: &mut Ui, cx: &mut craft::ui::contract::BodyCx<'_>, key: &str) {
let _ = (app, ui, cx, key);
todo!("rb.A16")
}
/// Applies a delayed outline colour answer using the opener key and shared line-pick path.
#[allow(dead_code)] // P3(ribbon-w5): rb.A16
pub(crate) fn apply_line_answer(app: &mut SlideApp, key: &str) {
let _ = (app, key);
todo!("rb.A16")
}
+2 -1
View File
@@ -173,7 +173,8 @@ mod tests {
/// Imports the old ui.json and prefs.json settings once.
#[allow(dead_code)] // P3(shell-w12): sh.A25
pub(crate) fn legacy() -> Vec<craft::settings::LegacyFile<DeckSettings>> {
pub(crate) fn legacy(dir: &std::path::Path) -> Vec<craft::settings::LegacyFile<DeckSettings>> {
let _ = dir;
todo!("sh.A25")
}
+18 -7
View File
@@ -46,9 +46,9 @@ pub struct Show {
#[allow(dead_code)] // P3(show-w4): ss.A4
frames: frames::ShowFrames,
#[allow(dead_code)] // P3(show-w4): ss.A4
next_preview: Option<(std::sync::Arc<Presentation>, usize, std::sync::Arc<egui::ColorImage>)>,
next_preview: Option<(std::sync::Arc<Presentation>, usize)>,
#[allow(dead_code)] // P3(show-w4): ss.A4
presenter_start: PresenterStart,
pub(crate) presenter_start: PresenterStart,
#[allow(dead_code)] // P3(show-w4): ss.A4
remote_images: crate::presenter::DeltaCache,
@@ -679,7 +679,7 @@ pub enum Blank {
impl Show {
/// The current zoom window in slide space.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) fn zoom_window(&self) -> Option<Rect> {
pub(crate) fn zoom_window(&self) -> Option<craft::behavior::kurbo::Rect> {
todo!("ss.A5")
}
}
@@ -687,8 +687,8 @@ impl Show {
impl Show {
/// Zooms the audience at a slide point.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) fn zoom_at(&mut self, at: craft::behavior::kurbo::Point) {
let _ = at;
pub(crate) fn zoom_at(&mut self, at: craft::behavior::kurbo::Point, inputs: &ShowZoomInputs<'_>) {
let _ = (at, inputs);
todo!("ss.A5")
}
}
@@ -696,8 +696,8 @@ impl Show {
impl Show {
/// The next show wake deadline.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) fn next_wake(&self, now: f64) -> Option<f64> {
let _ = now;
pub(crate) fn next_wake(&self, doc: &Presentation, now: f64) -> Option<f64> {
let _ = (doc, now);
todo!("ss.A5")
}
}
@@ -727,3 +727,14 @@ pub(crate) mod commands;
pub(crate) mod frames;
pub(crate) mod grid;
pub(crate) mod tool;
/// The show command scope shared with the browser presenter shell.
pub const SHOW_SCOPE: craft::ui::runtime::commands::CommandScope = <commands::ShowCommands as craft::ui::runtime::commands::CommandSet>::SCOPE;
/// Current canvas inputs used by show zoom operations.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) struct ShowZoomInputs<'a> {
pub size: craft::behavior::kurbo::Size,
pub pixels_per_point: f32,
pub scheme: &'a craft::behavior::ZoomScheme,
}
+2 -2
View File
@@ -1,6 +1,6 @@
/// Shows the audience show bars.
#[allow(dead_code)] // P3(show-w5): ss.A9
pub(crate) fn show(ui: &mut egui::Ui, show: &super::Show, room: egui::Rect) {
let _ = (ui, show, room);
pub(crate) fn show(ui: &mut egui::Ui, show: &super::Show, doc: &deckcraft_model::Presentation, room: egui::Rect) {
let _ = (ui, show, doc, room);
todo!("ss.A9")
}
+2 -1
View File
@@ -82,8 +82,9 @@ pub(crate) fn run_command(
now: f64,
command: ShowCommands,
window: ShowWindow,
zoom: &super::ShowZoomInputs<'_>,
) -> bool {
let _ = (show, doc, now, command, window);
let _ = (show, doc, now, command, window, zoom);
todo!("ss.A2")
}
+52 -8
View File
@@ -17,14 +17,23 @@ pub(crate) struct PreviewFrame {
/// The show frame jobs and cached pictures.
#[allow(dead_code)] // P3(show-w6): ss.A7
#[derive(Default)]
pub(crate) struct ShowFrames {
pub(crate) previews: craft::host::queue::JobQueue<NextPreview, PreviewFrame>,
previews: Option<craft::host::queue::JobQueue<NextPreview, PreviewFrame>>,
}
/// Prepares show frames and preview jobs.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn prepare(show: &mut super::Show, doc: &Arc<Presentation>, media: &crate::media::MediaHost, room_px: egui::Vec2) {
let _ = (show, doc, media, room_px);
pub(crate) fn prepare(
show: &mut super::Show,
doc: &Arc<Presentation>,
media: &crate::media::MediaHost,
ctx: &egui::Context,
now: f64,
gifs: &[crate::media::Gif],
room_px: egui::Vec2,
) -> Option<f64> {
let _ = (show, doc, media, ctx, now, gifs, room_px);
todo!("ss.A7")
}
@@ -44,8 +53,8 @@ pub(crate) fn paint(
impl ShowFrames {
/// Returns a show backdrop.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn backdrop(&mut self, doc: &Arc<Presentation>, key: super::BackKey) -> Arc<deckcraft_render::Image> {
let _ = (doc, key);
pub(crate) fn backdrop(&mut self, ctx: &egui::Context, doc: &Arc<Presentation>, key: super::BackKey) -> Arc<deckcraft_render::Image> {
let _ = (ctx, doc, key);
todo!("ss.A7")
}
}
@@ -53,8 +62,8 @@ impl ShowFrames {
impl ShowFrames {
/// Prefetches a show backdrop.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn prefetch_backdrop(&mut self, doc: &Arc<Presentation>, key: super::BackKey) {
let _ = (doc, key);
pub(crate) fn prefetch_backdrop(&mut self, ctx: &egui::Context, doc: &Arc<Presentation>, key: super::BackKey) {
let _ = (ctx, doc, key);
todo!("ss.A7")
}
}
@@ -83,8 +92,43 @@ impl ShowFrames {
}
}
impl Default for ShowFrames {
impl ShowFrames {
// P3(show-w6): ss.A7
#[allow(dead_code)] // P3(show-w6): ss.A7
fn default_base() -> Self {
todo!("ss.A7")
}
}
/// Queue options for production show frames, backdrops and next previews.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) struct ShowFrameOptions {
pub next: craft::host::queue::QueueOptions,
pub backdrops: craft::host::queue::QueueOptions,
pub previews: craft::host::queue::QueueOptions,
}
impl Default for ShowFrameOptions {
fn default() -> Self {
todo!("ss.A7")
}
}
impl ShowFrames {
/// Initializes production queues once and keeps jobs on repeated calls.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn initialize(&mut self, ctx: &egui::Context, host: &craft::host::Host, options: ShowFrameOptions) {
let _ = (ctx, host, options);
todo!("ss.A7")
}
/// Requests a coalesced next preview, or withdraws it when no slide is wanted.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn request_preview(&mut self, ctx: &egui::Context, doc: Arc<Presentation>, slide: Option<usize>) {
let _ = (ctx, doc, slide);
todo!("ss.A7")
}
/// Runs one bounded inline budget across all show queues.
#[allow(dead_code)] // P3(show-w6): ss.A7
pub(crate) fn run_inline(&mut self, max_jobs: usize) {
let _ = max_jobs;
todo!("ss.A7")
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ pub enum GridSource<'a> {
/// Presentation.
doc: &'a deckcraft_model::Presentation,
/// Thumbnail store.
thumbs: &'a craft::ui::primitives::Thumbnails<u64>,
thumbs: &'a craft::ui::primitives::Thumbnails<crate::thumb_source::ThumbKey>,
/// Presentation thumbnail source.
source: &'a crate::thumb_source::DeckThumbs,
},
+2 -1
View File
@@ -86,7 +86,8 @@ fn navigation_key(
match k {
Escape | Minus => {
let cancelled = k == Escape && show.clear_goto();
if !cancelled && !show.back_out(presenter) {
// P3(show-w4): ss.A5
if !cancelled && !show.back_out_base(presenter) {
*keep = false;
}
}
+14 -7
View File
@@ -872,14 +872,18 @@ fn escape_only_closes_the_grid_of_its_own_window() {
let doc = s.active().unwrap().doc.clone();
let mut show = Show::new(&doc, 0, false, true);
show.presenter_grid = true;
assert!(!show.back_out(false), "audience Esc leaves the show, the Presenter View grid stays");
// P3(show-w10): ss.A5
assert!(!show.back_out_base(false), "audience Esc leaves the show, the Presenter View grid stays");
assert!(show.presenter_grid);
assert!(show.back_out(true));
// P3(show-w10): ss.A5
assert!(show.back_out_base(true));
assert!(!show.presenter_grid);
show.grid = true;
assert!(!show.back_out(true), "Presenter View Esc does not close the audience grid");
// P3(show-w10): ss.A5
assert!(!show.back_out_base(true), "Presenter View Esc does not close the audience grid");
assert!(show.grid);
assert!(show.back_out(false));
// P3(show-w10): ss.A5
assert!(show.back_out_base(false));
assert!(!show.grid);
}
@@ -891,12 +895,15 @@ fn escape_leaves_the_grid_then_the_zoom_and_blank_toggles() {
let mut show = Show::new(&doc, 0, false, true);
show.grid = true;
show.zoom = Some(Zoom::at(0.2, 0.3));
assert!(show.back_out(false));
// P3(show-w10): ss.A5
assert!(show.back_out_base(false));
assert!(!show.grid);
assert!(show.zoom.is_some(), "closing the grid leaves the zoom");
assert!(show.back_out(false));
// P3(show-w10): ss.A5
assert!(show.back_out_base(false));
assert!(show.zoom.is_none());
assert!(!show.back_out(false));
// P3(show-w10): ss.A5
assert!(!show.back_out_base(false));
show.zoom_key();
assert!(show.zoom_arm);
show.zoom_key();
+4 -1
View File
@@ -178,6 +178,8 @@ pub(crate) fn ui(app: &mut SlideApp, ui: &mut Ui, bcx: &mut craft::ui::contract:
}
}
host.update(crate::presenter::Snapshot {
// P3(show-w5): ss.A11
aspect: Default::default(),
slide: show.state.slide,
total: doc.slides.len(),
ended: show.ended,
@@ -285,7 +287,8 @@ fn handle_clicks(app: &mut SlideApp, ui: &mut Ui, show: &mut Show, f: &Fr, out:
show.zoom_arm = false;
}
} else if clicked && show.zoom.is_some() && !show.pen && !show.reading_bar_hit(ctx) {
show.dismiss_zoom();
// P3(show-w5): ss.A5
show.dismiss_zoom_base();
} else if clicked && !show.pen && !show.reading_bar_hit(ctx) && !pointer_on_media_bar(ctx, ui, doc, show, now) {
if show.ended {
out.keep = false;
+23 -4
View File
@@ -29,7 +29,8 @@ impl Show {
/// Z, or the Zoom button: arm a click-to-zoom, or leave a zoom that is already on.
pub(super) fn zoom_key(&mut self) {
if self.zoom.is_some() || self.zoom_arm {
self.dismiss_zoom();
// P3(show-w4): ss.A5
self.dismiss_zoom_base();
} else {
self.zoom_arm = true;
self.pen = false;
@@ -61,7 +62,8 @@ impl Show {
}
/// Esc closes the See All Slides of the window it was pressed in, then a zoom, and only then leaves the show.
pub(super) fn back_out(&mut self, presenter: bool) -> bool {
// P3(show-w4): ss.A5
pub(super) fn back_out_base(&mut self, presenter: bool) -> bool {
if presenter && self.presenter_grid {
self.presenter_grid = false;
true
@@ -69,12 +71,14 @@ impl Show {
self.grid = false;
true
} else {
self.dismiss_zoom()
// P3(show-w4): ss.A5
self.dismiss_zoom_base()
}
}
/// Esc backs out of a zoom before it leaves the show. True when it did.
pub(super) fn dismiss_zoom(&mut self) -> bool {
// P3(show-w4): ss.A5
pub(super) fn dismiss_zoom_base(&mut self) -> bool {
if self.zoom.is_some() || self.zoom_arm {
self.zoom = None;
self.zoom_arm = false;
@@ -403,3 +407,18 @@ pub(super) fn paint_grid(painter: &egui::Painter, ctx: &egui::Context, show: &mu
);
}
}
impl Show {
/// Dismisses the zoom with the current pass inputs.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) fn dismiss_zoom(&mut self, inputs: &super::ShowZoomInputs<'_>) {
let _ = inputs;
todo!("ss.A5")
}
/// Closes the target window grid, then dismisses zoom before leaving the show.
#[allow(dead_code)] // P3(show-w4): ss.A5
pub(crate) fn back_out(&mut self, presenter: bool, inputs: &super::ShowZoomInputs<'_>) -> bool {
let _ = (presenter, inputs);
todo!("ss.A5")
}
}
+40 -20
View File
@@ -2134,58 +2134,78 @@ fn synthetic_click_is_consumed_on_its_old_target_before_logic_changes_the_docume
fn input_target_tracks_slideshow_opening_and_palette_selection() {
// P3(shell-w10): sh.A2
let mut app = SlideApp::new_base(Session::with_new(), Services::default());
let base = app.input_target();
// P3(shell-w10): sh.A21
let base = app.input_target_base();
app.start_show(0, true);
assert_ne!(app.input_target(), base, "a slideshow is a different input target");
let started = app.input_target();
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), base, "a slideshow is a different input target");
// P3(shell-w10): sh.A21
let started = app.input_target_base();
app.show.as_mut().unwrap().state.step += 1;
let stepped = app.input_target();
// P3(shell-w10): sh.A21
let stepped = app.input_target_base();
assert_ne!(stepped, started, "the show step changes which click areas are live");
let reading_now = app.show.as_ref().unwrap().reading;
app.show.as_mut().unwrap().reading = !reading_now;
let reading = app.input_target();
// P3(shell-w10): sh.A21
let reading = app.input_target_base();
assert_ne!(reading, stepped, "the reading layout moves the slide");
app.show.as_mut().unwrap().grid = true;
let grid = app.input_target();
// P3(shell-w10): sh.A21
let grid = app.input_target_base();
assert_ne!(grid, reading, "See All Slides turns a click into a thumbnail choice");
app.show.as_mut().unwrap().ended = true;
let ended = app.input_target();
// P3(shell-w10): sh.A21
let ended = app.input_target_base();
assert_ne!(ended, grid, "the end screen has different click targets");
app.show = None;
assert_eq!(app.input_target(), base, "leaving the show returns to the editor target");
// P3(shell-w10): sh.A21
assert_eq!(app.input_target_base(), base, "leaving the show returns to the editor target");
// Starting the show again is a new instance even at the same slide, so an old batch cannot
// match by value after an ABA transition.
app.start_show(0, true);
let first_instance = app.input_target();
// P3(shell-w10): sh.A21
let first_instance = app.input_target_base();
app.start_show(0, true);
assert_ne!(app.input_target(), first_instance, "a new show instance is a new target");
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), first_instance, "a new show instance is a new target");
app.show = None;
app.opening = Some(crate::opening::Opening::for_test("/tmp/quarterly.pptx"));
assert_ne!(app.input_target(), base, "the background-open window is a different target");
let opening = app.input_target();
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), base, "the background-open window is a different target");
// P3(shell-w10): sh.A21
let opening = app.input_target_base();
app.opening.as_mut().unwrap().generation = 2;
assert_ne!(app.input_target(), opening, "reopening the same path is a new attempt");
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), opening, "reopening the same path is a new attempt");
app.opening = None;
app.palette = Some(("open".into(), 0));
let first = app.input_target();
// P3(shell-w10): sh.A21
let first = app.input_target_base();
app.palette = Some(("open".into(), 1));
assert_ne!(app.input_target(), first, "the palette's highlighted entry is part of the target");
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), first, "the palette's highlighted entry is part of the target");
app.palette = None;
app.ui.tab = "Insert".into();
assert_ne!(app.input_target(), base, "another ribbon tab is another click target");
let insert = app.input_target();
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), base, "another ribbon tab is another click target");
// P3(shell-w10): sh.A21
let insert = app.input_target_base();
app.ui.ribbon_collapsed = true;
assert_ne!(app.input_target(), insert, "collapsing the ribbon changes the layout under a click");
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), insert, "collapsing the ribbon changes the layout under a click");
app.ui.ribbon_collapsed = false;
app.ribbon_scroll.insert("Insert".into(), 64.0_f32.to_bits());
assert_ne!(app.input_target(), insert, "scrolling the ribbon moves the buttons under a click");
// P3(shell-w10): sh.A21
assert_ne!(app.input_target_base(), insert, "scrolling the ribbon moves the buttons under a click");
app.ui.tab = "Home".into();
app.ribbon_scroll.remove("Insert");
assert_eq!(app.input_target(), base);
// P3(shell-w10): sh.A21
assert_eq!(app.input_target_base(), base);
}
/// A click queued for the editor is retracted when a slideshow, background-open window or
+16 -9
View File
@@ -7,10 +7,17 @@ use std::sync::Arc;
/// A slide or master layout thumbnail key.
#[allow(dead_code)] // P3(panels-w4): pn.A1
#[derive(Clone, Copy)]
pub(crate) enum ThumbKey {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum ThumbKey {
/// A presentation slide.
Slide(SlideId),
Layout { master: usize, layout: Option<usize> },
/// A master or one of its layouts.
Layout {
/// The master index.
master: usize,
/// The layout index, or the master itself.
layout: Option<usize>,
},
}
impl ThumbKey {
@@ -40,12 +47,12 @@ impl DeckThumbs {
}
}
impl ThumbSource<u64> for DeckThumbs {
fn revision(&self, key: &u64, request: &ThumbRequest) -> Revision {
impl ThumbSource<ThumbKey> for DeckThumbs {
fn revision(&self, key: &ThumbKey, request: &ThumbRequest) -> Revision {
let _ = (key, request);
todo!("pn.A1")
}
fn render(&self, key: &u64, request: &ThumbRequest) -> ThumbRender {
fn render(&self, key: &ThumbKey, request: &ThumbRequest) -> ThumbRender {
let _ = (key, request);
todo!("pn.A1")
}
@@ -53,21 +60,21 @@ impl ThumbSource<u64> for DeckThumbs {
/// Returns the shared deck thumbnail store.
#[allow(dead_code)] // P3(panels-w4): pn.A1
pub(crate) fn thumbnails(ctx: &egui::Context) -> Thumbnails<u64> {
pub(crate) fn thumbnails(ctx: &egui::Context) -> Thumbnails<ThumbKey> {
let _ = ctx;
todo!("pn.A1")
}
/// Shows a deck thumbnail picture.
#[allow(dead_code)] // P3(panels-w4): pn.A1
pub(crate) fn picture<'a>(label: impl Into<Label>, key: ThumbKey, thumbs: &'a Thumbnails<u64>, source: &'a DeckThumbs) -> Picture<'a> {
pub(crate) fn picture<'a>(label: impl Into<Label>, key: ThumbKey, thumbs: &'a Thumbnails<ThumbKey>, source: &'a DeckThumbs) -> Picture<'a> {
let _ = (label, key, thumbs, source);
todo!("pn.A1")
}
/// Paints a deck thumbnail in a content picture.
#[allow(dead_code)] // P3(panels-w4): pn.A1
pub(crate) fn paint(cx: &ContentPainterCx<'_>, rect: Rect, key: ThumbKey, thumbs: &Thumbnails<u64>, source: &DeckThumbs) {
pub(crate) fn paint(cx: &ContentPainterCx<'_>, rect: Rect, key: ThumbKey, thumbs: &Thumbnails<ThumbKey>, source: &DeckThumbs) {
let _ = (cx, rect, key, thumbs, source);
todo!("pn.A1")
}