Rev 5676 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4497 | leency | 1 | // cursor file should be 32x32 in default MS Windows .cur format |
5598 | pavelyakov | 2 | #ifndef INCLUDE_CURSOR_H |
3 | #define INCLUDE_CURSOR_H |
||
5676 | pavelyakov | 4 | #print "[include |
4497 | leency | 5 | |
5598 | pavelyakov | 6 | #ifndef INCLUDE_KOLIBRI_H |
7 | #include "../lib/kolibri.h" |
||
8 | #endif |
||
9 | |||
4497 | leency | 10 | struct CustomCursor |
11 | { |
||
12 | dword CursorPointer; |
||
13 | dword Load(); |
||
14 | dword Set(); |
||
15 | dword Restore(); |
||
16 | void Delete(); |
||
17 | }; |
||
18 | |||
19 | dword CustomCursor::Load(dword CursorFilePath) |
||
20 | { |
||
21 | if (CursorPointer) return; |
||
22 | EAX = 37; |
||
23 | EBX = 4; |
||
24 | ECX = CursorFilePath; |
||
25 | EDX = 1; |
||
26 | $int 0x40 |
||
27 | CursorPointer = EAX; // 0 - err, other - handle |
||
28 | } |
||
29 | |||
30 | dword CustomCursor::Set() |
||
31 | { |
||
32 | EAX = 37; |
||
33 | EBX = 5; |
||
34 | ECX = CursorPointer; |
||
35 | $int 0x40 |
||
36 | } |
||
37 | |||
38 | dword CustomCursor::Restore() |
||
39 | { |
||
7262 | leency | 40 | if (!CursorPointer) return; |
4497 | leency | 41 | EAX = 37; |
42 | EBX = 5; |
||
43 | ECX = 0; |
||
44 | $int 0x40 |
||
7262 | leency | 45 | CursorPointer = 0; |
4497 | leency | 46 | } |
47 | |||
48 | void CustomCursor::Delete() |
||
49 | { |
||
50 | EAX = 37; |
||
51 | EBX = 6; |
||
52 | ECX = CursorPointer; |
||
53 | $int 0x40 |
||
54 | } |
||
5598 | pavelyakov | 55 | |
56 | #endif |