Checkpoint

This commit is contained in:
Antonio Scandurra
2023-10-19 19:51:05 +02:00
parent 30269381e8
commit 7fef03a7db
7 changed files with 18 additions and 17 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ mod geometry;
mod hover; mod hover;
mod image_cache; mod image_cache;
mod interactive; mod interactive;
mod keymap_matcher; mod keymap;
mod platform; mod platform;
mod scene; mod scene;
mod style; mod style;
@@ -39,7 +39,7 @@ pub use gpui3_macros::*;
pub use hover::*; pub use hover::*;
pub use image_cache::*; pub use image_cache::*;
pub use interactive::*; pub use interactive::*;
pub use keymap_matcher::*; pub use keymap::*;
pub use platform::*; pub use platform::*;
pub use refineable::*; pub use refineable::*;
pub use scene::*; pub use scene::*;
@@ -1,12 +1,4 @@
mod binding; use crate::{Binding, Keymap, KeymapContext, KeymapVersion, Keystroke};
mod keymap;
mod keymap_context;
pub use binding::*;
pub use keymap::*;
pub use keymap_context::*;
use crate::Keystroke;
use smallvec::SmallVec; use smallvec::SmallVec;
use std::any::{Any, TypeId}; use std::any::{Any, TypeId};
@@ -16,13 +8,13 @@ pub trait Action: Any + Send + Sync {
fn as_any(&self) -> &dyn Any; fn as_any(&self) -> &dyn Any;
} }
pub struct KeymapMatcher { pub struct KeyMatcher {
pending_keystrokes: Vec<Keystroke>, pending_keystrokes: Vec<Keystroke>,
keymap: Keymap, keymap: Keymap,
keymap_version: KeymapVersion, keymap_version: KeymapVersion,
} }
impl KeymapMatcher { impl KeyMatcher {
pub fn new(keymap: Keymap) -> Self { pub fn new(keymap: Keymap) -> Self {
Self { Self {
pending_keystrokes: Vec::new(), pending_keystrokes: Vec::new(),
@@ -106,7 +98,7 @@ impl KeymapMatcher {
} }
} }
impl Default for KeymapMatcher { impl Default for KeyMatcher {
fn default() -> Self { fn default() -> Self {
Self::new(Keymap::default()) Self::new(Keymap::default())
} }
+9
View File
@@ -0,0 +1,9 @@
mod binding;
mod keymap;
mod keymap_context;
mod matcher;
pub use binding::*;
pub use keymap::*;
pub use keymap_context::*;
pub use matcher::*;
+3 -3
View File
@@ -2,7 +2,7 @@ use crate::{
px, size, Action, AnyBox, AnyView, AppContext, AsyncWindowContext, AvailableSpace, px, size, Action, AnyBox, AnyView, AppContext, AsyncWindowContext, AvailableSpace,
BorrowAppContext, Bounds, BoxShadow, Context, Corners, DevicePixels, DisplayId, Edges, Effect, BorrowAppContext, Bounds, BoxShadow, Context, Corners, DevicePixels, DisplayId, Edges, Effect,
Element, EntityId, EventEmitter, FocusEvent, FontId, GlobalElementId, GlyphId, Handle, Hsla, Element, EntityId, EventEmitter, FocusEvent, FontId, GlobalElementId, GlyphId, Handle, Hsla,
ImageData, InputEvent, IsZero, KeyListener, KeyMatch, KeymapMatcher, Keystroke, LayoutId, ImageData, InputEvent, IsZero, KeyListener, KeyMatch, KeyMatcher, Keystroke, LayoutId,
MainThread, MainThreadOnly, MonochromeSprite, MouseMoveEvent, Path, Pixels, Platform, MainThread, MainThreadOnly, MonochromeSprite, MouseMoveEvent, Path, Pixels, Platform,
PlatformAtlas, PlatformWindow, Point, PolychromeSprite, Quad, Reference, RenderGlyphParams, PlatformAtlas, PlatformWindow, Point, PolychromeSprite, Quad, Reference, RenderGlyphParams,
RenderImageParams, RenderSvgParams, ScaledPixels, SceneBuilder, Shadow, SharedString, Size, RenderImageParams, RenderSvgParams, ScaledPixels, SceneBuilder, Shadow, SharedString, Size,
@@ -150,8 +150,8 @@ pub struct Window {
pub(crate) element_id_stack: GlobalElementId, pub(crate) element_id_stack: GlobalElementId,
prev_frame_element_states: HashMap<GlobalElementId, AnyBox>, prev_frame_element_states: HashMap<GlobalElementId, AnyBox>,
element_states: HashMap<GlobalElementId, AnyBox>, element_states: HashMap<GlobalElementId, AnyBox>,
prev_frame_key_matchers: HashMap<GlobalElementId, KeymapMatcher>, prev_frame_key_matchers: HashMap<GlobalElementId, KeyMatcher>,
key_matchers: HashMap<GlobalElementId, KeymapMatcher>, key_matchers: HashMap<GlobalElementId, KeyMatcher>,
z_index_stack: StackingOrder, z_index_stack: StackingOrder,
content_mask_stack: Vec<ContentMask<Pixels>>, content_mask_stack: Vec<ContentMask<Pixels>>,
mouse_listeners: HashMap<TypeId, Vec<(StackingOrder, AnyListener)>>, mouse_listeners: HashMap<TypeId, Vec<(StackingOrder, AnyListener)>>,