| 1 | /* $Id: oslibgdi.h,v 1.4 1999-07-24 14:01:44 sandervl Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Window GDI wrapper functions for OS/2
|
|---|
| 4 | *
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | *
|
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 10 | *
|
|---|
| 11 | */
|
|---|
| 12 | #ifndef __OSLIBGDI_H__
|
|---|
| 13 | #define __OSLIBGDI_H__
|
|---|
| 14 |
|
|---|
| 15 | #ifdef OS2_INCLUDED
|
|---|
| 16 | #include "win32type.h"
|
|---|
| 17 | #endif
|
|---|
| 18 | #include <win32wnd.h>
|
|---|
| 19 |
|
|---|
| 20 | typedef struct
|
|---|
| 21 | {
|
|---|
| 22 | LONG xLeft;
|
|---|
| 23 | LONG yBottom;
|
|---|
| 24 | LONG xRight;
|
|---|
| 25 | LONG yTop;
|
|---|
| 26 | } RECTLOS2, *PRECTLOS2;
|
|---|
| 27 |
|
|---|
| 28 | typedef struct
|
|---|
| 29 | {
|
|---|
| 30 | LONG x;
|
|---|
| 31 | LONG y;
|
|---|
| 32 | } OSLIBPOINT;
|
|---|
| 33 |
|
|---|
| 34 | HDC OSLibWinBeginPaint(HWND hwnd, RECT *pRectl);
|
|---|
| 35 | BOOL OSLibWinEndPaint(HDC hdc);
|
|---|
| 36 |
|
|---|
| 37 | HDC OSLibWinGetPS(HWND hwnd);
|
|---|
| 38 | BOOL OSLibWinReleasePS(HDC hdc);
|
|---|
| 39 |
|
|---|
| 40 | BOOL OSLibWinInvalidateRect(HWND hwnd, PRECT pRect, BOOL fIncludeChildren); //must be RECTL pointer!
|
|---|
| 41 | BOOL OSLibWinQueryUpdateRect(HWND hwnd, PRECT pRect);
|
|---|
| 42 |
|
|---|
| 43 | //******************************************************************************
|
|---|
| 44 | //Map win32 y coordinate (in window coordinates) to OS/2 y coord. (in window coordinates)
|
|---|
| 45 | //******************************************************************************
|
|---|
| 46 | inline ULONG MapOS2ToWin32Y(Win32Window *window, ULONG y)
|
|---|
| 47 | {
|
|---|
| 48 | return window->getWindowHeight() - y - 1;
|
|---|
| 49 | }
|
|---|
| 50 |
|
|---|
| 51 | ULONG MapOS2ToWin32Y(HWND hwndParent, ULONG cy, ULONG y);
|
|---|
| 52 | BOOL MapOS2ToWin32Point(HWND hwndParent, HWND hwndChild, OSLIBPOINT *point);
|
|---|
| 53 |
|
|---|
| 54 | //map os/2 rectangle to screen coordinates and convert to win32 rect
|
|---|
| 55 | BOOL MapOS2ToWin32Rectl(HWND hwndParent, HWND hwndChild, PRECTLOS2 rectOS2, PRECT rectWin32);
|
|---|
| 56 |
|
|---|
| 57 | BOOL MapOS2ToWin32Rectl(PRECTLOS2 rectOS2, PRECT rectWin32);
|
|---|
| 58 | BOOL MapWin32ToOS2Rectl(PRECT rectWin32, PRECTLOS2 rectOS2);
|
|---|
| 59 |
|
|---|
| 60 | #endif //__OSLIBGDI_H__
|
|---|