From 9af9ceca26596d562a3ae89fda70bad9f8822ab0 Mon Sep 17 00:00:00 2001 From: Xiao-Yong Jin Date: Sun, 21 Oct 2018 20:59:21 -0500 Subject: devdraw: rewrite the Cocoa screen using Metal Add a new macOS cocoa screen, cocoa-screen-metal.m. Rewrite the macOS cocoa drawing code to use the builtin runloop, and use Metal to push pixels with CAMetalLayer. Remove all of the deprecated code, and simplify some of the logic. Modify mkwsysrules.sh such that the new code is used only when the system version is equal or higher than 10.14. Allow touch events to simulate mouse clicks: three finger tap for the middle mouse button; four finger tap for the 2-1 chord. Support Tresize. Scale 16x16 Cursor up to 32x32 with an EPX algorithm. Support macOS input sources including the basic dead keys and the advanced CJK input methods. Increase the communication buffers in cocoa-srv.c to allow more input, especially for long sentences prepared by the macOS input souces. --- src/cmd/devdraw/cocoa-screen.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cmd/devdraw/cocoa-screen.h') diff --git a/src/cmd/devdraw/cocoa-screen.h b/src/cmd/devdraw/cocoa-screen.h index 3c4c94c5..7b41c34b 100644 --- a/src/cmd/devdraw/cocoa-screen.h +++ b/src/cmd/devdraw/cocoa-screen.h @@ -16,5 +16,9 @@ void servep9p(void); void zlock(void); void zunlock(void); +void resizeimg(void); + Rectangle mouserect; -int mouseresized; + +int mouseresized; +void resizewindow(Rectangle); -- cgit v1.2.3 From 7d43dde539378fb5730df6ce961f7916f495746e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 15 Nov 2018 20:28:56 -0500 Subject: devdraw: add Cursor2 support on macOS 10.14 Mojave This replaces the pixel-art scaling algorithm used for upscaling before. The results were not crisp enough to serve as everyday cursors. --- src/cmd/devdraw/cocoa-screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/devdraw/cocoa-screen.h') diff --git a/src/cmd/devdraw/cocoa-screen.h b/src/cmd/devdraw/cocoa-screen.h index 7b41c34b..b5e3c701 100644 --- a/src/cmd/devdraw/cocoa-screen.h +++ b/src/cmd/devdraw/cocoa-screen.h @@ -2,7 +2,7 @@ Memimage *attachscreen(char*, char*); void setmouse(Point); -void setcursor(Cursor*); +void setcursor(Cursor*, Cursor2*); void setlabel(char*); char* getsnarf(void); void putsnarf(char*); -- cgit v1.2.3