OpenTTD Source 20250527-master-g808af15975
macos.h File Reference

Functions related to MacOS support. More...

Go to the source code of this file.

Data Structures

struct  CFDeleter< T >
 Deleter that calls CFRelease rather than deleting the pointer. More...
 

Typedefs

template<typename T >
using CFAutoRelease = std::unique_ptr< typename std::remove_pointer< T >::type, CFDeleter< typename std::remove_pointer< T >::type > >
 Specialisation of std::unique_ptr for CoreFoundation objects.
 

Functions

void ShowMacDialog (std::string_view title, std::string_view message, std::string_view button_label)
 Helper function displaying a message the best possible way.
 
void GetMacOSVersion (int *return_major, int *return_minor, int *return_bugfix)
 
bool MacOSVersionIsAtLeast (long major, long minor, long bugfix)
 Check if we are at least running on the specified version of Mac OS.
 
bool IsMonospaceFont (CFStringRef name)
 
void MacOSSetThreadName (const std::string &name)
 
uint64_t MacOSGetPhysicalMemory ()
 

Detailed Description

Functions related to MacOS support.

Definition in file macos.h.

Typedef Documentation

◆ CFAutoRelease

template<typename T >
using CFAutoRelease = std::unique_ptr<typename std::remove_pointer<T>::type, CFDeleter<typename std::remove_pointer<T>::type> >

Specialisation of std::unique_ptr for CoreFoundation objects.

Definition at line 54 of file macos.h.

Function Documentation

◆ MacOSVersionIsAtLeast()

bool MacOSVersionIsAtLeast ( long  major,
long  minor,
long  bugfix 
)
inline

Check if we are at least running on the specified version of Mac OS.

Parameters
majormajor version of the os. This would be 10 in the case of 10.4.11.
minorminor version of the os. This would be 4 in the case of 10.4.11.
bugfixbugfix version of the os. This would be 11 in the case of 10.4.11.
Returns
true if the running os is at least what we asked, false otherwise.

Definition at line 25 of file macos.h.

Referenced by CoreTextParagraphLayoutFactory::GetParagraphLayout(), LoadCoreTextFont(), MacOSRegisterExternalFont(), MacOSSetCurrentLocaleName(), MacOSStringCompare(), and MacOSStringContains().