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