Commit 29236cce authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Add support for the CF_ENHMETAFILE clipboard format.

parent cdad6136
......@@ -72,6 +72,7 @@ typedef struct
static HANDLE import_clipboard_data(CFDataRef data);
static HANDLE import_bmp_to_bitmap(CFDataRef data);
static HANDLE import_bmp_to_dib(CFDataRef data);
static HANDLE import_enhmetafile(CFDataRef data);
static HANDLE import_metafilepict(CFDataRef data);
static HANDLE import_nsfilenames_to_hdrop(CFDataRef data);
static HANDLE import_oemtext_to_text(CFDataRef data);
......@@ -90,6 +91,7 @@ static HANDLE import_utf16_to_unicodetext(CFDataRef data);
static CFDataRef export_clipboard_data(HANDLE data);
static CFDataRef export_bitmap_to_bmp(HANDLE data);
static CFDataRef export_dib_to_bmp(HANDLE data);
static CFDataRef export_enhmetafile(HANDLE data);
static CFDataRef export_hdrop_to_filenames(HANDLE data);
static CFDataRef export_metafilepict(HANDLE data);
static CFDataRef export_oemtext_to_utf8(HANDLE data);
......@@ -197,6 +199,7 @@ static const struct
{ CF_HDROP, CFSTR("org.winehq.builtin.hdrop"), import_clipboard_data, export_clipboard_data, FALSE },
{ CF_HDROP, CFSTR("NSFilenamesPboardType"), import_nsfilenames_to_hdrop, export_hdrop_to_filenames, TRUE },
{ CF_ENHMETAFILE, CFSTR("org.winehq.builtin.enhmetafile"), import_enhmetafile, export_enhmetafile, FALSE },
{ CF_METAFILEPICT, CFSTR("org.winehq.builtin.metafilepict"), import_metafilepict, export_metafilepict, FALSE },
};
......@@ -675,6 +678,25 @@ static HANDLE import_bmp_to_dib(CFDataRef data)
/**************************************************************************
* import_enhmetafile
*
* Import enhanced metafile data, converting it to CF_ENHMETAFILE.
*/
static HANDLE import_enhmetafile(CFDataRef data)
{
HANDLE ret = 0;
CFIndex len = CFDataGetLength(data);
TRACE("data %s\n", debugstr_cf(data));
if (len)
ret = SetEnhMetaFileBits(len, (const BYTE*)CFDataGetBytePtr(data));
return ret;
}
/**************************************************************************
* import_metafilepict
*
* Import metafile picture data, converting it to CF_METAFILEPICT.
......@@ -1169,6 +1191,30 @@ static CFDataRef export_dib_to_bmp(HANDLE data)
/**************************************************************************
* export_enhmetafile
*
* Export an enhanced metafile to data.
*/
static CFDataRef export_enhmetafile(HANDLE data)
{
CFMutableDataRef ret = NULL;
unsigned int size = GetEnhMetaFileBits(data, 0, NULL);
TRACE("data %p\n", data);
ret = CFDataCreateMutable(NULL, size);
if (ret)
{
CFDataSetLength(ret, size);
GetEnhMetaFileBits(data, size, (BYTE*)CFDataGetMutableBytePtr(ret));
}
TRACE(" -> %s\n", debugstr_cf(ret));
return ret;
}
/**************************************************************************
* export_hdrop_to_filenames
*
* Export CF_HDROP to NSFilenamesPboardType data, which is a CFArray of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment