- Timestamp:
- Sep 13, 1999, 6:13:46 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/dc.cpp
r911 r923 1 /* $Id: dc.cpp,v 1. 3 1999-09-12 15:44:20dengert Exp $ */1 /* $Id: dc.cpp,v 1.4 1999-09-13 16:13:46 dengert Exp $ */ 2 2 3 3 /* … … 268 268 ULONG OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData); 269 269 BOOL OPEN32API _O32_DeleteObject (LHANDLE hgdiobj); 270 int OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc); 271 272 #ifndef DEVESC_SETPS 273 #define DEVESC_SETPS 49149L 274 #endif 270 275 271 276 #define FLOAT_TO_FIXED(x) ((FIXED) ((x) * 65536.0)) … … 649 654 } 650 655 656 void 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 651 676 HDC WIN32API BeginPaint (HWND hWnd, PPAINTSTRUCT_W lpps) 652 677 { … … 916 941 PRECTL pr; 917 942 int i; 943 LONG height = OSLibQueryScreenHeight(); 918 944 919 945 if (!hrgn) … … 931 957 success = TRUE; 932 958 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; 934 964 success &= GpiExcludeClipRectangle (pHps->hps, pr); 965 } 935 966 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; 937 972 success &= GpiIntersectClipRectangle (pHps->hps, pr); 973 } 938 974 if (!success) 939 975 goto error; … … 978 1014 } 979 1015 980 1016 HDC WIN32API GetWindowDC (HWND hwnd) 1017 { 1018 return GetDCEx (hwnd, NULL, DCX_WINDOW_W); 1019 } 1020 1021 int 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 } 981 1040 //****************************************************************************** 982 1041 //****************************************************************************** -
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 $ 2 2 3 3 # … … 106 106 pmwindow.obj: pmwindow.cpp win32class.h win32wbase.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h oslibgdi.h oslibwin.h 107 107 win32class.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 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 dc.h 109 109 win32wnd.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 110 110 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h oslibmsg.h … … 120 120 oslibres.obj: oslibres.cpp oslibwin.h oslibres.h $(PDWIN32_INCLUDE)\winconst.h 121 121 oslibdos.obj: oslibdos.cpp oslibdos.h 122 dc.obj: dc.cpp win32wbase.h 122 dc.obj: dc.cpp win32wbase.h dc.h 123 123 124 124 clipboard.obj: clipboard.cpp -
trunk/src/user32/new/wingdi.cpp
r911 r923 1 /* $Id: wingdi.cpp,v 1.1 5 1999-09-12 15:44:20dengert Exp $ */1 /* $Id: wingdi.cpp,v 1.16 1999-09-13 16:13:46 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window graphics apis for OS/2 … … 33 33 return 0; 34 34 } 35 // !! there is no HDC to paint on !!! 35 // !! there is no HDC to paint on !!! window->MsgEraseBackGround(hdc); 36 36 #ifdef OPEN32_GDI 37 37 hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps); … … 97 97 return GetDC(hwnd); 98 98 } 99 #endif100 99 101 100 //****************************************************************************** … … 112 111 //****************************************************************************** 113 112 //****************************************************************************** 113 114 114 HDC WIN32API GetWindowDC(HWND hwnd) 115 115 { … … 118 118 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 119 119 if(!window) { 120 121 120 dprintf(("GetWindowDC, window %x not found", hwnd)); 121 return 0; 122 122 } 123 123 dprintf(("GetWindowDC %x", hwnd)); … … 128 128 #endif 129 129 } 130 #endif 130 131 //****************************************************************************** 131 132 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.