Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4ae5b106
Commit
4ae5b106
authored
Mar 13, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Mar 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Enable pasteboard functions to operate on arbitrary pasteboards.
... not just the general pasteboard (although the general pasteboard is still the default).
parent
761ad810
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
clipboard.c
dlls/winemac.drv/clipboard.c
+6
-6
cocoa_clipboard.m
dlls/winemac.drv/cocoa_clipboard.m
+14
-8
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+2
-2
No files found.
dlls/winemac.drv/clipboard.c
View file @
4ae5b106
...
@@ -1326,7 +1326,7 @@ INT CDECL macdrv_CountClipboardFormats(void)
...
@@ -1326,7 +1326,7 @@ INT CDECL macdrv_CountClipboardFormats(void)
return
0
;
return
0
;
}
}
types
=
macdrv_copy_pasteboard_types
();
types
=
macdrv_copy_pasteboard_types
(
NULL
);
if
(
!
types
)
if
(
!
types
)
{
{
WARN
(
"Failed to copy pasteboard types
\n
"
);
WARN
(
"Failed to copy pasteboard types
\n
"
);
...
@@ -1396,7 +1396,7 @@ UINT CDECL macdrv_EnumClipboardFormats(UINT prev_format)
...
@@ -1396,7 +1396,7 @@ UINT CDECL macdrv_EnumClipboardFormats(UINT prev_format)
TRACE
(
"prev_format %s
\n
"
,
debugstr_format
(
prev_format
));
TRACE
(
"prev_format %s
\n
"
,
debugstr_format
(
prev_format
));
check_clipboard_ownership
(
NULL
);
check_clipboard_ownership
(
NULL
);
types
=
macdrv_copy_pasteboard_types
();
types
=
macdrv_copy_pasteboard_types
(
NULL
);
if
(
!
types
)
if
(
!
types
)
{
{
WARN
(
"Failed to copy pasteboard types
\n
"
);
WARN
(
"Failed to copy pasteboard types
\n
"
);
...
@@ -1490,7 +1490,7 @@ HANDLE CDECL macdrv_GetClipboardData(UINT desired_format)
...
@@ -1490,7 +1490,7 @@ HANDLE CDECL macdrv_GetClipboardData(UINT desired_format)
TRACE
(
"desired_format %s
\n
"
,
debugstr_format
(
desired_format
));
TRACE
(
"desired_format %s
\n
"
,
debugstr_format
(
desired_format
));
check_clipboard_ownership
(
NULL
);
check_clipboard_ownership
(
NULL
);
types
=
macdrv_copy_pasteboard_types
();
types
=
macdrv_copy_pasteboard_types
(
NULL
);
if
(
!
types
)
if
(
!
types
)
{
{
WARN
(
"Failed to copy pasteboard types
\n
"
);
WARN
(
"Failed to copy pasteboard types
\n
"
);
...
@@ -1526,7 +1526,7 @@ HANDLE CDECL macdrv_GetClipboardData(UINT desired_format)
...
@@ -1526,7 +1526,7 @@ HANDLE CDECL macdrv_GetClipboardData(UINT desired_format)
if
(
best_format
)
if
(
best_format
)
{
{
CFDataRef
pasteboard_data
=
macdrv_copy_pasteboard_data
(
best_type
);
CFDataRef
pasteboard_data
=
macdrv_copy_pasteboard_data
(
NULL
,
best_type
);
TRACE
(
"got pasteboard data for type %s: %s
\n
"
,
debugstr_cf
(
best_type
),
debugstr_cf
(
pasteboard_data
));
TRACE
(
"got pasteboard data for type %s: %s
\n
"
,
debugstr_cf
(
best_type
),
debugstr_cf
(
pasteboard_data
));
...
@@ -1556,7 +1556,7 @@ BOOL CDECL macdrv_IsClipboardFormatAvailable(UINT desired_format)
...
@@ -1556,7 +1556,7 @@ BOOL CDECL macdrv_IsClipboardFormatAvailable(UINT desired_format)
TRACE
(
"desired_format %s
\n
"
,
debugstr_format
(
desired_format
));
TRACE
(
"desired_format %s
\n
"
,
debugstr_format
(
desired_format
));
check_clipboard_ownership
(
NULL
);
check_clipboard_ownership
(
NULL
);
types
=
macdrv_copy_pasteboard_types
();
types
=
macdrv_copy_pasteboard_types
(
NULL
);
if
(
!
types
)
if
(
!
types
)
{
{
WARN
(
"Failed to copy pasteboard types
\n
"
);
WARN
(
"Failed to copy pasteboard types
\n
"
);
...
@@ -1758,7 +1758,7 @@ BOOL query_pasteboard_data(HWND hwnd, CFStringRef type)
...
@@ -1758,7 +1758,7 @@ BOOL query_pasteboard_data(HWND hwnd, CFStringRef type)
if
(
!
types
)
if
(
!
types
)
{
{
types
=
macdrv_copy_pasteboard_types
();
types
=
macdrv_copy_pasteboard_types
(
NULL
);
if
(
!
types
)
if
(
!
types
)
{
{
WARN
(
"Failed to copy pasteboard types
\n
"
);
WARN
(
"Failed to copy pasteboard types
\n
"
);
...
...
dlls/winemac.drv/cocoa_clipboard.m
View file @
4ae5b106
...
@@ -53,8 +53,9 @@ int macdrv_is_pasteboard_owner(void)
...
@@ -53,8 +53,9 @@ int macdrv_is_pasteboard_owner(void)
* the pasteboard, or NULL on error. The caller is responsible for
* the pasteboard, or NULL on error. The caller is responsible for
* releasing the returned array with CFRelease().
* releasing the returned array with CFRelease().
*/
*/
CFArrayRef
macdrv_copy_pasteboard_types
(
voi
d
)
CFArrayRef
macdrv_copy_pasteboard_types
(
CFTypeRef
pasteboar
d
)
{
{
NSPasteboard
*
pb
=
(
NSPasteboard
*
)
pasteboard
;
__block
CFArrayRef
ret
=
NULL
;
__block
CFArrayRef
ret
=
NULL
;
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
...
@@ -79,8 +80,11 @@ CFArrayRef macdrv_copy_pasteboard_types(void)
...
@@ -79,8 +80,11 @@ CFArrayRef macdrv_copy_pasteboard_types(void)
OnMainThread
(
^
{
OnMainThread
(
^
{
@try
@try
{
{
NSPasteboard
*
pb
=
[
NSPasteboard
generalPasteboard
];
NSPasteboard
*
local_pb
=
pb
;
NSArray
*
types
=
[
pb
types
];
NSArray
*
types
;
if
(
!
local_pb
)
local_pb
=
[
NSPasteboard
generalPasteboard
];
types
=
[
local_pb
types
];
// If there are any types understood by NSBitmapImageRep, then we
// If there are any types understood by NSBitmapImageRep, then we
// can offer all of the types that it can output, too. For example,
// can offer all of the types that it can output, too. For example,
...
@@ -115,22 +119,24 @@ CFArrayRef macdrv_copy_pasteboard_types(void)
...
@@ -115,22 +119,24 @@ CFArrayRef macdrv_copy_pasteboard_types(void)
* if there's no such type on the pasteboard. The caller is responsible
* if there's no such type on the pasteboard. The caller is responsible
* for releasing the returned data object with CFRelease().
* for releasing the returned data object with CFRelease().
*/
*/
CFDataRef
macdrv_copy_pasteboard_data
(
CFStringRef
type
)
CFDataRef
macdrv_copy_pasteboard_data
(
CF
TypeRef
pasteboard
,
CF
StringRef
type
)
{
{
NSPasteboard
*
pb
=
(
NSPasteboard
*
)
pasteboard
;
__block
NSData
*
ret
=
nil
;
__block
NSData
*
ret
=
nil
;
OnMainThread
(
^
{
OnMainThread
(
^
{
@try
@try
{
{
NSPasteboard
*
pb
=
[
NSPasteboard
generalPasteboard
];
NSPasteboard
*
local_pb
=
pb
;
if
([
pb
availableTypeFromArray
:[
NSArray
arrayWithObject
:(
NSString
*
)
type
]])
if
(
!
local_pb
)
local_pb
=
[
NSPasteboard
generalPasteboard
];
ret
=
[[
pb
dataForType
:(
NSString
*
)
type
]
copy
];
if
([
local_pb
availableTypeFromArray
:[
NSArray
arrayWithObject
:(
NSString
*
)
type
]])
ret
=
[[
local_pb
dataForType
:(
NSString
*
)
type
]
copy
];
else
else
{
{
NSNumber
*
bitmapType
=
[
BitmapOutputTypeMap
objectForKey
:(
NSString
*
)
type
];
NSNumber
*
bitmapType
=
[
BitmapOutputTypeMap
objectForKey
:(
NSString
*
)
type
];
if
(
bitmapType
)
if
(
bitmapType
)
{
{
NSArray
*
reps
=
[
NSBitmapImageRep
imageRepsWithPasteboard
:
pb
];
NSArray
*
reps
=
[
NSBitmapImageRep
imageRepsWithPasteboard
:
local_
pb
];
ret
=
[
NSBitmapImageRep
representationOfImageRepsInArray
:
reps
ret
=
[
NSBitmapImageRep
representationOfImageRepsInArray
:
reps
usingType
:[
bitmapType
unsignedIntegerValue
]
usingType
:[
bitmapType
unsignedIntegerValue
]
properties:
nil
];
properties:
nil
];
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
4ae5b106
...
@@ -304,8 +304,8 @@ extern CFDataRef macdrv_copy_keyboard_layout(CGEventSourceKeyboardType* keyboard
...
@@ -304,8 +304,8 @@ extern CFDataRef macdrv_copy_keyboard_layout(CGEventSourceKeyboardType* keyboard
/* clipboard */
/* clipboard */
extern
CFArrayRef
macdrv_copy_pasteboard_types
(
voi
d
)
DECLSPEC_HIDDEN
;
extern
CFArrayRef
macdrv_copy_pasteboard_types
(
CFTypeRef
pasteboar
d
)
DECLSPEC_HIDDEN
;
extern
CFDataRef
macdrv_copy_pasteboard_data
(
CFStringRef
type
)
DECLSPEC_HIDDEN
;
extern
CFDataRef
macdrv_copy_pasteboard_data
(
CF
TypeRef
pasteboard
,
CF
StringRef
type
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_is_pasteboard_owner
(
void
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_is_pasteboard_owner
(
void
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_clear_pasteboard
(
void
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_clear_pasteboard
(
void
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_set_pasteboard_data
(
CFStringRef
type
,
CFDataRef
data
,
macdrv_window
w
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_set_pasteboard_data
(
CFStringRef
type
,
CFDataRef
data
,
macdrv_window
w
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment