Rev 6562 | Rev 6613 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6562 | Rev 6565 | ||
---|---|---|---|
1 | #ifndef INCLUDE_CLIPBOARD_H |
1 | #ifndef INCLUDE_CLIPBOARD_H |
2 | #define INCLUDE_CLIPBOARD_H |
2 | #define INCLUDE_CLIPBOARD_H |
3 | #print "[include |
3 | #print "[include |
4 | 4 | ||
5 | #ifndef INCLUDE_KOLIBRI_H |
5 | #ifndef INCLUDE_KOLIBRI_H |
6 | #include "../lib/kolibri.h" |
6 | #include "../lib/kolibri.h" |
7 | #endif |
7 | #endif |
8 | 8 | ||
9 | struct buffer_data |
9 | struct buffer_data |
10 | { |
10 | { |
11 | dword size; |
11 | dword size; |
12 | dword type; |
12 | dword type; |
13 | dword encoding; |
13 | dword encoding; |
14 | dword content; |
14 | dword content; |
15 | }; |
15 | }; |
16 | 16 | ||
17 | 17 | ||
18 | struct Clipboard { |
18 | struct Clipboard { |
19 | buffer_data slot_data; |
19 | buffer_data slot_data; |
20 | dword GetSlotCount(); |
20 | dword GetSlotCount(); |
21 | dword GetSlotData( ECX); |
21 | dword GetSlotData( ECX); |
22 | dword SetSlotData( EDX, ESI); |
22 | dword SetSlotData( EDX, ESI); |
23 | dword DelLastSlot(); |
23 | dword DelLastSlot(); |
24 | dword ResetBlockingBuffer(); |
24 | dword ResetBlockingBuffer(); |
25 | }; |
25 | }; |
26 | 26 | ||
27 | dword Clipboard::GetSlotCount() |
27 | dword Clipboard::GetSlotCount() |
28 | { |
28 | { |
29 | $mov eax, 54 |
29 | $mov eax, 54 |
30 | $mov ebx, 0 |
30 | $mov ebx, 0 |
31 | $int 0x40 |
31 | $int 0x40 |
32 | } |
32 | } |
33 | 33 | ||
34 | #define SLOT_DATA_TYPE_TEXT 0 |
34 | #define SLOT_DATA_TYPE_TEXT 0 |
35 | #define SLOT_DATA_TYPE_IMAGE 1 |
35 | #define SLOT_DATA_TYPE_IMAGE 1 |
36 | #define SLOT_DATA_TYPE_RAW 2 |
36 | #define SLOT_DATA_TYPE_RAW 2 |
37 | #define SLOT_DATA_TYPE_RESERVED 3 |
37 | #define SLOT_DATA_TYPE_RESERVED 3 |
38 | dword Clipboard::GetSlotData( ECX) //ECX = slot number |
38 | dword Clipboard::GetSlotData( ECX) //ECX = slot number |
39 | { |
39 | { |
40 | dword result; |
40 | dword result; |
41 | $mov eax, 54 |
41 | $mov eax, 54 |
42 | $mov ebx, 1 |
42 | $mov ebx, 1 |
43 | $int 0x40 |
43 | $int 0x40 |
44 | result = EAX; |
44 | result = EAX; |
45 | slot_data.size = DSDWORD[result]; |
45 | slot_data.size = DSDWORD[result]; |
46 | slot_data.type = DSDWORD[result+4]; |
46 | slot_data.type = DSDWORD[result+4]; |
47 | slot_data.encoding = DSDWORD[result+8]; |
47 | slot_data.encoding = DSDWORD[result+8]; |
48 | if (slot_data.type == SLOT_DATA_TYPE_TEXT) slot_data.content = result+12; |
48 | if (slot_data.type == SLOT_DATA_TYPE_TEXT) slot_data.content = result+12; |
49 | else slot_data.content = result+10; |
49 | else slot_data.content = result+10; |
- | 50 | return result; |
|
50 | } |
51 | } |
51 | 52 | ||
52 | dword Clipboard::SetSlotData( ECX, EDX) //ECX = data size, EDX - pointer to data |
53 | dword Clipboard::SetSlotData( ECX, EDX) //ECX = data size, EDX - pointer to data |
53 | { |
54 | { |
54 | $mov eax, 54 |
55 | $mov eax, 54 |
55 | $mov ebx, 2 |
56 | $mov ebx, 2 |
56 | $int 0x40 |
57 | $int 0x40 |
57 | } |
58 | } |
58 | 59 | ||
59 | dword Clipboard::DelLastSlot() |
60 | dword Clipboard::DelLastSlot() |
60 | { |
61 | { |
61 | $mov eax, 54 |
62 | $mov eax, 54 |
62 | $mov ebx, 3 |
63 | $mov ebx, 3 |
63 | $int 0x40 |
64 | $int 0x40 |
64 | } |
65 | } |
65 | 66 | ||
66 | dword Clipboard::ResetBlockingBuffer() |
67 | dword Clipboard::ResetBlockingBuffer() |
67 | { |
68 | { |
68 | $mov eax, 54 |
69 | $mov eax, 54 |
69 | $mov ebx, 4 |
70 | $mov ebx, 4 |
70 | $int 0x40 |
71 | $int 0x40 |
71 | } |
72 | } |
72 | 73 | ||
73 | #endif |
74 | #endif |