Changeset 1704


Ignore:
Timestamp:
Nov 11, 1999, 2:17:33 PM (25 years ago)
Author:
sandervl
Message:

dlg fix, keyboard additions, + misc other things

Location:
trunk/src/user32
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/dc.cpp

    r1688 r1704  
    1 /* $Id: dc.cpp,v 1.20 1999-11-10 14:16:44 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.21 1999-11-11 13:17:29 sandervl Exp $ */
    22
    33/*
     
    875875   if (hwnd == NULLHANDLE)
    876876   {
     877#if 1
     878        // Don't do this for now (causes lots of desktop repaints in WordPad)
     879         O32_SetLastError (ERROR_INVALID_PARAMETER);
     880         return FALSE;
     881#else
    877882      hwnd = HWND_DESKTOP;
    878883      wnd  = Win32BaseWindow::GetWindowFromOS2Handle(OSLIB_HWND_DESKTOP);
     
    885890         return FALSE;
    886891      }
    887 
     892#endif
    888893   }
    889894   else
     
    14151420//******************************************************************************
    14161421//******************************************************************************
     1422INT WIN32API ExcludeUpdateRgn( HDC hDC, HWND  hWnd)
     1423{
     1424    dprintf(("USER32:  ExcludeUpdateRgn\n"));
     1425    hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
     1426
     1427    return O32_ExcludeUpdateRgn(hDC,hWnd);
     1428}
     1429//******************************************************************************
     1430//******************************************************************************
  • TabularUnified trunk/src/user32/dc.h

    r1550 r1704  
    1 /* $Id: dc.h,v 1.7 1999-11-02 19:13:00 sandervl Exp $ */
     1/* $Id: dc.h,v 1.8 1999-11-11 13:17:29 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    332332}
    333333
     334BOOL    OPEN32API _O32_ExcludeUpdateRgn( HDC, HWND );
     335
     336inline BOOL O32_ExcludeUpdateRgn(HDC a, HWND b)
     337{
     338 BOOL yyrc;
     339 USHORT sel = RestoreOS2FS();
     340
     341    yyrc = _O32_ExcludeUpdateRgn(a, b);
     342    SetFS(sel);
     343
     344    return yyrc;
     345}
     346
    334347BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
    335348
  • TabularUnified trunk/src/user32/oslibwin.cpp

    r1693 r1704  
    1 /* $Id: oslibwin.cpp,v 1.43 1999-11-10 17:11:29 cbratschi Exp $ */
     1/* $Id: oslibwin.cpp,v 1.44 1999-11-11 13:17:29 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    11641164//******************************************************************************
    11651165//******************************************************************************
     1166BOOL OSLibWinGetKeyboardStateTable(unsigned char *PMKeyState)
     1167{
     1168  return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)&PMKeyState, FALSE );
     1169}
     1170//******************************************************************************
     1171//******************************************************************************
     1172BOOL OSLibWinSetKeyboardStateTable(unsigned char *PMKeyState)
     1173{
     1174  return WinSetKeyboardStateTable(HWND_DESKTOP, (PBYTE)&PMKeyState, TRUE );
     1175}
     1176//******************************************************************************
     1177//******************************************************************************
  • TabularUnified trunk/src/user32/oslibwin.h

    r1693 r1704  
    1 /* $Id: oslibwin.h,v 1.24 1999-11-10 17:11:29 cbratschi Exp $ */
     1/* $Id: oslibwin.h,v 1.25 1999-11-11 13:17:30 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    281281BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y);
    282282
     283BOOL  OSLibWinGetKeyboardStateTable(unsigned char * PMKeyState);
     284BOOL  OSLibWinSetKeyboardStateTable(unsigned char * PMKeyState);
     285
    283286#endif //__OSLIBWIN_H__
  • TabularUnified trunk/src/user32/pmframe.cpp

    r1693 r1704  
    1 /* $Id: pmframe.cpp,v 1.22 1999-11-10 17:11:29 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.23 1999-11-11 13:17:30 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    312312        goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken
    313313    }
    314 
     314       
    315315    case WM_WINDOWPOSCHANGED:
    316316    {
  • TabularUnified trunk/src/user32/user32.cpp

    r1671 r1704  
    1 /* $Id: user32.cpp,v 1.52 1999-11-09 19:23:16 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.53 1999-11-11 13:17:30 sandervl Exp $ */
    22
    33/*
     
    10381038/* Help Functions */
    10391039
    1040 DWORD WIN32API GetWindowContextHelpId(HWND hwnd)
    1041 {
    1042 #ifdef DEBUG
    1043   WriteLog("USER32:  GetWindowContextHelpId, not implemented\n");
    1044 #endif
    1045   hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    1046 
    1047   return(0);
    1048 }
    1049 //******************************************************************************
    1050 //******************************************************************************
    1051 BOOL WIN32API SetWindowContextHelpId(HWND hwnd, DWORD dwContextHelpId)
    1052 {
    1053 #ifdef DEBUG
    1054   WriteLog("USER32:  SetWindowContextHelpId, not implemented\n");
    1055 #endif
    1056   hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    1057 
    1058   return(TRUE);
    1059 }
    1060 //******************************************************************************
    1061 //******************************************************************************
    10621040BOOL WIN32API WinHelpA( HWND hwnd, LPCSTR lpszHelp, UINT uCommand, DWORD  dwData)
    10631041{
     
    11231101{
    11241102  return (GetOEMCP());
    1125 }
    1126 /*****************************************************************************
    1127  * Name      : BOOL WIN32API GetKeyboardLayoutNameA
    1128  * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
    1129  *             active keyboard layout.
    1130  * Parameters: LPTSTR pwszKLID address of buffer for layout name
    1131  * Variables :
    1132  * Result    : If the function succeeds, the return value is TRUE.
    1133  *             If the function fails, the return value is FALSE. To get extended
    1134  *               error information, call GetLastError.
    1135  * Remark    :
    1136  * Status    : UNTESTED STUB
    1137  *
    1138  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1139  *****************************************************************************/
    1140 // @@@PH Win32 BOOL's are casted to INTs
    1141 INT WIN32API GetKeyboardLayoutNameA(LPTSTR pwszKLID)
    1142 {
    1143   dprintf(("USER32:GetKeyboardLayoutNameA (%08x) not implemented.",
    1144          pwszKLID));
    1145 
    1146   return(FALSE);
    1147 }
    1148 //******************************************************************************
    1149 //******************************************************************************
    1150 int WIN32API GetKeyboardLayoutList(int nBuff, HKL *lpList)
    1151 {
    1152   dprintf(("USER32:  GetKeyboardLayoutList, not implemented\n"));
    1153   return(0);
    1154 }
    1155 //******************************************************************************
    1156 //******************************************************************************
    1157 HKL WIN32API GetKeyboardLayout(DWORD dwLayout)
    1158 {
    1159 #ifdef DEBUG
    1160   WriteLog("USER32:  GetKeyboardLayout, not implemented\n");
    1161 #endif
    1162   return(0);
    1163 }
    1164 /*****************************************************************************
    1165  * Name      : BOOL WIN32API GetKeyboardLayoutNameW
    1166  * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
    1167  *             active keyboard layout.
    1168  * Parameters: LPTSTR pwszKLID address of buffer for layout name
    1169  * Variables :
    1170  * Result    : If the function succeeds, the return value is TRUE.
    1171  *             If the function fails, the return value is FALSE. To get extended
    1172  *               error information, call GetLastError.
    1173  * Remark    :
    1174  * Status    : UNTESTED STUB
    1175  *
    1176  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1177  *****************************************************************************/
    1178 // @@@PH Win32 BOOL's are casted to INTs
    1179 INT WIN32API GetKeyboardLayoutNameW(LPWSTR pwszKLID)
    1180 {
    1181   dprintf(("USER32:GetKeyboardLayoutNameW (%08x) not implemented.",
    1182          pwszKLID));
    1183 
    1184   return(FALSE);
    1185 }
    1186 //******************************************************************************
    1187 //******************************************************************************
    1188 BOOL WIN32API GetKeyboardState(PBYTE lpKeyState)
    1189 {
    1190 #ifdef DEBUG
    1191   WriteLog("USER32:  GetKeyboardState, not properly implemented\n");
    1192 #endif
    1193   memset(lpKeyState, 0, 256);
    1194   return(TRUE);
    11951103}
    11961104//******************************************************************************
     
    14091317#endif
    14101318  hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    1411   return(TRUE);
    1412 }
    1413 //******************************************************************************
    1414 //******************************************************************************
    1415 BOOL WIN32API SetKeyboardState(PBYTE lpKeyState)
    1416 {
    1417 #ifdef DEBUG
    1418   WriteLog("USER32:  SetKeyboardState, not implemented\n");
    1419 #endif
    14201319  return(TRUE);
    14211320}
     
    17131612  return (FALSE);
    17141613}
    1715 //******************************************************************************
    1716 //******************************************************************************
    1717 HWND WIN32API GetForegroundWindow(void)
    1718 {
    1719 #ifdef DEBUG
    1720     WriteLog("USER32:  GetForegroundWindow\n");
    1721 #endif
    1722     return Win32Window::OS2ToWin32Handle(O32_GetForegroundWindow());
    1723 }
    1724 //******************************************************************************
    1725 //******************************************************************************
    1726 HWND WIN32API GetLastActivePopup( HWND hWnd)
    1727 {
    1728 #ifdef DEBUG
    1729     WriteLog("USER32:  GetLastActivePopup\n");
    1730 #endif
    1731     hWnd = Win32Window::Win32ToOS2Handle(hWnd);
    1732 
    1733     return Win32Window::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd));
    1734 }
    1735 //******************************************************************************
    1736 //******************************************************************************
    1737 DWORD WIN32API GetWindowThreadProcessId(HWND hWnd, PDWORD  lpdwProcessId)
    1738 {
    1739 #ifdef DEBUG
    1740     WriteLog("USER32:  GetWindowThreadProcessId\n");
    1741 #endif
    1742     hWnd = Win32Window::Win32ToOS2Handle(hWnd);
    1743 
    1744     return O32_GetWindowThreadProcessId(hWnd,lpdwProcessId);
    1745 }
    1746 
    1747 /* Painting and Drawing Functions */
    1748 
    1749 INT WIN32API ExcludeUpdateRgn( HDC hDC, HWND  hWnd)
    1750 {
    1751 #ifdef DEBUG
    1752     WriteLog("USER32:  ExcludeUpdateRgn\n");
    1753 #endif
    1754     hWnd = Win32Window::Win32ToOS2Handle(hWnd);
    1755 
    1756     return O32_ExcludeUpdateRgn(hDC,hWnd);
    1757 }
     1614
    17581615//******************************************************************************
    17591616//******************************************************************************
  • TabularUnified trunk/src/user32/win32dlg.cpp

    r1622 r1704  
    1 /* $Id: win32dlg.cpp,v 1.32 1999-11-05 17:50:30 achimha Exp $ */
     1/* $Id: win32dlg.cpp,v 1.33 1999-11-11 13:17:31 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    8585        }
    8686    }
     87
     88    //Set help id
     89    setWindowContextHelpId(dlgInfo.helpId);
    8790
    8891    /* Create dialog main window */
     
    209212        }
    210213    }
    211 
    212 //TODO:
    213 //    wndPtr->helpContext = helpId;
    214214
    215215    if (hUserFont)
     
    10211021    LONG oldval;
    10221022
     1023    dprintf2(("Win32Dialog::SetWindowLongA %x %d %x", getWindowHandle(), index, value));
    10231024    switch(index)
    10241025    {
    10251026    case DWL_DLGPROC:
    10261027        oldval = (LONG)Win32DlgProc;
    1027         Win32DlgProc = (DLGPROC)index;
     1028        Win32DlgProc = (DLGPROC)value;
    10281029        return oldval;
    10291030    case DWL_MSGRESULT:
     
    10431044ULONG Win32Dialog::GetWindowLongA(int index)
    10441045{
     1046    dprintf2(("Win32Dialog::GetWindowLongA %x %d", getWindowHandle(), index));
    10451047    switch(index)
    10461048    {
  • TabularUnified trunk/src/user32/win32wbase.cpp

    r1694 r1704  
    1 /* $Id: win32wbase.cpp,v 1.80 1999-11-10 20:02:48 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.81 1999-11-11 13:17:31 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    173173  windowId         = 0xFFFFFFFF;        //default = -1
    174174  userData         = 0;
     175  contextHelpId    = 0;
    175176
    176177  pOldFrameProc = NULL;
     
    11511152
    11521153    if(ISMOUSE_CAPTURED()) {
    1153         POINT point = {x,y};
     1154        POINT point = {x,y};
    11541155
    11551156        MapWindowPoints(getWindowHandle(), HWND_DESKTOP, &point, 1);
    1156         if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, point.x, point.y, keystate))
    1157                 return 0;
     1157        if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, point.x, point.y, keystate))
     1158            return 0;
    11581159    }
    11591160
     
    26922693 LONG oldval;
    26932694
    2694    switch(index) {
     2695    dprintf2(("SetWindowLongA %x %d %x", getWindowHandle(), index, value));
     2696    switch(index) {
    26952697        case GWL_EXSTYLE:
    26962698        {
     
    27522754                SetLastError(ERROR_INVALID_PARAMETER);
    27532755                return 0;
    2754    }
     2756    }
    27552757}
    27562758//******************************************************************************
     
    27582760ULONG Win32BaseWindow::GetWindowLongA(int index)
    27592761{
    2760    switch(index) {
     2762    dprintf2(("GetWindowLongA %x %d", getWindowHandle(), index));
     2763    switch(index) {
    27612764        case GWL_EXSTYLE:
    27622765                return dwExStyle;
     
    27832786                SetLastError(ERROR_INVALID_PARAMETER);
    27842787                return 0;
    2785    }
     2788    }
    27862789}
    27872790//******************************************************************************
     
    28382841 Win32BaseWindow *win32wnd;
    28392842 DWORD        magic;
     2843
     2844  if(hwnd == OSLIB_HWND_DESKTOP)
     2845  {
     2846    return windowDesktop;
     2847  }
    28402848
    28412849  win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
  • TabularUnified trunk/src/user32/win32wbase.h

    r1693 r1704  
    1 /* $Id: win32wbase.h,v 1.42 1999-11-10 17:11:31 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.43 1999-11-11 13:17:32 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    107107         HWND   getOS2FrameWindowHandle()       { return OS2HwndFrame; };
    108108 Win32WndClass *getWindowClass()                { return windowClass; };
     109
     110         DWORD  getWindowContextHelpId()        { return contextHelpId; };
     111         void   setWindowContextHelpId(DWORD id){ contextHelpId = id; };
    109112
    110113         BOOL   isFrameWindow();
     
    268271         HWND   hwndLinkAfter;
    269272        DWORD   flags;
     273        DWORD   contextHelpId;
    270274        LONG    lastHitTestVal;         //Last value returned by WM_NCHITTEST handler
    271275
  • TabularUnified trunk/src/user32/window.cpp

    r1606 r1704  
    1 /* $Id: window.cpp,v 1.33 1999-11-05 09:16:22 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.34 1999-11-11 13:17:32 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    11411141{
    11421142    dprintf(("USER32:  ChildWindowFromPoint\n"));
    1143 //    return O32_ChildWindowFromPoint(arg1, arg2);
    11441143    return ChildWindowFromPointEx(hwnd, pt, 0);
    11451144}
     
    13041303  return (0);
    13051304}
    1306 /*****************************************************************************
    1307  * Name      : BOOL WIN32API SwitchToThisWindow
    1308  * Purpose   : Unknown
    1309  * Parameters: Unknown
    1310  * Variables :
    1311  * Result    :
    1312  * Remark    :
    1313  * Status    : UNTESTED UNKNOWN STUB
    1314  *
    1315  * Author    : Patrick Haller [Wed, 1998/06/16 11:55]
    1316  *****************************************************************************/
    1317 
    1318 BOOL WIN32API SwitchToThisWindow(HWND hwnd,
    1319                                  BOOL x2)
    1320 {
    1321   dprintf(("USER32: SwitchToThisWindow(%08xh,%08xh) not implemented.\n",
    1322            hwnd,
    1323            x2));
    1324 
    1325   return (FALSE); /* default */
     1305/***********************************************************************
     1306 *             SwitchToThisWindow   (USER32.539)
     1307 */
     1308DWORD WINAPI SwitchToThisWindow( HWND hwnd, BOOL restore )
     1309{
     1310    return ShowWindow( hwnd, restore ? SW_RESTORE : SW_SHOWMINIMIZED );
    13261311}
    13271312//******************************************************************************
     
    14331418BOOL WIN32API OpenIcon(HWND hwnd)
    14341419{
    1435 #ifdef DEBUG
    1436   WriteLog("USER32:  OpenIcon\n");
    1437 #endif
     1420  dprintf(("USER32:  OpenIcon"));
     1421
    14381422  if(!IsIconic(hwnd))
    14391423        return FALSE;
     
    14501434//******************************************************************************
    14511435//******************************************************************************
    1452 
     1436HWND WIN32API GetForegroundWindow(void)
     1437{
     1438    dprintf(("USER32:  GetForegroundWindow"));
     1439    return Win32BaseWindow::OS2ToWin32Handle(O32_GetForegroundWindow());
     1440}
     1441//******************************************************************************
     1442//******************************************************************************
     1443HWND WIN32API GetLastActivePopup( HWND hWnd)
     1444{
     1445    dprintf(("USER32:  GetLastActivePopup"));
     1446    hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
     1447
     1448    return Win32BaseWindow::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd));
     1449}
     1450//******************************************************************************
     1451//******************************************************************************
     1452DWORD WIN32API GetWindowThreadProcessId(HWND hWnd, PDWORD  lpdwProcessId)
     1453{
     1454    dprintf(("USER32:  GetWindowThreadProcessId"));
     1455    hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
     1456
     1457    return O32_GetWindowThreadProcessId(hWnd,lpdwProcessId);
     1458}
     1459//******************************************************************************
     1460//******************************************************************************
     1461DWORD WIN32API GetWindowContextHelpId(HWND hwnd)
     1462{
     1463  dprintf(("USER32:  GetWindowContextHelpId, not implemented\n"));
     1464  hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
     1465
     1466  return(0);
     1467}
     1468//******************************************************************************
     1469//******************************************************************************
     1470BOOL WIN32API SetWindowContextHelpId(HWND hwnd, DWORD dwContextHelpId)
     1471{
     1472  dprintf(("USER32:  SetWindowContextHelpId, not implemented"));
     1473  hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);
     1474
     1475  return(TRUE);
     1476}
     1477//******************************************************************************
     1478//******************************************************************************
  • TabularUnified trunk/src/user32/windowword.cpp

    r1333 r1704  
    1 /* $Id: windowword.cpp,v 1.2 1999-10-17 12:17:46 cbratschi Exp $ */
     1/* $Id: windowword.cpp,v 1.3 1999-11-11 13:17:33 sandervl Exp $ */
    22
    33/*
     
    2525    {
    2626      return window->SetWindowLongA(nIndex,lNewLong);
    27     } else
     27    }
     28    else
    2829    {
    2930      if (nIndex == GWL_WNDPROC && !Win32BaseWindow::GetWindowFromOS2Handle(hwnd))
     
    4748
    4849        return (LONG)window->getOldWndProc();
    49       } else dprintf(("SetWindowLongA; window %x not found!", hwnd));
     50      }
     51      else dprintf(("SetWindowLongA; window %x not found!", hwnd));
    5052    }
    5153    return 0;
     
    6163    {
    6264      return window->SetWindowLongA(nIndex,lNewLong);
    63     } else
     65    }
     66    else
    6467    {
    6568      if (nIndex == GWL_WNDPROC && !Win32BaseWindow::GetWindowFromOS2Handle(hwnd))
     
    8386
    8487        return (LONG)window->getOldWndProc();
    85       } else dprintf(("SetWindowLongW; window %x not found!", hwnd));
     88      }
     89      else dprintf(("SetWindowLongW; window %x not found!", hwnd));
    8690    }
    8791    return 0;
     
    96100    if(window)
    97101    {
    98     return window->GetWindowWord(nIndex);
     102        return window->GetWindowWord(nIndex);
    99103    }
    100104    else
    101105    {
    102     dprintf(("GetWindowWord; window %x not found!", hwnd));
     106        dprintf(("GetWindowWord; window %x not found!", hwnd));
    103107    }
    104108    return 0;
     
    113117    if(window)
    114118    {
    115     return window->SetWindowWord(nIndex, arg3);
     119        return window->SetWindowWord(nIndex, arg3);
    116120    }
    117121    else
    118122    {
    119     dprintf(("SetWindowWord; window %x not found!", hwnd));
     123        dprintf(("SetWindowWord; window %x not found!", hwnd));
    120124    }
    121125    return 0;
     
    130134    if(window)
    131135    {
    132     return window->GetWindowLongA(nIndex);
     136        return window->GetWindowLongA(nIndex);
    133137    }
    134138    else
    135139    {
    136     dprintf(("GetWindowLongA; window %x not found!", hwnd));
     140        dprintf(("GetWindowLongA; window %x not found!", hwnd));
    137141    }
    138142    return 0;
     
    147151    if(window)
    148152    {
    149     return window->GetWindowLongA(nIndex);
     153        return window->GetWindowLongA(nIndex);
    150154    }
    151155    else
    152156    {
    153     dprintf(("GetWindowLongW; window %x not found!", hwnd));
     157        dprintf(("GetWindowLongW; window %x not found!", hwnd));
    154158    }
    155159    return 0;
  • TabularUnified trunk/src/user32/winkeyboard.cpp

    r1629 r1704  
    1 /* $Id: winkeyboard.cpp,v 1.1 1999-11-08 13:44:40 sandervl Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.2 1999-11-11 13:17:33 sandervl Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    99#include <os2win.h>
    1010#include <odin.h>
     11#include <string.h>
     12#include <stdio.h>
    1113#include <winkeyboard.h>
     14#include "oslibwin.h"
     15#include <heapstring.h>
    1216
    1317BYTE abPMScanToWinVKey[256] =
     
    289293//******************************************************************************
    290294//******************************************************************************
     295BOOL WIN32API GetKeyboardState(PBYTE lpKeyState)
     296{
     297 BYTE   PMKeyState[256];
     298 BOOL   rc;
     299
     300  dprintf(("USER32:  GetKeyboardState"));
     301  rc = OSLibWinGetKeyboardStateTable((PBYTE)&PMKeyState );
     302
     303  if(rc == TRUE)
     304  {
     305        KeyTranslatePMToWinBuf((BYTE *)&PMKeyState, lpKeyState, 256);
     306        return TRUE;
     307  }
     308  return FALSE;
     309}
     310//******************************************************************************
     311//******************************************************************************
     312BOOL WIN32API SetKeyboardState(PBYTE lpKeyState)
     313{
     314  dprintf(("USER32:  SetKeyboardState, not implemented"));
     315  return(TRUE);
     316}
     317/***********************************************************************
     318 *           GetKeyboardLayout                  (USER32.250)
     319 *
     320 * FIXME: - device handle for keyboard layout defaulted to
     321 *          the language id. This is the way Windows default works.
     322 *        - the thread identifier (dwLayout) is also ignored.
     323 */
     324// * Remark    : Based on Wine version (991031)
     325HKL WIN32API GetKeyboardLayout(DWORD dwLayout)
     326{
     327        HKL layout;
     328        layout = GetSystemDefaultLCID(); /* FIXME */
     329        layout |= (layout<<16);          /* FIXME */
     330        dprintf(("GetKeyboardLayout returning %08x\n",layout));
     331        return layout;
     332}
     333/*****************************************************************************
     334 * Name      : BOOL WIN32API GetKeyboardLayoutNameA
     335 * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
     336 *             active keyboard layout.
     337 * Parameters: LPTSTR pwszKLID address of buffer for layout name
     338 * Variables :
     339 * Result    : If the function succeeds, the return value is TRUE.
     340 *             If the function fails, the return value is FALSE. To get extended
     341 *               error information, call GetLastError.
     342 * Remark    : Based on Wine version (991031)
     343 * Status    : UNTESTED STUB
     344 *
     345 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     346 *****************************************************************************/
     347INT WIN32API GetKeyboardLayoutNameA(LPTSTR pwszKLID)
     348{
     349   dprintf(("USER32:GetKeyboardLayoutNameA"));
     350
     351   sprintf(pwszKLID, "%08x",GetKeyboardLayout(0));
     352   return 1;
     353}
     354/*****************************************************************************
     355 * Name      : BOOL WIN32API GetKeyboardLayoutNameW
     356 * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
     357 *             active keyboard layout.
     358 * Parameters: LPTSTR pwszKLID address of buffer for layout name
     359 * Variables :
     360 * Result    : If the function succeeds, the return value is TRUE.
     361 *             If the function fails, the return value is FALSE. To get extended
     362 *               error information, call GetLastError.
     363 * Remark    : Based on Wine version (991031)
     364 * Status    : UNTESTED STUB
     365 *
     366 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     367 *****************************************************************************/
     368INT WIN32API GetKeyboardLayoutNameW(LPWSTR pwszKLID)
     369{
     370   LPSTR buf = (LPSTR)HEAP_xalloc( GetProcessHeap(), 0, strlen("00000409")+1);
     371
     372   dprintf(("USER32:GetKeyboardLayoutNameA"));
     373   int res = GetKeyboardLayoutNameA(buf);
     374   lstrcpyAtoW(pwszKLID,buf);
     375   HeapFree( GetProcessHeap(), 0, buf );
     376   return res;
     377}
     378/***********************************************************************
     379 *           GetKeyboardLayoutList              (USER32.251)
     380 *
     381 * FIXME: Supports only the system default language and layout and
     382 *          returns only 1 value.
     383 *
     384 * Return number of values available if either input parm is
     385 *  0, per MS documentation.
     386 *
     387 * Remark    : Based on Wine version (991031)
     388 */
     389INT WINAPI GetKeyboardLayoutList(INT nBuff,HKL *layouts)
     390{
     391        dprintf(("GetKeyboardLayoutList(%d,%p)\n",nBuff,layouts));
     392        if (!nBuff || !layouts)
     393            return 1;
     394        if (layouts)
     395                layouts[0] = GetKeyboardLayout(0);
     396        return 1;
     397}
     398
     399//******************************************************************************
     400//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.