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
f1faeb0f
Commit
f1faeb0f
authored
Oct 21, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add support for PS_USERSTYLE pens.
parent
f839e532
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
23 deletions
+39
-23
pen.c
dlls/wineps.drv/pen.c
+27
-16
ps.c
dlls/wineps.drv/ps.c
+8
-6
psdrv.h
dlls/wineps.drv/psdrv.h
+4
-1
No files found.
dlls/wineps.drv/pen.c
View file @
f1faeb0f
...
...
@@ -28,11 +28,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
psdrv
);
static
const
char
PEN_dash
[]
=
"50 30"
;
/* ----- ----- ----- */
static
const
char
PEN_dot
[]
=
"20"
;
/* -- -- -- -- -- -- */
static
const
char
PEN_dashdot
[]
=
"40 30 20 30"
;
/* ---- -- ---- -- */
static
const
char
PEN_dashdotdot
[]
=
"40 20 20 20 20 20"
;
/* ---- -- -- ---- */
static
const
char
PEN_alternate
[]
=
"1"
;
static
const
DWORD
PEN_dash
[]
=
{
50
,
30
};
/* ----- ----- ----- */
static
const
DWORD
PEN_dot
[]
=
{
20
};
/* -- -- -- -- -- -- */
static
const
DWORD
PEN_dashdot
[]
=
{
40
,
30
,
20
,
30
};
/* ---- -- ---- -- */
static
const
DWORD
PEN_dashdotdot
[]
=
{
40
,
20
,
20
,
20
,
20
,
20
}
;
/* ---- -- -- ---- */
static
const
DWORD
PEN_alternate
[]
=
{
1
}
;
/***********************************************************************
* SelectPen (WINEPS.@)
...
...
@@ -41,11 +41,11 @@ HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen )
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
LOGPEN
logpen
;
EXTLOGPEN
*
elp
=
NULL
;
if
(
!
GetObjectW
(
hpen
,
sizeof
(
logpen
),
&
logpen
))
{
/* must be an extended pen */
EXTLOGPEN
*
elp
;
INT
size
=
GetObjectW
(
hpen
,
0
,
NULL
);
if
(
!
size
)
return
0
;
...
...
@@ -58,8 +58,6 @@ HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen )
logpen
.
lopnWidth
.
x
=
elp
->
elpWidth
;
logpen
.
lopnWidth
.
y
=
0
;
logpen
.
lopnColor
=
elp
->
elpColor
;
HeapFree
(
GetProcessHeap
(),
0
,
elp
);
}
TRACE
(
"hpen = %p colour = %08x
\n
"
,
hpen
,
logpen
.
lopnColor
);
...
...
@@ -94,34 +92,47 @@ HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen )
switch
(
physDev
->
pen
.
style
)
{
case
PS_DASH
:
physDev
->
pen
.
dash
=
PEN_dash
;
memcpy
(
physDev
->
pen
.
dash
,
PEN_dash
,
sizeof
(
PEN_dash
)
);
physDev
->
pen
.
dash_len
=
sizeof
(
PEN_dash
)
/
sizeof
(
DWORD
);
break
;
case
PS_DOT
:
physDev
->
pen
.
dash
=
PEN_dot
;
memcpy
(
physDev
->
pen
.
dash
,
PEN_dot
,
sizeof
(
PEN_dot
)
);
physDev
->
pen
.
dash_len
=
sizeof
(
PEN_dot
)
/
sizeof
(
DWORD
);
break
;
case
PS_DASHDOT
:
physDev
->
pen
.
dash
=
PEN_dashdot
;
memcpy
(
physDev
->
pen
.
dash
,
PEN_dashdot
,
sizeof
(
PEN_dashdot
)
);
physDev
->
pen
.
dash_len
=
sizeof
(
PEN_dashdot
)
/
sizeof
(
DWORD
);
break
;
case
PS_DASHDOTDOT
:
physDev
->
pen
.
dash
=
PEN_dashdotdot
;
memcpy
(
physDev
->
pen
.
dash
,
PEN_dashdotdot
,
sizeof
(
PEN_dashdotdot
)
);
physDev
->
pen
.
dash_len
=
sizeof
(
PEN_dashdotdot
)
/
sizeof
(
DWORD
);
break
;
case
PS_ALTERNATE
:
physDev
->
pen
.
dash
=
PEN_alternate
;
memcpy
(
physDev
->
pen
.
dash
,
PEN_alternate
,
sizeof
(
PEN_alternate
)
);
physDev
->
pen
.
dash_len
=
sizeof
(
PEN_alternate
)
/
sizeof
(
DWORD
);
break
;
case
PS_USERSTYLE
:
physDev
->
pen
.
dash_len
=
min
(
elp
->
elpNumEntries
,
MAX_DASHLEN
);
memcpy
(
physDev
->
pen
.
dash
,
elp
->
elpStyleEntry
,
physDev
->
pen
.
dash_len
*
sizeof
(
DWORD
)
);
break
;
default:
physDev
->
pen
.
dash
=
NULL
;
physDev
->
pen
.
dash
_len
=
0
;
}
if
((
physDev
->
pen
.
width
>
1
)
&&
(
physDev
->
pen
.
dash
!=
NULL
))
{
if
((
physDev
->
pen
.
width
>
1
)
&&
physDev
->
pen
.
dash_len
&&
physDev
->
pen
.
style
!=
PS_USERSTYLE
&&
physDev
->
pen
.
style
!=
PS_ALTERNATE
)
{
physDev
->
pen
.
style
=
PS_SOLID
;
physDev
->
pen
.
dash
=
NULL
;
physDev
->
pen
.
dash_len
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
elp
);
physDev
->
pen
.
set
=
FALSE
;
return
hpen
;
}
...
...
dlls/wineps.drv/ps.c
View file @
f1faeb0f
...
...
@@ -125,9 +125,6 @@ static const char pssetfont[] = /* fontname, xx_scale, xy_scale, yx_scale, yy_sc
static
const
char
pssetline
[]
=
/* width, join, endcap */
"%d setlinewidth %u setlinejoin %u setlinecap
\n
"
;
static
const
char
pssetdash
[]
=
/* dash, offset */
"[%s] %d setdash
\n
"
;
static
const
char
pssetgray
[]
=
/* gray */
"%.2f setgray
\n
"
;
...
...
@@ -556,15 +553,20 @@ BOOL PSDRV_WriteSetPen(PHYSDEV dev)
{
PSDRV_PDEVICE
*
physDev
=
get_psdrv_dev
(
dev
);
char
buf
[
256
];
DWORD
i
,
pos
;
sprintf
(
buf
,
pssetline
,
physDev
->
pen
.
width
,
physDev
->
pen
.
join
,
physDev
->
pen
.
endcap
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
if
(
physDev
->
pen
.
dash
)
{
sprintf
(
buf
,
pssetdash
,
physDev
->
pen
.
dash
,
0
);
if
(
physDev
->
pen
.
dash_len
)
{
for
(
i
=
pos
=
0
;
i
<
physDev
->
pen
.
dash_len
;
i
++
)
pos
+=
sprintf
(
buf
+
pos
,
" %u"
,
physDev
->
pen
.
dash
[
i
]
);
buf
[
0
]
=
'['
;
sprintf
(
buf
+
pos
,
"] %u setdash
\n
"
,
0
);
}
else
sprintf
(
buf
,
pssetdash
,
"
"
,
0
);
sprintf
(
buf
,
"[] %u setdash
\n
"
,
0
);
PSDRV_WriteSpool
(
dev
,
buf
,
strlen
(
buf
));
...
...
dlls/wineps.drv/psdrv.h
View file @
f1faeb0f
...
...
@@ -329,12 +329,15 @@ typedef struct {
BOOL
set
;
}
PSBRUSH
;
#define MAX_DASHLEN 16
typedef
struct
{
INT
style
;
INT
width
;
BYTE
join
;
BYTE
endcap
;
const
char
*
dash
;
DWORD
dash
[
MAX_DASHLEN
];
DWORD
dash_len
;
PSCOLOR
color
;
BOOL
set
;
}
PSPEN
;
...
...
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