| 1 | /* $Id: oslibres.h,v 1.1 2001-05-11 08:35:19 sandervl Exp $ */ | 
|---|
| 2 | /* | 
|---|
| 3 | * Window GUI resource 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 __OSLIBRES_H__ | 
|---|
| 13 | #define __OSLIBRES_H__ | 
|---|
| 14 |  | 
|---|
| 15 | #ifdef OS2_INCLUDED | 
|---|
| 16 | #include <win32type.h> | 
|---|
| 17 | #endif | 
|---|
| 18 |  | 
|---|
| 19 | #include <win\cursoricon.h> | 
|---|
| 20 |  | 
|---|
| 21 | #ifdef OS2_INCLUDED | 
|---|
| 22 | typedef struct | 
|---|
| 23 | { | 
|---|
| 24 | BYTE rgbBlue; | 
|---|
| 25 | BYTE rgbGreen; | 
|---|
| 26 | BYTE rgbRed; | 
|---|
| 27 | BYTE rgbReserved; | 
|---|
| 28 | } RGBQUAD, *LPRGBQUAD; | 
|---|
| 29 | #endif | 
|---|
| 30 |  | 
|---|
| 31 | typedef struct | 
|---|
| 32 | { | 
|---|
| 33 | INT  bmType; | 
|---|
| 34 | INT  bmWidth; | 
|---|
| 35 | INT  bmHeight; | 
|---|
| 36 | INT  bmWidthBytes; | 
|---|
| 37 | WORD   bmPlanes; | 
|---|
| 38 | WORD   bmBitsPixel; | 
|---|
| 39 | LPVOID bmBits; | 
|---|
| 40 | } BITMAP_W, *LPBITMAP_W; | 
|---|
| 41 |  | 
|---|
| 42 | HANDLE  OSLibWinSetAccelTable(HWND hwnd, HANDLE hAccel, PVOID acceltemplate); | 
|---|
| 43 | HANDLE  OSLibWinCreateIcon(PVOID iconbitmap, ULONG cxDesired, ULONG cyDesired); | 
|---|
| 44 |  | 
|---|
| 45 | //NOTE: Depends on origin of bitmap data!!! | 
|---|
| 46 | //      Assumes 1 bpp bitmaps have a top left origin and all others have a bottom left origin | 
|---|
| 47 | HANDLE  OSLibWinCreatePointer(PVOID cursorbitmap, ULONG cxDesired, ULONG cyDesired); | 
|---|
| 48 |  | 
|---|
| 49 | HANDLE  OSLibWinCreateCursor(CURSORICONINFO *pInfo, char *pAndBits, BITMAP_W *pAndBmp, char *pXorBits, BITMAP_W *pXorBmp); | 
|---|
| 50 | HANDLE  OSLibWinQuerySysPointer(ULONG type,INT w,INT h); | 
|---|
| 51 | HANDLE  OSLibWinQuerySysIcon(ULONG type,INT w,INT h); | 
|---|
| 52 | VOID    OSLibWinDestroyPointer(HANDLE hPointer); | 
|---|
| 53 | BOOL    OSLibWinSetPointer(HANDLE hPointer); | 
|---|
| 54 | BOOL    OSLibWinClipCursor(const RECT * pRect); | 
|---|
| 55 | BOOL    OSLibWinGetClipCursor(LPRECT pRect); | 
|---|
| 56 |  | 
|---|
| 57 |  | 
|---|
| 58 |  | 
|---|
| 59 | BOOL APIENTRY _WinSetPointerClipRect(HWND hwnd, PRECTL pRect); | 
|---|
| 60 | BOOL APIENTRY _WinQueryPointerClipRect(HWND hwnd, PRECTL pRect); | 
|---|
| 61 |  | 
|---|
| 62 | inline BOOL APIENTRY WinSetPointerClipRect(HWND hwnd, PRECTL pRect) | 
|---|
| 63 | { | 
|---|
| 64 | BOOL yyrc; | 
|---|
| 65 | USHORT sel = RestoreOS2FS(); | 
|---|
| 66 |  | 
|---|
| 67 | yyrc = _WinSetPointerClipRect(hwnd, pRect); | 
|---|
| 68 | SetFS(sel); | 
|---|
| 69 |  | 
|---|
| 70 | return yyrc; | 
|---|
| 71 | } | 
|---|
| 72 |  | 
|---|
| 73 | inline BOOL APIENTRY WinQueryPointerClipRect(HWND hwnd, PRECTL pRect) | 
|---|
| 74 | { | 
|---|
| 75 | BOOL yyrc; | 
|---|
| 76 | USHORT sel = RestoreOS2FS(); | 
|---|
| 77 |  | 
|---|
| 78 | yyrc = _WinQueryPointerClipRect(hwnd, pRect); | 
|---|
| 79 | SetFS(sel); | 
|---|
| 80 |  | 
|---|
| 81 | return yyrc; | 
|---|
| 82 | } | 
|---|
| 83 |  | 
|---|
| 84 | #endif //__OSLIBGDI_H__ | 
|---|