winex11: Pre-register atoms for all the built-in clipboard formats.

This commit is contained in:
Alexandre Julliard 2011-03-03 21:27:34 +01:00
parent ade3b4f148
commit f15e91a883
3 changed files with 63 additions and 23 deletions

View File

@ -218,30 +218,30 @@ static const struct
} builtin_formats[] =
{
{ CF_TEXT, wszCF_TEXT, XA_STRING, X11DRV_CLIPBOARD_ImportXAString, X11DRV_CLIPBOARD_ExportString},
{ CF_BITMAP, wszCF_BITMAP, 0, X11DRV_CLIPBOARD_ImportClipboardData, NULL},
{ CF_METAFILEPICT, wszCF_METAFILEPICT, 0, X11DRV_CLIPBOARD_ImportMetaFilePict, X11DRV_CLIPBOARD_ExportMetaFilePict },
{ CF_SYLK, wszCF_SYLK, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIF, wszCF_DIF, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_TIFF, wszCF_TIFF, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_OEMTEXT, wszCF_OEMTEXT, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_BITMAP, wszCF_BITMAP, XATOM_WCF_BITMAP, X11DRV_CLIPBOARD_ImportClipboardData, NULL},
{ CF_METAFILEPICT, wszCF_METAFILEPICT, XATOM_WCF_METAFILEPICT, X11DRV_CLIPBOARD_ImportMetaFilePict, X11DRV_CLIPBOARD_ExportMetaFilePict },
{ CF_SYLK, wszCF_SYLK, XATOM_WCF_SYLK, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIF, wszCF_DIF, XATOM_WCF_DIF, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_TIFF, wszCF_TIFF, XATOM_WCF_TIFF, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_OEMTEXT, wszCF_OEMTEXT, XATOM_WCF_OEMTEXT, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIB, wszCF_DIB, XA_PIXMAP, X11DRV_CLIPBOARD_ImportXAPIXMAP, X11DRV_CLIPBOARD_ExportXAPIXMAP },
{ CF_PALETTE, wszCF_PALETTE, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_PENDATA, wszCF_PENDATA, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_RIFF, wszCF_RIFF, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_WAVE, wszCF_WAVE, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_UNICODETEXT, wszUTF8STRING, 0, X11DRV_CLIPBOARD_ImportUTF8, X11DRV_CLIPBOARD_ExportString },
{ CF_PALETTE, wszCF_PALETTE, XATOM_WCF_PALETTE, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_PENDATA, wszCF_PENDATA, XATOM_WCF_PENDATA, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_RIFF, wszCF_RIFF, XATOM_WCF_RIFF, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_WAVE, wszCF_WAVE, XATOM_WCF_WAVE, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_UNICODETEXT, wszUTF8STRING, XATOM_UTF8_STRING, X11DRV_CLIPBOARD_ImportUTF8, X11DRV_CLIPBOARD_ExportString },
/* If UTF8_STRING is not available, attempt COMPOUND_TEXT */
{ CF_UNICODETEXT, wszCOMPOUNDTEXT, 0, X11DRV_CLIPBOARD_ImportCompoundText, X11DRV_CLIPBOARD_ExportString },
{ CF_ENHMETAFILE, wszCF_ENHMETAFILE, 0, X11DRV_CLIPBOARD_ImportEnhMetaFile, X11DRV_CLIPBOARD_ExportEnhMetaFile },
{ CF_HDROP, wszCF_HDROP, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_LOCALE, wszCF_LOCALE, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIBV5, wszCF_DIBV5, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_OWNERDISPLAY, wszCF_OWNERDISPLAY, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPTEXT, wszCF_DSPTEXT, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPBITMAP, wszCF_DSPBITMAP, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPMETAFILEPICT, wszCF_DSPMETAFILEPICT, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPENHMETAFILE, wszCF_DSPENHMETAFILE, 0, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIB, wszIMAGEBMP, 0, X11DRV_CLIPBOARD_ImportImageBmp, X11DRV_CLIPBOARD_ExportImageBmp },
{ CF_UNICODETEXT, wszCOMPOUNDTEXT, XATOM_COMPOUND_TEXT, X11DRV_CLIPBOARD_ImportCompoundText, X11DRV_CLIPBOARD_ExportString },
{ CF_ENHMETAFILE, wszCF_ENHMETAFILE, XATOM_WCF_ENHMETAFILE, X11DRV_CLIPBOARD_ImportEnhMetaFile, X11DRV_CLIPBOARD_ExportEnhMetaFile },
{ CF_HDROP, wszCF_HDROP, XATOM_WCF_HDROP, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_LOCALE, wszCF_LOCALE, XATOM_WCF_LOCALE, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIBV5, wszCF_DIBV5, XATOM_WCF_DIBV5, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_OWNERDISPLAY, wszCF_OWNERDISPLAY, XATOM_WCF_OWNERDISPLAY, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPTEXT, wszCF_DSPTEXT, XATOM_WCF_DSPTEXT, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPBITMAP, wszCF_DSPBITMAP, XATOM_WCF_DSPBITMAP, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPMETAFILEPICT, wszCF_DSPMETAFILEPICT, XATOM_WCF_DSPMETAFILEPICT, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DSPENHMETAFILE, wszCF_DSPENHMETAFILE, XATOM_WCF_DSPENHMETAFILE, X11DRV_CLIPBOARD_ImportClipboardData, X11DRV_CLIPBOARD_ExportClipboardData },
{ CF_DIB, wszIMAGEBMP, XATOM_image_bmp, X11DRV_CLIPBOARD_ImportImageBmp, X11DRV_CLIPBOARD_ExportImageBmp },
};
static struct list format_list = LIST_INIT( format_list );
@ -362,7 +362,7 @@ void X11DRV_InitClipboard(void)
if (!(format = HeapAlloc( GetProcessHeap(), 0, sizeof(*format )))) break;
format->wFormatID = builtin_formats[i].id;
format->Name = builtin_formats[i].name;
format->drvData = builtin_formats[i].data;
format->drvData = GET_ATOM(builtin_formats[i].data);
format->wFlags = CF_FLAG_BUILTINFMT;
format->lpDrvImportFunc = builtin_formats[i].import;
format->lpDrvExportFunc = builtin_formats[i].export;

