mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
app: add support for system cursors
Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
@@ -20,3 +20,43 @@ void gio_nsstringGetCharacters(CFTypeRef cstr, unichar *chars, NSUInteger loc, N
|
||||
NSString *str = (__bridge NSString *)cstr;
|
||||
[str getCharacters:chars range:NSMakeRange(loc, length)];
|
||||
}
|
||||
|
||||
void gio_hideCursor() {
|
||||
@autoreleasepool {
|
||||
[NSCursor hide];
|
||||
}
|
||||
}
|
||||
|
||||
void gio_showCursor() {
|
||||
@autoreleasepool {
|
||||
[NSCursor unhide];
|
||||
}
|
||||
}
|
||||
|
||||
void gio_setCursor(NSUInteger curID) {
|
||||
@autoreleasepool {
|
||||
switch (curID) {
|
||||
case 1:
|
||||
[NSCursor.arrowCursor set];
|
||||
break;
|
||||
case 2:
|
||||
[NSCursor.IBeamCursor set];
|
||||
break;
|
||||
case 3:
|
||||
[NSCursor.pointingHandCursor set];
|
||||
break;
|
||||
case 4:
|
||||
[NSCursor.crosshairCursor set];
|
||||
break;
|
||||
case 5:
|
||||
[NSCursor.resizeLeftRightCursor set];
|
||||
break;
|
||||
case 6:
|
||||
[NSCursor.resizeUpDownCursor set];
|
||||
break;
|
||||
default:
|
||||
[NSCursor.arrowCursor set];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user