~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
min()/max() macros conflict with ones defined by Windows (or at least MinGW)
[sgt/puzzles]
/
osx.m
diff --git
a/osx.m
b/osx.m
index
dfed94c
..
039f081
100644
(file)
--- a/
osx.m
+++ b/
osx.m
@@
-383,7
+383,7
@@
struct frontend {
- (void)keyDown:(NSEvent *)ev;
- (void)activateTimer;
- (void)deactivateTimer;
- (void)keyDown:(NSEvent *)ev;
- (void)activateTimer;
- (void)deactivateTimer;
-- (void)setStatusLine:(
NSString
*)text;
+- (void)setStatusLine:(
char
*)text;
@end
@implementation MyImageView
@end
@implementation MyImageView
@@
-589,22
+589,34
@@
struct frontend {
* function key codes.
*/
if (c >= 0x80) {
* function key codes.
*/
if (c >= 0x80) {
+ int mods = FALSE;
switch (c) {
case NSUpArrowFunctionKey:
c = CURSOR_UP;
switch (c) {
case NSUpArrowFunctionKey:
c = CURSOR_UP;
+ mods = TRUE;
break;
case NSDownArrowFunctionKey:
c = CURSOR_DOWN;
break;
case NSDownArrowFunctionKey:
c = CURSOR_DOWN;
+ mods = TRUE;
break;
case NSLeftArrowFunctionKey:
c = CURSOR_LEFT;
break;
case NSLeftArrowFunctionKey:
c = CURSOR_LEFT;
+ mods = TRUE;
break;
case NSRightArrowFunctionKey:
c = CURSOR_RIGHT;
break;
case NSRightArrowFunctionKey:
c = CURSOR_RIGHT;
+ mods = TRUE;
break;
default:
continue;
}
break;
default:
continue;
}
+
+ if (mods) {
+ if ([ev modifierFlags] & NSShiftKeyMask)
+ c |= MOD_SHFT;
+ if ([ev modifierFlags] & NSControlKeyMask)
+ c |= MOD_CTRL;
+ }
}
if (c >= '0' && c <= '9' && ([ev modifierFlags] & NSNumericPadKeyMask))
}
if (c >= '0' && c <= '9' && ([ev modifierFlags] & NSNumericPadKeyMask))
@@
-1119,9
+1131,11
@@
struct frontend {
[self sheetEndWithStatus:NO];
}
[self sheetEndWithStatus:NO];
}
-- (void)setStatusLine:(
NSString
*)text
+- (void)setStatusLine:(
char
*)text
{
{
- [[status cell] setTitle:text];
+ char *rewritten = midend_rewrite_statusbar(me, text);
+ [[status cell] setTitle:[NSString stringWithCString:rewritten]];
+ sfree(rewritten);
}
@end
}
@end
@@
-1255,7
+1269,7
@@
void activate_timer(frontend *fe)
void status_bar(frontend *fe, char *text)
{
void status_bar(frontend *fe, char *text)
{
- [fe->window setStatusLine:
[NSString stringWithCString:text]
];
+ [fe->window setStatusLine:
text
];
}
/* ----------------------------------------------------------------------
}
/* ----------------------------------------------------------------------