bidi16.c 10.6 KB
Newer Older
1 2
/*
 * Win16 BiDi functions
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 * Copyright 2000 Erez Volk
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * NOTE: Right now, most of these functions do nothing.
20 21
 */

22
#include <string.h>
23 24
#include "winbase.h"
#include "wingdi.h"
25
#include "wine/winuser16.h"
26
#include "winerror.h"
27
#include "wine/debug.h"
28

29
WINE_DEFAULT_DEBUG_CHANNEL(relay);
30

31
/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
32
 *		ChangeDialogTemplate   (USER.905)
33 34
 * FIXME: The prototypes of this function have not been found yet.
 */
35
LONG WINAPI ChangeDialogTemplate16(void) { FIXME("stub (no prototype)\n"); return 0; }
36 37

/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
38
 *		BiDiMessageBoxEx   (USER.910)
39 40
 * FIXME: The prototypes of this function have not been found yet.
 */
41 42 43 44
LONG WINAPI BiDiMessageBoxEx16(void) { FIXME("stub (no prototype)\n"); return 0; }


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
45
 *                    ChangeKeyboardCodePage [USER.924]
46 47 48 49 50 51 52 53 54 55 56
 * Change the keyboard layouts to a new pair.
 * If the language IDs are set to -1, the language is not to be changed.
 */
