source: trunk/src/user32/new/wingdi.cpp@ 923

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

some more DC related functions

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