2015-07-22 21:32:54 +03:00
|
|
|
#ifndef INCLUDE_CLIPBOARD_H
|
|
|
|
#define INCLUDE_CLIPBOARD_H
|
2015-08-04 18:48:36 +03:00
|
|
|
#print "[include <clipboard.h>]\n"
|
2015-07-22 21:32:54 +03:00
|
|
|
|
|
|
|
#ifndef INCLUDE_KOLIBRI_H
|
|
|
|
#include "../lib/kolibri.h"
|
|
|
|
#endif
|
|
|
|
|
2014-01-07 05:04:38 +04:00
|
|
|
struct buffer_data
|
|
|
|
{
|
|
|
|
dword size;
|
|
|
|
dword type;
|
|
|
|
dword encoding;
|
2016-10-05 01:44:07 +03:00
|
|
|
dword content;
|
2014-01-07 05:04:38 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-01-06 04:33:26 +04:00
|
|
|
struct Clipboard {
|
2016-10-05 01:44:07 +03:00
|
|
|
buffer_data slot_data;
|
2014-01-06 04:33:26 +04:00
|
|
|
dword GetSlotCount();
|
|
|
|
dword GetSlotData( ECX);
|
|
|
|
dword SetSlotData( EDX, ESI);
|
|
|
|
dword DelLastSlot();
|
|
|
|
dword ResetBlockingBuffer();
|
|
|
|
};
|
|
|
|
|
|
|
|
dword Clipboard::GetSlotCount()
|
|
|
|
{
|
|
|
|
$mov eax, 54
|
|
|
|
$mov ebx, 0
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2016-10-05 01:44:07 +03:00
|
|
|
#define SLOT_DATA_TYPE_TEXT 0
|
2016-12-08 20:20:55 +03:00
|
|
|
#define SLOT_DATA_TYPE_TEXT_WITH_BLOCK_SELECTION 1
|
|
|
|
#define SLOT_DATA_TYPE_IMAGE 2
|
|
|
|
#define SLOT_DATA_TYPE_RAW 3
|
2014-01-06 04:33:26 +04:00
|
|
|
dword Clipboard::GetSlotData( ECX) //ECX = slot number
|
|
|
|
{
|
2016-10-05 01:44:07 +03:00
|
|
|
dword result;
|
2014-01-06 04:33:26 +04:00
|
|
|
$mov eax, 54
|
|
|
|
$mov ebx, 1
|
|
|
|
$int 0x40
|
2016-10-05 01:44:07 +03:00
|
|
|
result = EAX;
|
|
|
|
slot_data.size = DSDWORD[result];
|
|
|
|
slot_data.type = DSDWORD[result+4];
|
|
|
|
slot_data.encoding = DSDWORD[result+8];
|
|
|
|
if (slot_data.type == SLOT_DATA_TYPE_TEXT) slot_data.content = result+12;
|
2016-10-24 02:30:27 +03:00
|
|
|
else slot_data.content = result+8;
|
2016-10-05 13:34:43 +03:00
|
|
|
return result;
|
2014-01-06 04:33:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
dword Clipboard::SetSlotData( ECX, EDX) //ECX = data size, EDX - pointer to data
|
|
|
|
{
|
|
|
|
$mov eax, 54
|
|
|
|
$mov ebx, 2
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
dword Clipboard::DelLastSlot()
|
|
|
|
{
|
|
|
|
$mov eax, 54
|
|
|
|
$mov ebx, 3
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
dword Clipboard::ResetBlockingBuffer()
|
|
|
|
{
|
|
|
|
$mov eax, 54
|
2016-10-05 01:44:07 +03:00
|
|
|
$mov ebx, 4
|
2014-01-06 04:33:26 +04:00
|
|
|
$int 0x40
|
2015-07-22 21:32:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|