DWORD WINAPI ChangeKeyboardCodePage16( UINT16 iLangLeft, UINT16 iLangRight )
{
    FIXME( "( %hu, %hu ): stub\n", iLangLeft, iLangRight );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
57
 *                    ChangeKeyboardLanguage [USER.912]
58 59 60 61 62 63 64 65 66 67 68 69 70
 * Change the keyboard layouts to a new pair.
 *
 * RETURNS
 *    The old keyboard layout pair.
 */
DWORD WINAPI ChangeKeyboardLanguage16( UINT16 iLangLeft, UINT iLangRight )
{
    FIXME( "( %hu, %hu ): stub\n", iLangLeft, iLangRight );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
71
 *                    CreateDialogIndirectParamML [USER.916]
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
 */
HWND16 WINAPI CreateDialogIndirectParamML16( HINSTANCE16 hinstWnd,
                                             const void * lpvDlgTmp,
                                             HWND16 hwndOwner,
                                             DLGPROC16 dlgProc,
                                             LPARAM lParamInit,
                                             UINT16 iCodePage, UINT16 iLang,
                                             LPCSTR lpDlgName,
                                             HINSTANCE16 hinstLoad )
{
    FIXME( "( %04hx, %p, %04hx, %p, %08lx, %hu, %hu, %p, %04hx ): stub\n",
           hinstWnd, lpvDlgTmp, hwndOwner, dlgProc, lParamInit,
           iCodePage, iLang, lpDlgName, hinstLoad );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
90
 *                    DialogBoxIndirectParamML [USER.918]
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
 */
HWND16 WINAPI DialogBoxIndirectParamML16( HINSTANCE16 hinstWnd,
                                          HGLOBAL16 hglbDlgTemp,
                                          HWND16 hwndOwner,
                                          DLGPROC16 dlgprc,
                                          LPARAM lParamInit,
                                          UINT16 iCodePage, UINT16 iLang,
                                          LPCSTR lpDlgName,
                                          HINSTANCE16 hinstLoad )
{
    FIXME( "( %04hx, %04hx, %04hx, %p, %08lx, %hu, %hu, %p, %04hx ): stub\n",
           hinstWnd, hglbDlgTemp, hwndOwner, dlgprc, lParamInit,
           iCodePage, iLang, lpDlgName, hinstLoad );
    return 0;
}



/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
110
 *                    FindLanguageResource [USER.923]
111 112 113 114 115 116 117 118 119 120
 */
HRSRC16 WINAPI FindLanguageResource16( HINSTANCE16 hinst, LPCSTR lpRes,
                                       LPCSTR lpResType, UINT16 iLang )
{
    FIXME( "( %04hx, %p, %p, %hu ): stub\n", hinst, lpRes, lpResType, iLang );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
121
 *                    GetAppCodePage [USER.915]
122 123 124 125 126 127 128 129 130 131 132 133 134
 * Returns the code page and language of the window
 *
 * RETURNS
 *    The low word contains the code page, the high word contains the resource language.
 */
DWORD WINAPI GetAppCodePage16( HWND16 hwnd )
{
    FIXME( "( %04hx ): stub\n", hwnd );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
135
 *                    GetBaseCodePage [USER.922]
136 137 138 139 140 141 142 143 144 145 146 147 148
 * Returns the base code page and resource language.
 * For example, Hebrew windows will return HebrewCodePage in the low word
 * and English in the high word.
 */
DWORD WINAPI GetBaseCodePage16( void )
{
    FIXME( ": stub\n" );
    return 0;
}



/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
149
 *                    GetCodePageSystemFont [USER.913]
150 151 152 153 154 155 156 157 158 159 160
 * Returns the stock font for the requested code page.
 */
HFONT16 WINAPI GetCodePageSystemFont16( UINT16 iFont, UINT16 iCodePage )
{
    FIXME( "( %hu, %hu ): stub\n", iFont, iCodePage );
    return 0;
}



/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
161
 *                    GetLanguageName [USER.907]
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
 * Returns the name of one language in (possibly) a different language.
 * Currently only handles language 0 (english).
 *
 * RETURNS
 *    Success: The number of bytes copied to the buffer, not including the null.
 *    Failure: 0
 */
UINT WINAPI GetLanguageName16( UINT16 iLang, UINT16 iName,
                               LPSTR lpszName, UINT16 cbBuffer )
{
    if ( (iLang == 0) && (iName == 0) ) {
        if ( !lpszName || cbBuffer < 8 ) {
            SetLastError( ERROR_INVALID_PARAMETER );
            return 0;
        }
        strcpy( lpszName, "English" );
        return 7;
    }

    FIXME( "( %hu, %hu, %p, %hu ): No BiDi16\n", iLang, iName, lpszName, cbBuffer );
    return 0;
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
187
 *                    GetNumLanguages [USER.906]
188 189 190 191 192 193 194 195 196 197 198
 * Returns the number of languages in the system.
 */
UINT WINAPI GetNumLanguages16( void )
{
    FIXME( ": No Bidi16\n" );
    return 1;
}



/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
199
 *                    GetProcessDefaultLayout [USER.1001]
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
 *
 * Gets the default layout for parentless windows.
 * Right now, just returns 0 (left-to-right).
 *
 * RETURNS
 *    Success: Nonzero
 *    Failure: Zero
 */
BOOL16 WINAPI GetProcessDefaultLayout16( DWORD *pdwDefaultLayout )
{
    FIXME( "( %p ): no BiDi16\n", pdwDefaultLayout );
    return GetProcessDefaultLayout( pdwDefaultLayout );
}


/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
216
 *                   LoadLanguageString [USER.919]
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
 * Loads a string for a specific language.
 *
 * RETURNS
 *    SUCCESS: The length of the string loaded.
 *    FAILURE: Zero.
 */
UINT16 WINAPI LoadLanguageString16( HINSTANCE16 hinst, UINT16 id, UINT16 iLang,
                                    LPSTR lpszText, INT16 nBytes )
{
    FIXME( "( %04hx, %hu, %hu, %p, %hd ): stub\n", hinst, id, iLang, lpszText, nBytes );
    return 0;
}



/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
233
 *                   LoadSystemLanguageString [USER.902]
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
 * Loads a string which is in one of the system language modules.
 *
 * RETURNS
 *    Success: The length of the string loaded
 *    Failure: Zero
 */
UINT WINAPI LoadSystemLanguageString16( HINSTANCE16 hinstCaller, UINT16 id,
                                        LPSTR lpszText, INT16 nBytes, UINT16 iLang )
{
    FIXME( "( %04hx, %hu, %p, %hd, %hu ): stub\n", hinstCaller, id, lpszText, nBytes, iLang );
    return 0;
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
249
 *           MessageBoxEx [USER.930]
250 251 252 253 254 255 256 257 258 259 260 261
 * The multilingual version of MessageBox.
 */
INT16 WINAPI MessageBoxEx16( HWND16 hwndParent, LPCSTR lpszText,
                             LPCSTR lpszTitle, UINT16 fuStyle, UINT16 iLang )
{
    FIXME( "( %04hx, %p, %p, %hu, %hu ): stub\n", hwndParent, lpszText, lpszTitle,
           fuStyle, iLang );
    return 0;
}


/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
262
 *           QueryCodePage   [USER.914]
263 264 265 266 267 268 269 270 271 272
 * Query code page specific data.
 */
LRESULT WINAPI QueryCodePage16( UINT16 idxLang, UINT16 msg,
                                WPARAM16 wParam, LPARAM lParam )
{
    FIXME( "( %hu, %hu, %04hx, %08lx ): stub\n", idxLang, msg, wParam, lParam );
    return 0;
}

/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
273
 *           SetAppCodePage   [USER.920]
274 275 276 277 278 279 280 281 282 283 284 285 286 287
 * Set the code page and language of the window to new values.
 *
 * RETURNS
 *    The low word contains the old code page, the high word contains
 *       the old resource language.
 */
DWORD WINAPI SetAppCodePage16( HWND16 hwnd, UINT16 iCodePage, UINT16 iLang,
                               UINT16 fRedraw )
{
    FIXME( "( %04hx, %hu, %hu, %hu ): stub\n", hwnd, iCodePage, iLang, fRedraw );
    return 0;
}

/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
288
 *           SetDlgItemTextEx   [USER.911]
289 290 291 292 293 294 295 296 297 298
 * Sets the title or text of a control in a dialog box.
 * Currently only works for language 0 (english)
 */
void WINAPI SetDlgItemTextEx16( HWND16 hwnd, INT16 id,
                                LPCSTR lpszText, UINT16 iLang )
{
    FIXME( "( %04hx, %hd, %p, %hu ): stub\n", hwnd, id, lpszText, iLang );
}

/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
299
 *                    SetProcessDefaultLayout [USER.1000]
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
 *
 * Sets the default layout for parentless windows.
 * Right now, only accepts 0 (left-to-right).
 *
 * RETURNS
 *    Success: Nonzero
 *    Failure: Zero
 */
BOOL16 WINAPI SetProcessDefaultLayout16( DWORD dwDefaultLayout )
{
    FIXME( "( %08lx ): No BiDi16\n", dwDefaultLayout );
    return SetProcessDefaultLayout( dwDefaultLayout );
}

/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
315
 *                    SetWindowTextEx [USER.909]
316 317 318 319 320 321
 * Sets the given window's title to the specified text in the specified language.
 */
void WINAPI SetWindowTextEx16( HWND16 hwnd, LPCSTR lpsz, UINT16 iLang )
{
    FIXME( "( %04hx, %p, %hu ): stub\n", hwnd, lpsz, iLang );
}