Commit 6b2b3e69 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Implement CountClipboardFormats() with support for text formats.

parent 41658157
......@@ -3,6 +3,7 @@ IMPORTS = user32 gdi32 advapi32
EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL
C_SRCS = \
clipboard.c \
display.c \
event.c \
gdi.c \
......@@ -16,6 +17,7 @@ C_SRCS = \
OBJC_SRCS = \
cocoa_app.m \
cocoa_clipboard.m \
cocoa_display.m \
cocoa_event.m \
cocoa_main.m \
......
/*
* MACDRV Cocoa clipboard code
*
* Copyright 2012, 2013 Ken Thomases for CodeWeavers Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "macdrv_cocoa.h"
#import "cocoa_app.h"
/***********************************************************************
* macdrv_copy_pasteboard_types
*
* Returns an array of UTI strings for the types of data available on
* the pasteboard, or NULL on error. The caller is responsible for
* releasing the returned array with CFRelease().
*/
CFArrayRef macdrv_copy_pasteboard_types(void)
{
__block CFArrayRef ret = NULL;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
OnMainThread(^{
@try
{
NSPasteboard* pb = [NSPasteboard generalPasteboard];
NSArray* types = [pb types];
ret = (CFArrayRef)[types copy];
}
@catch (id e)
{
ERR(@"Exception discarded while copying pasteboard types: %@\n", e);
}
});
[pool release];
return ret;
}
......@@ -156,6 +156,8 @@ extern void macdrv_key_event(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDD
extern void macdrv_displays_changed(const macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_clipboard_process_attach(void) DECLSPEC_HIDDEN;
extern struct opengl_funcs *macdrv_wine_get_wgl_driver(PHYSDEV dev, UINT version) DECLSPEC_HIDDEN;
extern void sync_gl_view(struct macdrv_win_data *data) DECLSPEC_HIDDEN;
extern void set_gl_view_parent(HWND hwnd, HWND parent) DECLSPEC_HIDDEN;
......
......@@ -273,6 +273,10 @@ extern void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_conte
extern CFDataRef macdrv_copy_keyboard_layout(CGEventSourceKeyboardType* keyboard_type, int* is_iso) DECLSPEC_HIDDEN;
/* clipboard */
extern CFArrayRef macdrv_copy_pasteboard_types(void) DECLSPEC_HIDDEN;
/* opengl */
extern macdrv_opengl_context macdrv_create_opengl_context(void* cglctx) DECLSPEC_HIDDEN;
extern void macdrv_dispose_opengl_context(macdrv_opengl_context c) DECLSPEC_HIDDEN;
......
......@@ -89,6 +89,8 @@ static BOOL process_attach(void)
return FALSE;
}
macdrv_clipboard_process_attach();
return TRUE;
}
......
......@@ -8,6 +8,7 @@
@ cdecl Beep() macdrv_Beep
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) macdrv_ChangeDisplaySettingsEx
@ cdecl ClipCursor(ptr) macdrv_ClipCursor
@ cdecl CountClipboardFormats() macdrv_CountClipboardFormats
@ cdecl CreateDesktopWindow(long) macdrv_CreateDesktopWindow
@ cdecl CreateWindow(long) macdrv_CreateWindow
@ cdecl DestroyCursorIcon(long) macdrv_DestroyCursorIcon
......
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