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
cdad6136
Commit
cdad6136
authored
Nov 22, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Nov 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Add support for the CF_METAFILEPICT clipboard format.
parent
a983cfb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
clipboard.c
dlls/winemac.drv/clipboard.c
+58
-0
No files found.
dlls/winemac.drv/clipboard.c
View file @
cdad6136
...
...
@@ -72,6 +72,7 @@ typedef struct
static
HANDLE
import_clipboard_data
(
CFDataRef
data
);
static
HANDLE
import_bmp_to_bitmap
(
CFDataRef
data
);
static
HANDLE
import_bmp_to_dib
(
CFDataRef
data
);
static
HANDLE
import_metafilepict
(
CFDataRef
data
);
static
HANDLE
import_nsfilenames_to_hdrop
(
CFDataRef
data
);
static
HANDLE
import_oemtext_to_text
(
CFDataRef
data
);
static
HANDLE
import_oemtext_to_unicodetext
(
CFDataRef
data
);
...
...
@@ -90,6 +91,7 @@ static CFDataRef export_clipboard_data(HANDLE data);
static
CFDataRef
export_bitmap_to_bmp
(
HANDLE
data
);
static
CFDataRef
export_dib_to_bmp
(
HANDLE
data
);
static
CFDataRef
export_hdrop_to_filenames
(
HANDLE
data
);
static
CFDataRef
export_metafilepict
(
HANDLE
data
);
static
CFDataRef
export_oemtext_to_utf8
(
HANDLE
data
);
static
CFDataRef
export_oemtext_to_utf16
(
HANDLE
data
);
static
CFDataRef
export_text_to_utf8
(
HANDLE
data
);
...
...
@@ -194,6 +196,8 @@ static const struct
{
CF_HDROP
,
CFSTR
(
"org.winehq.builtin.hdrop"
),
import_clipboard_data
,
export_clipboard_data
,
FALSE
},
{
CF_HDROP
,
CFSTR
(
"NSFilenamesPboardType"
),
import_nsfilenames_to_hdrop
,
export_hdrop_to_filenames
,
TRUE
},
{
CF_METAFILEPICT
,
CFSTR
(
"org.winehq.builtin.metafilepict"
),
import_metafilepict
,
export_metafilepict
,
FALSE
},
};
static
const
WCHAR
wszRichTextFormat
[]
=
{
'R'
,
'i'
,
'c'
,
'h'
,
' '
,
'T'
,
'e'
,
'x'
,
't'
,
' '
,
'F'
,
'o'
,
'r'
,
'm'
,
'a'
,
't'
,
0
};
...
...
@@ -671,6 +675,33 @@ static HANDLE import_bmp_to_dib(CFDataRef data)
/**************************************************************************
* import_metafilepict
*
* Import metafile picture data, converting it to CF_METAFILEPICT.
*/
static
HANDLE
import_metafilepict
(
CFDataRef
data
)
{
HANDLE
ret
=
0
;
CFIndex
len
=
CFDataGetLength
(
data
);
METAFILEPICT
*
mfp
;
TRACE
(
"data %s
\n
"
,
debugstr_cf
(
data
));
if
(
len
>=
sizeof
(
*
mfp
)
&&
(
ret
=
GlobalAlloc
(
0
,
sizeof
(
*
mfp
))))
{
const
BYTE
*
bytes
=
(
const
BYTE
*
)
CFDataGetBytePtr
(
data
);
mfp
=
GlobalLock
(
ret
);
memcpy
(
mfp
,
bytes
,
sizeof
(
*
mfp
));
mfp
->
hMF
=
SetMetaFileBitsEx
(
len
-
sizeof
(
*
mfp
),
bytes
+
sizeof
(
*
mfp
));
GlobalUnlock
(
ret
);
}
return
ret
;
}
/**************************************************************************
* import_nsfilenames_to_hdrop
*
* Import NSFilenamesPboardType data, converting the property-list-
...
...
@@ -1231,6 +1262,33 @@ done:
/**************************************************************************
* export_metafilepict
*
* Export a metafile to data.
*/
static
CFDataRef
export_metafilepict
(
HANDLE
data
)
{
CFMutableDataRef
ret
=
NULL
;
METAFILEPICT
*
mfp
=
GlobalLock
(
data
);
unsigned
int
size
=
GetMetaFileBitsEx
(
mfp
->
hMF
,
0
,
NULL
);
TRACE
(
"data %p
\n
"
,
data
);
ret
=
CFDataCreateMutable
(
NULL
,
sizeof
(
*
mfp
)
+
size
);
if
(
ret
)
{
CFDataAppendBytes
(
ret
,
(
UInt8
*
)
mfp
,
sizeof
(
*
mfp
));
CFDataIncreaseLength
(
ret
,
size
);
GetMetaFileBitsEx
(
mfp
->
hMF
,
size
,
(
BYTE
*
)
CFDataGetMutableBytePtr
(
ret
)
+
sizeof
(
*
mfp
));
}
GlobalUnlock
(
data
);
TRACE
(
" -> %s
\n
"
,
debugstr_cf
(
ret
));
return
ret
;
}
/**************************************************************************
* export_oemtext_to_utf8
*
* Export CF_OEMTEXT to UTF-8.
...
...
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