doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
macosx_misc.mm
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #define GL_GLEXT_LEGACY // AppKit.h include pulls in gl.h already
30 #import <AppKit/AppKit.h>
31 #import <Foundation/Foundation.h>
32 #include "../../idlib/precompiled.h"
33 #include "../sys_local.h"
34 
35 /*
36 ==================
37 idSysLocal::OpenURL
38 ==================
39 */
40 void idSysLocal::OpenURL( const char *url, bool doexit ) {
41  static bool quit_spamguard = false;
42 
43  if ( quit_spamguard ) {
44  common->DPrintf( "Sys_OpenURL: already in a doexit sequence, ignoring %s\n", url );
45  return;
46  }
47 
48  common->Printf("Open URL: %s\n", url);
49 
50 
51  [[ NSWorkspace sharedWorkspace] openURL: [ NSURL URLWithString:
52  [ NSString stringWithCString: url ] ] ];
53 
54  if ( doexit ) {
55  quit_spamguard = true;
57  }
58 }
59 
60 /*
61 ==================
62 Sys_DoStartProcess
63 ==================
64 */
65 void Sys_DoStartProcess( const char *exeName, bool dofork = true ) {
66  common->Printf( "TODO: Sys_DoStartProcess %s\n", exeName );
67 }
68 
69 /*
70 ==================
71 OSX_GetLocalizedString
72 ==================
73 */
74 const char* OSX_GetLocalizedString( const char* key )
75 {
76  NSString *string = [ [ NSBundle mainBundle ] localizedStringForKey:[ NSString stringWithCString: key ]
77  value:@"No translation" table:nil];
78  return [string cString];
79 }
const char * OSX_GetLocalizedString(const char *key)
Definition: macosx_misc.mm:74
idCmdSystem * cmdSystem
Definition: CmdSystem.cpp:116
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
idCommon * common
Definition: Common.cpp:206
void Sys_DoStartProcess(const char *exeName, bool dofork=true)
Definition: macosx_misc.mm:65
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual void OpenURL(const char *url, bool quit)
Definition: main.cpp:421
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf