Changeset 3482 for trunk/src


Ignore:
Timestamp:
May 2, 2000, 10:50:53 PM (25 years ago)
Author:
sandervl
Message:

RDW_FRAME support for GetDCEx; added wine dialog change; added extra logging

Location:
trunk/src/user32
Files:
8 edited

Legend:

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

    r3341 r3482  
    1 /* $Id: dc.cpp,v 1.54 2000-04-07 12:55:15 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.55 2000-05-02 20:50:48 sandervl Exp $ */
    22
    33/*
     
    803803}
    804804//******************************************************************************
     805//******************************************************************************
     806int WIN32API ReleaseDC (HWND hwnd, HDC hdc)
     807{
     808   BOOL isOwnDC = FALSE;
     809   int rc;
     810
     811   if (hwnd)
     812   {
     813        Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
     814        if(wnd == NULL) {
     815                dprintf(("ERROR: ReleaseDC %x %x failed", hwnd, hdc));
     816                return 0;
     817        }
     818        //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)
     819//      isOwnDC = wnd->isOwnDC() && wnd->getOwnDC();
     820        isOwnDC = wnd->isOwnDC() && (wnd->getOwnDC() == hdc);
     821   }
     822   if (isOwnDC)
     823      rc = TRUE;
     824   else
     825      rc = O32_ReleaseDC (0, hdc);
     826
     827   dprintf(("ReleaseDC %x %x", hwnd, hdc));
     828   return (rc);
     829}
     830//******************************************************************************
    805831// This implementation of GetDCEx supports
    806832// DCX_WINDOW
     
    961987   /* Something went wrong; clean up
    962988    */
     989   dprintf(("ERROR: GetDCEx hwnd %x (%x %x) FAILED!", hwnd, hrgn, flags));
     990   DebugInt3();
    963991   if (pHps)
    964992   {
     
    9931021  if (!hwnd) hwnd = GetDesktopWindow();
    9941022  return GetDCEx (hwnd, NULL, DCX_USESTYLE_W | DCX_WINDOW_W);
    995 }
    996 //******************************************************************************
    997 //******************************************************************************
    998 int WIN32API ReleaseDC (HWND hwnd, HDC hdc)
    999 {
    1000    BOOL isOwnDC = FALSE;
    1001    int rc;
    1002 
    1003    if (hwnd)
    1004    {
    1005         Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    1006         if(wnd == NULL) {
    1007                 dprintf(("ERROR: ReleaseDC %x %x failed", hwnd, hdc));
    1008                 return 0;
    1009         }
    1010         //SvL: Hack for memory.exe (doesn't get repainted properly otherwise)
    1011 //      isOwnDC = wnd->isOwnDC() && wnd->getOwnDC();
    1012         isOwnDC = wnd->isOwnDC() && (wnd->getOwnDC() == hdc);
    1013    }
    1014    if (isOwnDC)
    1015       rc = TRUE;
    1016    else
    1017       rc = O32_ReleaseDC (0, hdc);
    1018 
    1019    dprintf(("ReleaseDC %x %x", hwnd, hdc));
    1020    return (rc);
    10211023}
    10221024//******************************************************************************
     
    10401042   else   dprintf(("RedrawWindow %x %x %x %x", hwnd, pRect, hrgn, redraw));
    10411043
    1042    if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W))
    1043    {
    1044         SetLastError(ERROR_NOT_SUPPORTED_W);
    1045         return FALSE;
    1046    }
    1047 
    10481044   if (hwnd == NULLHANDLE)
    10491045   {
     
    10761072            return FALSE;
    10771073        }
    1078         hwnd = wnd->getOS2WindowHandle();
     1074        //TODO: If frame, exclude client window from update
     1075        if(redraw & RDW_FRAME_W) {
     1076                hwnd = wnd->getOS2FrameWindowHandle();
     1077        }
     1078        else    hwnd = wnd->getOS2WindowHandle();
     1079
    10791080   }
    10801081
  • trunk/src/user32/loadres.cpp

    r3462 r3482  
    1 /* $Id: loadres.cpp,v 1.27 2000-04-29 18:28:36 sandervl Exp $ */
     1/* $Id: loadres.cpp,v 1.28 2000-05-02 20:50:48 sandervl Exp $ */
    22
    33/*
     
    468468                hbitmap = CreateDIBitmap(hdc, &fix_info->bmiHeader, CBM_INIT,
    469469                                         bits, fix_info, DIB_RGB_COLORS );
     470                if(hbitmap == 0) {
     471                        dprintf(("LoadBitmapA: CreateDIBitmap failed!!"));
     472                }
    470473//        }
    471474        }
  • trunk/src/user32/oslibmsgtranslate.cpp

    r3388 r3482  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.28 2000-04-15 15:11:13 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.29 2000-05-02 20:50:49 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    194194                        win32wnd = win32wnd->getParent();
    195195                }
     196                dprintf(("Rerouting mouse messages to parent %x of disabled window %x", win32wnd->getWindowHandle(), winMsg->hwnd));
    196197                fWasDisabled = TRUE;
    197198        }
     
    246247                        win32wnd = win32wnd->getParent();
    247248                }
     249                dprintf(("Rerouting mouse messages to parent %x of disabled window %x", win32wnd->getWindowHandle(), winMsg->hwnd));
    248250                fWasDisabled = TRUE;
    249251        }
     
    636638
    637639        dprintf(("PM: WM_CHAR: %x %x %d %x", SHORT1FROMMP(os2Msg->mp2), SHORT2FROMMP(os2Msg->mp2), repeatCount, scanCode));
    638         dprintf(("PM: WM_CHAR: %x", flags));
     640        dprintf(("PM: WM_CHAR: hwnd %x flags %x", win32wnd->getWindowHandle(), flags));
    639641
    640642        // vitali add begin
  • trunk/src/user32/uitools.cpp

    r2873 r3482  
    1 /* $Id: uitools.cpp,v 1.26 2000-02-23 17:05:17 cbratschi Exp $ */
     1/* $Id: uitools.cpp,v 1.27 2000-05-02 20:50:49 sandervl Exp $ */
    22/*
    33 * User Interface Functions
     
    16141614//******************************************************************************
    16151615//******************************************************************************
    1616 BOOL WIN32API DrawFocusRect( HDC arg1, const RECT *  arg2)
    1617 {
    1618 #ifdef DEBUG
    1619     WriteLog("USER32:  DrawFocusRect\n");
    1620 #endif
    1621     return O32_DrawFocusRect(arg1, arg2);
     1616BOOL WIN32API DrawFocusRect( HDC hdc, const RECT *lpRect)
     1617{
     1618 BOOL rc;
     1619
     1620    rc = O32_DrawFocusRect(hdc, lpRect);
     1621    dprintf(("USER32:  DrawFocusRect %x %x returned %d", hdc, lpRect, rc));
     1622    return rc;
    16221623}
    16231624//******************************************************************************
     
    16311632  COLORREF oldFg,oldBg;
    16321633
    1633 #ifdef DEBUG
    1634   WriteLog("USER32:  DrawIcon\n");
    1635 #endif
     1634  dprintf(("USER32:  DrawIcon\n"));
    16361635
    16371636  if (!hDC || !hIcon)
     
    16811680  INT oldStretchMode;
    16821681
    1683 #ifdef DEBUG
    1684   WriteLog("USER32:  DrawIconEx\n");
    1685 #endif
     1682  dprintf(("USER32:  DrawIconEx"));
    16861683
    16871684  //CB: istepIfAniCur, DI_COMPAT ignored
  • trunk/src/user32/user32.cpp

    r3337 r3482  
    1 /* $Id: user32.cpp,v 1.77 2000-04-07 10:01:16 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.78 2000-05-02 20:50:50 sandervl Exp $ */
    22
    33/*
     
    151151       (lprcSrc1->top >= lprcSrc2->bottom) || (lprcSrc2->top >= lprcSrc1->bottom))
    152152    {
    153       SetLastError(ERROR_INVALID_PARAMETER);
    154       if (lprcDst) SetRectEmpty(lprcDst);
    155       return FALSE;
     153        //SvL: NT doesn't set the last error here
     154        //SetLastError(ERROR_INVALID_PARAMETER);
     155        if (lprcDst) SetRectEmpty(lprcDst);
     156        return FALSE;
    156157    }
    157158    if (lprcDst)
     
    12221223SHORT WIN32API GetKeyState( int nVirtKey)
    12231224{
    1224 //SvL: Hehe. 32 MB logfile for Opera after a minute.
    12251225    dprintf2(("USER32:  GetKeyState %d\n", nVirtKey));
    12261226    return O32_GetKeyState(nVirtKey);
  • trunk/src/user32/win32dlg.cpp

    r3060 r3482  
    1 /* $Id: win32dlg.cpp,v 1.47 2000-03-09 19:05:39 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.48 2000-05-02 20:50:51 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    7676    if (dlgInfo.style & DS_SETFONT)
    7777    {
    78         /* The font height must be negative as it is a point size */
    79         /* (see CreateFont() documentation in the Windows SDK).   */
    80         hUserFont = CreateFontW(-(dlgInfo.pointSize*3)/2, 0, 0, 0,
     78          /* The font height must be negative as it is a point size */
     79          /* and must be converted to pixels first */
     80          /* (see CreateFont() documentation in the Windows SDK).   */
     81        HDC dc = GetDC(0);
     82        int pixels = dlgInfo.pointSize * GetDeviceCaps(dc , LOGPIXELSY)/72;
     83        ReleaseDC(0, dc);
     84
     85        hUserFont = CreateFontW(-pixels, 0, 0, 0,
    8186                            dlgInfo.weight, dlgInfo.italic, FALSE,
    8287                            FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY,
     
    125130            INT dX, dY;
    126131
    127             if( !(dlgInfo.style & DS_ABSALIGN) )
     132            if( !(dlgInfo.style & DS_ABSALIGN) && owner)
    128133                ClientToScreen(owner, (POINT *)&rect );
    129134
     
    232237        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    233238
    234         if (SendInternalMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param))
    235              SetFocus(hwndFocus);
     239        HWND hwndPreInitFocus = GetFocus();
     240        if(SendInternalMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param)) {
     241                SetFocus(hwndFocus);
     242        }
     243        else
     244        {
     245                /* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
     246                   but the focus has not changed, set the focus where we expect it. */
     247                if ( (getStyle() & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
     248                        SetFocus( hwndFocus );
     249        }
    236250
    237251        if (dlgInfo.style & WS_VISIBLE && !(getStyle() & WS_VISIBLE))
  • trunk/src/user32/win32wbase.cpp

    r3462 r3482  
    1 /* $Id: win32wbase.cpp,v 1.181 2000-04-29 18:28:39 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.182 2000-05-02 20:50:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    21132113        return TRUE;
    21142114    }
     2115#if 0
     2116    /* Fix redundant flags */
     2117    if(getStyle() & WS_VISIBLE) {
     2118        fuFlags &= ~SWP_SHOWWINDOW;
     2119    }
     2120    else
     2121    {
     2122        if (!(fuFlags & SWP_SHOWWINDOW))
     2123              fuFlags |= SWP_NOREDRAW;
     2124        fuFlags &= ~SWP_HIDEWINDOW;
     2125    }
     2126
     2127    if(cx < 0) cx = 0;
     2128    if(cy < 0) cy = 0;
     2129
     2130    if((rectWindow.right - rectWindow.left == cx) && (rectWindow.bottom - rectWindow.top == cy)) {
     2131        fuFlags |= SWP_NOSIZE;    /* Already the right size */
     2132    }
     2133
     2134    if((rectWindow.left == x) && (rectWindow.top == y)) {
     2135        fuFlags |= SWP_NOMOVE;    /* Already the right position */
     2136    }
     2137
     2138    if(getWindowHandle() == GetActiveWindow()) {
     2139        fuFlags |= SWP_NOACTIVATE;   /* Already active */
     2140    }
     2141    else
     2142    if((getStyle() & (WS_POPUP | WS_CHILD)) != WS_CHILD )
     2143    {
     2144        if(!(fuFlags & SWP_NOACTIVATE)) /* Bring to the top when activating */
     2145        {
     2146            fuFlags &= ~SWP_NOZORDER;
     2147            hwndInsertAfter = HWND_TOP;           
     2148        }
     2149    }
     2150#endif
     2151
    21152152    WINDOWPOS wpos;
    21162153    SWP swp, swpOld;
     
    21962233        FrameUpdateClient(this);
    21972234    }
    2198 
    21992235    return (rc);
    22002236}
  • trunk/src/user32/window.cpp

    r3462 r3482  
    1 /* $Id: window.cpp,v 1.62 2000-04-29 18:28:41 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.63 2000-05-02 20:50:53 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    465465        return 0;
    466466    }
    467     dprintf(("ShowWindow %x", hwnd));
    468467    return window->ShowWindow(nCmdShow);
    469468}
     
    868867 OSLIBPOINT point;
    869868
     869    SetLastError(0);
    870870    if(lpPoints == NULL || cPoints == 0) {
    871871        SetLastError(ERROR_INVALID_PARAMETER);
     
    902902    if (!mapWin32Point(wndfrom,wndto,&point))
    903903    {
    904       SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    905       return 0;
     904        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     905        return 0;
    906906    }
    907907
     
    919919//******************************************************************************
    920920//******************************************************************************
    921 BOOL WIN32API ScreenToClient (HWND hwnd, LPPOINT pt)
     921BOOL WIN32API ScreenToClient(HWND hwnd, LPPOINT pt)
    922922{
    923923    Win32BaseWindow *wnd;
     
    929929    if (!wnd) {
    930930        dprintf(("warning: ScreenToClient: window %x not found!", hwnd));
    931         return (TRUE);
    932     }
     931        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     932        return FALSE;
     933    }
     934    SetLastError(0);
    933935#ifdef DEBUG
    934936    POINT tmp = *pt;
Note: See TracChangeset for help on using the changeset viewer.