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
11248262
Commit
11248262
authored
May 21, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
May 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add test for metafile enumeration.
parent
d436e518
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
4 deletions
+86
-4
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
metafile.c
dlls/gdiplus/metafile.c
+19
-0
metafile.c
dlls/gdiplus/tests/metafile.c
+59
-1
gdiplus.h
include/gdiplus.h
+2
-2
gdiplusflat.h
include/gdiplusflat.h
+3
-0
gdiplustypes.h
include/gdiplustypes.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
11248262
...
...
@@ -198,7 +198,7 @@
198 stub GdipEnumerateMetafileDestRectI
199 stub GdipEnumerateMetafileSrcRectDestPoint
200 stub GdipEnumerateMetafileSrcRectDestPointI
201 st
ub GdipEnumerateMetafileSrcRectDestPoints
201 st
dcall GdipEnumerateMetafileSrcRectDestPoints(ptr ptr ptr long ptr long ptr ptr ptr)
202 stub GdipEnumerateMetafileSrcRectDestPointsI
203 stub GdipEnumerateMetafileSrcRectDestRect
204 stub GdipEnumerateMetafileSrcRectDestRectI
...
...
dlls/gdiplus/metafile.c
View file @
11248262
...
...
@@ -322,3 +322,22 @@ GpStatus WINGDIPAPI GdipGetHemfFromMetafile(GpMetafile *metafile, HENHMETAFILE *
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipEnumerateMetafileSrcRectDestPoints
(
GpGraphics
*
graphics
,
GDIPCONST
GpMetafile
*
metafile
,
GDIPCONST
GpPointF
*
destPoints
,
INT
count
,
GDIPCONST
GpRectF
*
srcRect
,
Unit
srcUnit
,
EnumerateMetafileProc
callback
,
VOID
*
callbackData
,
GDIPCONST
GpImageAttributes
*
imageAttributes
)
{
FIXME
(
"(%p,%p,%p,%i,%p,%i,%p,%p,%p): stub
\n
"
,
graphics
,
metafile
,
destPoints
,
count
,
srcRect
,
srcUnit
,
callback
,
callbackData
,
imageAttributes
);
if
(
!
graphics
||
!
metafile
||
!
destPoints
||
count
!=
3
||
!
srcRect
)
return
InvalidParameter
;
TRACE
(
"%s %i -> %s %s %s
\n
"
,
debugstr_rectf
(
srcRect
),
srcUnit
,
debugstr_pointf
(
&
destPoints
[
0
]),
debugstr_pointf
(
&
destPoints
[
1
]),
debugstr_pointf
(
&
destPoints
[
2
]));
return
NotImplemented
;
}
dlls/gdiplus/tests/metafile.c
View file @
11248262
...
...
@@ -140,6 +140,61 @@ static void check_emfplus(HENHMETAFILE hemf, const emfplus_record *expected, con
ok
(
expected
[
state
.
count
].
record_type
==
0
,
"%s: Got %i records, expecting more
\n
"
,
desc
,
state
.
count
);
}
static
BOOL
CALLBACK
enum_metafile_proc
(
EmfPlusRecordType
record_type
,
unsigned
int
flags
,
unsigned
int
dataSize
,
const
unsigned
char
*
pStr
,
void
*
userdata
)
{
emfplus_check_state
*
state
=
(
emfplus_check_state
*
)
userdata
;
emfplus_record
actual
;
actual
.
todo
=
0
;
actual
.
record_type
=
record_type
;
actual
.
is_emfplus
=
((
record_type
&
GDIP_EMFPLUS_RECORD_BASE
)
==
GDIP_EMFPLUS_RECORD_BASE
);
if
(
dataSize
==
0
)
ok
(
pStr
==
NULL
,
"non-NULL pStr
\n
"
);
if
(
state
->
expected
[
state
->
count
].
record_type
)
{
check_record
(
state
->
count
,
state
->
desc
,
&
state
->
expected
[
state
->
count
],
&
actual
);
state
->
count
++
;
}
else
{
ok
(
0
,
"%s: Unexpected EMF 0x%x record
\n
"
,
state
->
desc
,
record_type
);
}
return
TRUE
;
}
static
void
check_metafile
(
GpMetafile
*
metafile
,
const
emfplus_record
*
expected
,
const
char
*
desc
,
const
GpPointF
*
dst_points
,
const
GpRectF
*
src_rect
,
Unit
src_unit
)
{
GpStatus
stat
;
HDC
hdc
;
GpGraphics
*
graphics
;
emfplus_check_state
state
;
state
.
desc
=
desc
;
state
.
count
=
0
;
state
.
expected
=
expected
;
hdc
=
CreateCompatibleDC
(
0
);
stat
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipEnumerateMetafileSrcRectDestPoints
(
graphics
,
metafile
,
dst_points
,
3
,
src_rect
,
src_unit
,
enum_metafile_proc
,
&
state
,
NULL
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
ok
(
expected
[
state
.
count
].
record_type
==
0
,
"%s: Got %i records, expecting more
\n
"
,
desc
,
state
.
count
);
GdipDeleteGraphics
(
graphics
);
DeleteDC
(
hdc
);
}
static
const
emfplus_record
empty_records
[]
=
{
{
0
,
EMR_HEADER
,
0
},
{
0
,
EmfPlusRecordTypeHeader
,
1
},
...
...
@@ -157,6 +212,7 @@ static void test_empty(void)
HENHMETAFILE
hemf
,
dummy
;
BOOL
ret
;
static
const
GpRectF
frame
=
{
0
.
0
,
0
.
0
,
100
.
0
,
100
.
0
};
static
const
GpPointF
dst_points
[
3
]
=
{{
0
.
0
,
0
.
0
},{
100
.
0
,
0
.
0
},{
0
.
0
,
100
.
0
}};
static
const
WCHAR
description
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
};
hdc
=
CreateCompatibleDC
(
0
);
...
...
@@ -199,6 +255,8 @@ static void test_empty(void)
stat
=
GdipDeleteGraphics
(
graphics
);
expect
(
Ok
,
stat
);
check_metafile
(
metafile
,
empty_records
,
"empty metafile"
,
dst_points
,
&
frame
,
UnitPixel
);
stat
=
GdipGetHemfFromMetafile
(
metafile
,
&
hemf
);
expect
(
Ok
,
stat
);
...
...
@@ -208,7 +266,7 @@ static void test_empty(void)
stat
=
GdipDisposeImage
((
GpImage
*
)
metafile
);
expect
(
Ok
,
stat
);
check_emfplus
(
hemf
,
empty_records
,
"empty"
);
check_emfplus
(
hemf
,
empty_records
,
"empty
emf
"
);
ret
=
DeleteEnhMetaFile
(
hemf
);
ok
(
ret
!=
0
,
"Failed to delete enhmetafile %p
\n
"
,
hemf
);
...
...
include/gdiplus.h
View file @
11248262
...
...
@@ -28,8 +28,8 @@ namespace Gdiplus
#include "gdiplusmem.h"
};
#include "gdiplustypes.h"
#include "gdiplusenums.h"
#include "gdiplustypes.h"
#include "gdiplusinit.h"
#include "gdipluspixelformats.h"
#include "gdiplusmetaheader.h"
...
...
@@ -48,8 +48,8 @@ namespace Gdiplus
#include "gdiplusmem.h"
#include "gdiplustypes.h"
#include "gdiplusenums.h"
#include "gdiplustypes.h"
#include "gdiplusinit.h"
#include "gdipluspixelformats.h"
#include "gdiplusmetaheader.h"
...
...
include/gdiplusflat.h
View file @
11248262
...
...
@@ -206,6 +206,9 @@ GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics*,GpPen*,GDIPCONST GpRect*,INT
GpStatus
WINGDIPAPI
GdipDrawString
(
GpGraphics
*
,
GDIPCONST
WCHAR
*
,
INT
,
GDIPCONST
GpFont
*
,
GDIPCONST
RectF
*
,
GDIPCONST
GpStringFormat
*
,
GDIPCONST
GpBrush
*
);
GpStatus
WINGDIPAPI
GdipEnumerateMetafileSrcRectDestPoints
(
GpGraphics
*
,
GDIPCONST
GpMetafile
*
,
GDIPCONST
GpPointF
*
,
INT
,
GDIPCONST
GpRectF
*
,
Unit
,
EnumerateMetafileProc
,
VOID
*
,
GDIPCONST
GpImageAttributes
*
);
GpStatus
WINGDIPAPI
GdipFillClosedCurve2
(
GpGraphics
*
,
GpBrush
*
,
GDIPCONST
GpPointF
*
,
INT
,
REAL
,
GpFillMode
);
GpStatus
WINGDIPAPI
GdipFillClosedCurve2I
(
GpGraphics
*
,
GpBrush
*
,
GDIPCONST
GpPoint
*
,
INT
,
...
...
include/gdiplustypes.h
View file @
11248262
...
...
@@ -55,6 +55,8 @@ typedef BOOL (CALLBACK * ImageAbort)(VOID *);
typedef
ImageAbort
DrawImageAbort
;
typedef
ImageAbort
GetThumbnailImageAbort
;
typedef
BOOL
(
CALLBACK
*
EnumerateMetafileProc
)(
EmfPlusRecordType
,
UINT
,
UINT
,
const
BYTE
*
,
VOID
*
);
#ifdef __cplusplus
}
#endif
...
...
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