Changeset 923


Ignore:
Timestamp:
Sep 13, 1999, 6:13:46 PM (26 years ago)
Author:
dengert
Message:

some more DC related functions

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/changelog

    r918 r923  
    1  /* $Id: changelog,v 1.196 1999-09-13 12:36:35 phaller Exp $ */
     1 /* $Id: changelog,v 1.197 1999-09-13 16:13:45 dengert Exp $ */
     2
     3 99-09-13: Daniela Engert <dani@ngrt.de>
     4        - USER32\NEW: DC/related code: ReleaseDC, GetWindowDC, DC destruction,..
    25
    36 99-09-13: Patrick Haller <phaller@gmx.net>
     
    69 99-09-13: David Raison <djr@lemur.co.uk>
    710        - KERNEL32: Fixed MultiByteToWideChar. Return size of string including
    8                     0 terminator.
     11                    0 terminator.
    912
    1013 99-09-13: Jens Wiessner <wiessnej@rfi.de>
     
    1316 99-09-08: David Raison <djr@lemur.co.uk>
    1417        - OLEAUT32: Updated TypeLib code to find typelibs in EXE/DLL etc
    15                     NB Still need to fix typelib translation.
     18                    NB Still need to fix typelib translation.
    1619
    1720 99-09-12: Daniela Engert <dani@ngrt.de>
     
    2023
    2124 99-09-12: knut st. osmundsen <knut.stange.osmundsen@pmsc.no>
    22         - WIN32K: An untested version is checked in. The new skeleton is
     25        - WIN32K: An untested version is checked in. The new skeleton is
    2326          partially tested. PE2LX is not updated and will probably not be updated
    2427          before pe2lx is rewritten.
     
    4346
    4447 99-09-08: knut st. osmundsen <knut.stange.osmundsen@pmsc.no>
    45         - KERNEL32, USER32, USER32\NEW, GDI32, ADVAPI32: <dllname>exp.def is
    46           now generated by a util called ImpDef. (source in tools\impdef).
    47         - INC: pdwin32.tools is updated with a IMPDEF macro. This requires
     48        - KERNEL32, USER32, USER32\NEW, GDI32, ADVAPI32: <dllname>exp.def is
     49          now generated by a util called ImpDef. (source in tools\impdef).
     50        - INC: pdwin32.tools is updated with a IMPDEF macro. This requires
    4851          the macro PDWIN32_TOOLS too point to the tools\bin directory.
    49         - TOOLS: New directory tree for tools developed to aid us create odin32.
     52        - TOOLS: New directory tree for tools developed to aid us create odin32.
    5053          Create a subdirectory for each tool.
    5154          Currently database, impdef and omfdumper is placed here.
    52         - TOOLS\IMPDEF: generates the <dllname>exp.def files.
    53         - TOOLS\OMFDUMPER: source for the omfdumper use to create pmwinx.def.
     55        - TOOLS\IMPDEF: generates the <dllname>exp.def files.
     56        - TOOLS\OMFDUMPER: source for the omfdumper use to create pmwinx.def.
    5457          Base source for a library converted used in win32k.
    55         - TOOLS\DATABASE: source for the odin32 API database and it's tools.
     58        - TOOLS\DATABASE: source for the odin32 API database and it's tools.
    5659          See the Odin32 API Database Design Document for more info.
    5760          Document will soon be placed in the 'Vault' of the win32-os2 group.
    58         - TOOLS\DATABASE\MYSQL: mysql headers and libraries.
    59         - TOOLS\DATABASE\GD: Gifdraw 1.2 - used to draw graphs.
     61        - TOOLS\DATABASE\MYSQL: mysql headers and libraries.
     62        - TOOLS\DATABASE\GD: Gifdraw 1.2 - used to draw graphs.
    6063
    6164 99-09-08: Patrick Haller <phaller@gmx.net>
  • TabularUnified trunk/src/user32/new/dc.cpp

    r911 r923  
    1 /* $Id: dc.cpp,v 1.3 1999-09-12 15:44:20 dengert Exp $ */
     1/* $Id: dc.cpp,v 1.4 1999-09-13 16:13:46 dengert Exp $ */
    22
    33/*
     
    268268ULONG   OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData);
    269269BOOL    OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
     270int     OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
     271
     272#ifndef DEVESC_SETPS
     273  #define DEVESC_SETPS  49149L
     274#endif
    270275
    271276#define FLOAT_TO_FIXED(x) ((FIXED) ((x) * 65536.0))
     
    649654}
    650655
     656void releaseOwnDC (HDC hps)
     657{
     658   pDCData pHps = (pDCData)GpiQueryDCData ((HPS)hps);
     659
     660   if (pHps) {
     661      if (pHps->hrgnHDC)
     662         GpiDestroyRegion (pHps->hps, pHps->hrgnHDC);
     663
     664      GpiSetBitmap (pHps->hps, NULL);
     665      _O32_DeleteObject (pHps->nullBitmapHandle);
     666      GpiDestroyPS(pHps->hps);
     667
     668      if (pHps->hdc)
     669         DevCloseDC(pHps->hdc);
     670
     671// how can a memory chunk allocated by GpiAllocateDCData freed by delete?
     672//      delete pHps;
     673   }
     674}
     675
    651676HDC WIN32API BeginPaint (HWND hWnd, PPAINTSTRUCT_W lpps)
    652677{
     
    916941      PRECTL pr;
    917942      int i;
     943      LONG height = OSLibQueryScreenHeight();
    918944
    919945      if (!hrgn)
     
    931957      success = TRUE;
    932958      if (flags & DCX_EXCLUDERGN_W)
    933          for (; (i > 0) && success; i--, pr++)
     959         for (; (i > 0) && success; i--, pr++) {
     960            LONG y = pr->yBottom;
     961
     962            pr->yBottom = height - pr->yTop;
     963            pr->yTop    = height - y;
    934964            success &= GpiExcludeClipRectangle (pHps->hps, pr);
     965         }
    935966      else
    936          for (; (i > 0) && success; i--, pr++)
     967         for (; (i > 0) && success; i--, pr++) {
     968            LONG y = pr->yBottom;
     969
     970            pr->yBottom = height - pr->yTop;
     971            pr->yTop    = height - y;
    937972            success &= GpiIntersectClipRectangle (pHps->hps, pr);
     973         }
    938974      if (!success)
    939975         goto error;
     
    9781014}
    9791015
    980 
     1016HDC WIN32API GetWindowDC (HWND hwnd)
     1017{
     1018  return GetDCEx (hwnd, NULL, DCX_WINDOW_W);
     1019}
     1020
     1021int WIN32API ReleaseDC (HWND hwnd, HDC hdc)
     1022{
     1023   USHORT sel = RestoreOS2FS();
     1024   BOOL isOwnDC = FALSE;
     1025   int rc;
     1026
     1027   if (hwnd)
     1028   {
     1029      Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
     1030      isOwnDC = wnd->isOwnDC();
     1031   }
     1032   if (isOwnDC)
     1033      rc = TRUE;
     1034   else
     1035      rc = _O32_ReleaseDC (0, hdc);
     1036
     1037   SetFS(sel);
     1038   return (rc);
     1039}
    9811040//******************************************************************************
    9821041//******************************************************************************
  • TabularUnified trunk/src/user32/new/makefile

    r896 r923  
    1 # $Id: makefile,v 1.49 1999-09-09 18:08:46 dengert Exp $
     1# $Id: makefile,v 1.50 1999-09-13 16:13:46 dengert Exp $
    22
    33#
     
    106106pmwindow.obj:   pmwindow.cpp win32class.h win32wbase.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h oslibgdi.h oslibwin.h
    107107win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h
    108 win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h
     108win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h
    109109win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h
    110110win32dlg.obj:   win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h oslibmsg.h
     
    120120oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h
    121121oslibdos.obj:   oslibdos.cpp oslibdos.h
    122 dc.obj:         dc.cpp win32wbase.h
     122dc.obj:         dc.cpp win32wbase.h dc.h
    123123
    124124clipboard.obj:  clipboard.cpp
  • TabularUnified trunk/src/user32/new/wingdi.cpp

    r911 r923  
    1 /* $Id: wingdi.cpp,v 1.15 1999-09-12 15:44:20 dengert Exp $ */
     1/* $Id: wingdi.cpp,v 1.16 1999-09-13 16:13:46 dengert Exp $ */
    22/*
    33 * Win32 Window graphics apis for OS/2
     
    3333    return 0;
    3434    }
    35 // !! there is no HDC to paint on !!!    window->MsgEraseBackGround(hdc);
     35// !! there is no HDC to paint on !!!    window->MsgEraseBackGround(hdc);
    3636#ifdef OPEN32_GDI
    3737    hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps);
     
    9797    return GetDC(hwnd);
    9898}
    99 #endif
    10099
    101100//******************************************************************************
     
    112111//******************************************************************************
    113112//******************************************************************************
     113
    114114HDC WIN32API GetWindowDC(HWND hwnd)
    115115{
     
    118118   window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    119119   if(!window) {
    120         dprintf(("GetWindowDC, window %x not found", hwnd));
    121         return 0;
     120        dprintf(("GetWindowDC, window %x not found", hwnd));
     121        return 0;
    122122   }
    123123   dprintf(("GetWindowDC %x", hwnd));
     
    128128#endif
    129129}
     130#endif
    130131//******************************************************************************
    131132//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.