1 | /* $Id: wingdi.cpp,v 1.2 1999-07-18 13:57:48 cbratschi 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 | //******************************************************************************
|
---|
20 | //TODO: Not complete
|
---|
21 | //******************************************************************************
|
---|
22 | HDC WIN32API BeginPaint(HWND hwnd, PPAINTSTRUCT lps)
|
---|
23 | {
|
---|
24 | Win32Window *window;
|
---|
25 | OSRECTL rect;
|
---|
26 |
|
---|
27 | window = Win32Window::GetWindowFromHandle(hwnd);
|
---|
28 | if(!window) {
|
---|
29 | dprintf(("GetDC, window %x not found", hwnd));
|
---|
30 | return 0;
|
---|
31 | }
|
---|
32 | dprintf(("BeginPaint %X\n", hwnd));
|
---|
33 | if(OSLibWinQueryUpdateRect(window->getOS2WindowHandle(), &rect) == FALSE)
|
---|
34 | {
|
---|
35 | dprintf(("BeginPaint, NO update rectl"));
|
---|
36 | return 0;
|
---|
37 | }
|
---|
38 | MapOS2ToWin32Rectl(window->getOS2WindowHandle(),(PRECTLOS2)&rect,&lps->rcPaint);
|
---|
39 | lps->hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), (PVOID)&lps->rcPaint);
|
---|
40 |
|
---|
41 | return lps->hdc;
|
---|
42 | }
|
---|
43 | //******************************************************************************
|
---|
44 | //******************************************************************************
|
---|
45 | BOOL WIN32API EndPaint(HWND hwnd, const PAINTSTRUCT *lps)
|
---|
46 | {
|
---|
47 | dprintf(("EndPaint %x\n", hwnd));
|
---|
48 | return OSLibWinEndPaint(lps->hdc);
|
---|
49 | }
|
---|
50 | //******************************************************************************
|
---|
51 | //TODO: PARENT_DC flag
|
---|
52 | //******************************************************************************
|
---|
53 | HDC WIN32API GetDC(HWND hwnd)
|
---|
54 | {
|
---|
55 | Win32Window *window;
|
---|
56 |
|
---|
57 | window = Win32Window::GetWindowFromHandle(hwnd);
|
---|
58 | if(!window) {
|
---|
59 | dprintf(("GetDC, window %x not found", hwnd));
|
---|
60 | return 0;
|
---|
61 | }
|
---|
62 | dprintf(("GetDC %x", hwnd));
|
---|
63 | return OSLibWinGetPS(window->getOS2WindowHandle());
|
---|
64 | }
|
---|
65 | //******************************************************************************
|
---|
66 | //TODO
|
---|
67 | //******************************************************************************
|
---|
68 | HDC WIN32API GetDCEx(HWND hwnd, HRGN arg2, DWORD arg3)
|
---|
69 | {
|
---|
70 | #ifdef DEBUG
|
---|
71 | WriteLog("USER32: GetDCEx NOT CORRECT!\n");
|
---|
72 | #endif
|
---|
73 | return GetDC(hwnd);
|
---|
74 | }
|
---|
75 | //******************************************************************************
|
---|
76 | //******************************************************************************
|
---|
77 | int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
|
---|
78 | {
|
---|
79 | return OSLibWinReleasePS(hdc);
|
---|
80 | }
|
---|
81 | //******************************************************************************
|
---|
82 | //******************************************************************************
|
---|