winex11.drv: Import text/plain XDND selections through the clipboard.

This commit is contained in:
Damjan Jovanovic 2014-05-27 02:23:27 +02:00 committed by Alexandre Julliard
parent d33989f675
commit c2f73b9780
2 changed files with 1 additions and 57 deletions

View File

@ -186,6 +186,7 @@ static const struct
} builtin_formats[] =
{
{ CF_TEXT, XA_STRING, X11DRV_CLIPBOARD_ImportXAString, X11DRV_CLIPBOARD_ExportString},
{ CF_TEXT, XATOM_text_plain, X11DRV_CLIPBOARD_ImportXAString, X11DRV_CLIPBOARD_ExportString},
{ CF_BITMAP, XATOM_WCF_BITMAP, X11DRV_CLIPBOARD_ImportClipboardData, NULL},
{ CF_METAFILEPICT, XATOM_WCF_METAFILEPICT, X11DRV_CLIPBOARD_ImportMetaFilePict, X11DRV_CLIPBOARD_ExportMetaFilePict },
{ CF_SYLK, XATOM_WCF_SYLK, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },

View File

@ -73,13 +73,11 @@ static HWND XDNDLastDropTargetWnd;
static void X11DRV_XDND_InsertXDNDData(int property, int format, void* data, unsigned int len);
static int X11DRV_XDND_DeconstructTextURIList(int property, void* data, int len);
static int X11DRV_XDND_DeconstructTextPlain(int property, void* data, int len);
static void X11DRV_XDND_MapFormat(Display *display, Window xwin, unsigned int property, unsigned char *data, int len);
static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm,
Atom *types, unsigned long count);
static void X11DRV_XDND_SendDropFiles(HWND hwnd);
static void X11DRV_XDND_FreeDragDropOp(void);
static unsigned int X11DRV_XDND_UnixToDos(char** lpdest, char* lpsrc, int len);
static WCHAR* X11DRV_XDND_URIToDOS(char *encodedURI);
static CRITICAL_SECTION xdnd_cs;
@ -566,8 +564,6 @@ static void X11DRV_XDND_MapFormat(Display *display, Window xwin, unsigned int pr
if (property == x11drv_atom(text_uri_list))
X11DRV_XDND_DeconstructTextURIList(property, data, len);
else if (property == x11drv_atom(text_plain))
X11DRV_XDND_DeconstructTextPlain(property, data, len);
else
{
/* use the clipboard import functions for other types */
@ -675,25 +671,6 @@ static int X11DRV_XDND_DeconstructTextURIList(int property, void* data, int len)
}
/**************************************************************************
* X11DRV_XDND_DeconstructTextPlain
*
* Interpret text/plain Data and add records to <dndfmt> linked list
*/
static int X11DRV_XDND_DeconstructTextPlain(int property, void* data, int len)
{
char* dostext;
/* Always supply plain text */
X11DRV_XDND_UnixToDos(&dostext, data, len);
X11DRV_XDND_InsertXDNDData(property, CF_TEXT, dostext, strlen(dostext));
TRACE("CF_TEXT (%d): %s\n", CF_TEXT, dostext);
return 1;
}
/**************************************************************************
* X11DRV_XDND_SendDropFiles
*/
@ -766,40 +743,6 @@ static void X11DRV_XDND_FreeDragDropOp(void)
}
/**************************************************************************
* X11DRV_XDND_UnixToDos
*/
static unsigned int X11DRV_XDND_UnixToDos(char** lpdest, char* lpsrc, int len)
{
int i;
unsigned int destlen, lines;
for (i = 0, lines = 0; i <= len; i++)
{
if (lpsrc[i] == '\n')
lines++;
}
destlen = len + lines + 1;
if (lpdest)
{
char* lpstr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, destlen);
for (i = 0, lines = 0; i <= len; i++)
{
if (lpsrc[i] == '\n')
lpstr[++lines + i] = '\r';
lpstr[lines + i] = lpsrc[i];
}
*lpdest = lpstr;
}
return lines;
}
/**************************************************************************
* X11DRV_XDND_URIToDOS
*/