winex11.drv: Remove old dnd code.

This commit is contained in:
Lei Zhang 2007-07-11 13:58:25 -07:00 committed by Alexandre Julliard
parent b2b4048f7a
commit d0e068744a
1 changed files with 1 additions and 88 deletions

View File

@ -69,7 +69,6 @@ static void X11DRV_XDND_SendDropFiles(HWND hwnd);
static void X11DRV_XDND_FreeDragDropOp(void); static void X11DRV_XDND_FreeDragDropOp(void);
static unsigned int X11DRV_XDND_UnixToDos(char** lpdest, char* lpsrc, int len); static unsigned int X11DRV_XDND_UnixToDos(char** lpdest, char* lpsrc, int len);
static WCHAR* X11DRV_XDND_URIToDOS(char *encodedURI); static WCHAR* X11DRV_XDND_URIToDOS(char *encodedURI);
static DROPFILES* X11DRV_XDND_BuildDropFiles(char* filename, unsigned int len, POINT pt);
static CRITICAL_SECTION xdnd_cs; static CRITICAL_SECTION xdnd_cs;
static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION_DEBUG critsect_debug =
@ -442,49 +441,15 @@ static int X11DRV_XDND_DeconstructTextURIList(int property, void* data, int len)
*/ */
static int X11DRV_XDND_DeconstructTextPlain(int property, void* data, int len) static int X11DRV_XDND_DeconstructTextPlain(int property, void* data, int len)
{ {
char *p = (char*) data;
char* dostext; char* dostext;
int count = 0;
/* Always suppply plain text */ /* Always suppply plain text */
X11DRV_XDND_UnixToDos(&dostext, (char*)data, len); X11DRV_XDND_UnixToDos(&dostext, (char*)data, len);
X11DRV_XDND_InsertXDNDData(property, CF_TEXT, dostext, strlen(dostext)); X11DRV_XDND_InsertXDNDData(property, CF_TEXT, dostext, strlen(dostext));
count++;
TRACE("CF_TEXT (%d): %s\n", CF_TEXT, dostext); TRACE("CF_TEXT (%d): %s\n", CF_TEXT, dostext);
/* Check for additional mappings */ return 1;
while (*p != '\0' && *p != ':') /* Advance to end of protocol */
p++;
if (*p == ':')
{
if (!strncasecmp(data, "http", 4))
{
X11DRV_XDND_InsertXDNDData(property, RegisterClipboardFormatA("UniformResourceLocator"),
strdup(dostext), strlen(dostext));
count++;
TRACE("UniformResourceLocator: %s\n", dostext);
}
else if (!strncasecmp(data, "file", 4))
{
DROPFILES* pdf;
pdf = X11DRV_XDND_BuildDropFiles(p+1, len - 5, XDNDxy);
if (pdf)
{
unsigned int size = HeapSize(GetProcessHeap(), 0, pdf);
X11DRV_XDND_InsertXDNDData(property, CF_HDROP, pdf, size);
count++;
}
TRACE("CF_HDROP: %p\n", pdf);
}
}
return count;
} }
@ -577,57 +542,6 @@ static void X11DRV_XDND_FreeDragDropOp(void)
/**************************************************************************
* X11DRV_XDND_BuildDropFiles
*/
static DROPFILES* X11DRV_XDND_BuildDropFiles(char* filename, unsigned int len, POINT pt)
{
char* pfn;
int pathlen;
char path[MAX_PATH];
DROPFILES *lpDrop = NULL;
/* Advance to last starting slash */
pfn = filename + 1;
while (*pfn && (*pfn == '\\' || *pfn =='/'))
{
pfn++;
filename++;
}
/* Remove any trailing \r or \n */
while (*pfn)
{
if (*pfn == '\r' || *pfn == '\n')
{
*pfn = 0;
break;
}
pfn++;
}
TRACE("%s\n", filename);
pathlen = GetLongPathNameA(filename, path, MAX_PATH);
if (pathlen)
{
lpDrop = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DROPFILES) + pathlen + 1);
lpDrop->pFiles = sizeof(DROPFILES);
lpDrop->pt.x = pt.x;
lpDrop->pt.y = pt.y;
lpDrop->fNC = 0;
lpDrop->fWide = FALSE;
strcpy(((char*)lpDrop)+lpDrop->pFiles, path);
}
TRACE("resolved %s\n", lpDrop ? filename : NULL);
return lpDrop;
}
/************************************************************************** /**************************************************************************
* X11DRV_XDND_UnixToDos * X11DRV_XDND_UnixToDos
*/ */
@ -741,4 +655,3 @@ static WCHAR* X11DRV_XDND_URIToDOS(char *encodedURI)
HeapFree(GetProcessHeap(), 0, uri); HeapFree(GetProcessHeap(), 0, uri);
return ret; return ret;
} }