1 /* $Id: macos.h 25663 2013-08-05 20:36:06Z michi_cc $ */
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
10 /** @file macos.h Functions related to MacOS support. */
15 /** Helper function displaying a message the best possible way. */
16 void ShowMacDialog(const char *title
, const char *message
, const char *button_label
);
18 void GetMacOSVersion(int *return_major
, int *return_minor
, int *return_bugfix
);
21 * Check if we are at least running on the specified version of Mac OS.
22 * @param major major version of the os. This would be 10 in the case of 10.4.11.
23 * @param minor minor version of the os. This would be 4 in the case of 10.4.11.
24 * @param bugfix bugfix version of the os. This would be 11 in the case of 10.4.11.
25 * @return true if the running os is at least what we asked, false otherwise.
27 static inline bool MacOSVersionIsAtLeast(long major
, long minor
, long bugfix
)
29 int version_major
, version_minor
, version_bugfix
;
30 GetMacOSVersion(&version_major
, &version_minor
, &version_bugfix
);
32 if (version_major
< major
) return false;
33 if (version_major
== major
&& version_minor
< minor
) return false;
34 if (version_major
== major
&& version_minor
== minor
&& version_bugfix
< bugfix
) return false;
39 bool IsMonospaceFont(CFStringRef name
);