diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings index 78ad12bd..1538ff21 100644 Binary files a/English.lproj/InfoPlist.strings and b/English.lproj/InfoPlist.strings differ diff --git a/Grafx2.xcodeproj/project.pbxproj b/Grafx2.xcodeproj/project.pbxproj index 6d19cc04..4a23ff6b 100644 --- a/Grafx2.xcodeproj/project.pbxproj +++ b/Grafx2.xcodeproj/project.pbxproj @@ -16,6 +16,11 @@ F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */; }; F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; }; F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; }; + F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405A0FBC406D00B7577C /* pxquad.c */; }; + F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405B0FBC406D00B7577C /* pxtall2.c */; }; + F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405C0FBC406D00B7577C /* pxtriple.c */; }; + F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405D0FBC406D00B7577C /* pxwide2.c */; }; + F5AA40630FBC406D00B7577C /* transform.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405E0FBC406D00B7577C /* transform.c */; }; F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28B90F4873C700455509 /* hotkeys.c */; }; F5AC28BD0F4873C700455509 /* input.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BA0F4873C700455509 /* input.c */; }; F5AC28BE0F4873C700455509 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BB0F4873C700455509 /* realpath.c */; }; @@ -143,6 +148,11 @@ F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */ = {isa = PBXFileReference; lastKnownFileType = file; name = colorfont.pcx; path = fonts/colorfont.pcx; sourceTree = ""; }; F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = ""; }; F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = ""; }; + F5AA405A0FBC406D00B7577C /* pxquad.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxquad.c; sourceTree = ""; }; + F5AA405B0FBC406D00B7577C /* pxtall2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall2.c; sourceTree = ""; }; + F5AA405C0FBC406D00B7577C /* pxtriple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtriple.c; sourceTree = ""; }; + F5AA405D0FBC406D00B7577C /* pxwide2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide2.c; sourceTree = ""; }; + F5AA405E0FBC406D00B7577C /* transform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = transform.c; sourceTree = ""; }; F5AC28B90F4873C700455509 /* hotkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hotkeys.c; sourceTree = ""; }; F5AC28BA0F4873C700455509 /* input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = ""; }; F5AC28BB0F4873C700455509 /* realpath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = ""; }; @@ -313,6 +323,11 @@ children = ( 32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */, 002F3A3E09D088BA00EBEB88 /* main.c */, + F5AA405A0FBC406D00B7577C /* pxquad.c */, + F5AA405B0FBC406D00B7577C /* pxtall2.c */, + F5AA405C0FBC406D00B7577C /* pxtriple.c */, + F5AA405D0FBC406D00B7577C /* pxwide2.c */, + F5AA405E0FBC406D00B7577C /* transform.c */, ); name = "Other Sources"; sourceTree = ""; @@ -429,6 +444,11 @@ F5B310B80F949A9C008197E2 /* keyboard.c in Sources */, F5B310B90F949A9C008197E2 /* misc.c in Sources */, F5B310BA0F949A9C008197E2 /* text.c in Sources */, + F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */, + F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */, + F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */, + F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */, + F5AA40630FBC406D00B7577C /* transform.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Grafx2.xcodeproj/xx.pbxuser b/Grafx2.xcodeproj/xx.pbxuser index f217ee32..0d7e9a95 100644 --- a/Grafx2.xcodeproj/xx.pbxuser +++ b/Grafx2.xcodeproj/xx.pbxuser @@ -165,8 +165,8 @@ PBXFileDataSource_Warnings_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 262786429; - PBXWorkspaceStateSaveDate = 262786429; + PBXPerProjectTemplateStateSaveDate = 263995769; + PBXWorkspaceStateSaveDate = 263995769; }; sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */; userBuildSettings = { diff --git a/Grafx2.xcodeproj/xx.perspective b/Grafx2.xcodeproj/xx.perspective index 35236725..a0fb20b6 100644 --- a/Grafx2.xcodeproj/xx.perspective +++ b/Grafx2.xcodeproj/xx.perspective @@ -456,7 +456,7 @@ PBXSmartGroupTreeModuleColumnWidthsKey - 418 + 275 PBXSmartGroupTreeModuleColumnsKey_v4 @@ -481,7 +481,7 @@ PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 506}, {418, 592}} + {{0, 0}, {275, 583}} PBXTopSmartGroupGIDs @@ -491,19 +491,19 @@ GeometryConfiguration Frame - {{0, 0}, {435, 610}} + {{0, 0}, {292, 601}} GroupTreeTableConfiguration MainColumn - 418 + 275 RubberWindowFrame - 225 -383 1092 651 0 0 1024 746 + 2 -15 944 642 0 0 1024 746 Module PBXSmartGroupTreeModule Proportion - 435pt + 292pt Dock @@ -535,9 +535,9 @@ GeometryConfiguration Frame - {{0, 0}, {652, 0}} + {{0, 0}, {647, 0}} RubberWindowFrame - 225 -383 1092 651 0 0 1024 746 + 2 -15 944 642 0 0 1024 746 Module PBXNavigatorGroup @@ -546,14 +546,14 @@ Proportion - 605pt + 596pt Tabs ContentConfiguration PBXBuildLogShowsTranscriptDefaultKey - {{0, 5}, {652, 573}} + {{0, 5}, {647, 564}} PBXProjectModuleGUID XCMainBuildResultsModuleGUID PBXProjectModuleLabel @@ -566,9 +566,9 @@ GeometryConfiguration Frame - {{10, 27}, {652, 578}} + {{10, 27}, {647, 569}} RubberWindowFrame - 225 -383 1092 651 0 0 1024 746 + 2 -15 944 642 0 0 1024 746 Module PBXBuildResultsModule @@ -630,7 +630,7 @@ Proportion - 652pt + 647pt Name @@ -648,14 +648,14 @@ TableOfContents - F5F7346C0F94B3DD003FC65B + F5AA406F0FBC418100B7577C 1CA23EE50692099D00951B8B - F5F7346D0F94B3DD003FC65B + F5AA40700FBC418100B7577C F5A33EC20EC89C3000F8052D - F5F7346E0F94B3DD003FC65B + F5AA40710FBC418100B7577C XCMainBuildResultsModuleGUID 1CA23EE80692099D00951B8B - F5F7346F0F94B3DD003FC65B + F5AA40720FBC418100B7577C ToolbarConfiguration xcode.toolbar.config.buildAndRun @@ -829,7 +829,7 @@ /Users/xx/Grafx2/Grafx2.xcodeproj WindowString - 225 -383 1092 651 0 0 1024 746 + 2 -15 944 642 0 0 1024 746 WindowTools diff --git a/SDLMain.m b/SDLMain.m index 05b39448..5274d96c 100644 --- a/SDLMain.m +++ b/SDLMain.m @@ -76,6 +76,20 @@ static NSString *getApplicationName(void) event.type = SDL_QUIT; SDL_PushEvent(&event); } +/* override NSApplication:sendEvent, to keep Cocoa from beeping on + non-command keystrokes */ +- (void)sendEvent:(NSEvent *)anEvent { + if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) { + if ([anEvent modifierFlags] & NSCommandKeyMask) + { + SDL_SetModState(SDL_GetModState() | KMOD_META); + [super sendEvent: anEvent]; + } + } else + { + [super sendEvent: anEvent]; + } +} @end /* The main class of the application, the application's delegate */ @@ -297,6 +311,8 @@ static void CustomApplicationMain (int argc, char **argv) [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; #endif + setenv("SDL_ENABLEAPPEVENTS", "1", 1); + /* Hand off to main application code */ gCalledAppMainline = TRUE; status = SDL_main (gArgc, gArgv); diff --git a/filesel.c b/filesel.c index 7b59a79a..bacaa853 100644 --- a/filesel.c +++ b/filesel.c @@ -1,5 +1,6 @@ /* Grafx2 - The Ultimate 256-color bitmap paint program + Copyright 2009 Franck Charlet Copyright 2008 Peter Gordon Copyright 2008 Yves Rizoud Copyright 2007 Adrien Destugues diff --git a/global.h b/global.h index cd6e312d..d4ed4517 100644 --- a/global.h +++ b/global.h @@ -102,12 +102,22 @@ GFX2_GLOBAL dword Key_ANSI; #ifdef MOD_ALT #undef MOD_ALT #endif + +#if defined(__macosx__) +#ifdef MOD_META + #undef MOD_META +#endif +#endif + /// Key modifier for SHIFT key. Used as mask in ::Key, for example. #define MOD_SHIFT 0x1000 /// Key modifier for CONTROL key. Used as mask in ::Key, for example. #define MOD_CTRL 0x2000 /// Key modifier for ALT key. Used as mask in ::Key, for example. #define MOD_ALT 0x4000 +#if defined(__macosx__) +#define MOD_META 0x8000 +#endif /// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button GFX2_GLOBAL byte Quit_is_required; diff --git a/input.c b/input.c index ee2db87b..9335cb42 100644 --- a/input.c +++ b/input.c @@ -1,5 +1,6 @@ /* Grafx2 - The Ultimate 256-color bitmap paint program + Copyright 2009 Franck Charlet Copyright 2007 Adrien Destugues Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) @@ -364,6 +365,14 @@ int Handle_key_release(SDL_KeyboardEvent event) case SDLK_MODE: modifier=MOD_ALT; break; + +#if defined(__macosx__) + case SDLK_RMETA: + case SDLK_LMETA: + modifier=MOD_META; + break; +#endif + default: modifier=0; } diff --git a/keyboard.c b/keyboard.c index 1ce195a5..20d371fd 100644 --- a/keyboard.c +++ b/keyboard.c @@ -1,5 +1,6 @@ /* Grafx2 - The Ultimate 256-color bitmap paint program + Copyright 2009 Franck Charlet Copyright 2008 Yves Rizoud Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud) @@ -318,6 +319,11 @@ word Key_modifiers(SDLMod mod) if (mod & (KMOD_ALT|KMOD_MODE)) modifiers|=MOD_ALT; +#if defined(__macosx__) + if (mod & (KMOD_META)) + modifiers|=MOD_META; +#endif + return modifiers; } @@ -325,11 +331,12 @@ word Keysym_to_keycode(SDL_keysym keysym) { word key_code = 0; word mod; - + // On ignore shift, alt et control isolés. if (keysym.sym == SDLK_RSHIFT || keysym.sym == SDLK_LSHIFT || keysym.sym == SDLK_RCTRL || keysym.sym == SDLK_LCTRL || keysym.sym == SDLK_RALT || keysym.sym == SDLK_LALT || + keysym.sym == SDLK_RMETA || keysym.sym == SDLK_LMETA || keysym.sym == SDLK_MODE) // AltGr return 0; @@ -346,6 +353,7 @@ word Keysym_to_keycode(SDL_keysym keysym) // is buggy: if you release a modifier key, the following keys (when they repeat) // still name the original modifiers. mod=Key_modifiers(SDL_GetModState()); + // SDL_GetModState() seems to get the right up-to-date info. key_code |= mod; return key_code;