mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
`/client/web` -> `/frontend` `/client/cli` -> *delete for now* `/client/native` -> *delete for now* `/core/editor` -> `/editor` `/core/document` -> `/graphene` `/core/renderer` -> `/charcoal` `/core/proc-macro` -> `/proc-macros` *(now plural)*
28 lines
831 B
Rust
28 lines
831 B
Rust
use crate::LayerId;
|
|
use serde::{Deserialize, Serialize};
|
|
use std::fmt;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
|
#[repr(C)]
|
|
pub enum DocumentResponse {
|
|
DocumentChanged,
|
|
FolderChanged { path: Vec<LayerId> },
|
|
CreatedLayer { path: Vec<LayerId> },
|
|
DeletedLayer { path: Vec<LayerId> },
|
|
LayerChanged { path: Vec<LayerId> },
|
|
}
|
|
|
|
impl fmt::Display for DocumentResponse {
|
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
|
let name = match self {
|
|
DocumentResponse::DocumentChanged { .. } => "DocumentChanged",
|
|
DocumentResponse::FolderChanged { .. } => "FolderChanged",
|
|
DocumentResponse::CreatedLayer { .. } => "CreatedLayer",
|
|
DocumentResponse::LayerChanged { .. } => "LayerChanged",
|
|
DocumentResponse::DeletedLayer { .. } => "DeleteLayer",
|
|
};
|
|
|
|
formatter.write_str(name)
|
|
}
|
|
}
|