| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * PE2LX cursor conversion code
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 5 | *
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 | #ifndef __CURSOR_H__
|
|---|
| 11 | #define __CURSOR_H__
|
|---|
| 12 |
|
|---|
| 13 | #pragma pack(1)
|
|---|
| 14 |
|
|---|
| 15 | typedef struct {
|
|---|
| 16 | WORD wReserved; // Currently zero
|
|---|
| 17 | WORD wType; // 2 for cursors
|
|---|
| 18 | WORD cwCount; // Number of components
|
|---|
| 19 | //Fout in docs, geen padding
|
|---|
| 20 | // WORD padding; // filler for DWORD alignment
|
|---|
| 21 | } CursorHeader;
|
|---|
| 22 |
|
|---|
| 23 | typedef struct {
|
|---|
| 24 | WORD wWidth;
|
|---|
| 25 | WORD wHeight;
|
|---|
| 26 | WORD wPlanes;
|
|---|
| 27 | WORD wBitCount;
|
|---|
| 28 | DWORD lBytesInRes;
|
|---|
| 29 | WORD wNameOrdinal; // Points to component
|
|---|
| 30 | //Fout in docs, geen padding
|
|---|
| 31 | // WORD padding; // filler for DWORD alignment
|
|---|
| 32 | } CursorResDir;
|
|---|
| 33 |
|
|---|
| 34 | typedef struct {
|
|---|
| 35 | short xHotspot;
|
|---|
| 36 | short yHotspot;
|
|---|
| 37 | } CursorComponent;
|
|---|
| 38 |
|
|---|
| 39 | #pragma pack()
|
|---|
| 40 |
|
|---|
| 41 | class OS2Cursor
|
|---|
| 42 | {
|
|---|
| 43 | public:
|
|---|
| 44 | // Constructors and destructors
|
|---|
| 45 | OS2Cursor(int id, CursorComponent *bmpHdr, int size);
|
|---|
| 46 | ~OS2Cursor();
|
|---|
| 47 |
|
|---|
| 48 | int QueryCursorSize();
|
|---|
| 49 | void SetCursorHdrOffset(int offset);
|
|---|
| 50 | BITMAPFILEHEADER *GetCursorHeader(int wWidth, int wHeight, int wPlanes, int wBitCount);
|
|---|
| 51 |
|
|---|
| 52 | static OS2Cursor *GetCursor(int id);
|
|---|
| 53 | static void DestroyAll();
|
|---|
| 54 |
|
|---|
| 55 | protected:
|
|---|
| 56 |
|
|---|
| 57 | private:
|
|---|
| 58 | int id, cursorsize, prevoffset;
|
|---|
| 59 | BITMAPFILEHEADER *cursorhdr;
|
|---|
| 60 |
|
|---|
| 61 | // Linked list management
|
|---|
| 62 | OS2Cursor* next; // Next Cursor
|
|---|
| 63 | static OS2Cursor* cursors; // List of Cursors
|
|---|
| 64 | };
|
|---|
| 65 |
|
|---|
| 66 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.