mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 12:08:11 +08:00
Rename editor_api.rs -> editor_wrapper.rs (#3926)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Overview of `/frontend/wasm/`
|
||||
|
||||
## Wasm wrapper API: `src/editor_api.rs`
|
||||
## Wasm wrapper API: `src/editor_wrapper.rs`
|
||||
|
||||
Provides bindings for JS to call functions defined in this file, and for `FrontendMessage`s to be sent from Rust back to JS in the form of a callback to the subscription router. This Wasm wrapper crate, since it's written in Rust, is able to call into the Editor crate's codebase and send `FrontendMessage`s back to JS.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#[cfg(not(feature = "native"))]
|
||||
use crate::EDITOR;
|
||||
use crate::editor_api::EditorWrapper;
|
||||
use crate::editor_wrapper::EditorWrapper;
|
||||
use crate::{EDITOR_HAS_CRASHED, EDITOR_WRAPPER};
|
||||
#[cfg(not(feature = "native"))]
|
||||
use editor::application::Editor;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
pub mod editor_api;
|
||||
pub mod editor_wrapper;
|
||||
pub mod helpers;
|
||||
pub mod native_communication;
|
||||
|
||||
@@ -25,7 +25,7 @@ thread_local! {
|
||||
#[cfg(not(feature = "native"))]
|
||||
pub static EDITOR: Mutex<Option<editor::application::Editor>> = const { Mutex::new(None) };
|
||||
pub static MESSAGE_BUFFER: std::cell::RefCell<Vec<Message>> = const { std::cell::RefCell::new(Vec::new()) };
|
||||
pub static EDITOR_WRAPPER: Mutex<Option<editor_api::EditorWrapper>> = const { Mutex::new(None) };
|
||||
pub static EDITOR_WRAPPER: Mutex<Option<editor_wrapper::EditorWrapper>> = const { Mutex::new(None) };
|
||||
pub static PANIC_DIALOG_MESSAGE_CALLBACK: std::cell::RefCell<Option<js_sys::Function>> = const { std::cell::RefCell::new(None) };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::editor_api::EditorWrapper;
|
||||
use crate::editor_wrapper::EditorWrapper;
|
||||
use crate::helpers::wrapper;
|
||||
use editor::messages::prelude::FrontendMessage;
|
||||
use js_sys::{ArrayBuffer, Uint8Array};
|
||||
|
||||
Reference in New Issue
Block a user