| 1 | /* $Id: cursor.h,v 1.3 1999-06-10 17:08:52 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * PE2LX cursor conversion code
|
|---|
| 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 | #ifndef __CURSOR_H__
|
|---|
| 13 | #define __CURSOR_H__
|
|---|
| 14 |
|
|---|
| 15 | #pragma pack(1)
|
|---|
| 16 |
|
|---|
| 17 | typedef struct {
|
|---|
| 18 | WORD wReserved; // Currently zero
|
|---|
| 19 | WORD wType; // 2 for cursors
|
|---|
| 20 | WORD cwCount; // Number of components
|
|---|
| 21 | //Fout in docs, geen padding
|
|---|
| 22 | // WORD padding; // filler for DWORD alignment
|
|---|
| 23 | } CursorHeader;
|
|---|
| 24 |
|
|---|
| 25 | typedef struct {
|
|---|
| 26 | WORD wWidth;
|
|---|
| 27 | WORD wHeight;
|
|---|
| 28 | WORD wPlanes;
|
|---|
| 29 | WORD wBitCount;
|
|---|
| 30 | DWORD lBytesInRes;
|
|---|
| 31 | WORD wNameOrdinal; // Points to component
|
|---|
| 32 | //Fout in docs, geen padding
|
|---|
| 33 | // WORD padding; // filler for DWORD alignment
|
|---|
| 34 | } CursorResDir;
|
|---|
| 35 |
|
|---|
| 36 | typedef struct {
|
|---|
| 37 | short xHotspot;
|
|---|
| 38 | short yHotspot;
|
|---|
| 39 | } CursorComponent;
|
|---|
| 40 |
|
|---|
| 41 | #pragma pack()
|
|---|
| 42 |
|
|---|
| 43 | class OS2Cursor
|
|---|
| 44 | {
|
|---|
| 45 | public:
|
|---|
| 46 | // Constructors and destructors
|
|---|
| 47 | OS2Cursor(int id, CursorComponent *bmpHdr, int size);
|
|---|
| 48 | ~OS2Cursor();
|
|---|
| 49 |
|
|---|
| 50 | int QueryCursorSize();
|
|---|
| 51 | void SetCursorHdrOffset(int offset);
|
|---|
| 52 | BITMAPFILEHEADER *GetCursorHeader(int wWidth, int wHeight, int wPlanes, int wBitCount);
|
|---|
| 53 |
|
|---|
| 54 | static OS2Cursor *GetCursor(int id);
|
|---|
| 55 | static void DestroyAll();
|
|---|
| 56 |
|
|---|
| 57 | protected:
|
|---|
| 58 |
|
|---|
| 59 | private:
|
|---|
| 60 | int id, cursorsize, prevoffset;
|
|---|
| 61 | BITMAPFILEHEADER *cursorhdr;
|
|---|
| 62 |
|
|---|
| 63 | // Linked list management
|
|---|
| 64 | OS2Cursor* next; // Next Cursor
|
|---|
| 65 | static OS2Cursor* cursors; // List of Cursors
|
|---|
| 66 | };
|
|---|
| 67 |
|
|---|
| 68 | #endif
|
|---|