Changeset 3679 for trunk/src


Ignore:
Timestamp:
Jun 8, 2000, 8:10:12 PM (25 years ago)
Author:
sandervl
Message:

lots of fixes + changes (see ChangeLog)

Location:
trunk/src/user32
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r3662 r3679  
    1 # $Id: Makefile,v 1.71 2000-06-07 14:51:23 sandervl Exp $
     1# $Id: Makefile,v 1.72 2000-06-08 18:10:08 sandervl Exp $
    22
    33#
     
    7979$(OBJDIR)\oslibres.obj \
    8080$(OBJDIR)\dc.obj \
     81$(OBJDIR)\dcrgn.obj \
    8182$(OBJDIR)\timer.obj \
    8283$(OBJDIR)\dbglocal.obj \
  • trunk/src/user32/USER32.DEF

    r3662 r3679  
    1 ; $Id: USER32.DEF,v 1.32 2000-06-07 14:51:24 sandervl Exp $
     1; $Id: USER32.DEF,v 1.33 2000-06-08 18:10:08 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    649649    _GetClipBox@8                                                @2014
    650650    _GetClipRgn@8                                                @2015
     651    _ExtSelectClipRgn@12                                         @2016
     652    _ExcludeClipRect@20                                          @2017
     653    _IntersectClipRect@20                                        @2018
     654    _OffsetClipRgn@12                                            @2019
     655    _SelectClipRgn@8                                             @2020
     656
  • trunk/src/user32/dbglocal.cpp

    r3496 r3679  
    1 /* $Id: dbglocal.cpp,v 1.5 2000-05-05 13:14:07 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.6 2000-06-08 18:10:09 sandervl Exp $ */
    22
    33/*
     
    8787"win32wdesktop",
    8888"win32wbasenonclient",
    89 "win32wbaseprop"
     89"win32wbaseprop",
     90"dcrgn"
    9091};
    9192//******************************************************************************
  • trunk/src/user32/dbglocal.h

    r3493 r3679  
    1 /* $Id: dbglocal.h,v 1.4 2000-05-05 11:32:36 sandervl Exp $ */
     1/* $Id: dbglocal.h,v 1.5 2000-06-08 18:10:09 sandervl Exp $ */
    22
    33/*
     
    8787#define DBG_win32wbasenonclient  65
    8888#define DBG_win32wbaseprop       66
    89 #define DBG_MAXFILES             67
     89#define DBG_dcrgn                67
     90#define DBG_MAXFILES             68
    9091
    9192extern USHORT DbgEnabled[DBG_MAXFILES];
  • trunk/src/user32/dc.cpp

    r3662 r3679  
    1 /* $Id: dc.cpp,v 1.59 2000-06-07 14:51:25 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.60 2000-06-08 18:10:09 sandervl Exp $ */
    22
    33/*
     
    348348        goto setupclipregion;
    349349   }
    350 
     350   if(pHps->isClientArea) {
     351        //TODO: counter
     352        dprintf(("WARNING: selectClientArea; already selected!!"));
     353        goto setupclipregion;
     354   }
    351355   pHps->isClient = TRUE;
    352356
     
    411415setupclipregion:
    412416   if(prclPaint) {
     417#if 0
    413418        hrgnClip = GpiQueryClipRegion(pHps->hps);
    414419        if(hrgnClip) {
     
    419424        }
    420425        else {
     426#endif
    421427                hrgnClip = GreCreateRectRegion(pHps->hps, prclPaint, 1);
    422428                GreSelectClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);
    423         }
     429//      }
    424430   }
    425431
     
    610616        dprintf (("USER32: WARNING: WinQueryUpdateRect failed (error or no update rectangle)!!"));
    611617
    612         mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient);
    613         WinOffsetRect(NULL, &rectlClient, -rectlClient.xLeft, -rectlClient.yBottom);
    614 
    615         hrgnOldClip = selectClientArea(wnd, pHps, &rectlClient);
     618//      mapWin32ToOS2Rect(wnd->getWindowHeight(), wnd->getClientRectPtr(), (PRECTLOS2)&rectlClient);
     619//      WinOffsetRect(NULL, &rectlClient, -rectlClient.xLeft, -rectlClient.yBottom);
     620
     621        hrgnOldClip = selectClientArea(wnd, pHps, &rectl);
    616622        //save old clip region (restored for CS_OWNDC windows in EndPaint)
    617623        wnd->SetClipRegion(hrgnOldClip);
     
    619625   }
    620626   else {
     627#if 0
    621628        HRGN hrgnTmp = GpiCreateRegion(pHps->hps, 1, &rectl);
    622629
     
    627634        GpiQueryRegionRects(pHps->hps, hrgnTmp, &rcltemp, &rgnrect, &rectls[0]);
    628635        GpiDestroyRegion(pHps->hps, hrgnTmp);
    629 
     636#endif
    630637        WinValidateRect(hwndClient, &rectl, FALSE);
    631638
     
    696703   if (pHps && (pHps->hdcType == TYPE_3))
    697704   {
    698         removeClientArea(pHps);
     705        GpiSetClipRegion(pHps->hps, wnd->GetClipRegion(), &hrgnOld);
     706        wnd->SetClipRegion(0);
    699707        if(hrgnOld) {
    700                 GpiSetClipRegion(pHps->hps, NULLHANDLE, &hrgnOld);
    701708                GpiDestroyRegion(pHps->hps, hrgnOld);
    702709        }
    703         if(hwnd == HWND_DESKTOP || !wnd->isOwnDC()) {
    704                 pHps->hdcType = TYPE_1; //otherwise Open32's ReleaseDC fails
    705                 ReleaseDC(hwnd, pPaint->hdc);
    706         }
    707         else
    708         if(wnd->GetClipRegion()) {
    709                 //TODO: What else do we need to restore here???
    710                 GpiSetClipRegion(pHps->hps, wnd->GetClipRegion(), &hrgnOld);
    711                 wnd->SetClipRegion(0);
    712                 pHps->hdcType = TYPE_1;
    713         }
     710        pHps->hdcType = TYPE_1; //otherwise Open32's ReleaseDC fails
     711        ReleaseDC(hwnd, pPaint->hdc);
    714712   }
    715713   else {
     
    723721   SetLastError(0);
    724722   return TRUE;
    725 }
    726 //******************************************************************************
    727 //******************************************************************************
    728 int WIN32API GetClipBox( HDC hdc, PRECT lpRect)
    729 {
    730  pDCData  pHps = (pDCData)GpiQueryDCData((HPS)hdc);
    731  RECTL    rectl;
    732  LONG     lComplexity;
    733  int      rc;
    734 
    735     if(!hdc || !lpRect || !pHps) {
    736         dprintf(("GDI32: GetClipBox %x %x ERROR_INVALID_PARAMETER", hdc, lpRect));
    737         SetLastError(ERROR_INVALID_PARAMETER_W);
    738         return ERROR_W;
    739     }
    740     if(pHps->isPrinter)
    741     {
    742         lpRect->left   = 0;
    743         lpRect->top    = 0;
    744         lpRect->right  = GetDeviceCaps( hdc, HORZRES_W);
    745         lpRect->bottom = GetDeviceCaps( hdc, VERTRES_W);
    746 
    747         rc = SIMPLEREGION_W;
    748     }
    749     else {
    750         lComplexity = GpiQueryClipBox(pHps->hps, &rectl);
    751         if(lComplexity == RGN_ERROR)
    752         {
    753                 rc = ERROR_W;
    754         }
    755         else
    756         if(lComplexity == RGN_NULL)
    757         {
    758                 memset(lpRect, 0, sizeof(*lpRect));
    759                 rc = NULLREGION_W;
    760         }
    761         else {
    762                 lpRect->left   = rectl.xLeft;
    763                 lpRect->right  = rectl.xRight;
    764 #if 0
    765                 lpRect->top    = pHps->height - rectl.yTop;
    766                 lpRect->bottom = pHps->height - rectl.yBottom;
    767 #else
    768                 //No conversion required as GpiQueryClipBox is affected by
    769                 //the y-inversion of the window
    770                 lpRect->top    = rectl.yBottom;
    771                 lpRect->bottom = rectl.yTop;
    772 #endif
    773                 //Convert including/including to including/excluding
    774                 if(lpRect->left != lpRect->right) {
    775                         lpRect->right++;
    776                 }
    777                 if(lpRect->top != lpRect->bottom) {
    778                         lpRect->bottom++;
    779                 }
    780                 rc = (lComplexity == RGN_RECT) ? SIMPLEREGION_W : COMPLEXREGION_W;
    781         }
    782     }
    783     dprintf(("GDI32: GetClipBox of %X returned %d\n", hdc, rc));
    784     return rc;
    785 }
    786 //******************************************************************************
    787 //******************************************************************************
    788 int WIN32API GetClipRgn( HDC hdc, HRGN hRgn)
    789 {
    790  int rc;
    791 
    792     rc = O32_GetClipRgn(hdc, hRgn);
    793     dprintf(("GDI32: GetClipRgn %x %x returned %x", hdc, hRgn, rc));
    794     return rc;
    795 }
    796 //******************************************************************************
    797 //******************************************************************************
    798 BOOL WIN32API GetUpdateRect (HWND hwnd, LPRECT pRect, BOOL erase)
    799 {
    800    if (!hwnd)
    801    {
    802         dprintf(("GetUpdateRect %x %x %d -> invalid handle!!", hwnd, pRect, erase));
    803         SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
    804         return FALSE;
    805    }
    806 
    807    RECTL rectl;
    808    Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    809 
    810    if (!wnd)
    811    {
    812         SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
    813         dprintf(("GetUpdateRect %x %x %d -> invalid handle!!", hwnd, pRect, erase));
    814         return FALSE;
    815    }
    816 
    817    dprintf(("GetUpdateRect %x %x %d", hwnd, pRect, erase));
    818 
    819    BOOL updateRegionExists = WinQueryUpdateRect (wnd->getOS2WindowHandle(), pRect ? &rectl : NULL);
    820    if (!pRect) {
    821       return (updateRegionExists);
    822    }
    823 
    824    if (updateRegionExists)
    825    {
    826         //CB: for PM empty rect is valid
    827         if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) {
    828                 if(pRect) {
    829                         pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
    830                 }
    831                 return FALSE;
    832         }
    833 #if 0
    834         //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)
    835 //      if (wnd->isOwnDC() && wnd->getOwnDC())
    836         if (wnd->isOwnDC())
    837         {
    838                 pDCData pHps = NULL;
    839                 pHps = (pDCData)GpiQueryDCData(wnd->getOwnDC());
    840                 if (!pHps)
    841                 {
    842                         SetLastError(ERROR_INVALID_HANDLE_W);
    843                         return FALSE;
    844                 }
    845                 GpiConvert (pHps->hps, CVTC_DEVICE, CVTC_WORLD, 2, (PPOINTL)&rectl);
    846         }
    847         else
    848         {
    849 #endif
    850                 long height   = wnd->getClientHeight();
    851                 rectl.yTop    = height - rectl.yTop;
    852                 rectl.yBottom = height - rectl.yBottom;
    853 //////////              }
    854 
    855         if (pRect)
    856                 WINRECT_FROM_PMRECT (*pRect, rectl);
    857 
    858         if (erase)
    859                 sendEraseBkgnd (wnd);
    860    }
    861    else
    862    {
    863         if(pRect) {
    864                 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
    865         }
    866    }
    867 
    868    return updateRegionExists;
    869 }
    870 //******************************************************************************
    871 //functions for WM_NCPAINT
    872 //******************************************************************************
    873 INT SYSTEM GetOS2UpdateRgn(HWND hwnd,HRGN hrgn)
    874 {
    875   return O32_GetUpdateRgn(hwnd,hrgn,FALSE);
    876 }
    877 //******************************************************************************
    878 //******************************************************************************
    879 BOOL GetOS2UpdateRect(Win32BaseWindow *window, LPRECT pRect)
    880 {
    881    RECTL rectl;
    882    BOOL updateRegionExists = WinQueryUpdateRect(window->getOS2WindowHandle(),pRect ? &rectl:NULL);
    883 
    884    if (!pRect)
    885      return (updateRegionExists);
    886 
    887    if (updateRegionExists)
    888    {
    889      //CB: for PM empty rect is valid
    890      if ((rectl.xLeft == rectl.xRight) || (rectl.yTop == rectl.yBottom)) return FALSE;
    891      mapOS2ToWin32Rect(window->getWindowHeight(), (PRECTLOS2)&rectl,pRect);
    892    }
    893    else
    894        pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
    895 
    896    return updateRegionExists;
    897 }
    898 //******************************************************************************
    899 //******************************************************************************
    900 int WIN32API GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase)
    901 {
    902    LONG Complexity;
    903 
    904    Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    905 
    906    if (!wnd)
    907    {
    908       SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
    909       return ERROR_W;
    910    }
    911 
    912    Complexity = O32_GetUpdateRgn (wnd->getOS2WindowHandle(), hrgn, FALSE);
    913    if (erase && (Complexity > NULLREGION_W)) sendEraseBkgnd(wnd);
    914 
    915    return Complexity;
    916723}
    917724//******************************************************************************
     
    929736                return 0;
    930737        }
    931         //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)
    932 //      isOwnDC = wnd->isOwnDC() && wnd->getOwnDC();
    933738        isOwnDC = wnd->isOwnDC() && (wnd->getOwnDC() == hdc);
    934739        if(!isOwnDC)
     
    1002807
    1003808   isWindowOwnDC = (((hWindow == HWND_DESKTOP) ? FALSE : (wnd->isOwnDC()))
    1004                  && !(flags & DCX_CACHE_W));
    1005 
    1006    if(isWindowOwnDC)
     809                 && !(flags & (DCX_CACHE_W|DCX_WINDOW_W)));
     810
     811   if(isWindowOwnDC) //own dc always for client area
    1007812   {
    1008813      hps = wnd->getOwnDC();
    1009814      if (hps)
    1010815      {
    1011          pDCData pHps = (pDCData)GpiQueryDCData (hps);
    1012          if (!pHps)
     816        pDCData pHps = (pDCData)GpiQueryDCData (hps);
     817        if (!pHps)
    1013818            goto error;
    1014819
    1015          if(flags & DCX_WINDOW_W)
    1016             removeClientArea(pHps);
    1017          else
    1018             selectClientArea(wnd, pHps, NULL);
    1019 
    1020          setPageXForm (wnd, pHps);
    1021          pHps->hdcType = TYPE_1;
    1022 
    1023          dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x hdc %x", hwnd, hrgn, flags, wnd, hps));
    1024          return (HDC)hps;
     820        selectClientArea(wnd, pHps, NULL);
     821
     822        //TODO: Is this always necessary??
     823        setPageXForm (wnd, pHps);
     824        pHps->hdcType = TYPE_1;
     825
     826        //TODO: intersect/exclude clip region?
     827        dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x hdc %x", hwnd, hrgn, flags, wnd, hps));
     828        return (HDC)hps;
    1025829      }
    1026830      else
    1027          creatingOwnDC = TRUE;
     831        creatingOwnDC = TRUE;
    1028832   }
    1029833
     
    1086890   else removeClientArea(pHps);
    1087891
    1088 
    1089892   setMapMode(wnd, pHps, MM_TEXT_W);
    1090893
     
    12001003// RDW_ERASENOW
    12011004// RDW_UPDATENOW
     1005// RDW_FRAME
     1006//
     1007//TODO: Work ok for RDW_FRAME??
    12021008//******************************************************************************
    12031009BOOL WIN32API RedrawWindow(HWND hwnd, const RECT* pRect, HRGN hrgn, DWORD redraw)
     
    12601066      PRECTL pr;
    12611067      int i;
    1262       LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight();
     1068      LONG height;
     1069
     1070      if(wnd) {
     1071                height = (redraw & RDW_FRAME_W) ? wnd->getWindowHeight() : wnd->getClientHeight();
     1072      }
     1073      else      height = OSLibQueryScreenHeight();
    12631074
    12641075      if (!hrgn)
     
    12841095   else if (pRect)
    12851096   {
    1286       LONG height = wnd ? wnd->getClientHeight() : OSLibQueryScreenHeight();
    1287 
    1288       PMRECT_FROM_WINRECT (rectl, *pRect);
    1289       rectl.yTop    = height - rectl.yTop;
    1290       rectl.yBottom = height - rectl.yBottom;
     1097      if(wnd) {
     1098                if(redraw & RDW_FRAME_W) {
     1099                        mapWin32ToOS2Rect(wnd->getWindowHeight(), (PRECT)pRect, (PRECTLOS2)&rectl);
     1100                }
     1101                else    mapWin32ToOS2RectClientToFrame(wnd, (PRECT)pRect, (PRECTLOS2)&rectl);
     1102      }
     1103      else      mapWin32ToOS2Rect(OSLibQueryScreenHeight(), (PRECT)pRect, (PRECTLOS2)&rectl);
    12911104   }
    12921105
     
    13301143        //TODO: Does this work if RDW_ALLCHILDREN is set??
    13311144        if(redraw & RDW_UPDATENOW_W) {
    1332                 wnd->MsgPaint (0, FALSE);
     1145                wnd->MsgNCPaint();
     1146                wnd->MsgPaint(0, FALSE);
    13331147        }
    13341148        else
     
    13391153   else if((redraw & RDW_INTERNALPAINT_W) && !(redraw & RDW_INVALIDATE_W))
    13401154   {
    1341         if(redraw & RDW_UPDATENOW_W)
     1155        if(redraw & RDW_UPDATENOW_W) {
     1156                wnd->MsgNCPaint();
    13421157                wnd->MsgPaint (0, FALSE);
     1158        }
    13431159        else    PostMessageA(hwnd, WINWM_PAINT, 0, 0);
    13441160   }
     
    14661282//******************************************************************************
    14671283//TODO: Check if this one works correctly...
     1284//Have to check if dc is for frame or client!!
    14681285//******************************************************************************
    14691286BOOL WIN32API ScrollDC(HDC hDC, int dx, int dy, const RECT *pScroll,
     
    17911608//******************************************************************************
    17921609//******************************************************************************
    1793 INT WIN32API ExcludeUpdateRgn( HDC hDC, HWND  hWnd)
    1794 {
    1795     dprintf(("USER32:  ExcludeUpdateRgn\n"));
    1796     hWnd = Win32BaseWindow::Win32ToOS2Handle(hWnd);
    1797 
    1798     return O32_ExcludeUpdateRgn(hDC,hWnd);
    1799 }
    1800 //******************************************************************************
    1801 //******************************************************************************
    18021610BOOL WIN32API ValidateRect( HWND hwnd, const RECT * lprc)
    18031611{
     
    18161624    return RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE_W | RDW_NOCHILDREN_W | (hwnd==0 ? RDW_UPDATENOW_W : 0));
    18171625}
    1818 /*****************************************************************************
    1819  * Name      : int WIN32API GetWindowRgn
    1820  * Purpose   : The GetWindowRgn function obtains a copy of the window region of a window.
    1821  * Parameters: HWND hWnd handle to window whose window region is to be obtained
    1822  *             HRGN hRgn handle to region that receives a copy of the window region
    1823  * Variables :
    1824  * Result    : NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR
    1825  * Remark    :
    1826  * Status    : UNTESTED STUB
    1827  *
    1828  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1829  *****************************************************************************/
    1830 
    1831 int WIN32API GetWindowRgn(HWND hwnd, HRGN hRgn)
    1832 {
    1833   Win32BaseWindow *window;
    1834   HRGN hWindowRegion;
    1835 
    1836     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1837     if(!window) {
    1838         dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
    1839         SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
    1840         return 0;
    1841     }
    1842     dprintf(("USER32:GetWindowRgn (%x,%x)", hwnd, hRgn));
    1843     hWindowRegion = window->GetWindowRegion();
    1844 
    1845     return O32_CombineRgn(hRgn, hWindowRegion, 0, RGN_COPY_W);
    1846 }
    1847 /*****************************************************************************
    1848  * Name      : int WIN32API SetWindowRgn
    1849  * Purpose   : The SetWindowRgn function sets the window region of a window. The
    1850  *             window region determines the area within the window where the
    1851  *             operating system permits drawing. The operating system does not
    1852  *             display any portion of a window that lies outside of the window region
    1853  *             When this function is called, the system sends the WM_WINDOWPOSCHANGING and
    1854  *             WM_WINDOWPOSCHANGED messages to the window.
    1855  *
    1856  * Parameters: HWND  hWnd    handle to window whose window region is to be set
    1857  *             HRGN  hRgn    handle to region
    1858  *             BOOL  bRedraw window redraw flag
    1859  * Variables :
    1860  * Result    : If the function succeeds, the return value is non-zero.
    1861  *             If the function fails, the return value is zero.
    1862  * Remark    :
    1863  * Status    : UNTESTED STUB
    1864  *
    1865  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1866  *****************************************************************************/
    1867 
    1868 int WIN32API SetWindowRgn(HWND hwnd,
    1869                           HRGN hRgn,
    1870                           BOOL bRedraw)
    1871 {
    1872   Win32BaseWindow *window;
    1873   HRGN hWindowRegion;
    1874 
    1875     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1876     if(!window) {
    1877         dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
    1878         SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
    1879         return 0;
    1880     }
    1881     dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw));
    1882     if(window->GetWindowRegion()) {
    1883         O32_DeleteObject(window->GetWindowRegion());
    1884     }
    1885     window->SetWindowRegion(hRgn);
    1886     if(bRedraw) {
    1887         RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);
    1888     }
    1889 //TODO:
    1890 //  When this function is called, the system sends the WM_WINDOWPOSCHANGING and
    1891 //  WM_WINDOWPOSCHANGED messages to the window.
    1892     return 1;
    1893 }
    1894 //******************************************************************************
    1895 //******************************************************************************
     1626//******************************************************************************
     1627//******************************************************************************
  • trunk/src/user32/dc.h

    r3662 r3679  
    1 /* $Id: dc.h,v 1.13 2000-06-07 14:51:25 sandervl Exp $ */
     1/* $Id: dc.h,v 1.14 2000-06-08 18:10:09 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    463463}
    464464
     465int APIENTRY _O32_ExcludeClipRect(HDC a, int b, int c, int d, int e);
     466
     467inline int O32_ExcludeClipRect(HDC a, int b, int c, int d, int e)
     468{
     469 int yyrc;
     470 USHORT sel = RestoreOS2FS();
     471
     472    yyrc = _O32_ExcludeClipRect(a, b, c, d, e);
     473    SetFS(sel);
     474
     475    return yyrc;
     476}
     477
     478int APIENTRY _O32_IntersectClipRect(HDC a, int b, int c, int d, int e);
     479
     480inline int O32_IntersectClipRect(HDC a, int b, int c, int d, int e)
     481{
     482 int yyrc;
     483 USHORT sel = RestoreOS2FS();
     484
     485    yyrc = _O32_IntersectClipRect(a, b, c, d, e);
     486    SetFS(sel);
     487
     488    return yyrc;
     489}
     490
     491int APIENTRY _O32_ExtSelectClipRgn(HDC a, HRGN b, int c);
     492
     493inline int O32_ExtSelectClipRgn(HDC a, HRGN b, int c)
     494{
     495 int yyrc;
     496 USHORT sel = RestoreOS2FS();
     497
     498    yyrc = _O32_ExtSelectClipRgn(a, b, c);
     499    SetFS(sel);
     500
     501    return yyrc;
     502}
     503
     504int APIENTRY _O32_OffsetClipRgn(HDC a, int b, int c);
     505
     506inline int O32_OffsetClipRgn(HDC a, int b, int c)
     507{
     508 int yyrc;
     509 USHORT sel = RestoreOS2FS();
     510
     511    yyrc = _O32_OffsetClipRgn(a, b, c);
     512    SetFS(sel);
     513
     514    return yyrc;
     515}
     516
    465517   // from pmddi.h:
    466518   /* CopyClipRegion */
  • trunk/src/user32/oslibgdi.cpp

    r3662 r3679  
    1 /* $Id: oslibgdi.cpp,v 1.12 2000-06-07 14:51:26 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.13 2000-06-08 18:10:10 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    121121}
    122122//******************************************************************************
     123//Win32 rectangle in client coordinates (relative to upper left corner of client window)
     124//Convert to frame coordinates (relative to lower left corner of window)
    123125//******************************************************************************
    124126BOOL mapWin32ToOS2RectClientToFrame(Win32BaseWindow *window, PRECT rectWin32,PRECTLOS2 rectOS2)
     
    138140  rectOS2->yBottom = height - (rectWin32->bottom + yclientorg);
    139141  rectOS2->yTop    = height - (rectWin32->top + yclientorg);
    140   rectOS2->xLeft   = rectWin32->left  - xclientorg;
    141   rectOS2->xRight  = rectWin32->right - xclientorg;
     142  rectOS2->xLeft   = rectWin32->left  + xclientorg;
     143  rectOS2->xRight  = rectWin32->right + xclientorg;
     144
     145  return TRUE;
     146}
     147//******************************************************************************
     148//OS/2 rectangle in frame coordinates (relative to lower left corner of window)
     149//Convert to client coordinates (relative to upper left corner of client window)
     150//Note: win32 rectangle can be bigger than client area!
     151//******************************************************************************
     152BOOL mapOS2ToWin32RectFrameToClient(Win32BaseWindow *window, PRECTLOS2 rectOS2,
     153                                    PRECT rectWin32)
     154{
     155 int height;
     156 int xclientorg;
     157 int yclientorg;
     158
     159  if(!window || !rectOS2 || !rectWin32) {
     160        DebugInt3();
     161        return FALSE;
     162  }
     163  height     = window->getWindowHeight();
     164  xclientorg = window->getClientRectPtr()->left;
     165  yclientorg = window->getClientRectPtr()->top;
     166
     167  rectWin32->bottom = height - (rectOS2->yBottom + yclientorg);
     168  rectWin32->top    = height - (rectOS2->yTop + yclientorg);
     169  rectWin32->left   = rectOS2->xLeft  - xclientorg;
     170  rectWin32->right  = rectOS2->xRight - xclientorg;
    142171
    143172  return TRUE;
  • trunk/src/user32/oslibgdi.h

    r3662 r3679  
    1 /* $Id: oslibgdi.h,v 1.6 2000-06-07 14:51:26 sandervl Exp $ */
     1/* $Id: oslibgdi.h,v 1.7 2000-06-08 18:10:10 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    8181
    8282BOOL mapWin32ToOS2RectClientToFrame(Win32BaseWindow *window, PRECT rectWin32,PRECTLOS2 rectOS2);
     83BOOL mapOS2ToWin32RectFrameToClient(Win32BaseWindow *window, PRECTLOS2 rectOS2, PRECT rectWin32);
    8384
    8485#define mapWin32ToOS2RectFrame(window, rectWin32, rectOS2) \
  • trunk/src/user32/pmwindow.cpp

    r3662 r3679  
    1 /* $Id: pmwindow.cpp,v 1.92 2000-06-07 14:51:27 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.93 2000-06-08 18:10:10 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    255255
    256256        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    257 
     257 
     258        if(pswp->fl & SWP_NOADJUST) {
     259                //ignore weird messages (TODO: why are they sent?)
     260                break;
     261        }
    258262        //CB: show dialog in front of owner
    259263        if (win32wnd->IsModalDialogOwner())
  • trunk/src/user32/win32wbase.cpp

    r3663 r3679  
    1 /* $Id: win32wbase.cpp,v 1.199 2000-06-07 21:45:50 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.200 2000-06-08 18:10:11 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    716716            }
    717717
    718             if (cs->style & WS_VISIBLE) ShowWindow(sw);
     718            if(cs->style & WS_VISIBLE) {
     719                dwStyle &= ~WS_VISIBLE;
     720                ShowWindow(sw);
     721            }
    719722
    720723            /* Call WH_SHELL hook */
     
    22382241                MsgFormatFrame(NULL);
    22392242                UnionRect(&oldClientRect, &oldClientRect, &rectClient);
     2243                OffsetRect(&oldClientRect, -rectClient.left, -rectClient.top);
    22402244                InvalidateRect(getWindowHandle(), &oldClientRect, TRUE);
    22412245//TODO: move child windows!!
     
    22842288    {
    22852289        UnionRect(&oldClientRect, &oldClientRect, &rectClient);
     2290        OffsetRect(&oldClientRect, -rectClient.left, -rectClient.top);
    22862291        InvalidateRect(getWindowHandle(), &oldClientRect, TRUE);
    22872292//TODO: move child windows!!
     
    24982503HWND Win32BaseWindow::GetTopWindow()
    24992504{
    2500     return GetWindow(GW_CHILD);
     2505 HWND             hwndTop;
     2506 Win32BaseWindow *topwindow;
     2507
     2508    hwndTop = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP);
     2509    if(!isDesktopWindow()) {
     2510        topwindow = GetWindowFromOS2Handle(hwndTop);
     2511        if(topwindow) {
     2512                return topwindow->getWindowHandle();
     2513        }
     2514        return 0;       
     2515    }
     2516    while(hwndTop) {
     2517        topwindow = GetWindowFromOS2Handle(hwndTop);
     2518        if(topwindow) {
     2519                return topwindow->getWindowHandle();
     2520        }
     2521        hwndTop = OSLibWinQueryWindow(hwndTop, QWOS_NEXT);
     2522    }
     2523
     2524    return 0;
    25012525}
    25022526//******************************************************************************
  • trunk/src/user32/window.cpp

    r3663 r3679  
    1 /* $Id: window.cpp,v 1.69 2000-06-07 21:45:52 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.70 2000-06-08 18:10:12 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    400400  Win32BaseWindow *window;
    401401
    402     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    403     if(!window) {
    404         dprintf(("GetTopWindow, window %x not found", hwnd));
    405         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    406         return 0;
     402    if(hwnd == HWND_DESKTOP) {
     403        window = windowDesktop;
     404    }
     405    else {
     406        window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     407        if(!window) {
     408                dprintf(("GetTopWindow, window %x not found", hwnd));
     409                SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     410                return 0;
     411        }
    407412    }
    408413    return window->GetTopWindow();
Note: See TracChangeset for help on using the changeset viewer.