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
da3511fd
Commit
da3511fd
authored
Oct 31, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Implement PolyBezier using the Postscript curveto function.
parent
996b451c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
2 deletions
+70
-2
graphics.c
dlls/wineps.drv/graphics.c
+54
-0
init.c
dlls/wineps.drv/init.c
+2
-2
ps.c
dlls/wineps.drv/ps.c
+11
-0
psdrv.h
dlls/wineps.drv/psdrv.h
+3
-0
No files found.
dlls/wineps.drv/graphics.c
View file @
da3511fd
...
...
@@ -411,6 +411,60 @@ BOOL PSDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
/***********************************************************************
* PSDRV_PolyBezier
*/
BOOL
PSDRV_PolyBezier
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
{
DWORD
i
;
POINT
*
dev_pts
;
TRACE
(
"
\n
"
);
if
(
!
(
dev_pts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
dev_pts
)
)))
return
FALSE
;
memcpy
(
dev_pts
,
pts
,
count
*
sizeof
(
*
dev_pts
)
);
LPtoDP
(
dev
->
hdc
,
dev_pts
,
count
);
PSDRV_WriteSpool
(
dev
,
"%PolyBezier
\n
"
,
12
);
PSDRV_SetPen
(
dev
);
PSDRV_SetClip
(
dev
);
PSDRV_WriteMoveTo
(
dev
,
dev_pts
[
0
].
x
,
dev_pts
[
0
].
y
);
for
(
i
=
1
;
i
<
count
;
i
+=
3
)
PSDRV_WriteCurveTo
(
dev
,
dev_pts
+
i
);
PSDRV_DrawLine
(
dev
);
PSDRV_ResetClip
(
dev
);
HeapFree
(
GetProcessHeap
(),
0
,
dev_pts
);
return
TRUE
;
}
/***********************************************************************
* PSDRV_PolyBezierTo
*/
BOOL
PSDRV_PolyBezierTo
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
{
DWORD
i
;
POINT
*
dev_pts
;
TRACE
(
"
\n
"
);
count
++
;
/* add initial position */
if
(
!
(
dev_pts
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
*
dev_pts
)
)))
return
FALSE
;
GetCurrentPositionEx
(
dev
->
hdc
,
dev_pts
);
memcpy
(
dev_pts
+
1
,
pts
,
(
count
-
1
)
*
sizeof
(
*
dev_pts
)
);
LPtoDP
(
dev
->
hdc
,
dev_pts
,
count
);
PSDRV_WriteSpool
(
dev
,
"%PolyBezier
\n
"
,
12
);
PSDRV_SetPen
(
dev
);
PSDRV_SetClip
(
dev
);
PSDRV_WriteMoveTo
(
dev
,
dev_pts
[
0
].
x
,
dev_pts
[
0
].
y
);
for
(
i
=
1
;
i
<
count
;
i
+=
3
)
PSDRV_WriteCurveTo
(
dev
,
dev_pts
+
i
);
PSDRV_DrawLine
(
dev
);
PSDRV_ResetClip
(
dev
);
HeapFree
(
GetProcessHeap
(),
0
,
dev_pts
);
return
TRUE
;
}
/***********************************************************************
* PSDRV_SetPixel
*/
COLORREF
PSDRV_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
...
...
dlls/wineps.drv/init.c
View file @
da3511fd
...
...
@@ -890,8 +890,8 @@ static const struct gdi_dc_funcs psdrv_funcs =
PSDRV_PaintRgn
,
/* pPaintRgn */
PSDRV_PatBlt
,
/* pPatBlt */
PSDRV_Pie
,
/* pPie */
NULL
,
/* pPolyBezier */
NULL
,
/* pPolyBezierTo */
PSDRV_PolyBezier
,
/* pPolyBezier */
PSDRV_PolyBezierTo
,
/* pPolyBezierTo */
NULL
,
/* pPolyDraw */
PSDRV_PolyPolygon
,
/* pPolyPolygon */
PSDRV_PolyPolyline
,
/* pPolyPolyline */
...
...
dlls/wineps.drv/ps.c
View file @
da3511fd
...
...
@@ -138,6 +138,9 @@ static const char psarc[] = /* x, y, w, h, ang1, ang2 */
"0 0 0.5 %.1f %.1f arc
\n
"
"tmpmtrx setmatrix
\n
"
;
static
const
char
pscurveto
[]
=
/* x1, y1, x2, y2, x3, y3 */
"%d %d %d %d %d %d curveto
\n
"
;
static
const
char
psgsave
[]
=
"gsave
\n
"
;
...
...
@@ -501,6 +504,14 @@ BOOL PSDRV_WriteArc(PHYSDEV dev, INT x, INT y, INT w, INT h, double ang1,
return
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
}
BOOL
PSDRV_WriteCurveTo
(
PHYSDEV
dev
,
POINT
pts
[
3
])
{
char
buf
[
256
];
sprintf
(
buf
,
pscurveto
,
pts
[
0
].
x
,
pts
[
0
].
y
,
pts
[
1
].
x
,
pts
[
1
].
y
,
pts
[
2
].
x
,
pts
[
2
].
y
);
return
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
}
BOOL
PSDRV_WriteSetFont
(
PHYSDEV
dev
,
const
char
*
name
,
matrix
size
,
INT
escapement
)
{
...
...
dlls/wineps.drv/psdrv.h
View file @
da3511fd
...
...
@@ -442,6 +442,8 @@ extern BOOL PSDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN;
extern
BOOL
PSDRV_PatBlt
(
PHYSDEV
dev
,
struct
bitblt_coords
*
dst
,
DWORD
dwRop
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_Pie
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
,
INT
xstart
,
INT
ystart
,
INT
xend
,
INT
yend
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_PolyBezier
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_PolyBezierTo
(
PHYSDEV
dev
,
const
POINT
*
pts
,
DWORD
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_PolyPolygon
(
PHYSDEV
dev
,
const
POINT
*
pts
,
const
INT
*
counts
,
UINT
polygons
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_PolyPolyline
(
PHYSDEV
dev
,
const
POINT
*
pts
,
const
DWORD
*
counts
,
DWORD
polylines
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_Polygon
(
PHYSDEV
dev
,
const
POINT
*
pt
,
INT
count
)
DECLSPEC_HIDDEN
;
...
...
@@ -502,6 +504,7 @@ extern BOOL PSDRV_WriteGlyphShow(PHYSDEV dev, LPCSTR g_name) DECLSPEC_HIDDEN;
extern
BOOL
PSDRV_WriteSetPen
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteArc
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
INT
w
,
INT
h
,
double
ang1
,
double
ang2
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteCurveTo
(
PHYSDEV
dev
,
POINT
pts
[
3
])
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteSetColor
(
PHYSDEV
dev
,
PSCOLOR
*
color
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteSetBrush
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
extern
BOOL
PSDRV_WriteFill
(
PHYSDEV
dev
)
DECLSPEC_HIDDEN
;
...
...
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