Changeset 10379 for trunk/src


Ignore:
Timestamp:
Jan 11, 2004, 1:04:44 PM (22 years ago)
Author:
sandervl
Message:

Update

Location:
trunk/src/user32
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/Makefile

    r10222 r10379  
    1 # $Id: Makefile,v 1.108 2003-08-08 15:54:32 sandervl Exp $
     1# $Id: Makefile,v 1.109 2004-01-11 12:03:12 sandervl Exp $
    22
    33#
     
    6969$(OBJDIR)\windowword.obj \
    7070$(OBJDIR)\windowmsg.obj \
     71$(OBJDIR)\callwrap.obj \
    7172$(OBJDIR)\message.obj \
    7273$(OBJDIR)\winproc.obj \
  • trunk/src/user32/caret.cpp

    r9217 r10379  
    1 /* $Id: caret.cpp,v 1.19 2002-09-06 12:31:40 sandervl Exp $ */
     1/* $Id: caret.cpp,v 1.20 2004-01-11 12:03:13 sandervl Exp $ */
    22
    33/*
     
    119119}
    120120
     121/*
     122 * The SetCaretPos function moves the caret to the specified coordinates. If
     123 * the window that owns the caret was created with the CS_OWNDC class style,
     124 * then the specified coordinates are subject to the mapping mode of the device
     125 * context associated with that window.
     126 *
     127 */
    121128BOOL WIN32API SetCaretPos (int x, int y)
    122129{
  • trunk/src/user32/dc.cpp

    r10316 r10379  
    1 /* $Id: dc.cpp,v 1.122 2003-11-12 14:10:18 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.123 2004-01-11 12:03:13 sandervl Exp $ */
    22
    33/*
     
    618618//******************************************************************************
    619619//******************************************************************************
    620 void releaseOwnDC (HDC hps)
    621 {
    622    pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hps);
    623 
    624    dprintf2(("releaseOwnDC %x", hps));
    625 
    626    if (pHps) {
    627       if (pHps->hrgnHDC)
    628          GpiDestroyRegion (pHps->hps, pHps->hrgnHDC);
    629 
    630       GpiSetBitmap (pHps->hps, NULL);
    631       O32_DeleteObject (pHps->nullBitmapHandle);
    632       GpiDestroyPS(pHps->hps);
    633 
    634       if (pHps->hdc)
    635          DevCloseDC(pHps->hdc);
    636    }
    637 }
    638 //******************************************************************************
    639 //******************************************************************************
    640620HDC WIN32API BeginPaint (HWND hWnd, PPAINTSTRUCT_W lpps)
    641621{
     
    685665            }
    686666            hpsPaint = hPS_ownDC;
     667            STATS_GetDCEx(hwnd, hpsPaint, 0, 0);
    687668        }
    688669    }
     
    865846
    866847    HWND hwndDC = WindowFromDC(hdc);
    867 
     848 
     849    //hwndDC can be zero if the window has already been destroyed
    868850    if(hwndDC != hwnd) {
    869851        dprintf(("WARNING: ReleaseDC: wrong window handle specified %x -> %x", hwnd, hwndDC));
     
    908890    }
    909891
     892    STATS_ReleaseDC(hwnd, hdc);
    910893    if(isOwnDC) {
    911894        rc = TRUE;
     
    914897        UnselectGDIObjects(hdc);
    915898        rc = O32_ReleaseDC (0, hdc);
    916         STATS_ReleaseDC(hwnd, hdc);
    917899    }
    918900
     
    11171099    RELEASE_WNDOBJ(wnd);
    11181100
    1119 
    11201101    STATS_GetDCEx(hwnd, pHps->hps, hrgn, flags);
    11211102    return (HDC)pHps->hps;
     
    16201601    if (lComplexity == RGN_ERROR)
    16211602    {
    1622         RELEASE_WNDOBJ(window);
    1623         return ERROR_W;
     1603        goto fail;
    16241604    }
    16251605
     
    16461626                if(!child) {
    16471627                    dprintf(("ERROR: ScrollWindowEx, child %x not found", hwnd));
    1648                     RELEASE_WNDOBJ(window);
    1649                     return 0;
     1628                    goto fail;
    16501629                }
    16511630                rectChild = *child->getWindowRect();
     
    17121691    RELEASE_WNDOBJ(window);
    17131692    return (regionType);
     1693
     1694fail:
     1695    if(hrgn)      GpiDestroyRegion(hpsScreen, hrgn);
     1696    if(hpsScreen) WinReleasePS(hpsScreen);
     1697    RELEASE_WNDOBJ(window);
     1698    return ERROR_W;
    17141699}
    17151700//******************************************************************************
  • trunk/src/user32/dc.h

    r10316 r10379  
    1 /* $Id: dc.h,v 1.18 2003-11-12 14:10:19 sandervl Exp $ */
     1/* $Id: dc.h,v 1.19 2004-01-11 12:03:15 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    1515extern BOOL isYup (struct _DCData *pHps);
    1616extern HDC sendEraseBkgnd (Win32BaseWindow *wnd);
    17 extern void releaseOwnDC (HDC hps);
    1817BOOL setPageXForm(Win32BaseWindow *wnd, struct _DCData * pHps);
    1918
  • trunk/src/user32/oslibwin.cpp

    r10284 r10379  
    1 /* $Id: oslibwin.cpp,v 1.145 2003-10-22 12:43:13 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.146 2004-01-11 12:03:15 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    8585    dwWinStyle = dwWinStyle & ~(WS_TABSTOP | WS_GROUP);
    8686
    87     if(fTaskList)
     87    if(fTaskList || hwndParent == HWND_DESKTOP)
    8888    {
    8989        dwFrameStyle |= FCF_NOMOVEWITHOWNER;
     
    280280              swp[i].cx += minmaxwidth/2;
    281281          }
    282           swp[i].cy = minmaxheight;
     282          //one pixel more to let PM center the controls properly
     283          swp[i].cy = minmaxheight+1;
    283284          swp[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
    284285          dprintf(("FID_MINMAX (%d,%d)(%d,%d)", swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
  • trunk/src/user32/pmwindow.cpp

    r10328 r10379  
    1 /* $Id: pmwindow.cpp,v 1.225 2003-11-15 12:28:47 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.226 2004-01-11 12:03:16 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    4444#include <thread.h>
    4545#include <wprocess.h>
     46#include <objhandle.h>
    4647#include "caret.h"
    4748#include "timer.h"
     
    6465#include "dbglocal.h"
    6566
    66 
    67 #define ODIN_SetExceptionHandler(a)
    68 #define ODIN_UnsetExceptionHandler(a)
    69 #define hookInit(a)
    7067
    7168// Notification that focus change has completed (UNDOCUMENTED)
     
    332329        //Create win32 bitmap handles of the OS/2 min, max and restore buttons
    333330        hBmpMinButton     = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MINBUTTON]);
     331        ObjSetHandleFlag(hBmpMinButton, OBJHANDLE_FLAG_NODELETE, 1);
    334332        hBmpMinButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MINBUTTONDOWN]);
     333        ObjSetHandleFlag(hBmpMinButtonDown, OBJHANDLE_FLAG_NODELETE, 1);
    335334        hBmpMaxButton     = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MAXBUTTON]);
     335        ObjSetHandleFlag(hBmpMaxButton, OBJHANDLE_FLAG_NODELETE, 1);
    336336        hBmpMaxButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_MAXBUTTONDOWN]);
     337        ObjSetHandleFlag(hBmpMaxButtonDown, OBJHANDLE_FLAG_NODELETE, 1);
    337338        hBmpRestoreButton = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_RESTOREBUTTON]);
     339        ObjSetHandleFlag(hBmpRestoreButton, OBJHANDLE_FLAG_NODELETE, 1);
    338340        hBmpRestoreButtonDown = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_RESTOREBUTTONDOWN]);
     341        ObjSetHandleFlag(hBmpRestoreButtonDown, OBJHANDLE_FLAG_NODELETE, 1);
    339342        hBmpCloseButton   = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTON]);
     343        ObjSetHandleFlag(hBmpCloseButton, OBJHANDLE_FLAG_NODELETE, 1);
    340344        hBmpCloseButtonDown   = O32_CreateBitmapFromPMHandle(hbmFrameMenu[PMMENU_CLOSEBUTTONDOWN]);
     345        ObjSetHandleFlag(hBmpCloseButtonDown, OBJHANDLE_FLAG_NODELETE, 1);
    341346        DevCloseDC(hdc);
    342347    }
     
    21262131
    21272132        dprintf(("PMFRAME:WM_OWNERPOSCHANGE %x %x %x (%s) (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, DbgGetStringSWPFlags(pswp->fl), pswp->x, pswp->y, pswp->cx, pswp->cy));
    2128         goto RunDefFrameWndProc;
     2133        RestoreOS2TIB();
     2134        rc = pfnFrameWndProc(hwnd, msg, mp1, mp2);
     2135        SetWin32TIB();
     2136        dprintf(("PMFRAME: DEF WM_OWNERPOSCHANGE %x %x %x (%s) (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, DbgGetStringSWPFlags(pswp->fl), pswp->x, pswp->y, pswp->cx, pswp->cy));
     2137        break;
    21292138    }
    21302139#endif
  • trunk/src/user32/win32dlg.cpp

    r10033 r10379  
    1 /* $Id: win32dlg.cpp,v 1.81 2003-04-24 13:59:14 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.82 2004-01-11 12:03:17 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    426426    if (!getCharSizeFromDC( hdc, 0, &size )) return FALSE;
    427427    DeleteDC( hdc );
     428    dprintf(("Dialog base unit size (%d,%d)", size.cx, size.cy));
    428429    xBaseUnit = size.cx;
    429430    yBaseUnit = size.cy;
  • trunk/src/user32/win32wbase.cpp

    r10332 r10379  
    1 /* $Id: win32wbase.cpp,v 1.382 2003-11-17 13:15:03 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.383 2004-01-11 12:03:18 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    6868#include "timer.h"
    6969#include "user32api.h"
     70#include "callwrap.h"
    7071
    7172#define DBG_LOCALLOG    DBG_win32wbase
     
    144145        DebugInt3();
    145146  }
     147  Win32HwndOrg     = Win32Hwnd;
    146148
    147149  posx = posy      = 0;
     
    249251    }
    250252
    251     /* Decrement class window counter */
     253    // Decrement class window counter
     254    // NOTE: Must be done before ReleaseDC call for ownDC!
    252255    if(windowClass) {
    253256        RELEASE_CLASSOBJ(windowClass);
    254257    }
    255258
    256     if(isOwnDC())
    257         releaseOwnDC(ownDC);
     259    if(ownDC)
     260        ReleaseDC(Win32HwndOrg, ownDC);
    258261
    259262    if(Win32Hwnd)
     
    670673        //DC among different windows... DevOpenDC apparently can't be used
    671674        //for window DCs and WinOpenWindowDC must be associated with a window
    672         ownDC = GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE);
     675        ownDC = 0; //GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE);
    673676    }
    674677    /* Set the window menu */
     
    888891            HwFreeWindowHandle(Win32Hwnd);
    889892            Win32Hwnd = 0;
     893        }
     894        // Decrement class window counter
     895        // NOTE: Must be done before ReleaseDC call for ownDC!
     896        if(windowClass) {
     897            RELEASE_CLASSOBJ(windowClass);
     898        }
     899
     900        if(ownDC) {
     901            ReleaseDC(Win32Hwnd, ownDC);
     902            ownDC = 0;
    890903        }
    891904    }
     
    23512364
    23522365    case SW_SHOWNOACTIVATE:
    2353         swp |= SWP_NOZORDER;
    2354         if (GetActiveWindow())
    2355             swp |= SWP_NOACTIVATE;
     2366        swp |= SWP_NOZORDER | SWP_NOACTIVATE;
    23562367        /* fall through */
    23572368    case SW_SHOWNORMAL:  /* same as SW_NORMAL: */
     
    25392550            dprintf(("new window rectangle (%d,%d)(%d,%d)", rectWindow.left, rectWindow.top, rectWindow.right, rectWindow.bottom));
    25402551        }
     2552    }
     2553
     2554    // Hack alert: This makes sure the tooltips windows in OpenOffice don't
     2555    //             activate the owner windows too.
     2556    //             First condition takes care of SetWindowPos during window
     2557    //             creation. The 2nd one for calls made by OpenOffice
     2558    if(((getStyle() & WS_POPUP) && (getExStyle() & WS_EX_TOPMOST)) || (fuFlags & SWP_NOOWNERZORDER))
     2559    {
     2560        //SWP_NOOWNERZORDER means only the z-order of this window changes; it
     2561        //should not affect the owner
     2562        //PM doesn't support this feature, so this hack might work
     2563        wpos.flags |= SWP_NOZORDER;
    25412564    }
    25422565
     
    31233146        child->addRef();
    31243147        unlock();
    3125         if(lpfn(hwnd, lParam) == FALSE)
     3148        if(WrapCallback2((WNDPROC)lpfn, hwnd, lParam) == FALSE)
    31263149        {
    31273150                child->release();
     
    31893212            if(dwThreadId == tid) {
    31903213                dprintf(("EnumThreadWindows: Found Window %x", hwndWin32));
    3191                 if((rc = lpfn(hwndWin32, lParam)) == FALSE) {
     3214                if((rc = WrapCallback2((WNDPROC)lpfn, hwndWin32, lParam)) == FALSE) {
    31923215                    break;
    31933216                }
     
    32233246            {
    32243247                dprintf2(("EnumWindows: Found Window %x", hwnd));
    3225                 if((rc = lpfn(hwnd, lParam)) == FALSE) {
     3248                if((rc = WrapCallback2((WNDPROC)lpfn, hwnd, lParam)) == FALSE) {
    32263249                    break;
    32273250                }
  • trunk/src/user32/win32wbase.h

    r10316 r10379  
    1 /* $Id: win32wbase.h,v 1.156 2003-11-12 14:10:21 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.157 2004-01-11 12:03:20 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    258258         void   setOldPMWindowProc(PVOID pfnPMWndProc) { pfnOldPMWndProc = pfnPMWndProc; };
    259259
    260          HWND   GetWindow(UINT uCmd);
     260 virtual HWND   GetWindow(UINT uCmd);
    261261 virtual BOOL   EnableWindow(BOOL fEnable);
    262262         BOOL   CloseWindow();
     
    377377        HWND    OS2Hwnd, OS2HwndFrame;
    378378        HMENU   hSysMenu;
    379         HWND    Win32Hwnd;
     379        HWND    Win32Hwnd, Win32HwndOrg;
    380380
    381381        int     posx, posy, width, height;
     
    520520         //Temporary hack for CS_CLASSDC style (do the same as for CS_OWNDC)
    521521#ifndef OS2_INCLUDED
    522          BOOL   isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC)); }
     522         BOOL   isOwnDC() { return (windowClass && (windowClass->getStyle() & (CS_OWNDC|CS_CLASSDC))); }
    523523#else
    524          BOOL   isOwnDC() { return (windowClass && windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W)); }
     524         BOOL   isOwnDC() { return (windowClass && (windowClass->getStyle() & (CS_OWNDC_W|CS_CLASSDC_W))); }
    525525#endif
    526526
  • trunk/src/user32/win32wdesktop.cpp

    r9523 r10379  
    1 /* $Id: win32wdesktop.cpp,v 1.20 2002-12-18 12:28:07 sandervl Exp $ */
     1/* $Id: win32wdesktop.cpp,v 1.21 2004-01-11 12:03:21 sandervl Exp $ */
    22/*
    33 * Win32 Desktop Window for OS/2
     
    9090}
    9191//******************************************************************************
     92//******************************************************************************
     93HWND Win32Desktop::GetWindow(UINT uCmd)
     94{
     95 HWND hwndRelated = 0;
     96 Win32BaseWindow *window;
     97
     98    switch(uCmd)
     99    {
     100    case GW_CHILD:
     101        //special case for the desktop window. we need to find the first Odin
     102        //window in the z-order
     103        hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP);
     104        while(hwndRelated)
     105        {
     106            window = GetWindowFromOS2FrameHandle(hwndRelated);
     107            if(window) {
     108                 hwndRelated = window->getWindowHandle();
     109                 RELEASE_WNDOBJ(window);
     110                 break;
     111            }
     112            hwndRelated = OSLibWinQueryWindow(hwndRelated, QWOS_NEXT);
     113        }
     114        break;
     115
     116    default:
     117        return Win32BaseWindow::GetWindow(uCmd);
     118    }
     119end:
     120    dprintf(("GetWindow %x %d returned %x", getWindowHandle(), uCmd, hwndRelated));
     121    return hwndRelated;
     122}
     123//******************************************************************************
    92124//Dummy window procedure. Does nothing.
    93125//******************************************************************************
  • trunk/src/user32/win32wdesktop.h

    r5935 r10379  
    1 /* $Id: win32wdesktop.h,v 1.8 2001-06-09 14:50:22 sandervl Exp $ */
     1/* $Id: win32wdesktop.h,v 1.9 2004-01-11 12:03:21 sandervl Exp $ */
    22/*
    33 * Win32 Desktop Window for OS/2
     
    2525 virtual BOOL   EnableWindow(BOOL fEnable);
    2626 virtual BOOL   DestroyWindow();
    27 virtual  BOOL   isDesktopWindow();
     27 virtual BOOL   isDesktopWindow();
     28 virtual HWND   GetWindow(UINT uCmd);
    2829
    2930protected:
  • trunk/src/user32/win32wndhandle.cpp

    r10256 r10379  
    1 /* $Id: win32wndhandle.cpp,v 1.18 2003-10-02 10:36:00 sandervl Exp $ */
     1/* $Id: win32wndhandle.cpp,v 1.19 2004-01-11 12:03:21 sandervl Exp $ */
    22/*
    33 * Win32 Handle Management Code for OS/2
     
    4848{
    4949    if(globalwhandlecritsect.hmtxLock == 0) {
    50          dprintf(("InitializeWindowHandles -> create shared critical section"));
     50         dprintf(("InitializeWindowHandles %x -> create shared critical section", &globalwhandlecritsect));
    5151         DosInitializeCriticalSection(&globalwhandlecritsect, pszWndHandleSemName);
    5252    }
    5353    else {
    54          dprintf(("InitializeWindowHandles -> access shared critical section"));
     54         dprintf(("InitializeWindowHandles %x -> access shared critical section", &globalwhandlecritsect));
    5555         DosAccessCriticalSection(&globalwhandlecritsect, pszWndHandleSemName);
    5656    }
     
    6060void FinalizeWindowHandles()
    6161{
     62    dprintf(("FinalizeWindowHandles %x", &globalwhandlecritsect));
    6263    DosDeleteCriticalSection(&globalwhandlecritsect);
    6364}
Note: See TracChangeset for help on using the changeset viewer.