source: trunk/src/user32/wingdi.cpp@ 1036

Last change on this file since 1036 was 1000, checked in by dengert, 26 years ago

erase background/paint stuff enhanced

File size: 4.1 KB
Line 
1/* $Id: wingdi.cpp,v 1.2 1999-09-21 17:04:27 dengert Exp $ */
2/*
3 * Win32 Window graphics apis for OS/2
4 *
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Daniela Engert (dani@ngrt.de)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#include <os2win.h>
14#include <misc.h>
15
16#include <win32wbase.h>
17#include <oslibwin.h>
18#include <oslibgdi.h>
19
20#define OPEN32_GDI
21
22#if 0
23//******************************************************************************
24//TODO: Not complete
25//******************************************************************************
26HDC WIN32API BeginPaint(HWND hwnd, PPAINTSTRUCT lps)
27{
28 Win32BaseWindow *window;
29 HDC hdc;
30
31 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
32 if(!window) {
33 dprintf(("GetDC, window %x not found", hwnd));
34 return 0;
35 }
36// !! there is no HDC to paint on !!! window->MsgEraseBackGround(hdc);
37#ifdef OPEN32_GDI
38 hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps);
39 //CB: conflict with Open32 mechanism
40#else
41 hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint);
42 lps->hdc = hdc;
43#endif
44 dprintf(("BeginPaint %X returned %x\n", hwnd, hdc));
45
46 lps->fErase = !window->MsgEraseBackGround(hdc);
47 return hdc;
48
49// return lps->hdc;
50}
51//******************************************************************************
52//******************************************************************************
53BOOL WIN32API EndPaint(HWND hwnd, const PAINTSTRUCT *lps)
54{
55 dprintf(("EndPaint %x\n", hwnd));
56#ifdef OPEN32_GDI
57 return O32_EndPaint(hwnd,lps);
58 //CB: dito
59#else
60 return OSLibWinEndPaint(lps->hdc);
61#endif
62}
63
64//******************************************************************************
65//TODO: PARENT_DC flag
66//******************************************************************************
67HDC WIN32API GetDC(HWND hwnd)
68{
69 Win32BaseWindow *window;
70
71 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
72 if(!window) {
73 dprintf(("GetDC, window %x not found", hwnd));
74#ifdef OPEN32_GDI
75 dprintf(("GetDC %x", hwnd));
76 return O32_GetDC(0);
77#else
78 //desktop window?
79 dprintf(("GetDC %x", hwnd));
80 return OSLibWinGetPS(OSLIB_HWND_DESKTOP);
81#endif
82 }
83 dprintf(("GetDC %x", hwnd));
84#ifdef OPEN32_GDI
85 return O32_GetDC(window->getOS2WindowHandle());
86#else
87 return OSLibWinGetPS(window->getOS2WindowHandle());
88#endif
89}
90//******************************************************************************
91//TODO
92//******************************************************************************
93HDC WIN32API GetDCEx(HWND hwnd, HRGN arg2, DWORD arg3)
94{
95#ifdef DEBUG
96 WriteLog("USER32: GetDCEx NOT CORRECT!\n");
97#endif
98 return GetDC(hwnd);
99}
100
101//******************************************************************************
102//******************************************************************************
103int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
104{
105 dprintf(("ReleaseDC %x %x", hwnd, hdc));
106#ifdef OPEN32_GDI
107 return O32_ReleaseDC(hwnd,hdc);
108#else
109 return OSLibWinReleasePS(hdc);
110#endif
111}
112//******************************************************************************
113//******************************************************************************
114
115HDC WIN32API GetWindowDC(HWND hwnd)
116{
117 Win32BaseWindow *window;
118
119 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
120 if(!window) {
121 dprintf(("GetWindowDC, window %x not found", hwnd));
122 return 0;
123 }
124 dprintf(("GetWindowDC %x", hwnd));
125#ifdef OPEN32_GDI
126 return O32_GetWindowDC(window->getOS2FrameWindowHandle());
127#else
128 return OSLibWinGetPS(window->getOS2FrameWindowHandle());
129#endif
130}
131#endif
132//******************************************************************************
133//******************************************************************************
134HWND WIN32API WindowFromDC(HDC hdc)
135{
136 dprintf(("USER32: WindowFromDC\n"));
137#ifdef OPEN32_GDI
138 return O32_WindowFromDC(hdc);
139#else
140 ?????
141#endif
142}
143//******************************************************************************
144//******************************************************************************
Note: See TracBrowser for help on using the repository browser.