Correct tests involved with processing the LVIF_DI_SETITEM flag.
[wine] / dlls / user / bidi16.c
1 /*
2  * Win16 BiDi functions
3  * Right now, most of these functions do nothing.
4  */
5
6 #include <string.h>
7 #include "winbase.h"
8 #include "wingdi.h"
9 #include "wine/winuser16.h"
10 #include "winerror.h"
11 #include "debugtools.h"
12
13 DEFAULT_DEBUG_CHANNEL(relay);
14
15 /***********************************************************************
16  *              ChangeDialogTemplate   (USER.905)
17  * FIXME: The prototypes of this function have not been found yet.
18  */
19 LONG WINAPI ChangeDialogTemplate16(void) { FIXME("stub (no prototype)\n"); return 0; }
20
21 /***********************************************************************
22  *              BiDiMessageBoxEx   (USER.910)
23  * FIXME: The prototypes of this function have not been found yet.
24  */
25 LONG WINAPI BiDiMessageBoxEx16(void) { FIXME("stub (no prototype)\n"); return 0; }
26
27
28 /******************************************************************************
29  *                    ChangeKeyboardCodePage [USER.924]
30  * Change the keyboard layouts to a new pair.
31  * If the language IDs are set to -1, the language is not to be changed.
32  */
33 DWORD WINAPI ChangeKeyboardCodePage16( UINT16 iLangLeft, UINT16 iLangRight )
34 {
35     FIXME( "( %hu, %hu ): stub\n", iLangLeft, iLangRight );
36     return 0;
37 }
38
39
40 /******************************************************************************
41  *                    ChangeKeyboardLanguage [USER.912]
42  * Change the keyboard layouts to a new pair.
43  *
44  * RETURNS
45  *    The old keyboard layout pair.
46  */
47 DWORD WINAPI ChangeKeyboardLanguage16( UINT16 iLangLeft, UINT iLangRight )
48 {
49     FIXME( "( %hu, %hu ): stub\n", iLangLeft, iLangRight );
50     return 0;
51 }
52
53
54 /******************************************************************************
55  *                    CreateDialogIndirectParamML [USER.916]
56  */
57 HWND16 WINAPI CreateDialogIndirectParamML16( HINSTANCE16 hinstWnd,
58                                              const void * lpvDlgTmp,
59                                              HWND16 hwndOwner,
60                                              DLGPROC16 dlgProc,
61                                              LPARAM lParamInit,
62                                              UINT16 iCodePage, UINT16 iLang,
63                                              LPCSTR lpDlgName,
64                                              HINSTANCE16 hinstLoad )
65 {
66     FIXME( "( %04hx, %p, %04hx, %p, %08lx, %hu, %hu, %p, %04hx ): stub\n",
67            hinstWnd, lpvDlgTmp, hwndOwner, dlgProc, lParamInit,
68            iCodePage, iLang, lpDlgName, hinstLoad );
69     return 0;
70 }
71
72
73 /******************************************************************************
74  *                    DialogBoxIndirectParamML [USER.918]
75  */
76 HWND16 WINAPI DialogBoxIndirectParamML16( HINSTANCE16 hinstWnd,
77                                           HGLOBAL16 hglbDlgTemp,
78                                           HWND16 hwndOwner,
79                                           DLGPROC16 dlgprc,
80                                           LPARAM lParamInit,
81                                           UINT16 iCodePage, UINT16 iLang,
82                                           LPCSTR lpDlgName,
83                                           HINSTANCE16 hinstLoad )
84 {
85     FIXME( "( %04hx, %04hx, %04hx, %p, %08lx, %hu, %hu, %p, %04hx ): stub\n",
86            hinstWnd, hglbDlgTemp, hwndOwner, dlgprc, lParamInit,
87            iCodePage, iLang, lpDlgName, hinstLoad );
88     return 0;
89 }
90
91
92
93 /******************************************************************************
94  *                    FindLanguageResource [USER.923]
95  */
96 HRSRC16 WINAPI FindLanguageResource16( HINSTANCE16 hinst, LPCSTR lpRes,
97                                        LPCSTR lpResType, UINT16 iLang )
98 {
99     FIXME( "( %04hx, %p, %p, %hu ): stub\n", hinst, lpRes, lpResType, iLang );
100     return 0;
101 }
102
103
104 /******************************************************************************
105  *                    GetAppCodePage [USER.915]
106  * Returns the code page and language of the window
107  *
108  * RETURNS
109  *    The low word contains the code page, the high word contains the resource language.
110  */
111 DWORD WINAPI GetAppCodePage16( HWND16 hwnd )
112 {
113     FIXME( "( %04hx ): stub\n", hwnd );
114     return 0;
115 }
116
117
118 /******************************************************************************
119  *                    GetBaseCodePage [USER.922]
120  * Returns the base code page and resource language.
121  * For example, Hebrew windows will return HebrewCodePage in the low word
122  * and English in the high word.
123  */
124 DWORD WINAPI GetBaseCodePage16( void )
125 {
126     FIXME( ": stub\n" );
127     return 0;
128 }
129
130
131
132 /******************************************************************************
133  *                    GetCodePageSystemFont [USER.913]
134  * Returns the stock font for the requested code page.
135  */
136 HFONT16 WINAPI GetCodePageSystemFont16( UINT16 iFont, UINT16 iCodePage )
137 {
138     FIXME( "( %hu, %hu ): stub\n", iFont, iCodePage );
139     return 0;
140 }
141
142
143
144 /******************************************************************************
145  *                    GetLanguageName [USER.907]
146  * Returns the name of one language in (possibly) a different language.
147  * Currently only handles language 0 (english).
148  *
149  * RETURNS
150  *    Success: The number of bytes copied to the buffer, not including the null.
151  *    Failure: 0
152  */
153 UINT WINAPI GetLanguageName16( UINT16 iLang, UINT16 iName,
154                                LPSTR lpszName, UINT16 cbBuffer )
155 {
156     if ( (iLang == 0) && (iName == 0) ) {
157         if ( !lpszName || cbBuffer < 8 ) {
158             SetLastError( ERROR_INVALID_PARAMETER );
159             return 0;
160         }
161         strcpy( lpszName, "English" );
162         return 7;
163     }
164
165     FIXME( "( %hu, %hu, %p, %hu ): No BiDi16\n", iLang, iName, lpszName, cbBuffer );
166     return 0;
167 }
168
169
170 /******************************************************************************
171  *                    GetNumLanguages [USER.906]
172  * Returns the number of languages in the system.
173  */
174 UINT WINAPI GetNumLanguages16( void )
175 {
176     FIXME( ": No Bidi16\n" );
177     return 1;
178 }
179
180
181
182 /******************************************************************************
183  *                    GetProcessDefaultLayout [USER.1001]
184  *
185  * Gets the default layout for parentless windows.
186  * Right now, just returns 0 (left-to-right).
187  *
188  * RETURNS
189  *    Success: Nonzero
190  *    Failure: Zero
191  */
192 BOOL16 WINAPI GetProcessDefaultLayout16( DWORD *pdwDefaultLayout )
193 {
194     FIXME( "( %p ): no BiDi16\n", pdwDefaultLayout );
195     return GetProcessDefaultLayout( pdwDefaultLayout );
196 }
197
198
199 /******************************************************************************
200  *                   LoadLanguageString [USER.919]
201  * Loads a string for a specific language.
202  *
203  * RETURNS
204  *    SUCCESS: The length of the string loaded.
205  *    FAILURE: Zero.
206  */
207 UINT16 WINAPI LoadLanguageString16( HINSTANCE16 hinst, UINT16 id, UINT16 iLang,
208                                     LPSTR lpszText, INT16 nBytes )
209 {
210     FIXME( "( %04hx, %hu, %hu, %p, %hd ): stub\n", hinst, id, iLang, lpszText, nBytes );
211     return 0;
212 }
213
214
215
216 /******************************************************************************
217  *                   LoadSystemLanguageString [USER.902]
218  * Loads a string which is in one of the system language modules.
219  *
220  * RETURNS
221  *    Success: The length of the string loaded
222  *    Failure: Zero
223  */
224 UINT WINAPI LoadSystemLanguageString16( HINSTANCE16 hinstCaller, UINT16 id,
225                                         LPSTR lpszText, INT16 nBytes, UINT16 iLang )
226 {
227     FIXME( "( %04hx, %hu, %p, %hd, %hu ): stub\n", hinstCaller, id, lpszText, nBytes, iLang );
228     return 0;
229 }
230
231
232 /***********************************************************************
233  *           MessageBoxEx [USER.930]
234  * The multilingual version of MessageBox.
235  */
236 INT16 WINAPI MessageBoxEx16( HWND16 hwndParent, LPCSTR lpszText,
237                              LPCSTR lpszTitle, UINT16 fuStyle, UINT16 iLang )
238 {
239     FIXME( "( %04hx, %p, %p, %hu, %hu ): stub\n", hwndParent, lpszText, lpszTitle,
240            fuStyle, iLang );
241     return 0;
242 }
243
244
245 /***********************************************************************
246  *           QueryCodePage   [USER.914]
247  * Query code page specific data.
248  */
249 LRESULT WINAPI QueryCodePage16( UINT16 idxLang, UINT16 msg,
250                                 WPARAM16 wParam, LPARAM lParam )
251 {
252     FIXME( "( %hu, %hu, %04hx, %08lx ): stub\n", idxLang, msg, wParam, lParam );
253     return 0;
254 }
255
256 /***********************************************************************
257  *           SetAppCodePage   [USER.920]
258  * Set the code page and language of the window to new values.
259  *
260  * RETURNS
261  *    The low word contains the old code page, the high word contains
262  *       the old resource language.
263  */
264 DWORD WINAPI SetAppCodePage16( HWND16 hwnd, UINT16 iCodePage, UINT16 iLang,
265                                UINT16 fRedraw )
266 {
267     FIXME( "( %04hx, %hu, %hu, %hu ): stub\n", hwnd, iCodePage, iLang, fRedraw );
268     return 0;
269 }
270
271 /***********************************************************************
272  *           SetDlgItemTextEx   [USER.911]
273  * Sets the title or text of a control in a dialog box.
274  * Currently only works for language 0 (english)
275  */
276 void WINAPI SetDlgItemTextEx16( HWND16 hwnd, INT16 id,
277                                 LPCSTR lpszText, UINT16 iLang )
278 {
279     FIXME( "( %04hx, %hd, %p, %hu ): stub\n", hwnd, id, lpszText, iLang );
280 }
281
282 /******************************************************************************
283  *                    SetProcessDefaultLayout [USER.1000]
284  *
285  * Sets the default layout for parentless windows.
286  * Right now, only accepts 0 (left-to-right).
287  *
288  * RETURNS
289  *    Success: Nonzero
290  *    Failure: Zero
291  */
292 BOOL16 WINAPI SetProcessDefaultLayout16( DWORD dwDefaultLayout )
293 {
294     FIXME( "( %08lx ): No BiDi16\n", dwDefaultLayout );
295     return SetProcessDefaultLayout( dwDefaultLayout );
296 }
297
298 /******************************************************************************
299  *                    SetWindowTextEx [USER.909]
300  * Sets the given window's title to the specified text in the specified language.
301  */
302 void WINAPI SetWindowTextEx16( HWND16 hwnd, LPCSTR lpsz, UINT16 iLang )
303 {
304     FIXME( "( %04hx, %p, %hu ): stub\n", hwnd, lpsz, iLang );
305 }