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
fcaeffb7
Commit
fcaeffb7
authored
Oct 31, 2008
by
Kusanagi Kouichi
Committed by
Alexandre Julliard
Nov 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Implement large data transfers.
parent
6c380468
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
14 deletions
+93
-14
clipboard.c
dlls/winex11.drv/clipboard.c
+91
-14
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+1
-0
No files found.
dlls/winex11.drv/clipboard.c
View file @
fcaeffb7
...
@@ -325,7 +325,7 @@ static Window thread_selection_wnd(void)
...
@@ -325,7 +325,7 @@ static Window thread_selection_wnd(void)
XSetWindowAttributes
attr
;
XSetWindowAttributes
attr
;
attr
.
event_mask
=
(
ExposureMask
|
KeyPressMask
|
KeyReleaseMask
|
PointerMotionMask
|
attr
.
event_mask
=
(
ExposureMask
|
KeyPressMask
|
KeyReleaseMask
|
PointerMotionMask
|
ButtonPressMask
|
ButtonReleaseMask
|
EnterWindowMask
);
ButtonPressMask
|
ButtonReleaseMask
|
EnterWindowMask
|
PropertyChangeMask
);
wine_tsx11_lock
();
wine_tsx11_lock
();
w
=
XCreateWindow
(
thread_data
->
display
,
root_window
,
0
,
0
,
1
,
1
,
0
,
screen_depth
,
w
=
XCreateWindow
(
thread_data
->
display
,
root_window
,
0
,
0
,
1
,
1
,
0
,
screen_depth
,
...
@@ -1231,15 +1231,17 @@ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, At
...
@@ -1231,15 +1231,17 @@ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, At
HANDLE
hUnicodeText
;
HANDLE
hUnicodeText
;
XTextProperty
txtprop
;
XTextProperty
txtprop
;
wine_tsx11_lock
();
if
(
!
X11DRV_CLIPBOARD_ReadProperty
(
display
,
w
,
prop
,
&
txtprop
.
value
,
&
txtprop
.
nitems
))
if
(
!
XGetTextProperty
(
display
,
w
,
&
txtprop
,
prop
))
{
{
wine_tsx11_unlock
();
return
0
;
return
0
;
}
}
txtprop
.
encoding
=
x11drv_atom
(
COMPOUND_TEXT
);
txtprop
.
format
=
8
;
wine_tsx11_lock
();
XmbTextPropertyToTextList
(
display
,
&
txtprop
,
&
srcstr
,
&
count
);
XmbTextPropertyToTextList
(
display
,
&
txtprop
,
&
srcstr
,
&
count
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
txtprop
.
value
);
TRACE
(
"Importing %d line(s)
\n
"
,
count
);
TRACE
(
"Importing %d line(s)
\n
"
,
count
);
...
@@ -1276,7 +1278,6 @@ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, At
...
@@ -1276,7 +1278,6 @@ static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *display, Window w, At
wine_tsx11_lock
();
wine_tsx11_lock
();
XFreeStringList
(
srcstr
);
XFreeStringList
(
srcstr
);
XFree
(
txtprop
.
value
);
wine_tsx11_unlock
();
wine_tsx11_unlock
();
return
hUnicodeText
;
return
hUnicodeText
;
...
@@ -2017,27 +2018,23 @@ static BOOL X11DRV_CLIPBOARD_ReadSelectionData(Display *display, LPWINE_CLIPDATA
...
@@ -2017,27 +2018,23 @@ static BOOL X11DRV_CLIPBOARD_ReadSelectionData(Display *display, LPWINE_CLIPDATA
/**************************************************************************
/**************************************************************************
* X11DRV_CLIPBOARD_
Read
Property
* X11DRV_CLIPBOARD_
Get
Property
*
Reads the contents of the X selection property
.
*
Gets type, data and size
.
*/
*/
static
BOOL
X11DRV_CLIPBOARD_
Read
Property
(
Display
*
display
,
Window
w
,
Atom
prop
,
static
BOOL
X11DRV_CLIPBOARD_
Get
Property
(
Display
*
display
,
Window
w
,
Atom
prop
,
unsigned
char
**
data
,
unsigned
long
*
datasize
)
Atom
*
atype
,
unsigned
char
**
data
,
unsigned
long
*
datasize
)
{
{
Atom
atype
=
AnyPropertyType
;
int
aformat
;
int
aformat
;
unsigned
long
pos
=
0
,
nitems
,
remain
,
count
;
unsigned
long
pos
=
0
,
nitems
,
remain
,
count
;
unsigned
char
*
val
=
NULL
,
*
buffer
;
unsigned
char
*
val
=
NULL
,
*
buffer
;
if
(
prop
==
None
)
return
FALSE
;
TRACE
(
"Reading property %lu from X window %lx
\n
"
,
prop
,
w
);
TRACE
(
"Reading property %lu from X window %lx
\n
"
,
prop
,
w
);
for
(;;)
for
(;;)
{
{
wine_tsx11_lock
();
wine_tsx11_lock
();
if
(
XGetWindowProperty
(
display
,
w
,
prop
,
pos
,
INT_MAX
/
4
,
False
,
if
(
XGetWindowProperty
(
display
,
w
,
prop
,
pos
,
INT_MAX
/
4
,
False
,
AnyPropertyType
,
&
atype
,
&
aformat
,
&
nitems
,
&
remain
,
&
buffer
)
!=
Success
)
AnyPropertyType
,
atype
,
&
aformat
,
&
nitems
,
&
remain
,
&
buffer
)
!=
Success
)
{
{
wine_tsx11_unlock
();
wine_tsx11_unlock
();
WARN
(
"Failed to read property
\n
"
);
WARN
(
"Failed to read property
\n
"
);
...
@@ -2079,6 +2076,86 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
...
@@ -2079,6 +2076,86 @@ static BOOL X11DRV_CLIPBOARD_ReadProperty(Display *display, Window w, Atom prop,
/**************************************************************************
/**************************************************************************
* X11DRV_CLIPBOARD_ReadProperty
* Reads the contents of the X selection property.
*/
static
BOOL
X11DRV_CLIPBOARD_ReadProperty
(
Display
*
display
,
Window
w
,
Atom
prop
,
unsigned
char
**
data
,
unsigned
long
*
datasize
)
{
Atom
atype
;
XEvent
xe
;
if
(
prop
==
None
)
return
FALSE
;
if
(
!
X11DRV_CLIPBOARD_GetProperty
(
display
,
w
,
prop
,
&
atype
,
data
,
datasize
))
return
FALSE
;
wine_tsx11_lock
();
while
(
XCheckTypedWindowEvent
(
display
,
w
,
PropertyNotify
,
&
xe
))
;
wine_tsx11_unlock
();
if
(
atype
==
x11drv_atom
(
INCR
))
{
unsigned
char
*
buf
=
*
data
;
unsigned
long
bufsize
=
0
;
for
(;;)
{
int
i
;
unsigned
char
*
prop_data
,
*
tmp
;
unsigned
long
prop_size
;
/* Wait until PropertyNotify is received */
for
(
i
=
0
;
i
<
SELECTION_RETRIES
;
i
++
)
{
Bool
res
;
wine_tsx11_lock
();
res
=
XCheckTypedWindowEvent
(
display
,
w
,
PropertyNotify
,
&
xe
);
wine_tsx11_unlock
();
if
(
res
&&
xe
.
xproperty
.
atom
==
prop
&&
xe
.
xproperty
.
state
==
PropertyNewValue
)
break
;
usleep
(
SELECTION_WAIT
);
}
if
(
i
>=
SELECTION_RETRIES
||
!
X11DRV_CLIPBOARD_GetProperty
(
display
,
w
,
prop
,
&
atype
,
&
prop_data
,
&
prop_size
))
{
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
FALSE
;
}
/* Retrieved entire data. */
if
(
prop_size
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
*
data
=
buf
;
*
datasize
=
bufsize
;
return
TRUE
;
}
tmp
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
bufsize
+
prop_size
+
1
);
if
(
!
tmp
)
{
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
FALSE
;
}
buf
=
tmp
;
memcpy
(
buf
+
bufsize
,
prop_data
,
prop_size
+
1
);
bufsize
+=
prop_size
;
HeapFree
(
GetProcessHeap
(),
0
,
prop_data
);
}
}
return
TRUE
;
}
/**************************************************************************
* CLIPBOARD_SerializeMetafile
* CLIPBOARD_SerializeMetafile
*/
*/
static
HANDLE
X11DRV_CLIPBOARD_SerializeMetafile
(
INT
wformat
,
HANDLE
hdata
,
LPDWORD
lpcbytes
,
BOOL
out
)
static
HANDLE
X11DRV_CLIPBOARD_SerializeMetafile
(
INT
wformat
,
HANDLE
hdata
,
LPDWORD
lpcbytes
,
BOOL
out
)
...
...
dlls/winex11.drv/x11drv.h
View file @
fcaeffb7
...
@@ -580,6 +580,7 @@ enum x11drv_atoms
...
@@ -580,6 +580,7 @@ enum x11drv_atoms
FIRST_XATOM
=
XA_LAST_PREDEFINED
+
1
,
FIRST_XATOM
=
XA_LAST_PREDEFINED
+
1
,
XATOM_CLIPBOARD
=
FIRST_XATOM
,
XATOM_CLIPBOARD
=
FIRST_XATOM
,
XATOM_COMPOUND_TEXT
,
XATOM_COMPOUND_TEXT
,
XATOM_INCR
,
XATOM_MULTIPLE
,
XATOM_MULTIPLE
,
XATOM_SELECTION_DATA
,
XATOM_SELECTION_DATA
,
XATOM_TARGETS
,
XATOM_TARGETS
,
...
...
dlls/winex11.drv/x11drv_main.c
View file @
fcaeffb7
...
@@ -115,6 +115,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
...
@@ -115,6 +115,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
{
{
"CLIPBOARD"
,
"CLIPBOARD"
,
"COMPOUND_TEXT"
,
"COMPOUND_TEXT"
,
"INCR"
,
"MULTIPLE"
,
"MULTIPLE"
,
"SELECTION_DATA"
,
"SELECTION_DATA"
,
"TARGETS"
,
"TARGETS"
,
...
...
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