Changeset 1971 for trunk/src


Ignore:
Timestamp:
Dec 5, 1999, 1:31:50 AM (26 years ago)
Author:
sandervl
Message:

Rewrote some message apis + WM_WINDOWPOSCHANGED fix

Location:
trunk/src/user32
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r1831 r1971  
    1 # $Id: Makefile,v 1.45 1999-11-24 19:32:21 sandervl Exp $
     1# $Id: Makefile,v 1.46 1999-12-05 00:31:46 sandervl Exp $
    22
    33#
     
    159159
    160160clean:
    161         $(RM) *.obj *.lib *.dll *.map *.pch *.res *.lrf resource.asm
     161        $(RM) *.obj *.lib *.dll *.map *.pch *.res *.lrf resource.asm *.lrf
    162162        $(RM) $(PDWIN32_BIN)\$(TARGET).dll
    163163        $(RM) $(PDWIN32_LIB)\$(TARGET).lib
    164 #        $(RM) $(TARGET)exp.def
     164        $(RM) $(TARGET)exp.def
    165165
  • trunk/src/user32/USER32.DEF

    r1818 r1971  
    1 ; $Id: USER32.DEF,v 1.21 1999-11-23 19:34:18 sandervl Exp $
     1; $Id: USER32.DEF,v 1.22 1999-12-05 00:31:46 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    1010
    1111IMPORTS
    12     _WinSetDAXData             = PMMERGE.5448
    13     _GpiQueryDCData            = PMGPI.665
    14     _GpiEnableYInversion       = PMGPI.723
    15     _HPSToHDC                  = PMWINX.1022
    16     _DeleteHDC                 = PMWINX.1023
     12    _WinSetDAXData              = PMMERGE.5448
     13    _GpiQueryDCData             = PMGPI.665
     14    _GpiEnableYInversion        = PMGPI.723
     15    _HPSToHDC                   = PMWINX.1022
     16    _DeleteHDC                  = PMWINX.1023
    1717    __DestroyCaret              = PMMERGE.10001
    1818    __GetCaretBlinkTime         = PMMERGE.10002
     
    2020    __SetCaretBlinkTime         = PMMERGE.10005
    2121    __ShowCaret                 = PMMERGE.10007
     22    WinReplyMsg                 = PMMERGE.5325
    2223
    2324EXPORTS
  • trunk/src/user32/oslibmsg.cpp

    r1855 r1971  
    1 /* $Id: oslibmsg.cpp,v 1.13 1999-11-27 00:10:20 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.14 1999-12-05 00:31:47 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    2626#include <thread.h>
    2727#include <wprocess.h>
     28#include "pmwindow.h"
    2829
    2930typedef BOOL (EXPENTRY FNTRANS)(MSG *, QMSG *);
     
    274275//******************************************************************************
    275276//******************************************************************************
     277BOOL OSLibWinInSendMessage()
     278{
     279   return WinInSendMsg(GetThreadHAB());
     280}
     281//******************************************************************************
     282//******************************************************************************
     283DWORD OSLibWinGetMessagePos()
     284{
     285 APIRET rc;
     286 POINTL ptl;
     287
     288   rc = WinQueryMsgPos(GetThreadHAB(), &ptl);
     289   if(!rc) {
     290      return 0;
     291   }
     292   //convert to windows coordinates
     293   return MAKEULONG(ptl.x, ScreenHeight - ptl.y - 1);
     294}
     295//******************************************************************************
     296//******************************************************************************
     297LONG OSLibWinGetMessageTime()
     298{
     299   return (LONG)WinQueryMsgTime(GetThreadHAB());
     300}
     301//******************************************************************************
     302//******************************************************************************
     303BOOL OSLibWinReplyMessage(ULONG result)
     304{
     305   return (BOOL)WinReplyMsg( NULLHANDLE, NULLHANDLE, HMQ_CURRENT, (MRESULT)result);
     306}
     307//******************************************************************************
     308//******************************************************************************
  • trunk/src/user32/oslibmsg.h

    r1855 r1971  
    1 /* $Id: oslibmsg.h,v 1.5 1999-11-27 00:10:20 sandervl Exp $ */
     1/* $Id: oslibmsg.h,v 1.6 1999-12-05 00:31:47 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3333BOOL  OSLibInitMsgQueue();
    3434BOOL  OSLibWinWaitMessage();
     35BOOL  OSLibWinInSendMessage();
     36DWORD OSLibWinGetMessagePos();
     37LONG  OSLibWinGetMessageTime();
     38BOOL  OSLibWinReplyMessage(ULONG result);
    3539
    3640ULONG OSLibWinQueryQueueStatus();
  • trunk/src/user32/pmframe.cpp

    r1922 r1971  
    1 /* $Id: pmframe.cpp,v 1.25 1999-12-01 18:23:28 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.26 1999-12-05 00:31:47 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    321321      LONG      yDelta = pswp->cy - swpOld.cy;
    322322      LONG      xDelta = pswp->cx - swpOld.cx;
     323      LONG      clientHeight;
    323324
    324325        dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     326
     327        //Save height so WM_WINDOWPOSCHANGED handler in pmwindow.cpp
     328        //(for client) doesn't overwrite the client rectangle (breaks ydelta calculation)
     329        clientHeight = win32wnd->getWindowHeight();
    325330
    326331        RestoreOS2TIB();
     
    329334
    330335        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    331             goto PosChangedEnd;
    332 
    333         if(!win32wnd->CanReceiveSizeMsgs())
    334336            goto PosChangedEnd;
    335337
     
    345347
    346348        //delta is difference between old and new client height
    347         yDelta = swpOld.cy - win32wnd->getWindowHeight();
     349        yDelta = swpOld.cy - clientHeight;
    348350
    349351        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
    350352        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     353
     354        if(!win32wnd->CanReceiveSizeMsgs())
     355            goto PosChangedEnd;
    351356
    352357        wp.hwnd = win32wnd->getWindowHandle();
     
    385390                    swp[i].fl &= ~(SWP_NOREDRAW);
    386391                }
    387                 //else child window with the same start coorindates as the client area
     392                //else child window with the same start coordinates as the client area
    388393                //The app should resize it.
    389394
  • trunk/src/user32/pmwindow.cpp

    r1965 r1971  
    1 /* $Id: pmwindow.cpp,v 1.61 1999-12-04 00:04:19 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.62 1999-12-05 00:31:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    277277        break;
    278278
    279 #if 0
     279#if 1
     280    case WM_ADJUSTWINDOWPOS:
     281    {
     282      PSWP     pswp = (PSWP)mp1;
     283
     284        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     285        goto RunDefWndProc;
     286    }
     287#else
    280288    case WM_ADJUSTWINDOWPOS:
    281289    {
     
    331339        break;
    332340    }
    333 
     341#endif
     342
     343#if 1
    334344    case WM_WINDOWPOSCHANGED:
    335345    {
     
    341351      LONG      xDelta = pswp->cx - swpOld.cx;
    342352
    343         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    344 
    345         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
     353        dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     354
     355        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;
    346356
    347357        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    355365        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());
    356366
    357         if (!win32wnd->CanReceiveSizeMsgs())    break;
    358 
    359         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     367        if (!win32wnd->CanReceiveSizeMsgs())    goto RunDefWndProc;
     368
     369        dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
    360370        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    361371
     
    366376           wp.hwndInsertAfter = wndAfter->getWindowHandle();
    367377        }
    368 
    369         if (yDelta != 0 || xDelta != 0)
    370         {
    371             HENUM henum = WinBeginEnumWindows(pswp->hwnd);
    372             SWP swp[10];
    373             int i = 0;
    374             HWND hwnd;
    375 
    376             while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
    377             {
    378 #if 0
    379                 if (mdiClient )
    380                 {
    381                   continue;
    382                 }
    383 #endif
    384                 WinQueryWindowPos(hwnd, &(swp[i]));
    385 
    386 #ifdef DEBUG
    387                 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    388                 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
    389                          yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
    390 #endif
    391 
    392                 if(swp[i].y != 0) {
    393                     //child window at offset <> 0 from client area -> offset now changes
    394                     swp[i].y  += yDelta;
    395                     swp[i].fl &= ~(SWP_NOREDRAW);
    396                 }
    397                 //else child window with the same start coorindates as the client area
    398                 //The app should resize it.
    399 
    400                if (i == 9)
    401                 {
    402                     WinSetMultWindowPos(GetThreadHAB(), swp, 10);
    403                     i = 0;
    404                 }
    405                 else
    406                 {
    407                     i++;
    408                 }
    409             }
    410 
    411             WinEndEnumWindows(henum);
    412 
    413             if (i)
    414                WinSetMultWindowPos(GetThreadHAB(), swp, i);
    415         }
    416         if (yDelta != 0)
    417         {
    418             POINT pt;
    419             if(GetCaretPos (&pt) == TRUE)
    420             {
    421                 pt.y -= yDelta;
    422                 SetCaretPos (pt.x, pt.y);
    423             }
    424         }
     378        //SvL: Can be sent twice now (once in pmframe, once here); shouldn't really matter though...
    425379        win32wnd->MsgPosChanged((LPARAM)&wp);
    426380
     
    881835        dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
    882836#if 1
    883         break;
     837        break;
    884838#else
    885839
     
    971925//  dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
    972926  RestoreOS2TIB();
     927
    973928  return WinDefWindowProc( hwnd, msg, mp1, mp2 );
    974929} /* End of Win32WindowProc */
  • trunk/src/user32/win32wbase.cpp

    r1965 r1971  
    1 /* $Id: win32wbase.cpp,v 1.103 1999-12-04 00:04:19 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.104 1999-12-05 00:31:48 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    1111 *
    1212 * TODO: Not thread/process safe
     13 * TODO: Calling window handler directly from SendMessageA/W can cause problems
     14 *       for GetMessageTime/Pos & InSendMessage
    1315 *
    1416 * Project Odin Software License can be found in LICENSE.TXT
     
    716718{
    717719  if(SendInternalMessageA(WM_CLOSE, 0, 0) == 0) {
     720        dprintf(("Win32BaseWindow::MsgClose, app handles msg"));
    718721        return 0; //app handles this message
    719722  }
  • trunk/src/user32/window.cpp

    r1949 r1971  
    1 /* $Id: window.cpp,v 1.39 1999-12-02 19:30:41 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.40 1999-12-05 00:31:49 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    12511251    POINT wPoint;
    12521252
    1253 
    12541253    wPoint.x = point.x;
    12551254    wPoint.y = windowDesktop->getWindowHeight() - point.y;
  • trunk/src/user32/windowmsg.cpp

    r1855 r1971  
    1 /* $Id: windowmsg.cpp,v 1.7 1999-11-27 00:10:22 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.8 1999-12-05 00:31:50 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    1111 * TODO: GetQueueStatus: QS_HOTKEY (oslibmsg.cpp) & low word bits
    1212 * TODO: MsgWaitForMultipleObjects: timeout isn't handled correctly (can return too late)
     13 * TODO: GetMessageExtraInfo
    1314 *
    1415 * Project Odin Software License can be found in LICENSE.TXT
     
    9596}
    9697//******************************************************************************
    97 //******************************************************************************
    98 LONG WIN32API GetMessageExtraInfo(void)
    99 {
    100     dprintf(("USER32:  GetMessageExtraInfo\n"));
    101     return O32_GetMessageExtraInfo();
     98//TODO:
     99//******************************************************************************
     100LONG WIN32API GetMessageExtraInfo()
     101{
     102    dprintf(("USER32: GetMessageExtraInfo NOT SUPPORTED"));
     103    return 0;
    102104}
    103105//******************************************************************************
     
    105107DWORD WIN32API GetMessagePos(void)
    106108{
    107     dprintf(("USER32:  GetMessagePos\n"));
    108     return O32_GetMessagePos();
     109    dprintf(("USER32: GetMessagePos"));
     110    return OSLibWinGetMessagePos();
    109111}
    110112//******************************************************************************
     
    112114LONG WIN32API GetMessageTime(void)
    113115{
    114     dprintf(("USER32:  GetMessageTime\n"));
    115     return O32_GetMessageTime();
     116    dprintf(("USER32: GetMessageTime"));
     117    return OSLibWinGetMessageTime();
    116118}
    117119//******************************************************************************
     
    210212BOOL WIN32API InSendMessage(void)
    211213{
    212 #ifdef DEBUG
    213     WriteLog("USER32:  InSendMessage\n");
    214 #endif
    215     return O32_InSendMessage();
    216 }
    217 //******************************************************************************
    218 //******************************************************************************
    219 //******************************************************************************
    220 BOOL WIN32API ReplyMessage( LRESULT arg1)
    221 {
    222 #ifdef DEBUG
    223     WriteLog("USER32:  ReplyMessage\n");
    224 #endif
    225     return O32_ReplyMessage(arg1);
     214    dprintf(("USER32:  InSendMessage"));
     215    return OSLibWinInSendMessage();
     216}
     217//******************************************************************************
     218//******************************************************************************
     219//******************************************************************************
     220BOOL WIN32API ReplyMessage(LRESULT result)
     221{
     222    dprintf(("USER32: ReplyMessage %x", result));
     223    return OSLibWinReplyMessage(result);
    226224}
    227225//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.