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

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

Lots of changes; Solitaire now starts

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