Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

refactor(ui-egui): move install_ime_reset_callbacks to ime_reset and EXPORT_SAVE_DIALOGS to native_dialogs

aiongg8fd96e1f2479
diff --git a/crates/ui-egui/src/ime_reset.rs b/crates/ui-egui/src/ime_reset.rs
index ec1e2336d..16cb02380 100644
--- a/crates/ui-egui/src/ime_reset.rs
+++ b/crates/ui-egui/src/ime_reset.rs
@@ -5,6 +5,7 @@
use std::sync::Arc;
+use super::*;
use egui::{Context, IMEPurpose, Id, ImeResetId, ImeTarget, ViewportId, ViewportIdMap};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
@@ -286,6 +287,11 @@ pub(crate) fn install(ctx: &Context) {
ctx.data_mut(|data| data.insert_temp(installed, true));
}
+/// Install once in each native/web/harness Context creator, before the first UI pass.
+pub fn install_ime_reset_callbacks(ctx: &egui::Context) {
+ ime_reset::install(ctx);
+}
+
#[cfg(test)]
mod tests {
use super::*;
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index c2315abab..7527cbd61 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -95,6 +95,9 @@ pub use gpu::{gpu_compositor_unsupported, software_rasterizer};
pub use hooks::{AudioDevices, AudioOut, ClipboardMedia, HostHooks, RelinkHint, SystemThemeFn};
pub(crate) use raw_input::rewrite_native_window_input;
+pub use ime_reset::install_ime_reset_callbacks;
+pub(crate) use native_dialogs::EXPORT_SAVE_DIALOGS;
+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dialog {
About,
@@ -153,18 +156,6 @@ pub struct Playback {
pub rest_at: Option<Tick>,
}
-/// Export entries that run from the menus through the save panel: command, filter label,
-/// extension.
-pub(crate) const EXPORT_SAVE_DIALOGS: [(&str, &str, &str); 7] = [
- ("markers.exportCsv", "Marker report (CSV)", "csv"),
- ("file.exportEdl", "EDL", "edl"),
- ("file.exportFcp7Xml", "Final Cut Pro XML", "xml"),
- ("file.exportFcpxml", "FCPXML", "fcpxml"),
- ("file.exportOtio", "OpenTimelineIO", "otio"),
- ("file.exportAle", "Avid Log Exchange", "ale"),
- ("file.exportSelectionProject", "FilmCraft Project", "fcproj"),
-];
-
/// Incoming composition identity for the Program monitor. Interrupted compositions remain
/// Stale until the matching opaque native reset fence; output or old terminal input is not
/// acknowledgement. The retired origin and current destination live in the UI reset adapter.
@@ -374,8 +365,3 @@ pub struct GpuState {
/// Largest texture side the device accepts.
pub max_texture: u32,
}
-
-/// Install once in each native/web/harness Context creator, before the first UI pass.
-pub fn install_ime_reset_callbacks(ctx: &egui::Context) {
- ime_reset::install(ctx);
-}
diff --git a/crates/ui-egui/src/native_dialogs.rs b/crates/ui-egui/src/native_dialogs.rs
index e1445155a..68e9a610f 100644
--- a/crates/ui-egui/src/native_dialogs.rs
+++ b/crates/ui-egui/src/native_dialogs.rs
@@ -179,3 +179,15 @@ impl FilmcraftApp {
ctx.request_repaint();
}
}
+
+/// Export entries that run from the menus through the save panel: command, filter label,
+/// extension.
+pub(crate) const EXPORT_SAVE_DIALOGS: [(&str, &str, &str); 7] = [
+ ("markers.exportCsv", "Marker report (CSV)", "csv"),
+ ("file.exportEdl", "EDL", "edl"),
+ ("file.exportFcp7Xml", "Final Cut Pro XML", "xml"),
+ ("file.exportFcpxml", "FCPXML", "fcpxml"),
+ ("file.exportOtio", "OpenTimelineIO", "otio"),
+ ("file.exportAle", "Avid Log Exchange", "ale"),
+ ("file.exportSelectionProject", "FilmCraft Project", "fcproj"),
+];