|
OpenTTD Source 20260129-master-g2bb01bd0e4
|
Code related to MacOSX. More...
#include "../../stdafx.h"#include "../../core/bitmath_func.hpp"#include "../../rev.h"#include "macos.h"#include "../../string_func.h"#include "../../fileio_func.h"#include <pthread.h>#include "macos_objective_c.h"Go to the source code of this file.
Functions | |
| std::tuple< int, int, int > | GetMacOSVersion () |
| Get the version of the MacOS we are running under. | |
| void | ShowMacDialog (std::string_view title, std::string_view message, std::string_view buttonLabel) |
| Show the system dialogue message, uses Cocoa if available and console otherwise. | |
| void | ShowOSErrorBox (std::string_view buf, bool system) |
| Show an error message. | |
| void | OSOpenBrowser (const std::string &url) |
| Opens browser on MacOS. | |
| std::optional< std::string > | GetCurrentLocale (const char *) |
| Determine and return the current user's charset. | |
| bool | IsMonospaceFont (CFStringRef name) |
| Check if a font is a monospace font. | |
| void | MacOSSetThreadName (const std::string &name) |
| Set the name of the current thread for the debugger. | |
| uint64_t | MacOSGetPhysicalMemory () |
| Ask OS how much RAM it has physically attached. | |
Code related to MacOSX.
This file contains objective C. Apple uses objective C instead of plain C to interact with OS specific/native functions.
Definition in file macos.mm.
| std::optional< std::string > GetCurrentLocale | ( | const char * | ) |
| std::tuple< int, int, int > GetMacOSVersion | ( | ) |
| bool IsMonospaceFont | ( | CFStringRef | name | ) |
| uint64_t MacOSGetPhysicalMemory | ( | ) |
| void MacOSSetThreadName | ( | const std::string & | name | ) |
Set the name of the current thread for the debugger.
| name | The new name of the current thread. |
Definition at line 178 of file macos.mm.
Referenced by SetCurrentThreadName().
| void OSOpenBrowser | ( | const std::string & | url | ) |
| void ShowMacDialog | ( | std::string_view | title, |
| std::string_view | message, | ||
| std::string_view | buttonLabel | ||
| ) |
Show the system dialogue message, uses Cocoa if available and console otherwise.
Helper function displaying a message the best possible way.
Definition at line 48 of file macos.mm.
References CocoaDialog().
Referenced by CrashLogOSX::DisplayCrashDialog(), HandleCrash(), and ShowOSErrorBox().