macos.h

Go to the documentation of this file.
00001 /* $Id: macos.h 25663 2013-08-05 20:36:06Z michi_cc $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef MACOS_H
00013 #define MACOS_H
00014 
00016 void ShowMacDialog(const char *title, const char *message, const char *button_label);
00017 
00018 void GetMacOSVersion(int *return_major, int *return_minor, int *return_bugfix);
00019 
00027 static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
00028 {
00029   int version_major, version_minor, version_bugfix;
00030   GetMacOSVersion(&version_major, &version_minor, &version_bugfix);
00031 
00032   if (version_major < major) return false;
00033   if (version_major == major && version_minor < minor) return false;
00034   if (version_major == major && version_minor == minor && version_bugfix < bugfix) return false;
00035 
00036   return true;
00037 }
00038 
00039 bool IsMonospaceFont(CFStringRef name);
00040 
00041 #endif /* MACOS_H */