OpenClonk
C4AppMac.mm File Reference
#include "C4ForbidLibraryCompilation.h"
#include <epoxy/gl.h>
#include "C4Include.h"
#include "platform/C4Window.h"
#include "graphics/C4Draw.h"
#include "platform/C4App.h"
#import <Cocoa/Cocoa.h>
#import "platform/C4WindowController.h"
#import "graphics/C4DrawGLMac.h"
Include dependency graph for C4AppMac.mm:

Go to the source code of this file.

Macros

#define GL_SILENCE_DEPRECATION
 

Functions

bool IsGermanSystem ()
 
bool OpenURL (const char *szURL)
 
bool EraseItemSafe (const char *szFilename)
 

Macro Definition Documentation

◆ GL_SILENCE_DEPRECATION

#define GL_SILENCE_DEPRECATION

Definition at line 20 of file C4AppMac.mm.

Function Documentation

◆ EraseItemSafe()

bool EraseItemSafe ( const char *  szFilename)

Definition at line 206 of file C4AppMac.mm.

207 {
208  NSString* filename = [NSString stringWithUTF8String: szFilename];
209  return [[NSWorkspace sharedWorkspace]
210  performFileOperation: NSWorkspaceRecycleOperation
211  source: [filename stringByDeletingLastPathComponent]
212  destination: @""
213  files: [NSArray arrayWithObject: [filename lastPathComponent]]
214  tag: 0];
215 }

◆ IsGermanSystem()

bool IsGermanSystem ( )

Definition at line 193 of file C4AppMac.mm.

194 {
195  id languages = [[NSUserDefaults standardUserDefaults] valueForKey:@"AppleLanguages"];
196  return languages && [[languages objectAtIndex:0] isEqualToString:@"de"];
197 }

Referenced by C4ConfigGeneral::DefaultLanguage().

Here is the caller graph for this function:

◆ OpenURL()

bool OpenURL ( const char *  szURL)

Definition at line 199 of file C4AppMac.mm.

200 {
201  std::string command = std::string("open ") + '"' + szURL + '"';
202  std::system(command.c_str());
203  return true;
204 }