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
63201471
Commit
63201471
authored
Sep 17, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add separate export functions for the various string types.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8b7520ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
39 deletions
+21
-39
clipboard.c
dlls/winex11.drv/clipboard.c
+21
-39
No files found.
dlls/winex11.drv/clipboard.c
View file @
63201471
...
...
@@ -140,6 +140,10 @@ static HANDLE export_data(Display *display, Window requestor, Atom aTarget,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
);
static
HANDLE
export_string
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
);
static
HANDLE
export_utf8_string
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
);
static
HANDLE
export_compound_text
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
);
static
HANDLE
export_pixmap
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpdata
,
LPDWORD
lpBytes
);
static
HANDLE
export_image_bmp
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
...
...
@@ -192,8 +196,8 @@ static const struct
{
0
,
CF_PENDATA
,
XATOM_WCF_PENDATA
,
import_data
,
export_data
},
{
0
,
CF_RIFF
,
XATOM_WCF_RIFF
,
import_data
,
export_data
},
{
0
,
CF_WAVE
,
XATOM_WCF_WAVE
,
import_data
,
export_data
},
{
0
,
CF_UNICODETEXT
,
XATOM_UTF8_STRING
,
import_utf8_string
,
export_string
},
{
0
,
CF_UNICODETEXT
,
XATOM_COMPOUND_TEXT
,
import_compound_text
,
export_
string
},
{
0
,
CF_UNICODETEXT
,
XATOM_UTF8_STRING
,
import_utf8_string
,
export_
utf8_
string
},
{
0
,
CF_UNICODETEXT
,
XATOM_COMPOUND_TEXT
,
import_compound_text
,
export_
compound_text
},
{
0
,
CF_ENHMETAFILE
,
XATOM_WCF_ENHMETAFILE
,
import_enhmetafile
,
export_enhmetafile
},
{
0
,
CF_HDROP
,
XATOM_text_uri_list
,
import_text_uri_list
,
export_hdrop
},
{
0
,
CF_LOCALE
,
XATOM_WCF_LOCALE
,
import_data
,
export_data
},
...
...
@@ -1365,17 +1369,19 @@ static HANDLE export_data(Display *display, Window requestor, Atom aTarget,
/**************************************************************************
*
X11DRV_CLIPBOARD_ExportXAS
tring
*
export_s
tring
*
* Export CF_TEXT converting the string to XA_STRING.
* Helper function for export_string.
*/
static
HANDLE
X11DRV_CLIPBOARD_ExportXAString
(
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
static
HANDLE
export_string
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
{
UINT
i
,
j
;
UINT
size
;
LPSTR
text
,
lpstr
=
NULL
;
if
(
!
X11DRV_CLIPBOARD_RenderFormat
(
display
,
lpData
))
return
0
;
*
lpBytes
=
0
;
/* Assume return has zero bytes */
text
=
GlobalLock
(
lpData
->
hData
);
...
...
@@ -1404,18 +1410,20 @@ done:
/**************************************************************************
*
X11DRV_CLIPBOARD_ExportUTF8S
tring
*
export_utf8_s
tring
*
* Export CF_UNICODE converting the string to UTF8.
* Helper function for export_string.
*/
static
HANDLE
X11DRV_CLIPBOARD_ExportUTF8String
(
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
static
HANDLE
export_utf8_string
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
{
UINT
i
,
j
;
UINT
size
;
LPWSTR
uni_text
;
LPSTR
text
,
lpstr
=
NULL
;
if
(
!
X11DRV_CLIPBOARD_RenderFormat
(
display
,
lpData
))
return
0
;
*
lpBytes
=
0
;
/* Assume return has zero bytes */
uni_text
=
GlobalLock
(
lpData
->
hData
);
...
...
@@ -1452,13 +1460,12 @@ done:
/**************************************************************************
*
X11DRV_CLIPBOARD_ExportCompoundT
ext
*
export_compound_t
ext
*
* Export CF_UNICODE to COMPOUND_TEXT
* Helper function for export_string.
*/
static
HANDLE
X11DRV_CLIPBOARD_ExportCompoundT
ext
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
static
HANDLE
export_compound_t
ext
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
{
char
*
lpstr
=
0
;
XTextProperty
prop
;
...
...
@@ -1467,6 +1474,8 @@ static HANDLE X11DRV_CLIPBOARD_ExportCompoundText(Display *display, Window reque
UINT
size
;
LPWSTR
uni_text
;
if
(
!
X11DRV_CLIPBOARD_RenderFormat
(
display
,
lpData
))
return
0
;
uni_text
=
GlobalLock
(
lpData
->
hData
);
size
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
uni_text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
...
...
@@ -1504,33 +1513,6 @@ static HANDLE X11DRV_CLIPBOARD_ExportCompoundText(Display *display, Window reque
return
0
;
}
/**************************************************************************
* export_string
*
* Export string
*/
static
HANDLE
export_string
(
Display
*
display
,
Window
requestor
,
Atom
aTarget
,
Atom
rprop
,
LPWINE_CLIPDATA
lpData
,
LPDWORD
lpBytes
)
{
if
(
X11DRV_CLIPBOARD_RenderFormat
(
display
,
lpData
))
{
if
(
aTarget
==
XA_STRING
)
return
X11DRV_CLIPBOARD_ExportXAString
(
lpData
,
lpBytes
);
else
if
(
aTarget
==
x11drv_atom
(
COMPOUND_TEXT
)
||
aTarget
==
x11drv_atom
(
TEXT
))
return
X11DRV_CLIPBOARD_ExportCompoundText
(
display
,
requestor
,
aTarget
,
rprop
,
lpData
,
lpBytes
);
else
{
TRACE
(
"Exporting target %ld to default UTF8_STRING
\n
"
,
aTarget
);
return
X11DRV_CLIPBOARD_ExportUTF8String
(
lpData
,
lpBytes
);
}
}
else
ERR
(
"Failed to render %04x format
\n
"
,
lpData
->
wFormatID
);
return
0
;
}
/**************************************************************************
* export_pixmap
...
...
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