2015-07-22 20:32:54 +02:00
|
|
|
#ifndef INCLUDE_CLIPBOARD_H
|
|
|
|
#define INCLUDE_CLIPBOARD_H
|
2015-08-04 17:48:36 +02:00
|
|
|
#print "[include <clipboard.h>]\n"
|
2015-07-22 20:32:54 +02:00
|
|
|
|
|
|
|
#ifndef INCLUDE_KOLIBRI_H
|
|
|
|
#include "../lib/kolibri.h"
|
|
|
|
#endif
|
|
|
|
|
2014-01-07 02:04:38 +01:00
|
|
|
struct buffer_data
|
|
|
|
{
|
|
|
|
dword size;
|
|
|
|
dword type;
|
|
|
|
dword encoding;
|
2016-10-05 00:44:07 +02:00
|
|
|
dword content;
|
2014-01-07 02:04:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-01-06 01:33:26 +01:00
|
|
|
struct Clipboard {
|
2016-10-05 00:44:07 +02:00
|
|
|
buffer_data slot_data;
|
2014-01-06 01:33:26 +01: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 00:44:07 +02:00
|
|
|
#define SLOT_DATA_TYPE_TEXT 0
|
2016-12-08 18:20:55 +01: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 01:33:26 +01:00
|
|
|
dword Clipboard::GetSlotData( ECX) //ECX = slot number
|
|
|
|
{
|
2016-10-05 00:44:07 +02:00
|
|
|
dword result;
|
2014-01-06 01:33:26 +01:00
|
|
|
$mov eax, 54
|
|
|
|
$mov ebx, 1
|
|
|
|
$int 0x40
|
2016-10-05 00:44:07 +02: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 01:30:27 +02:00
|
|
|
else slot_data.content = result+8;
|
2016-10-05 12:34:43 +02:00
|
|
|
return result;
|
2014-01-06 01:33:26 +01: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 00:44:07 +02:00
|
|
|
$mov ebx, 4
|
2014-01-06 01:33:26 +01:00
|
|
|
$int 0x40
|
2015-07-22 20:32:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|