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
6518edfa
Commit
6518edfa
authored
Jan 16, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement writing SetPageTransform records.
parent
55ad8315
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+18
-0
metafile.c
dlls/gdiplus/metafile.c
+29
-0
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
6518edfa
...
...
@@ -59,6 +59,7 @@ extern GpStatus METAFILE_GetDC(GpMetafile* metafile, HDC *hdc) DECLSPEC_HIDDEN;
extern
GpStatus
METAFILE_ReleaseDC
(
GpMetafile
*
metafile
,
HDC
hdc
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_FillRectangles
(
GpMetafile
*
metafile
,
GpBrush
*
brush
,
GDIPCONST
GpRectF
*
rects
,
INT
count
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_SetPageTransform
(
GpMetafile
*
metafile
,
GpUnit
unit
,
REAL
scale
)
DECLSPEC_HIDDEN
;
extern
GpStatus
METAFILE_GraphicsDeleted
(
GpMetafile
*
metafile
)
DECLSPEC_HIDDEN
;
extern
MetafileType
METAFILE_GetEmfType
(
HENHMETAFILE
hemf
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdiplus/graphics.c
View file @
6518edfa
...
...
@@ -5274,6 +5274,8 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics,
GpStatus
WINGDIPAPI
GdipSetPageScale
(
GpGraphics
*
graphics
,
REAL
scale
)
{
GpStatus
stat
;
TRACE
(
"(%p, %.2f)
\n
"
,
graphics
,
scale
);
if
(
!
graphics
||
(
scale
<=
0
.
0
))
...
...
@@ -5282,6 +5284,13 @@ GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale)
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
{
stat
=
METAFILE_SetPageTransform
((
GpMetafile
*
)
graphics
->
image
,
graphics
->
unit
,
scale
);
if
(
stat
!=
Ok
)
return
stat
;
}
graphics
->
scale
=
scale
;
return
Ok
;
...
...
@@ -5289,6 +5298,8 @@ GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale)
GpStatus
WINGDIPAPI
GdipSetPageUnit
(
GpGraphics
*
graphics
,
GpUnit
unit
)
{
GpStatus
stat
;
TRACE
(
"(%p, %d)
\n
"
,
graphics
,
unit
);
if
(
!
graphics
)
...
...
@@ -5300,6 +5311,13 @@ GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit)
if
(
unit
==
UnitWorld
)
return
InvalidParameter
;
if
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeMetafile
)
{
stat
=
METAFILE_SetPageTransform
((
GpMetafile
*
)
graphics
->
image
,
unit
,
graphics
->
scale
);
if
(
stat
!=
Ok
)
return
stat
;
}
graphics
->
unit
=
unit
;
return
Ok
;
...
...
dlls/gdiplus/metafile.c
View file @
6518edfa
...
...
@@ -64,6 +64,12 @@ typedef struct EmfPlusFillRects
DWORD
Count
;
}
EmfPlusFillRects
;
typedef
struct
EmfPlusSetPageTransform
{
EmfPlusRecordHeader
Header
;
REAL
PageScale
;
}
EmfPlusSetPageTransform
;
typedef
struct
EmfPlusRect
{
SHORT
X
;
...
...
@@ -416,6 +422,29 @@ GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush,
return
Ok
;
}
GpStatus
METAFILE_SetPageTransform
(
GpMetafile
*
metafile
,
GpUnit
unit
,
REAL
scale
)
{
if
(
metafile
->
metafile_type
==
MetafileTypeEmfPlusOnly
||
metafile
->
metafile_type
==
MetafileTypeEmfPlusDual
)
{
EmfPlusSetPageTransform
*
record
;
GpStatus
stat
;
stat
=
METAFILE_AllocateRecord
(
metafile
,
sizeof
(
EmfPlusSetPageTransform
),
(
void
**
)
&
record
);
if
(
stat
!=
Ok
)
return
stat
;
record
->
Header
.
Type
=
EmfPlusRecordTypeSetPageTransform
;
record
->
Header
.
Flags
=
unit
;
record
->
PageScale
=
scale
;
METAFILE_WriteRecords
(
metafile
);
}
return
Ok
;
}
GpStatus
METAFILE_ReleaseDC
(
GpMetafile
*
metafile
,
HDC
hdc
)
{
if
(
hdc
!=
metafile
->
record_dc
)
...
...
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