OpenTTD
win32.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
10 #ifndef WIN32_H
11 #define WIN32_H
12 
13 #include <windows.h>
14 bool MyShowCursor(bool show, bool toggle = false);
15 
16 typedef void (*Function)(int);
17 bool LoadLibraryList(Function proc[], const char *dll);
18 
19 char *convert_from_fs(const TCHAR *name, char *utf8_buf, size_t buflen);
20 TCHAR *convert_to_fs(const char *name, TCHAR *utf16_buf, size_t buflen, bool console_cp = false);
21 
22 /* Function shortcuts for UTF-8 <> UNICODE conversion. When unicode is not
23  * defined these macros return the string passed to them, with UNICODE
24  * they return a pointer to the converted string. These functions use an
25  * internal buffer of max 512 characters. */
26 #if defined(UNICODE)
27 # define MB_TO_WIDE(str) OTTD2FS(str)
28 # define WIDE_TO_MB(str) FS2OTTD(str)
29 #else
30 # define MB_TO_WIDE(str) (str)
31 # define WIDE_TO_MB(str) (str)
32 #endif
33 
34 HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR);
35 
36 #if defined(__MINGW32__) && !defined(__MINGW64__)
37 #define SHGFP_TYPE_CURRENT 0
38 #endif /* __MINGW32__ */
39 
40 void Win32SetCurrentLocaleName(const char *iso_code);
41 int OTTDStringCompare(const char *s1, const char *s2);
42 
43 #endif /* WIN32_H */
TCHAR * convert_to_fs(const char *name, TCHAR *utf16_buf, size_t buflen, bool console_cp=false)
Convert from OpenTTD&#39;s encoding to that of the environment in UNICODE.
Definition: win32.cpp:625
bool LoadLibraryList(Function proc[], const char *dll)
Helper function needed by dynamically loading libraries XXX: Hurray for MS only having an ANSI GetPro...
Definition: win32.cpp:56
HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR)
Our very own SHGetFolderPath function for support of windows operating systems that don&#39;t have this f...
Definition: win32.cpp:653
char * convert_from_fs(const TCHAR *name, char *utf8_buf, size_t buflen)
Convert to OpenTTD&#39;s encoding from that of the environment in UNICODE.
Definition: win32.cpp:591