[IPLUG/EXAMPLES] IPlugResampler: qualification of min no longer needed
[wdl/wdl-ol.git] / WDL / win32_utf8.h
blob091c9bbdd381fe92cdaebbe8681021a581e70874
1 #ifndef _WDL_WIN32_UTF8_H_
2 #define _WDL_WIN32_UTF8_H_
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #if defined(_WIN32) && !defined(WDL_NO_SUPPORT_UTF8)
10 #ifndef WDL_WIN32_UTF8_IMPL
11 #define WDL_WIN32_UTF8_IMPL
12 #define WDL_WIN32_UTF8_IMPL_NOTSTATIC
13 #endif
15 #include <windows.h>
16 #include <sys/stat.h>
17 #include <stdio.h>
19 WDL_WIN32_UTF8_IMPL BOOL SetWindowTextUTF8(HWND hwnd, LPCTSTR str);
20 WDL_WIN32_UTF8_IMPL BOOL SetDlgItemTextUTF8(HWND hDlg, int nIDDlgItem, LPCTSTR lpString);
21 WDL_WIN32_UTF8_IMPL int GetWindowTextUTF8(HWND hWnd, LPTSTR lpString, int nMaxCount);
22 WDL_WIN32_UTF8_IMPL UINT GetDlgItemTextUTF8(HWND hDlg, int nIDDlgItem, LPTSTR lpString, int nMaxCount);
23 WDL_WIN32_UTF8_IMPL int MessageBoxUTF8(HWND hwnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT fl);
25 WDL_WIN32_UTF8_IMPL BOOL CreateDirectoryUTF8(LPCTSTR path, LPSECURITY_ATTRIBUTES attr);
26 WDL_WIN32_UTF8_IMPL BOOL DeleteFileUTF8(LPCTSTR path);
27 WDL_WIN32_UTF8_IMPL BOOL MoveFileUTF8(LPCTSTR existfn, LPCTSTR newfn);
28 WDL_WIN32_UTF8_IMPL BOOL CopyFileUTF8(LPCTSTR existfn, LPCTSTR newfn, BOOL fie);
29 WDL_WIN32_UTF8_IMPL DWORD GetCurrentDirectoryUTF8(DWORD nBufferLength, LPTSTR lpBuffer);
30 WDL_WIN32_UTF8_IMPL BOOL SetCurrentDirectoryUTF8(LPCTSTR path);
31 WDL_WIN32_UTF8_IMPL BOOL RemoveDirectoryUTF8(LPCTSTR path);
32 WDL_WIN32_UTF8_IMPL HINSTANCE LoadLibraryUTF8(LPCTSTR path);
34 WDL_WIN32_UTF8_IMPL HANDLE CreateFileUTF8(LPCTSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
36 WDL_WIN32_UTF8_IMPL int DragQueryFileUTF8(HDROP hDrop, int idx, char *buf, int bufsz);
38 WDL_WIN32_UTF8_IMPL int DrawTextUTF8(HDC hdc, LPCTSTR str, int nc, LPRECT lpRect, UINT format);
40 WDL_WIN32_UTF8_IMPL BOOL GetOpenFileNameUTF8(LPOPENFILENAME lpofn);
41 WDL_WIN32_UTF8_IMPL BOOL GetSaveFileNameUTF8(LPOPENFILENAME lpofn);
44 WDL_WIN32_UTF8_IMPL HINSTANCE ShellExecuteUTF8(HWND hwnd, LPCTSTR lpOp, LPCTSTR lpFile, LPCTSTR lpParm, LPCTSTR lpDir, INT nShowCmd);
46 WDL_WIN32_UTF8_IMPL BOOL InsertMenuUTF8(HMENU hMenu, UINT uPosition, UINT uFlags, UINT_PTR uIDNewItem, LPCTSTR str);
47 WDL_WIN32_UTF8_IMPL BOOL InsertMenuItemUTF8( HMENU hMenu,UINT uItem, BOOL fByPosition, LPMENUITEMINFO lpmii);
48 WDL_WIN32_UTF8_IMPL BOOL SetMenuItemInfoUTF8(HMENU hMenu, UINT uItem, BOOL fByPosition,LPMENUITEMINFO lpmii);
49 WDL_WIN32_UTF8_IMPL BOOL GetMenuItemInfoUTF8(HMENU hMenu, UINT uItem,BOOL fByPosition,LPMENUITEMINFO lpmii);
51 WDL_WIN32_UTF8_IMPL int statUTF8(const char *filename, struct stat *buffer);
52 WDL_WIN32_UTF8_IMPL FILE *fopenUTF8(const char *filename, const char *mode);
55 WDL_WIN32_UTF8_IMPL WCHAR *WDL_UTF8ToWC(const char *buf, BOOL doublenull, int minsize, DWORD *sizeout);
57 WDL_WIN32_UTF8_IMPL BOOL WDL_HasUTF8(const char *_str);
59 WDL_WIN32_UTF8_IMPL void WDL_UTF8_HookComboBox(HWND h);
60 WDL_WIN32_UTF8_IMPL void WDL_UTF8_HookListView(HWND h);
61 WDL_WIN32_UTF8_IMPL void WDL_UTF8_HookListBox(HWND h);
62 WDL_WIN32_UTF8_IMPL void WDL_UTF8_HookTreeView(HWND h);
63 WDL_WIN32_UTF8_IMPL void WDL_UTF8_HookTabCtrl(HWND h);
65 WDL_WIN32_UTF8_IMPL LPSTR GetCommandParametersUTF8();
66 WDL_WIN32_UTF8_IMPL void WDL_UTF8_ListViewConvertDispInfoToW(void *di); //NMLVDISPINFO
68 #ifdef SetWindowText
69 #undef SetWindowText
70 #endif
71 #define SetWindowText SetWindowTextUTF8
73 #ifdef SetDlgItemText
74 #undef SetDlgItemText
75 #endif
76 #define SetDlgItemText SetDlgItemTextUTF8
79 #ifdef GetWindowText
80 #undef GetWindowText
81 #endif
82 #define GetWindowText GetWindowTextUTF8
84 #ifdef GetDlgItemText
85 #undef GetDlgItemText
86 #endif
87 #define GetDlgItemText GetDlgItemTextUTF8
89 #ifdef MessageBox
90 #undef MessageBox
91 #endif
92 #define MessageBox MessageBoxUTF8
94 #ifdef DragQueryFile
95 #undef DragQueryFile
96 #endif
97 #define DragQueryFile DragQueryFileUTF8
99 #ifdef GetOpenFileName
100 #undef GetOpenFileName
101 #endif
102 #define GetOpenFileName GetOpenFileNameUTF8
104 #ifdef GetSaveFileName
105 #undef GetSaveFileName
106 #endif
107 #define GetSaveFileName GetSaveFileNameUTF8
109 #ifdef ShellExecute
110 #undef ShellExecute
111 #endif
112 #define ShellExecute ShellExecuteUTF8
115 #ifdef CreateDirectory
116 #undef CreateDirectory
117 #endif
118 #define CreateDirectory CreateDirectoryUTF8
120 #ifdef DeleteFile
121 #undef DeleteFile
122 #endif
123 #define DeleteFile DeleteFileUTF8
125 #ifdef MoveFile
126 #undef MoveFile
127 #endif
128 #define MoveFile MoveFileUTF8
130 #ifdef CopyFile
131 #undef CopyFile
132 #endif
133 #define CopyFile CopyFileUTF8
135 #ifdef GetCurrentDirectory
136 #undef GetCurrentDirectory
137 #endif
138 #define GetCurrentDirectory GetCurrentDirectoryUTF8
140 #ifdef SetCurrentDirectory
141 #undef SetCurrentDirectory
142 #endif
143 #define SetCurrentDirectory SetCurrentDirectoryUTF8
146 #ifdef RemoveDirectory
147 #undef RemoveDirectory
148 #endif
149 #define RemoveDirectory RemoveDirectoryUTF8
152 #ifdef CreateFile
153 #undef CreateFile
154 #endif
155 #define CreateFile CreateFileUTF8
158 #ifdef InsertMenu
159 #undef InsertMenu
160 #endif
161 #define InsertMenu InsertMenuUTF8
163 #ifdef InsertMenuItem
164 #undef InsertMenuItem
165 #endif
166 #define InsertMenuItem InsertMenuItemUTF8
168 #ifdef SetMenuItemInfo
169 #undef SetMenuItemInfo
170 #endif
171 #define SetMenuItemInfo SetMenuItemInfoUTF8
173 #ifdef GetMenuItemInfo
174 #undef GetMenuItemInfo
175 #endif
176 #define GetMenuItemInfo GetMenuItemInfoUTF8
178 #ifdef LoadLibrary
179 #undef LoadLibrary
180 #endif
181 #define LoadLibrary LoadLibraryUTF8
183 #else
185 // compat defines for when UTF disabled
186 #define DrawTextUTF8 DrawText
187 #define statUTF8 stat
188 #define fopenUTF8 fopen
189 #define WDL_UTF8_HookComboBox(x)
190 #define WDL_UTF8_HookListView(x)
191 #define WDL_UTF8_HookListBox(x)
192 #define WDL_UTF8_HookTreeView(x)
193 #define WDL_UTF8_HookTabCtrl(x)
194 #define WDL_UTF8_ListViewConvertDispInfoToW(x)
196 #endif
198 #ifdef __cplusplus
200 #endif
202 #endif