Changeset 2294 for trunk/src


Ignore:
Timestamp:
Jan 2, 2000, 9:20:03 PM (26 years ago)
Author:
sandervl
Message:

Implemented Set/GetWindowRgn (not activated)

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r2257 r2294  
    1 /* $Id: dc.cpp,v 1.31 1999-12-29 22:53:59 cbratschi Exp $ */
     1/* $Id: dc.cpp,v 1.32 2000-01-02 20:20:01 sandervl Exp $ */
    22
    33/*
     
    14281428 *****************************************************************************/
    14291429
    1430 int WIN32API GetWindowRgn (HWND hWnd,
    1431                               HRGN hRgn)
    1432 {
    1433   dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
    1434          hWnd,
    1435          hRgn));
    1436   //Attention: Win32 hwnd handle!
    1437 
    1438   return (NULLREGION_W);
     1430int WIN32API GetWindowRgn(HWND hwnd, HRGN hRgn)
     1431{
     1432  Win32BaseWindow *window;
     1433  HRGN hWindowRegion;
     1434
     1435    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1436    if(!window) {
     1437        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1438        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1439        return 0;
     1440    }
     1441    dprintf(("USER32:GetWindowRgn (%x,%x)", hwnd, hRgn));
     1442    hWindowRegion = window->GetWindowRegion();
     1443
     1444    return O32_CombineRgn(hRgn, hWindowRegion, 0, RGN_COPY_W);
    14391445}
    14401446/*****************************************************************************
     
    14441450 *             operating system permits drawing. The operating system does not
    14451451 *             display any portion of a window that lies outside of the window region
     1452 *             When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1453 *             WM_WINDOWPOSCHANGED messages to the window.
     1454 *
    14461455 * Parameters: HWND  hWnd    handle to window whose window region is to be set
    14471456 *             HRGN  hRgn    handle to region
     
    14561465 *****************************************************************************/
    14571466
    1458 int WIN32API SetWindowRgn(HWND hWnd,
    1459                              HRGN hRgn,
    1460                              BOOL bRedraw)
    1461 {
    1462   dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
    1463          hWnd,
    1464          hRgn,
    1465          bRedraw));
    1466   //Attention: Win32 hwnd handle!
    1467 
    1468   return (0);
     1467int WIN32API SetWindowRgn(HWND hwnd,
     1468                          HRGN hRgn,
     1469                          BOOL bRedraw)
     1470{
     1471  Win32BaseWindow *window;
     1472  HRGN hWindowRegion;
     1473
     1474    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1475    if(!window) {
     1476        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1477        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1478        return 0;
     1479    }
     1480    dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw));
     1481    window->SetWindowRegion(hRgn);
     1482    if(bRedraw) {
     1483        RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);     
     1484    }
     1485//TODO:
     1486//  When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1487//  WM_WINDOWPOSCHANGED messages to the window.
     1488    return 1;
    14691489}
    14701490//******************************************************************************
  • trunk/src/user32/new/dc.cpp

    r2292 r2294  
    1 /* $Id: dc.cpp,v 1.7 2000-01-02 19:30:42 cbratschi Exp $ */
     1/* $Id: dc.cpp,v 1.8 2000-01-02 20:20:02 sandervl Exp $ */
    22
    33/*
     
    14281428 *****************************************************************************/
    14291429
    1430 int WIN32API GetWindowRgn (HWND hWnd,
    1431                               HRGN hRgn)
    1432 {
    1433   dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
    1434          hWnd,
    1435          hRgn));
    1436   //Attention: Win32 hwnd handle!
    1437 
    1438   return (NULLREGION_W);
     1430int WIN32API GetWindowRgn(HWND hwnd, HRGN hRgn)
     1431{
     1432  Win32BaseWindow *window;
     1433  HRGN hWindowRegion;
     1434
     1435    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1436    if(!window) {
     1437        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1438        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1439        return 0;
     1440    }
     1441    dprintf(("USER32:GetWindowRgn (%x,%x)", hwnd, hRgn));
     1442    hWindowRegion = window->GetWindowRegion();
     1443
     1444    return O32_CombineRgn(hRgn, hWindowRegion, 0, RGN_COPY_W);
    14391445}
    14401446/*****************************************************************************
     
    14441450 *             operating system permits drawing. The operating system does not
    14451451 *             display any portion of a window that lies outside of the window region
     1452 *             When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1453 *             WM_WINDOWPOSCHANGED messages to the window.
     1454 *
    14461455 * Parameters: HWND  hWnd    handle to window whose window region is to be set
    14471456 *             HRGN  hRgn    handle to region
     
    14561465 *****************************************************************************/
    14571466
    1458 int WIN32API SetWindowRgn(HWND hWnd,
    1459                              HRGN hRgn,
    1460                              BOOL bRedraw)
    1461 {
    1462   dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
    1463          hWnd,
    1464          hRgn,
    1465          bRedraw));
    1466   //Attention: Win32 hwnd handle!
    1467 
    1468   return (0);
     1467int WIN32API SetWindowRgn(HWND hwnd,
     1468                          HRGN hRgn,
     1469                          BOOL bRedraw)
     1470{
     1471  Win32BaseWindow *window;
     1472  HRGN hWindowRegion;
     1473
     1474    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1475    if(!window) {
     1476        dprintf(("SetWindowContextHelpId, window %x not found", hwnd));
     1477        O32_SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     1478        return 0;
     1479    }
     1480    dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw));
     1481    window->SetWindowRegion(hRgn);
     1482    if(bRedraw) {
     1483        RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W);     
     1484    }
     1485//TODO:
     1486//  When this function is called, the system sends the WM_WINDOWPOSCHANGING and
     1487//  WM_WINDOWPOSCHANGED messages to the window.
     1488    return 1;
    14691489}
    14701490//******************************************************************************
  • trunk/src/user32/new/win32wbase.cpp

    r2292 r2294  
    1 /* $Id: win32wbase.cpp,v 1.19 2000-01-02 19:30:44 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.20 2000-01-02 20:20:02 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    227227
    228228  ownDC              = 0;
     229  hWindowRegion      = 0;
    229230
    230231  if(currentProcessId == -1)
  • trunk/src/user32/new/win32wbase.h

    r2292 r2294  
    1 /* $Id: win32wbase.h,v 1.14 2000-01-02 19:30:45 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.15 2000-01-02 20:20:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    161161         HICON  GetIcon()                           { return (HICON) iconResource; };
    162162
     163         void   SetWindowRegion(HRGN hRegion)       { hWindowRegion = hRegion; };
     164         HRGN   GetWindowRegion()                   { return hWindowRegion; };
     165
    163166         BOOL   ShowWindow(ULONG nCmdShow);
    164167         BOOL   SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
     
    312315        BOOL    fParentDC;
    313316
     317        HRGN    hWindowRegion;
     318
    314319        DWORD   dwThreadId;             //id of thread that created this window
    315320        DWORD   dwProcessId;            //id of process that created this window
  • trunk/src/user32/win32wbase.cpp

    r2289 r2294  
    1 /* $Id: win32wbase.cpp,v 1.131 2000-01-01 14:37:34 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.132 2000-01-02 20:20:01 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    204204
    205205  ownDC              = 0;
     206  hWindowRegion      = 0;
    206207
    207208  if(currentProcessId == -1)
  • trunk/src/user32/win32wbase.h

    r2289 r2294  
    1 /* $Id: win32wbase.h,v 1.63 2000-01-01 14:37:35 cbratschi Exp $ */
     1/* $Id: win32wbase.h,v 1.64 2000-01-02 20:20:02 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    153153         BOOL   SetIcon(HICON hIcon);
    154154         HICON  GetIcon()                           { return (HICON) iconResource; };
     155
     156         void   SetWindowRegion(HRGN hRegion)       { hWindowRegion = hRegion; };
     157         HRGN   GetWindowRegion()                   { return hWindowRegion; };
    155158
    156159         BOOL   ShowWindow(ULONG nCmdShow);
     
    194197         BOOL   SetWindowTextW(LPWSTR lpsz);
    195198         BOOL   hasWindowName(LPSTR wndname, BOOL fUnicode = 0);
    196          CHAR  *getWindowNamePtrA();
    197          WCHAR *getWindowNamePtrW();
    198          VOID   freeWindowNamePtr(PVOID namePtr);
    199          CHAR  *getWindowNameA()              { return windowNameA; }; //only for MDI windows!
    200          WCHAR *getWindowNameW()              { return windowNameW; }; //only for MDI windows!
    201199Win32WndClass  *getClass()  { return windowClass; };
     200        //CB: windowNameA isn't always the window name!
     201        char   *getWindowNameA()                    { return windowNameA; };
    202202Win32BaseWindow *getOwner()                         { return owner; };
    203203        void    setOwner(Win32BaseWindow *newOwner) { owner = newOwner; };
     
    308308        BOOL    fParentDC;
    309309
     310        HRGN    hWindowRegion;
     311
    310312        DWORD   dwThreadId;             //id of thread that created this window
    311313        DWORD   dwProcessId;            //id of process that created this window
Note: See TracChangeset for help on using the changeset viewer.