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
4eaf41b5
Commit
4eaf41b5
authored
Mar 29, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Mar 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicodify CreateMetaFile.
parent
7b8d745a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
gdi_private.h
dlls/gdi/gdi_private.h
+1
-1
init.c
dlls/gdi/mfdrv/init.c
+15
-15
metafile.c
objects/metafile.c
+9
-10
No files found.
dlls/gdi/gdi_private.h
View file @
4eaf41b5
...
...
@@ -356,7 +356,7 @@ extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc);
/* metafile.c */
extern
HMETAFILE
MF_Create_HMETAFILE
(
METAHEADER
*
mh
);
extern
HMETAFILE16
MF_Create_HMETAFILE16
(
METAHEADER
*
mh
);
extern
METAHEADER
*
MF_CreateMetaHeaderDisk
(
METAHEADER
*
mr
,
LPC
STR
filename
);
extern
METAHEADER
*
MF_CreateMetaHeaderDisk
(
METAHEADER
*
mr
,
LPC
VOID
filename
,
BOOL
unicode
);
/* path.c */
...
...
dlls/gdi/mfdrv/init.c
View file @
4eaf41b5
...
...
@@ -222,7 +222,7 @@ static BOOL MFDRV_DeleteDC( PHYSDEV dev )
/**********************************************************************
* CreateMetaFile
A
(GDI32.@)
* CreateMetaFile
W
(GDI32.@)
*
* Create a new DC and associate it with a metafile. Pass a filename
* to create a disk-based metafile, NULL to create a memory metafile.
...
...
@@ -230,14 +230,14 @@ static BOOL MFDRV_DeleteDC( PHYSDEV dev )
* RETURNS
* A handle to the metafile DC if successful, NULL on failure.
*/
HDC
WINAPI
CreateMetaFile
A
(
LPC
STR
filename
)
/* [in] Filename of disk metafile */
HDC
WINAPI
CreateMetaFile
W
(
LPCW
STR
filename
)
/* [in] Filename of disk metafile */
{
HDC
ret
;
DC
*
dc
;
METAFILEDRV_PDEVICE
*
physDev
;
HANDLE
hFile
;
TRACE
(
"'%s'
\n
"
,
filename
);
TRACE
(
"'%s'
\n
"
,
debugstr_w
(
filename
)
);
if
(
!
(
dc
=
MFDRV_AllocMetaFile
()))
return
0
;
physDev
=
(
METAFILEDRV_PDEVICE
*
)
dc
->
physDev
;
...
...
@@ -245,12 +245,12 @@ HDC WINAPI CreateMetaFileA( LPCSTR filename ) /* [in] Filename of disk metafile
if
(
filename
)
/* disk based metafile */
{
physDev
->
mh
->
mtType
=
METAFILE_DISK
;
if
((
hFile
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
if
((
hFile
=
CreateFile
W
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
MFDRV_DeleteDC
(
dc
->
physDev
);
return
0
;
}
if
(
!
WriteFile
(
hFile
,
(
LPSTR
)
physDev
->
mh
,
sizeof
(
*
physDev
->
mh
),
NULL
,
if
(
!
WriteFile
(
hFile
,
physDev
->
mh
,
sizeof
(
*
physDev
->
mh
),
NULL
,
NULL
))
{
MFDRV_DeleteDC
(
dc
->
physDev
);
return
0
;
...
...
@@ -258,7 +258,7 @@ HDC WINAPI CreateMetaFileA( LPCSTR filename ) /* [in] Filename of disk metafile
physDev
->
hFile
=
hFile
;
/* Grow METAHEADER to include filename */
physDev
->
mh
=
MF_CreateMetaHeaderDisk
(
physDev
->
mh
,
filename
);
physDev
->
mh
=
MF_CreateMetaHeaderDisk
(
physDev
->
mh
,
filename
,
TRUE
);
}
else
/* memory based metafile */
physDev
->
mh
->
mtType
=
METAFILE_MEMORY
;
...
...
@@ -270,23 +270,23 @@ HDC WINAPI CreateMetaFileA( LPCSTR filename ) /* [in] Filename of disk metafile
}
/**********************************************************************
* CreateMetaFile
W
(GDI32.@)
* CreateMetaFile
A
(GDI32.@)
*/
HDC
WINAPI
CreateMetaFile
W
(
LPCW
STR
filename
)
HDC
WINAPI
CreateMetaFile
A
(
LPC
STR
filename
)
{
LP
STR
filenameA
;
LP
WSTR
filenameW
;
DWORD
len
;
HDC
hReturnDC
;
if
(
!
filename
)
return
CreateMetaFile
A
(
NULL
);
if
(
!
filename
)
return
CreateMetaFile
W
(
NULL
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
filename
A
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
filename
,
-
1
,
filenameA
,
len
,
NULL
,
NULL
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
filename
W
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
filenameW
,
len
);
hReturnDC
=
CreateMetaFile
A
(
filenameA
);
hReturnDC
=
CreateMetaFile
W
(
filenameW
);
HeapFree
(
GetProcessHeap
(),
0
,
filename
A
);
HeapFree
(
GetProcessHeap
(),
0
,
filename
W
);
return
hReturnDC
;
}
...
...
objects/metafile.c
View file @
4eaf41b5
...
...
@@ -370,7 +370,7 @@ static METAHEADER *MF_LoadDiskBasedMetaFile(METAHEADER *mh)
* Take a memory based METAHEADER and change it to a disk based METAHEADER
* assosiated with filename. Note: Trashes contents of old one.
*/
METAHEADER
*
MF_CreateMetaHeaderDisk
(
METAHEADER
*
mh
,
LPC
STR
filename
)
METAHEADER
*
MF_CreateMetaHeaderDisk
(
METAHEADER
*
mh
,
LPC
VOID
filename
,
BOOL
uni
)
{
METAHEADERDISK
*
mhd
;
DWORD
size
;
...
...
@@ -380,7 +380,12 @@ METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mh, LPCSTR filename)
mh
->
mtType
=
METAFILE_DISK
;
size
=
HeapSize
(
GetProcessHeap
(),
0
,
mh
);
mhd
=
(
METAHEADERDISK
*
)((
char
*
)
mh
+
sizeof
(
METAHEADER
));
strcpy
(
mhd
->
filename
,
filename
);
if
(
uni
)
WideCharToMultiByte
(
CP_ACP
,
0
,
filename
,
-
1
,
mhd
->
filename
,
sizeof
mhd
->
filename
,
NULL
,
NULL
);
else
lstrcpynA
(
mhd
->
filename
,
filename
,
sizeof
mhd
->
filename
);
return
mh
;
}
...
...
@@ -413,7 +418,7 @@ HMETAFILE16 WINAPI CopyMetaFile16( HMETAFILE16 hSrcMetaFile, LPCSTR lpFilename)
}
WriteFile
(
hFile
,
mh2
,
mh2
->
mtSize
*
2
,
NULL
,
NULL
);
CloseHandle
(
hFile
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilename
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilename
,
FALSE
);
}
return
MF_Create_HMETAFILE16
(
mh2
);
...
...
@@ -455,8 +460,6 @@ HMETAFILE WINAPI CopyMetaFileW(
}
if
(
lpFilename
)
{
/* disk based metafile */
DWORD
len
;
LPSTR
lpFilenameA
;
if
((
hFile
=
CreateFileW
(
lpFilename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
))
==
INVALID_HANDLE_VALUE
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mh2
);
...
...
@@ -464,11 +467,7 @@ HMETAFILE WINAPI CopyMetaFileW(
}
WriteFile
(
hFile
,
mh2
,
mh2
->
mtSize
*
2
,
NULL
,
NULL
);
CloseHandle
(
hFile
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
lpFilenameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpFilename
,
-
1
,
lpFilenameA
,
len
,
NULL
,
NULL
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilenameA
);
HeapFree
(
GetProcessHeap
(),
0
,
lpFilenameA
);
mh2
=
MF_CreateMetaHeaderDisk
(
mh2
,
lpFilename
,
TRUE
);
}
return
MF_Create_HMETAFILE
(
mh2
);
...
...
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