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
16b951cc
Commit
16b951cc
authored
Apr 26, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Factor out emf_eof helper.
parent
acbccf17
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
24 deletions
+33
-24
emfdc.c
dlls/gdi32/emfdc.c
+33
-24
No files found.
dlls/gdi32/emfdc.c
View file @
16b951cc
...
@@ -2575,35 +2575,16 @@ HDC WINAPI CreateEnhMetaFileW( HDC hdc, const WCHAR *filename, const RECT *rect,
...
@@ -2575,35 +2575,16 @@ HDC WINAPI CreateEnhMetaFileW( HDC hdc, const WCHAR *filename, const RECT *rect,
return
ret
;
return
ret
;
}
}
/******************************************************************
static
BOOL
emf_eof
(
DC_ATTR
*
dc_attr
)
* CloseEnhMetaFile (GDI32.@)
*/
HENHMETAFILE
WINAPI
CloseEnhMetaFile
(
HDC
hdc
)
{
{
struct
emf
*
emf
=
get_dc_emf
(
dc_attr
);
UINT
size
,
palette_size
;
UINT
size
,
palette_size
;
HENHMETAFILE
hmf
;
struct
emf
*
emf
;
DC_ATTR
*
dc_attr
;
EMREOF
*
emr
;
EMREOF
*
emr
;
HANDLE
mapping
=
0
;
BOOL
ret
;
TRACE
(
"(%p)
\n
"
,
hdc
);
if
(
!
(
dc_attr
=
get_dc_attr
(
hdc
))
||
!
get_dc_emf
(
dc_attr
))
return
0
;
emf
=
get_dc_emf
(
dc_attr
);
palette_size
=
emf
->
palette_used
*
sizeof
(
*
emf
->
palette
);
palette_size
=
emf
->
palette_used
*
sizeof
(
*
emf
->
palette
);
size
=
sizeof
(
*
emr
)
+
palette_size
;
size
=
sizeof
(
*
emr
)
+
palette_size
;
if
(
!
(
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
0
;
if
(
!
(
emr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
FALSE
;
if
(
dc_attr
->
save_level
)
RestoreDC
(
hdc
,
1
);
if
(
emf
->
dc_brush
)
DeleteObject
(
emf
->
dc_brush
);
emf
->
dc_brush
=
0
;
if
(
emf
->
dc_pen
)
DeleteObject
(
emf
->
dc_pen
);
emf
->
dc_pen
=
0
;
emr
->
emr
.
iType
=
EMR_EOF
;
emr
->
emr
.
iType
=
EMR_EOF
;
emr
->
emr
.
nSize
=
size
;
emr
->
emr
.
nSize
=
size
;
...
@@ -2612,8 +2593,9 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
...
@@ -2612,8 +2593,9 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
memcpy
(
(
BYTE
*
)
emr
+
emr
->
offPalEntries
,
emf
->
palette
,
palette_size
);
memcpy
(
(
BYTE
*
)
emr
+
emr
->
offPalEntries
,
emf
->
palette
,
palette_size
);
/* Set nSizeLast */
/* Set nSizeLast */
((
DWORD
*
)((
BYTE
*
)
emr
+
size
))[
-
1
]
=
size
;
((
DWORD
*
)((
BYTE
*
)
emr
+
size
))[
-
1
]
=
size
;
emfdc_record
(
emf
,
&
emr
->
emr
);
ret
=
emfdc_record
(
emf
,
&
emr
->
emr
);
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
HeapFree
(
GetProcessHeap
(),
0
,
emr
);
if
(
!
ret
)
return
FALSE
;
emf
->
emh
->
rclBounds
=
dc_attr
->
emf_bounds
;
emf
->
emh
->
rclBounds
=
dc_attr
->
emf_bounds
;
...
@@ -2629,6 +2611,33 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
...
@@ -2629,6 +2611,33 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
emf
->
emh
->
rclFrame
.
bottom
=
emf
->
emh
->
rclBounds
.
bottom
*
emf
->
emh
->
rclFrame
.
bottom
=
emf
->
emh
->
rclBounds
.
bottom
*
emf
->
emh
->
szlMillimeters
.
cy
*
100
/
emf
->
emh
->
szlDevice
.
cy
;
emf
->
emh
->
szlMillimeters
.
cy
*
100
/
emf
->
emh
->
szlDevice
.
cy
;
}
}
return
TRUE
;
}
/******************************************************************
* CloseEnhMetaFile (GDI32.@)
*/
HENHMETAFILE
WINAPI
CloseEnhMetaFile
(
HDC
hdc
)
{
HENHMETAFILE
hmf
;
struct
emf
*
emf
;
DC_ATTR
*
dc_attr
;
HANDLE
mapping
=
0
;
TRACE
(
"(%p)
\n
"
,
hdc
);
if
(
!
(
dc_attr
=
get_dc_attr
(
hdc
))
||
!
get_dc_emf
(
dc_attr
))
return
0
;
emf
=
get_dc_emf
(
dc_attr
);
if
(
dc_attr
->
save_level
)
RestoreDC
(
hdc
,
1
);
if
(
emf
->
dc_brush
)
DeleteObject
(
emf
->
dc_brush
);
emf
->
dc_brush
=
0
;
if
(
emf
->
dc_pen
)
DeleteObject
(
emf
->
dc_pen
);
emf
->
dc_pen
=
0
;
if
(
!
emf_eof
(
dc_attr
))
return
0
;
if
(
emf
->
file
)
/* disk based metafile */
if
(
emf
->
file
)
/* disk based metafile */
{
{
...
...
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