View File

@ -677,7 +677,27 @@ enum x11drv_atoms
XATOM_XdndTarget,
XATOM_XdndTypeList,
XATOM_HTML_Format,
XATOM_WCF_BITMAP,
XATOM_WCF_DIB,
XATOM_WCF_DIBV5,
XATOM_WCF_DIF,
XATOM_WCF_DSPBITMAP,
XATOM_WCF_DSPENHMETAFILE,
XATOM_WCF_DSPMETAFILEPICT,
XATOM_WCF_DSPTEXT,
XATOM_WCF_ENHMETAFILE,
XATOM_WCF_HDROP,
XATOM_WCF_LOCALE,
XATOM_WCF_METAFILEPICT,
XATOM_WCF_OEMTEXT,
XATOM_WCF_OWNERDISPLAY,
XATOM_WCF_PALETTE,
XATOM_WCF_PENDATA,
XATOM_WCF_RIFF,
XATOM_WCF_SYLK,
XATOM_WCF_TIFF,
XATOM_WCF_WAVE,
XATOM_image_bmp,
XATOM_image_gif,
XATOM_image_jpeg,
XATOM_image_png,

View File

@ -179,7 +179,27 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"XdndTarget",
"XdndTypeList",
"HTML Format",
"WCF_BITMAP",
"WCF_DIB",
"WCF_DIBV5",
"WCF_DIF",
"WCF_DSPBITMAP",
"WCF_DSPENHMETAFILE",
"WCF_DSPMETAFILEPICT",
"WCF_DSPTEXT",
"WCF_ENHMETAFILE",
"WCF_HDROP",
"WCF_LOCALE",
"WCF_METAFILEPICT",
"WCF_OEMTEXT",
"WCF_OWNERDISPLAY",
"WCF_PALETTE",
"WCF_PENDATA",
"WCF_RIFF",
"WCF_SYLK",
"WCF_TIFF",
"WCF_WAVE",
"image/bmp",
"image/gif",
"image/jpeg",
"image/png",