Ignore:
Timestamp:
Nov 12, 2003, 3:13:26 PM (22 years ago)
Author:
sandervl
Message:

Visible & Clip region changes

File:
1 edited

Legend:

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

    r10285 r10316  
    1 /* $Id: pmwindow.cpp,v 1.223 2003-10-22 12:43:51 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.224 2003-11-12 14:10:19 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5959#include "menu.h"
    6060#include "user32api.h"
     61#include <kbdhook.h>
    6162
    6263#define DBG_LOCALLOG    DBG_pmwindow
    6364#include "dbglocal.h"
    6465
     66
    6567#define ODIN_SetExceptionHandler(a)
    6668#define ODIN_UnsetExceptionHandler(a)
    67 
    6869
    6970// Notification that focus change has completed (UNDOCUMENTED)
     
    8485BOOL    fDragDropDisabled = FALSE;
    8586
    86 const char WIN32_CDCLASS[]       = "Win32CDWindowClass";
    87       char WIN32_STDCLASS[255]   = "Win32WindowClass";
     87const char WIN32_CDCLASS[]       = ODIN_WIN32_CDCLASS;
     88      char WIN32_STDCLASS[255]   = ODIN_WIN32_STDCLASS;
    8889
    8990#define PMMENU_MINBUTTON           0
     
    190191    SetThreadMessageQueue(hmq);
    191192
     193    //initialize keyboard hook for first thread 
     194    hookInit(hab);
     195
    192196    BOOL rc = WinSetCp(hmq, GetDisplayCodepage());
    193197    dprintf(("InitPM: WinSetCP was %sOK", rc ? "" : "not "));
     
    255259    // query the font height to find out whether we have small or large fonts
    256260    DevQueryCaps(hdc, CAPS_GRAPHICS_CHAR_HEIGHT, 1, (PLONG)&CapsCharHeight);
     261    dprintf(("CAPS_GRAPHICS_CHAR_HEIGHT = %d", CapsCharHeight));
     262    if(CapsCharHeight > 16) {
     263       CapsCharHeight = 16;
     264    }
     265
     266#ifdef DEBUG
     267    ULONG temp;
     268    DevQueryCaps(hdc, CAPS_GRAPHICS_CHAR_WIDTH, 1, (PLONG)&temp);
     269    dprintf(("CAPS_GRAPHICS_CHAR_WIDTH = %d", temp));
     270    DevQueryCaps(hdc, CAPS_CHAR_HEIGHT, 1, (PLONG)&temp);
     271    dprintf(("CAPS_CHAR_HEIGTH = %d", temp));
     272    DevQueryCaps(hdc, CAPS_CHAR_WIDTH, 1, (PLONG)&temp);
     273    dprintf(("CAPS_CHAR_WIDTH = %d", temp));
     274    DevQueryCaps(hdc, CAPS_SMALL_CHAR_HEIGHT, 1, (PLONG)&temp);
     275    dprintf(("CAPS_SMALL_CHAR_HEIGTH = %d", temp));
     276    DevQueryCaps(hdc, CAPS_SMALL_CHAR_WIDTH, 1, (PLONG)&temp);
     277    dprintf(("CAPS_SMALL_CHAR_WIDTH = %d", temp));
     278    DevQueryCaps(hdc, CAPS_VERTICAL_FONT_RES, 1,(PLONG)&temp);
     279    dprintf(("CAPS_VERTICAL_FONT_RES = %d", temp));
     280    DevQueryCaps(hdc, CAPS_HORIZONTAL_FONT_RES, 1,(PLONG)&temp);
     281    dprintf(("CAPS_HORIZONTAL_FONT_RES = %d", temp));
     282#endif
    257283
    258284    DevCloseDC(hdc);
    259285
    260     dprintf(("InitPM: Desktop (%d,%d) bpp %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel));
     286    dprintf(("InitPM: Desktop (%d,%d) bpp %d font size %d", ScreenWidth, ScreenHeight, ScreenBitsPerPel, CapsCharHeight));
    261287    return TRUE;
    262288} /* End of main */
     
    638664
    639665    case WM_SHOW:
     666    {
    640667        dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
    641668        win32wnd->MsgShow((ULONG)mp1);
    642         break;
     669 
     670        //if a child window is hidden, then the update region of the
     671        //parent changes and a WM_ERASEBKGND is required during the next
     672        //BeginPaint call.
     673        if((ULONG)mp1 == FALSE)
     674        {
     675            Win32BaseWindow *parent = win32wnd->getParent();
     676            if(parent) {
     677                dprintf(("PM Update region changed for parent %x", win32wnd->getWindowHandle()));
     678                parent->SetPMUpdateRegionChanged(TRUE);
     679            }
     680        }
     681        break;
     682    }
    643683
    644684    case WM_ACTIVATE:
     
    658698    {
    659699        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp1)));
    660         win32wnd->SetVisibleRegionChanged(TRUE);
     700        win32wnd->SetPMUpdateRegionChanged(TRUE);
    661701        goto RunDefWndProc;
    662702    }
     
    12671307    case WM_PAINT:
    12681308    {
    1269       RECTL rectl;
     1309        RECTL rectl;
     1310        HRGN  hrgn;
     1311
     1312        hrgn = CreateRectRgn(0, 0, 0, 0);
     1313        GetUpdateRgnFrame(win32wnd->getWindowHandle(), hrgn);
    12701314
    12711315        HPS hps = WinBeginPaint(hwnd, NULL, &rectl);
     
    12851329
    12861330                mapOS2ToWin32Rect(win32wnd->getWindowHeight(), (PRECTLOS2)&rectl, &rectUpdate);
    1287                 win32wnd->MsgNCPaint(&rectUpdate);
     1331                win32wnd->MsgNCPaint(&rectUpdate, hrgn);
    12881332            }
    12891333        }
    12901334        WinEndPaint(hps);
     1335
     1336        DeleteObject(hrgn);
    12911337        break;
    12921338    }
     
    15991645        if ((pswp->fl & SWP_MAXIMIZE) && (win32wnd->getExStyle() & WS_EX_MDICHILD_W))
    16001646        {
    1601          SendMessageA(win32wnd->getWindowHandle(), WM_SYSCOMMAND_W, SC_MAXIMIZE_W, 0);
    1602          goto PosChangedEnd;
     1647            SendMessageA(win32wnd->getWindowHandle(), WM_SYSCOMMAND_W, SC_MAXIMIZE_W, 0);
     1648            goto PosChangedEnd;
    16031649        }
    16041650
     
    24782524//******************************************************************************
    24792525//******************************************************************************
     2526char *WIN32API QueryCustomStdClassName()
     2527{
     2528   return WIN32_STDCLASS;
     2529}
     2530//******************************************************************************
     2531//******************************************************************************
    24802532
    24812533#ifdef DEBUG
Note: See TracChangeset for help on using the changeset viewer.