Clipboard paste support for Haiku.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1828 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
@@ -20,10 +20,14 @@
|
||||
#include "struct.h"
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <Clipboard.h>
|
||||
#include <Entry.h>
|
||||
#include <Volume.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern "C" qword haiku_get_free_space(char* path);
|
||||
extern "C" char* haiku_get_clipboard();
|
||||
|
||||
qword haiku_get_free_space(char* path)
|
||||
{
|
||||
@@ -33,4 +37,17 @@ qword haiku_get_free_space(char* path)
|
||||
BVolume disk(ref.device);
|
||||
return (qword) disk.Capacity();
|
||||
}
|
||||
|
||||
char* haiku_get_clipboard()
|
||||
{
|
||||
if (be_clipboard->Lock())
|
||||
{
|
||||
const char* value;
|
||||
ssize_t len;
|
||||
be_clipboard->Data()->FindData("text/plain", B_MIME_TYPE, &(const void*)value, &len);
|
||||
|
||||
return strdup(value);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user