tron@2186: /* $Id$ */ tron@2186: belugas@6117: /** @file win32.h declarations of functions for MS windows systems */ belugas@6117: tron@2183: #ifndef WIN32_H tron@2183: #define WIN32_H tron@2183: Darkvater@5304: #include tron@2207: bool MyShowCursor(bool show); tron@2207: tron@2183: typedef void (*Function)(int); Darkvater@5168: bool LoadLibraryList(Function proc[], const char *dll); Darkvater@5168: Darkvater@5218: char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen); Darkvater@5218: wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen); Darkvater@5218: Darkvater@5312: /* Function shortcuts for UTF-8 <> UNICODE conversion. When unicode is not Darkvater@5312: * defined these macros return the string passed to them, with UNICODE Darkvater@5312: * they return a pointer to the converted string. The only difference between Darkvater@5312: * XX_TO_YY and XX_TO_YY_BUFFER is that with the buffer variant you can Darkvater@5312: * specify where to put the converted string (and how long it can be). Without Darkvater@5312: * the buffer and internal buffer is used, of max 512 characters */ Darkvater@5168: #if defined(UNICODE) Darkvater@5218: # define MB_TO_WIDE(str) OTTD2FS(str) Darkvater@5218: # define MB_TO_WIDE_BUFFER(str, buffer, buflen) convert_to_fs(str, buffer, buflen) Darkvater@5218: # define WIDE_TO_MB(str) FS2OTTD(str) Darkvater@5218: # define WIDE_TO_MB_BUFFER(str, buffer, buflen) convert_from_fs(str, buffer, buflen) Darkvater@5168: #else Darkvater@6251: extern uint _codepage; // local code-page in the system @see win32_v.cpp:WM_INPUTLANGCHANGE Darkvater@5218: # define MB_TO_WIDE(str) (str) Darkvater@5218: # define MB_TO_WIDE_BUFFER(str, buffer, buflen) (str) Darkvater@5218: # define WIDE_TO_MB(str) (str) Darkvater@5218: # define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str) Darkvater@5168: #endif tron@2183: Darkvater@5304: /* Override SHGetFolderPath with our custom implementation */ Darkvater@5304: #if defined(SHGetFolderPath) Darkvater@5304: #undef SHGetFolderPath Darkvater@5304: #endif Darkvater@5304: #define SHGetFolderPath OTTDSHGetFolderPath Darkvater@5304: Darkvater@5304: HRESULT OTTDSHGetFolderPath(HWND, int, HANDLE, DWORD, LPTSTR); Darkvater@5304: Darkvater@5222: #if defined(__MINGW32__) Darkvater@5222: #define SHGFP_TYPE_CURRENT 0 Darkvater@5222: #endif /* __MINGW32__ */ Darkvater@5222: Darkvater@2436: #endif /* WIN32_H */