working f and t bindings

This commit is contained in:
Kay Simmons
2023-01-06 14:24:20 -08:00
parent 6a57bd2794
commit 73e7967a12
37 changed files with 1143 additions and 860 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ use std::ops::Deref;
use pathfinder_geometry::vector::vec2f;
use crate::{geometry::vector::Vector2F, keymap::Keystroke};
use crate::{geometry::vector::Vector2F, keymap_matcher::Keystroke};
#[derive(Clone, Debug)]
pub struct KeyDownEvent {
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::{
geometry::vector::vec2f,
keymap::Keystroke,
keymap_matcher::Keystroke,
platform::{Event, NavigationDirection},
KeyDownEvent, KeyUpEvent, Modifiers, ModifiersChangedEvent, MouseButton, MouseButtonEvent,
MouseMovedEvent, ScrollDelta, ScrollWheelEvent, TouchPhase,
+6 -5
View File
@@ -3,7 +3,8 @@ use super::{
FontSystem, Window,
};
use crate::{
executor, keymap,
executor,
keymap_matcher::KeymapMatcher,
platform::{self, CursorStyle},
Action, AppVersion, ClipboardItem, Event, Menu, MenuItem,
};
@@ -135,7 +136,7 @@ impl MacForegroundPlatform {
menus: Vec<Menu>,
delegate: id,
actions: &mut Vec<Box<dyn Action>>,
keystroke_matcher: &keymap::Matcher,
keystroke_matcher: &KeymapMatcher,
) -> id {
let application_menu = NSMenu::new(nil).autorelease();
application_menu.setDelegate_(delegate);
@@ -172,7 +173,7 @@ impl MacForegroundPlatform {
item: MenuItem,
delegate: id,
actions: &mut Vec<Box<dyn Action>>,
keystroke_matcher: &keymap::Matcher,
keystroke_matcher: &KeymapMatcher,
) -> id {
match item {
MenuItem::Separator => NSMenuItem::separatorItem(nil),
@@ -183,7 +184,7 @@ impl MacForegroundPlatform {
.map(|binding| binding.keystrokes());
let item;
if let Some(keystrokes) = keystrokes {
if let Some(keystrokes) = keystrokes.flatten() {
if keystrokes.len() == 1 {
let keystroke = &keystrokes[0];
let mut mask = NSEventModifierFlags::empty();
@@ -317,7 +318,7 @@ impl platform::ForegroundPlatform for MacForegroundPlatform {
self.0.borrow_mut().validate_menu_command = Some(callback);
}
fn set_menus(&self, menus: Vec<Menu>, keystroke_matcher: &keymap::Matcher) {
fn set_menus(&self, menus: Vec<Menu>, keystroke_matcher: &KeymapMatcher) {
unsafe {
let app: id = msg_send![APP_CLASS, sharedApplication];
let mut state = self.0.borrow_mut();
+1 -1
View File
@@ -4,7 +4,7 @@ use crate::{
rect::RectF,
vector::{vec2f, Vector2F},
},
keymap::Keystroke,
keymap_matcher::Keystroke,
mac::platform::NSViewLayerContentsRedrawDuringViewResize,
platform::{
self,
+3 -2
View File
@@ -4,7 +4,8 @@ use crate::{
rect::RectF,
vector::{vec2f, Vector2F},
},
keymap, Action, ClipboardItem,
keymap_matcher::KeymapMatcher,
Action, ClipboardItem,
};
use anyhow::{anyhow, Result};
use collections::VecDeque;
@@ -84,7 +85,7 @@ impl super::ForegroundPlatform for ForegroundPlatform {
fn on_menu_command(&self, _: Box<dyn FnMut(&dyn Action)>) {}
fn on_validate_menu_command(&self, _: Box<dyn FnMut(&dyn Action) -> bool>) {}
fn on_will_open_menu(&self, _: Box<dyn FnMut()>) {}
fn set_menus(&self, _: Vec<crate::Menu>, _: &keymap::Matcher) {}
fn set_menus(&self, _: Vec<crate::Menu>, _: &KeymapMatcher) {}
fn prompt_for_paths(
&self,