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
280aeb96
Commit
280aeb96
authored
Mar 30, 2000
by
Huw D M Davies
Committed by
Alexandre Julliard
Mar 30, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete objects after use in EnumEnhMetaFile.
Make PlayEnhMetaFile call EnumEnhMetaFile. Move EnumEnhMetaFile prototype to wingdi.h.
parent
502e15b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
50 deletions
+36
-50
wingdi.h
include/wingdi.h
+1
-0
enhmetafile.c
objects/enhmetafile.c
+35
-50
No files found.
include/wingdi.h
View file @
280aeb96
...
...
@@ -3139,6 +3139,7 @@ INT WINAPI DrawEscape(HDC,INT,INT,LPCSTR);
BOOL
WINAPI
Ellipse
(
HDC
,
INT
,
INT
,
INT
,
INT
);
INT
WINAPI
EndDoc
(
HDC
);
BOOL
WINAPI
EndPath
(
HDC
);
BOOL
WINAPI
EnumEnhMetaFile
(
HDC
,
HENHMETAFILE
,
ENHMFENUMPROC
,
LPVOID
,
const
RECT
*
);
INT
WINAPI
EnumFontFamiliesA
(
HDC
,
LPCSTR
,
FONTENUMPROCA
,
LPARAM
);
INT
WINAPI
EnumFontFamiliesW
(
HDC
,
LPCWSTR
,
FONTENUMPROCW
,
LPARAM
);
#define EnumFontFamilies WINELIB_NAME_AW(EnumFontFamilies)
...
...
objects/enhmetafile.c
View file @
280aeb96
...
...
@@ -29,11 +29,6 @@
DEFAULT_DEBUG_CHANNEL
(
enhmetafile
)
/* Prototypes */
BOOL
WINAPI
EnumEnhMetaFile
(
HDC
hdc
,
HENHMETAFILE
hmf
,
ENHMFENUMPROC
callback
,
LPVOID
data
,
const
RECT
*
rect
);
/****************************************************************************
* EMF_Create_HENHMETAFILE
*/
...
...
@@ -1230,54 +1225,20 @@ BOOL WINAPI EnumEnhMetaFile(
HENHMETAFILE
hmf
,
/* EMF to walk */
ENHMFENUMPROC
callback
,
/* callback function */
LPVOID
data
,
/* optional data for callback function */
const
RECT
*
r
ect
/* bounding rectangle for rendered metafile */
const
RECT
*
lpR
ect
/* bounding rectangle for rendered metafile */
)
{
BOOL
ret
=
TRUE
;
LPENHMETARECORD
p
=
(
LPENHMETARECORD
)
EMF_GetEnhMetaHeader
(
hmf
);
INT
count
;
INT
count
,
i
;
HANDLETABLE
*
ht
;
if
(
!
p
)
return
FALSE
;
count
=
((
LPENHMETAHEADER
)
p
)
->
nHandles
;
ht
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HANDLETABLE
)
*
count
);
ht
->
objectHandle
[
0
]
=
hmf
;
while
(
ret
)
{
ret
=
(
*
callback
)(
hdc
,
ht
,
p
,
count
,
data
);
if
(
p
->
iType
==
EMR_EOF
)
break
;
p
=
(
LPENHMETARECORD
)
((
char
*
)
p
+
p
->
nSize
);
}
HeapFree
(
GetProcessHeap
(),
0
,
ht
);
EMF_ReleaseEnhMetaHeader
(
hmf
);
return
ret
;
}
/**************************************************************************
* PlayEnhMetaFile (GDI32.263)
*
* Renders an enhanced metafile into a specified rectangle *lpRect
* in device context hdc.
*
* BUGS
* Almost entirely unimplemented
*
*/
BOOL
WINAPI
PlayEnhMetaFile
(
HDC
hdc
,
/* DC to render into */
HENHMETAFILE
hmf
,
/* metafile to render */
const
RECT
*
lpRect
/* rectangle to place metafile inside */
)
{
LPENHMETARECORD
p
=
(
LPENHMETARECORD
)
EMF_GetEnhMetaHeader
(
hmf
);
INT
count
;
HANDLETABLE
*
ht
;
BOOL
ret
=
FALSE
;
INT
savedMode
=
0
;
if
(
!
p
)
return
FALSE
;
count
=
((
LPENHMETAHEADER
)
p
)
->
nHandles
;
ht
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HANDLETABLE
)
*
count
);
ht
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
HANDLETABLE
)
*
count
);
ht
->
objectHandle
[
0
]
=
hmf
;
if
(
lpRect
)
{
LPENHMETAHEADER
h
=
(
LPENHMETAHEADER
)
p
;
FLOAT
xscale
=
(
h
->
rclBounds
.
right
-
h
->
rclBounds
.
left
)
/
...
...
@@ -1297,20 +1258,44 @@ BOOL WINAPI PlayEnhMetaFile(
WARN
(
"World transform failed!
\n
"
);
}
}
ht
->
objectHandle
[
0
]
=
hmf
;
while
(
1
)
{
PlayEnhMetaFileRecord
(
hdc
,
ht
,
p
,
count
);
while
(
ret
)
{
ret
=
(
*
callback
)(
hdc
,
ht
,
p
,
count
,
data
);
if
(
p
->
iType
==
EMR_EOF
)
break
;
p
=
(
LPENHMETARECORD
)
((
char
*
)
p
+
p
->
nSize
);
/* casted so that arithmetic is in bytes */
p
=
(
LPENHMETARECORD
)
((
char
*
)
p
+
p
->
nSize
);
}
for
(
i
=
1
;
i
<
count
;
i
++
)
/* Don't delete element 0 (hmf) */
if
(
(
ht
->
objectHandle
)[
i
]
)
DeleteObject
(
(
ht
->
objectHandle
)[
i
]
);
HeapFree
(
GetProcessHeap
(),
0
,
ht
);
EMF_ReleaseEnhMetaHeader
(
hmf
);
if
(
savedMode
)
SetGraphicsMode
(
hdc
,
savedMode
);
ret
=
TRUE
;
/* FIXME: calculate a more accurate return value */
return
ret
;
}
static
INT
CALLBACK
EMF_PlayEnhMetaFileCallback
(
HDC
hdc
,
HANDLETABLE
*
ht
,
ENHMETARECORD
*
emr
,
INT
handles
,
LPVOID
data
)
{
return
PlayEnhMetaFileRecord
(
hdc
,
ht
,
emr
,
handles
);
}
/**************************************************************************
* PlayEnhMetaFile (GDI32.263)
*
* Renders an enhanced metafile into a specified rectangle *lpRect
* in device context hdc.
*
*/
BOOL
WINAPI
PlayEnhMetaFile
(
HDC
hdc
,
/* DC to render into */
HENHMETAFILE
hmf
,
/* metafile to render */
const
RECT
*
lpRect
/* rectangle to place metafile inside */
)
{
return
EnumEnhMetaFile
(
hdc
,
hmf
,
EMF_PlayEnhMetaFileCallback
,
NULL
,
lpRect
);
}
/*****************************************************************************
* DeleteEnhMetaFile (GDI32.68)
*
...
...
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