Changeset 1855 for trunk/src


Ignore:
Timestamp:
Nov 27, 1999, 1:10:22 AM (26 years ago)
Author:
sandervl
Message:

several fixes + changes

Location:
trunk/src/user32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmsg.cpp

    r1836 r1855  
    1 /* $Id: oslibmsg.cpp,v 1.12 1999-11-24 20:11:36 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.13 1999-11-27 00:10:20 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    247247}
    248248//******************************************************************************
    249 //******************************************************************************
     249//TODO: QS_HOTKEY
     250//******************************************************************************
     251ULONG OSLibWinQueryQueueStatus()
     252{
     253 ULONG statusOS2, statusWin32;
     254
     255   statusOS2 = WinQueryQueueStatus(HWND_DESKTOP);
     256
     257   if(statusOS2 & QS_KEY)
     258        statusWin32 |= QS_KEY_W;
     259   if(statusOS2 & QS_MOUSEBUTTON)   
     260        statusWin32 |= QS_MOUSEBUTTON_W;
     261   if(statusOS2 & QS_MOUSEMOVE)
     262        statusWin32 |= QS_MOUSEMOVE_W;
     263   if(statusOS2 & QS_TIMER)   
     264        statusWin32 |= QS_TIMER_W;
     265   if(statusOS2 & QS_PAINT)   
     266        statusWin32 |= QS_PAINT_W;
     267   if(statusOS2 & QS_POSTMSG)   
     268        statusWin32 |= QS_POSTMESSAGE_W;
     269   if(statusOS2 & QS_SENDMSG)   
     270        statusWin32 |= QS_SENDMESSAGE_W;
     271
     272   return statusWin32;
     273}
     274//******************************************************************************
     275//******************************************************************************
  • trunk/src/user32/oslibmsg.h

    r1688 r1855  
    1 /* $Id: oslibmsg.h,v 1.4 1999-11-10 14:16:45 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.5 1999-11-27 00:10:20 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3333BOOL  OSLibInitMsgQueue();
    3434BOOL  OSLibWinWaitMessage();
     35
     36ULONG OSLibWinQueryQueueStatus();
    3537
    3638#define WINWM_NULL                  0x0000
  • trunk/src/user32/pmwindow.cpp

    r1849 r1855  
    1 /* $Id: pmwindow.cpp,v 1.57 1999-11-26 17:06:08 cbratschi Exp $ */
     1/* $Id: pmwindow.cpp,v 1.58 1999-11-27 00:10:20 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    692692        dprintf(("PM: WM_CHAR: %x %x %d %x", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), repeatCount, scanCode));
    693693        dprintf(("PM: WM_CHAR: %x", flags));
     694
     695        // vitali add begin
     696        if ( ( SHORT1FROMMP(mp2) & 0x0FF ) == 0x0E0 )
     697        {
     698            // an extended key ( arrows, ins, del and so on )
     699            // get "virtual" scancode from character code cause
     700            // for "regular" keys they are equal
     701            scanCode = ( SHORT1FROMMP(mp2) >> 8) & 0x0FF;
     702        }       
     703        // vitali add end
     704
    694705        // both WM_KEYUP & WM_KEYDOWN want a virtual key, find the right Win32 virtual key
    695706        // given the OS/2 virtual key and OS/2 character
  • trunk/src/user32/user32.cpp

    r1849 r1855  
    1 /* $Id: user32.cpp,v 1.56 1999-11-26 17:06:08 cbratschi Exp $ */
     1/* $Id: user32.cpp,v 1.57 1999-11-27 00:10:21 sandervl Exp $ */
    22
    33/*
     
    15711571}
    15721572
    1573 /* Synchronization Functions */
    1574 ODINFUNCTION5(DWORD,MsgWaitForMultipleObjects,DWORD,    nCount,
    1575                                               LPHANDLE, pHandles,
    1576                                               BOOL,     fWaitAll,
    1577                                               DWORD,    dwMilliseconds,
    1578                                               DWORD,    dwWakeMask)
    1579 {
    1580   // @@@PH that's a really difficult function to implement
    1581 
    1582   // @@@PH this is a temporary bugfix for WINFILE.EXE
    1583   if (nCount == 0)
    1584   {
    1585     // only listens to incoming thread messages.
    1586     return (WAIT_OBJECT_0);
    1587   }
    1588 
    1589   return O32_MsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask);
    1590 }
    1591 
    15921573/* Button Functions */
    15931574
     
    18741855/* Message and Message Queue Functions */
    18751856
    1876 /*****************************************************************************
    1877  * Name      : BOOL WIN32API GetInputState
    1878  * Purpose   : The GetInputState function determines whether there are
    1879  *             mouse-button or keyboard messages in the calling thread's message queue.
    1880  * Parameters:
    1881  * Variables :
    1882  * Result    : If the queue contains one or more new mouse-button or keyboard
    1883  *               messages, the return value is TRUE.
    1884  *             If the function fails, the return value is FALSE.
    1885  * Remark    :
    1886  * Status    : UNTESTED STUB
    1887  *
    1888  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1889  *****************************************************************************/
    1890 BOOL WIN32API GetInputState(VOID)
    1891 {
    1892   dprintf(("USER32:GetInputState () not implemented.\n"));
    1893 
    1894   return (FALSE);
    1895 }
    1896 //******************************************************************************
    1897 //******************************************************************************
    1898 DWORD WIN32API GetQueueStatus( UINT flags)
    1899 {
    1900 #ifdef DEBUG
    1901     WriteLog("USER32:  GetQueueStatus\n");
    1902 #endif
    1903     return O32_GetQueueStatus(flags);
    1904 }
    19051857
    19061858/* Font and Text Functions */
  • trunk/src/user32/windowmsg.cpp

    r1831 r1855  
    1 /* $Id: windowmsg.cpp,v 1.6 1999-11-24 19:32:23 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.7 1999-11-27 00:10:22 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    99 * Copyright 1993, 1994 Alexandre Julliard
    1010 *
     11 * TODO: GetQueueStatus: QS_HOTKEY (oslibmsg.cpp) & low word bits
     12 * TODO: MsgWaitForMultipleObjects: timeout isn't handled correctly (can return too late)
    1113 *
    1214 * Project Odin Software License can be found in LICENSE.TXT
     
    10171019        return WINPROC_CallProc32WTo32A( func, hwnd, msg, wParam, lParam);
    10181020}
     1021//******************************************************************************
     1022//TODO: QS_HOTKEY (oslibmsg.cpp) & low word bits
     1023//high word = messages currently in queue
     1024//low word  = messages that have been added to the queue and are still in the
     1025//            queue since the last call to GetQueueStatus
     1026//******************************************************************************
     1027DWORD WIN32API GetQueueStatus( UINT flags)
     1028{
     1029 DWORD queueStatus;
     1030
     1031    dprintf(("USER32:  GetQueueStatus"));
     1032    queueStatus = OSLibWinQueryQueueStatus();
     1033 
     1034    queueStatus = MAKELONG(queueStatus, queueStatus);
     1035    return queueStatus & MAKELONG(flags, flags);
     1036}
     1037/*****************************************************************************
     1038 * Name      : BOOL WIN32API GetInputState
     1039 * Purpose   : The GetInputState function determines whether there are
     1040 *             mouse-button or keyboard messages in the calling thread's message queue.
     1041 * Parameters:
     1042 * Variables :
     1043 * Result    : If the queue contains one or more new mouse-button or keyboard
     1044 *               messages, the return value is TRUE.
     1045 *             If the function fails, the return value is FALSE.
     1046 * Remark    :
     1047 * Status    : UNTESTED STUB
     1048 *
     1049 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     1050 *****************************************************************************/
     1051BOOL WIN32API GetInputState(VOID)
     1052{
     1053 DWORD queueStatus;
     1054
     1055  dprintf(("USER32:GetInputState()"));
     1056  queueStatus = OSLibWinQueryQueueStatus();
     1057
     1058  return (queueStatus & (QS_KEY | QS_MOUSEBUTTON)) ? TRUE : FALSE;
     1059}
     1060//******************************************************************************
     1061/* Synchronization Functions */
     1062//******************************************************************************
     1063DWORD MsgWaitForMultipleObjects(DWORD nCount, LPHANDLE pHandles, BOOL fWaitAll,
     1064                                DWORD dwMilliseconds, DWORD dwWakeMask)
     1065{
     1066 DWORD curtime, endtime;
     1067
     1068  dprintf(("MsgWaitForMultipleObjects %x %x %d %d %x", nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask));
     1069  // @@@PH this is a temporary bugfix for WINFILE.EXE
     1070  if (nCount == 0)
     1071  {
     1072        if(dwMilliseconds == 0) {
     1073                if(GetQueueStatus(dwWakeMask) == 0) {
     1074                        return WAIT_TIMEOUT;
     1075                }
     1076                return WAIT_OBJECT_0;
     1077        }
     1078        //SvL: Check time, wait for any message, check msg type and determine if
     1079        //     we have to return
     1080        //TODO: Timeout isn't handled correctly (can return too late)
     1081        curtime = GetCurrentTime();
     1082        endtime = curtime + dwMilliseconds;
     1083        while(curtime < endtime || dwMilliseconds == INFINITE) {
     1084                if(OSLibWinWaitMessage() == FALSE) {
     1085                        dprintf(("OSLibWinWaitMessage returned FALSE!"));
     1086                        return -1;
     1087                }
     1088                if(GetQueueStatus(dwWakeMask) != 0) {
     1089                        return WAIT_OBJECT_0;
     1090                }
     1091                curtime = GetCurrentTime();
     1092        }
     1093        return WAIT_TIMEOUT;
     1094  }
     1095  return O32_MsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask);
     1096}
Note: See TracChangeset for help on using the changeset viewer.