Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
caf6db7b
Commit
caf6db7b
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: Extract new function from macdrv_IsClipboardFormatAvailable()…
winemac: Extract new function from macdrv_IsClipboardFormatAvailable() parameterized by the target pasteboard.
parent
c8e6bad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
35 deletions
+44
-35
clipboard.c
dlls/winemac.drv/clipboard.c
+44
-35
No files found.
dlls/winemac.drv/clipboard.c
View file @
caf6db7b
...
...
@@ -1324,6 +1324,49 @@ static HANDLE macdrv_get_pasteboard_data(CFTypeRef pasteboard, UINT desired_form
/**************************************************************************
* macdrv_pasteboard_has_format
*/
static
BOOL
macdrv_pasteboard_has_format
(
CFTypeRef
pasteboard
,
UINT
desired_format
)
{
CFArrayRef
types
;
int
count
;
UINT
i
;
BOOL
found
=
FALSE
;
TRACE
(
"pasteboard %p, desired_format %s
\n
"
,
pasteboard
,
debugstr_format
(
desired_format
));
types
=
macdrv_copy_pasteboard_types
(
pasteboard
);
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
;
}
/**************************************************************************
* check_clipboard_ownership
*/
static
void
check_clipboard_ownership
(
HWND
*
owner
)
...
...
@@ -1558,42 +1601,8 @@ HANDLE CDECL macdrv_GetClipboardData(UINT desired_format)
*/
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
));
check_clipboard_ownership
(
NULL
);
types
=
macdrv_copy_pasteboard_types
(
NULL
);
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
;
return
macdrv_pasteboard_has_format
(
NULL
,
desired_format
);
}
...
...
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