Rework the trip history window layout.
[openttd-joker.git] / src / os / windows / win32.h
blobf73ce802c33bb650a9b840d62ea8d83a69bb6be1
1 /* $Id: win32.h 25676 2013-08-05 20:36:55Z michi_cc $ */
3 /*
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/>.
8 */
10 /** @file win32.h declarations of functions for MS windows systems */
12 #ifndef WIN32_H
13 #define WIN32_H
15 #include <windows.h>
16 bool MyShowCursor(bool show, bool toggle = false);
18 typedef void (*Function)(int);
19 bool LoadLibraryList(Function proc[], const char *dll);
21 char *convert_from_fs(const TCHAR *name, char *utf8_buf, size_t buflen);
22 TCHAR *convert_to_fs(const char *name, TCHAR *utf16_buf, size_t buflen, bool console_cp = false);
24 /* Function shortcuts for UTF-8 <> UNICODE conversion. When unicode is not
25 * defined these macros return the string passed to them, with UNICODE
26 * they return a pointer to the converted string. These functions use an
27 * internal buffer of max 512 characters. */
28 #if defined(UNICODE)
29 # define MB_TO_WIDE(str) OTTD2FS(str)
30 # define WIDE_TO_MB(str) FS2OTTD(str)
31 #else
32 # define MB_TO_WIDE(str) (str)
33 # define WIDE_TO_MB(str) (str)
34 #endif
36 HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR);
38 #if defined(__MINGW32__) && !defined(__MINGW64__)
39 #define SHGFP_TYPE_CURRENT 0
40 #endif /* __MINGW32__ */
42 #ifdef _MSC_VER
43 void SetWin32ThreadName(DWORD dwThreadID, const char* threadName);
44 #else
45 static inline void SetWin32ThreadName(DWORD dwThreadID, const char* threadName) {}
46 #endif
48 #endif /* WIN32_H */