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

Last change on this file since 5655 was 2803, checked in by sandervl, 26 years ago

Added new logging feature

File size: 3.8 KB
Line 
1/* $Id: wingdi.cpp,v 1.6 2000-02-16 14:28:27 sandervl 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 DBG_LOCALLOG DBG_wingdi
21#include "dbglocal.h"
22
23#define OPEN32_GDI
24
25#if 0
26//******************************************************************************
27//TODO: Not complete
28//******************************************************************************
29HDC WIN32API BeginPaint(HWND hwnd, PPAINTSTRUCT lps)
30{
31 Win32BaseWindow *window;
32 HDC hdc;
33
34 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
35 if(!window) {
36 dprintf(("GetDC, window %x not found", hwnd));
37 return 0;
38 }
39// !! there is no HDC to paint on !!! window->MsgEraseBackGround(hdc);
40#ifdef OPEN32_GDI
41 hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps);
42 //CB: conflict with Open32 mechanism
43#else
44 hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint);
45 lps->hdc = hdc;
46#endif
47 dprintf(("BeginPaint %X returned %x\n", hwnd, hdc));
48
49 lps->fErase = !window->MsgEraseBackGround(hdc);
50 return hdc;
51
52// return lps->hdc;
53}
54//******************************************************************************
55//******************************************************************************
56BOOL WIN32API EndPaint(HWND hwnd, const PAINTSTRUCT *lps)
57{
58 dprintf(("EndPaint %x\n", hwnd));
59#ifdef OPEN32_GDI
60 return O32_EndPaint(hwnd,lps);
61 //CB: dito
62#else
63 return OSLibWinEndPaint(lps->hdc);
64#endif
65}
66
67//******************************************************************************
68//TODO: PARENT_DC flag
69//******************************************************************************
70HDC WIN32API GetDC(HWND hwnd)
71{
72 Win32BaseWindow *window;
73
74 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
75 if(!window) {
76 dprintf(("GetDC, window %x not found", hwnd));
77#ifdef OPEN32_GDI
78 dprintf(("GetDC %x", hwnd));
79 return O32_GetDC(0);
80#else
81 //desktop window?
82 dprintf(("GetDC %x", hwnd));
83 return OSLibWinGetPS(OSLIB_HWND_DESKTOP);
84#endif
85 }
86 dprintf(("GetDC %x", hwnd));
87#ifdef OPEN32_GDI
88 return O32_GetDC(window->getOS2WindowHandle());
89#else
90 return OSLibWinGetPS(window->getOS2WindowHandle());
91#endif
92}
93//******************************************************************************
94//TODO
95//******************************************************************************
96HDC WIN32API GetDCEx(HWND hwnd, HRGN arg2, DWORD arg3)
97{
98#ifdef DEBUG
99 WriteLog("USER32: GetDCEx NOT CORRECT!\n");
100#endif
101 return GetDC(hwnd);
102}
103
104//******************************************************************************
105//******************************************************************************
106int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
107{
108 dprintf(("ReleaseDC %x %x", hwnd, hdc));
109#ifdef OPEN32_GDI
110 return O32_ReleaseDC(hwnd,hdc);
111#else
112 return OSLibWinReleasePS(hdc);
113#endif
114}
115//******************************************************************************
116//******************************************************************************
117
118HDC WIN32API GetWindowDC(HWND hwnd)
119{
120 Win32BaseWindow *window;
121
122 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
123 if(!window) {
124 dprintf(("GetWindowDC, window %x not found", hwnd));
125 return 0;
126 }
127 dprintf(("GetWindowDC %x", hwnd));
128#ifdef OPEN32_GDI
129 return O32_GetWindowDC(window->getOS2FrameWindowHandle());
130#else
131 return OSLibWinGetPS(window->getOS2FrameWindowHandle());
132#endif
133}
134#endif
135//******************************************************************************
136//******************************************************************************
Note: See TracBrowser for help on using the repository browser.