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
548ce58b
Commit
548ce58b
authored
Sep 23, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Reimplement import_targets to go through the format list in the standard way.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
df9ff687
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
58 deletions
+31
-58
clipboard.c
dlls/winex11.drv/clipboard.c
+31
-58
No files found.
dlls/winex11.drv/clipboard.c
View file @
548ce58b
...
...
@@ -464,22 +464,6 @@ void X11DRV_InitClipboard(void)
/**************************************************************************
* X11DRV_CLIPBOARD_LookupProperty
*/
static
struct
clipboard_format
*
X11DRV_CLIPBOARD_LookupProperty
(
struct
clipboard_format
*
current
,
Atom
prop
)
{
struct
list
*
ptr
=
current
?
&
current
->
entry
:
&
format_list
;
while
((
ptr
=
list_next
(
&
format_list
,
ptr
)))
{
struct
clipboard_format
*
format
=
LIST_ENTRY
(
ptr
,
struct
clipboard_format
,
entry
);
if
(
format
->
atom
==
prop
)
return
format
;
}
return
NULL
;
}
/**************************************************************************
* X11DRV_CLIPBOARD_LookupData
*/
static
LPWINE_CLIPDATA
X11DRV_CLIPBOARD_LookupData
(
DWORD
wID
)
...
...
@@ -1255,6 +1239,37 @@ static HANDLE import_text_uri_list( Atom type, const void *data, size_t size )
/**************************************************************************
* import_targets
*
* Import TARGETS and mark the corresponding clipboard formats as available.
*/
static
HANDLE
import_targets
(
Atom
type
,
const
void
*
data
,
size_t
size
)
{
UINT
i
,
count
=
size
/
sizeof
(
Atom
);
const
Atom
*
properties
=
data
;
struct
clipboard_format
*
format
;
if
(
type
!=
XA_ATOM
&&
type
!=
x11drv_atom
(
TARGETS
))
return
0
;
register_x11_formats
(
properties
,
count
);
LIST_FOR_EACH_ENTRY
(
format
,
&
format_list
,
struct
clipboard_format
,
entry
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
if
(
properties
[
i
]
==
format
->
atom
)
break
;
if
(
i
==
count
)
continue
;
if
(
format
->
import
&&
format
->
id
)
{
TRACE
(
"property %s -> format %s
\n
"
,
debugstr_xatom
(
properties
[
i
]
),
debugstr_format
(
format
->
id
));
X11DRV_CLIPBOARD_InsertClipboardData
(
format
->
id
,
0
,
format
,
FALSE
);
}
else
TRACE
(
"property %s (ignoring)
\n
"
,
debugstr_xatom
(
properties
[
i
]
));
}
return
(
HANDLE
)
1
;
}
/**************************************************************************
* import_data
*
* Generic import clipboard data routine.
...
...
@@ -1883,48 +1898,6 @@ static BOOL export_multiple( Display *display, Window win, Atom prop, Atom targe
/**************************************************************************
* import_targets
*
* Import TARGETS and mark the corresponding clipboard formats as available.
*/
static
HANDLE
import_targets
(
Atom
type
,
const
void
*
data
,
size_t
size
)
{
UINT
i
,
count
=
size
/
sizeof
(
Atom
);
const
Atom
*
properties
=
data
;
if
(
type
!=
XA_ATOM
&&
type
!=
x11drv_atom
(
TARGETS
))
return
0
;
register_x11_formats
(
properties
,
count
);
/* Cache these formats in the clipboard cache */
for
(
i
=
0
;
i
<
count
;
i
++
)
{
LPWINE_CLIPFORMAT
lpFormat
=
X11DRV_CLIPBOARD_LookupProperty
(
NULL
,
properties
[
i
]);
if
(
lpFormat
)
{
/* We found at least one Window's format that mapps to the property.
* Continue looking for more.
*
* If more than one property map to a Window's format then we use the first
* one and ignore the rest.
*/
while
(
lpFormat
)
{
TRACE
(
"property %s -> format %s
\n
"
,
debugstr_xatom
(
lpFormat
->
atom
),
debugstr_format
(
lpFormat
->
id
));
if
(
lpFormat
->
id
)
X11DRV_CLIPBOARD_InsertClipboardData
(
lpFormat
->
id
,
0
,
lpFormat
,
FALSE
);
lpFormat
=
X11DRV_CLIPBOARD_LookupProperty
(
lpFormat
,
properties
[
i
]);
}
}
}
return
(
HANDLE
)
1
;
}
/**************************************************************************
* X11DRV_CLIPBOARD_QueryAvailableData
*
* Caches the list of data formats available from the current selection.
...
...
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