winemac: Implement IsClipboardFormatAvailable() with support for text formats.
This commit is contained in:
parent
6b2b3e69f7
commit
af10783e18
|
@ -646,6 +646,49 @@ INT CDECL macdrv_CountClipboardFormats(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* IsClipboardFormatAvailable (MACDRV.@)
|
||||||
|
*/
|
||||||
|
BOOL CDECL macdrv_IsClipboardFormatAvailable(UINT desired_format)
|
||||||
|
{
|
||||||
|
CFArrayRef types;
|
||||||
|
int count;
|
||||||
|
UINT i;
|
||||||
|
BOOL found = FALSE;
|
||||||
|
|
||||||
|
TRACE("desired_format %s\n", debugstr_format(desired_format));
|
||||||
|
|
||||||
|
types = macdrv_copy_pasteboard_types();
|
||||||
|
if (!types)
|
||||||
|
{
|
||||||
|
WARN("Failed to copy pasteboard types\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
count = CFArrayGetCount(types);
|
||||||
|
TRACE("got %d types\n", count);
|
||||||
|
|
||||||
|
for (i = 0; !found && i < count; i++)
|
||||||
|
{
|
||||||
|
CFStringRef type = CFArrayGetValueAtIndex(types, i);
|
||||||
|
WINE_CLIPFORMAT* format;
|
||||||
|
|
||||||
|
format = NULL;
|
||||||
|
while (!found && (format = format_for_type(format, type)))
|
||||||
|
{
|
||||||
|
TRACE("for type %s got format %s\n", debugstr_cf(type), debugstr_format(format->format_id));
|
||||||
|
|
||||||
|
if (format->format_id == desired_format)
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CFRelease(types);
|
||||||
|
TRACE(" -> %d\n", found);
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* MACDRV Private Clipboard Exports
|
* MACDRV Private Clipboard Exports
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
@ cdecl GetKeyboardLayoutName(ptr) macdrv_GetKeyboardLayoutName
|
@ cdecl GetKeyboardLayoutName(ptr) macdrv_GetKeyboardLayoutName
|
||||||
@ cdecl GetKeyNameText(long ptr long) macdrv_GetKeyNameText
|
@ cdecl GetKeyNameText(long ptr long) macdrv_GetKeyNameText
|
||||||
@ cdecl GetMonitorInfo(long ptr) macdrv_GetMonitorInfo
|
@ cdecl GetMonitorInfo(long ptr) macdrv_GetMonitorInfo
|
||||||
|
@ cdecl IsClipboardFormatAvailable(long) macdrv_IsClipboardFormatAvailable
|
||||||
@ cdecl MapVirtualKeyEx(long long long) macdrv_MapVirtualKeyEx
|
@ cdecl MapVirtualKeyEx(long long long) macdrv_MapVirtualKeyEx
|
||||||
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) macdrv_MsgWaitForMultipleObjectsEx
|
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) macdrv_MsgWaitForMultipleObjectsEx
|
||||||
@ cdecl ScrollDC(long long long ptr ptr long ptr) macdrv_ScrollDC
|
@ cdecl ScrollDC(long long long ptr ptr long ptr) macdrv_ScrollDC
|
||||||
|
|
Loading…
Reference in New Issue