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
e28224f0
Commit
e28224f0
authored
Jul 10, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Jul 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added patterned brushes (level 2 PostScript only).
Simple PatBlt for PATCOPY, WHITENESS and BLACKNESS.
parent
e5ea09c1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
7 deletions
+129
-7
Makefile.in
graphics/psdrv/Makefile.in
+1
-0
bitblt.c
graphics/psdrv/bitblt.c
+51
-0
bitmap.c
graphics/psdrv/bitmap.c
+1
-1
brush.c
graphics/psdrv/brush.c
+23
-0
init.c
graphics/psdrv/init.c
+1
-1
ps.c
graphics/psdrv/ps.c
+48
-2
psdrv.h
include/psdrv.h
+4
-3
No files found.
graphics/psdrv/Makefile.in
View file @
e28224f0
...
...
@@ -7,6 +7,7 @@ MODULE = psdrv
C_SRCS
=
\
afm.c
\
bitblt.c
\
bitmap.c
\
brush.c
\
color.c
\
...
...
graphics/psdrv/bitblt.c
0 → 100644
View file @
e28224f0
/*
* PostScript driver BitBlt, StretchBlt and PatBlt
*
* Copyright 1999 Huw D M Davies
*
*/
#include "gdi.h"
#include "psdrv.h"
#include "debugtools.h"
#include "winbase.h"
DEFAULT_DEBUG_CHANNEL
(
psdrv
)
/***********************************************************************
*
* PSDRV_PatBlt
*/
BOOL
PSDRV_PatBlt
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
width
,
INT
height
,
DWORD
dwRop
)
{
PSDRV_PDEVICE
*
physDev
=
(
PSDRV_PDEVICE
*
)
dc
->
physDev
;
switch
(
dwRop
)
{
case
PATCOPY
:
PSDRV_WriteGSave
(
dc
);
PSDRV_WriteRectangle
(
dc
,
XLPTODP
(
dc
,
x
),
YLPTODP
(
dc
,
y
),
XLSTODS
(
dc
,
width
),
YLSTODS
(
dc
,
height
));
PSDRV_Brush
(
dc
,
FALSE
);
PSDRV_WriteGRestore
(
dc
);
return
TRUE
;
case
BLACKNESS
:
case
WHITENESS
:
{
PSCOLOR
pscol
;
PSDRV_WriteGSave
(
dc
);
PSDRV_WriteRectangle
(
dc
,
XLPTODP
(
dc
,
x
),
YLPTODP
(
dc
,
y
),
XLSTODS
(
dc
,
width
),
YLSTODS
(
dc
,
height
));
PSDRV_CreateColor
(
physDev
,
&
pscol
,
(
dwRop
==
BLACKNESS
)
?
RGB
(
0
,
0
,
0
)
:
RGB
(
0xff
,
0xff
,
0xff
)
);
PSDRV_WriteSetColor
(
dc
,
&
pscol
);
PSDRV_WriteFill
(
dc
);
PSDRV_WriteGRestore
(
dc
);
return
TRUE
;
}
default
:
FIXME
(
"Unsupported rop %ld
\n
"
,
dwRop
);
return
FALSE
;
}
}
graphics/psdrv/bitmap.c
View file @
e28224f0
...
...
@@ -83,7 +83,7 @@ static BOOL PSDRV_WriteImageHeader(DC *dc, const BITMAPINFO *info, INT xDst,
}
PSDRV_WriteImageDict
(
dc
,
info
->
bmiHeader
.
biBitCount
,
xDst
,
yDst
,
widthDst
,
heightDst
,
widthSrc
,
heightSrc
);
widthDst
,
heightDst
,
widthSrc
,
heightSrc
,
NULL
);
return
TRUE
;
}
...
...
graphics/psdrv/brush.c
View file @
e28224f0
...
...
@@ -9,6 +9,7 @@
#include "brush.h"
#include "debugtools.h"
#include "gdi.h"
#include "winbase.h"
DEFAULT_DEBUG_CHANNEL
(
psdrv
)
...
...
@@ -192,6 +193,28 @@ BOOL PSDRV_Brush(DC *dc, BOOL EO)
return
TRUE
;
break
;
case
BS_PATTERN
:
{
BITMAP
bm
;
BYTE
*
bits
;
GetObjectA
(
brush
->
logbrush
.
lbHatch
,
sizeof
(
BITMAP
),
&
bm
);
TRACE
(
"BS_PATTERN %dx%d %d bpp
\n
"
,
bm
.
bmWidth
,
bm
.
bmHeight
,
bm
.
bmBitsPixel
);
bits
=
HeapAlloc
(
PSDRV_Heap
,
0
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
);
GetBitmapBits
(
brush
->
logbrush
.
lbHatch
,
bm
.
bmWidthBytes
*
bm
.
bmHeight
,
bits
);
PSDRV_WriteGSave
(
dc
);
PSDRV_WritePatternDict
(
dc
,
&
bm
,
bits
);
HeapFree
(
PSDRV_Heap
,
0
,
bits
);
PSDRV_Fill
(
dc
,
EO
);
PSDRV_WriteGRestore
(
dc
);
return
TRUE
;
}
break
;
default
:
return
FALSE
;
break
;
...
...
graphics/psdrv/init.c
View file @
e28224f0
...
...
@@ -58,7 +58,7 @@ static const DC_FUNCTIONS PSDRV_Funcs =
NULL
,
/* pOffsetViewportOrg (optional) */
NULL
,
/* pOffsetWindowOrg (optional) */
NULL
,
/* pPaintRgn */
NULL
,
/* pPatBlt */
PSDRV_PatBlt
,
/* pPatBlt */
PSDRV_Pie
,
/* pPie */
PSDRV_PolyPolygon
,
/* pPolyPolygon */
PSDRV_PolyPolyline
,
/* pPolyPolyline */
...
...
graphics/psdrv/ps.c
View file @
e28224f0
...
...
@@ -741,7 +741,7 @@ BOOL PSDRV_WriteRGB(DC *dc, COLORREF *map, int number)
BOOL
PSDRV_WriteImageDict
(
DC
*
dc
,
WORD
depth
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
widthSrc
,
INT
heightSrc
)
INT
heightSrc
,
char
*
bits
)
{
char
start
[]
=
"%d %d translate
\n
%d %d scale
\n
<<
\n
"
" /ImageType 1
\n
/Width %d
\n
/Height %d
\n
/BitsPerComponent %d
\n
"
...
...
@@ -751,6 +751,7 @@ BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
char
decode3
[]
=
" /Decode [0 1 0 1 0 1]
\n
"
;
char
end
[]
=
" /DataSource currentfile /ASCIIHexDecode filter
\n
>> image
\n
"
;
char
endbits
[]
=
" /DataSource <%s>
\n
>> image
\n
"
;
char
*
buf
=
HeapAlloc
(
PSDRV_Heap
,
0
,
1000
);
...
...
@@ -779,12 +780,18 @@ BOOL PSDRV_WriteImageDict(DC *dc, WORD depth, INT xDst, INT yDst,
PSDRV_WriteSpool
(
dc
,
buf
,
strlen
(
buf
));
PSDRV_WriteSpool
(
dc
,
end
,
sizeof
(
end
)
-
1
);
if
(
!
bits
)
PSDRV_WriteSpool
(
dc
,
end
,
sizeof
(
end
)
-
1
);
else
{
sprintf
(
buf
,
endbits
,
bits
);
PSDRV_WriteSpool
(
dc
,
buf
,
strlen
(
buf
));
}
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
return
TRUE
;
}
BOOL
PSDRV_WriteBytes
(
DC
*
dc
,
const
BYTE
*
bytes
,
int
number
)
{
char
*
buf
=
HeapAlloc
(
PSDRV_Heap
,
0
,
number
*
3
+
1
);
...
...
@@ -872,3 +879,42 @@ BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number)
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
return
TRUE
;
}
BOOL
PSDRV_WritePatternDict
(
DC
*
dc
,
BITMAP
*
bm
,
BYTE
*
bits
)
{
char
start
[]
=
"<<
\n
/PaintType 1
\n
/PatternType 1
\n
/TilingType 1
\n
"
"/BBox [0 0 %d %d]
\n
/XStep %d
\n
/YStep %d
\n
/PaintProc {
\n
begin
\n
"
;
char
end
[]
=
" end
\n
}
\n
>>
\n
matrix makepattern setpattern
\n
"
;
char
*
buf
,
*
ptr
;
INT
w
,
h
,
x
,
y
;
COLORREF
map
[
2
];
w
=
bm
->
bmWidth
&
~
0x7
;
h
=
bm
->
bmHeight
&
~
0x7
;
buf
=
HeapAlloc
(
PSDRV_Heap
,
0
,
sizeof
(
start
)
+
100
);
sprintf
(
buf
,
start
,
w
,
h
,
w
,
h
);
PSDRV_WriteSpool
(
dc
,
buf
,
strlen
(
buf
));
PSDRV_WriteIndexColorSpaceBegin
(
dc
,
1
);
map
[
0
]
=
dc
->
w
.
textColor
;
map
[
1
]
=
dc
->
w
.
backgroundColor
;
PSDRV_WriteRGB
(
dc
,
map
,
2
);
PSDRV_WriteIndexColorSpaceEnd
(
dc
);
ptr
=
buf
;
for
(
y
=
h
-
1
;
y
>=
0
;
y
--
)
{
for
(
x
=
0
;
x
<
w
/
8
;
x
++
)
{
sprintf
(
ptr
,
"%02x"
,
*
(
bits
+
x
/
8
+
y
*
bm
->
bmWidthBytes
));
ptr
+=
2
;
}
}
PSDRV_WriteImageDict
(
dc
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
buf
);
PSDRV_WriteSpool
(
dc
,
end
,
sizeof
(
end
)
-
1
);
HeapFree
(
PSDRV_Heap
,
0
,
buf
);
return
TRUE
;
}
include/psdrv.h
View file @
e28224f0
...
...
@@ -296,14 +296,13 @@ extern BOOL PSDRV_WriteIndexColorSpaceEnd(DC *dc);
extern
BOOL
PSDRV_WriteRGB
(
DC
*
dc
,
COLORREF
*
map
,
int
number
);
extern
BOOL
PSDRV_WriteImageDict
(
DC
*
dc
,
WORD
depth
,
INT
xDst
,
INT
yDst
,
INT
widthDst
,
INT
heightDst
,
INT
widthSrc
,
INT
heightSrc
);
INT
heightSrc
,
char
*
bits
);
extern
BOOL
PSDRV_WriteBytes
(
DC
*
dc
,
const
BYTE
*
bytes
,
int
number
);
extern
BOOL
PSDRV_WriteDIBits16
(
DC
*
dc
,
const
WORD
*
words
,
int
number
);
extern
BOOL
PSDRV_WriteDIBits24
(
DC
*
dc
,
const
BYTE
*
bits
,
int
number
);
extern
BOOL
PSDRV_WriteDIBits32
(
DC
*
dc
,
const
BYTE
*
bits
,
int
number
);
extern
int
PSDRV_WriteSpool
(
DC
*
dc
,
LPSTR
lpData
,
WORD
cch
);
extern
BOOL
PSDRV_WritePatternDict
(
DC
*
dc
,
BITMAP
*
bm
,
BYTE
*
bits
);
extern
BOOL
PSDRV_Arc
(
DC
*
dc
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
,
INT
xstart
,
INT
ystart
,
...
...
@@ -327,6 +326,8 @@ extern BOOL PSDRV_GetTextExtentPoint( DC *dc, LPCSTR str, INT count,
extern
BOOL
PSDRV_GetTextMetrics
(
DC
*
dc
,
TEXTMETRICA
*
metrics
);
extern
BOOL
PSDRV_LineTo
(
DC
*
dc
,
INT
x
,
INT
y
);
extern
BOOL
PSDRV_MoveToEx
(
DC
*
dc
,
INT
x
,
INT
y
,
LPPOINT
pt
);
extern
BOOL
PSDRV_PatBlt
(
DC
*
dc
,
INT
x
,
INT
y
,
INT
width
,
INT
height
,
DWORD
dwRop
);
extern
BOOL
PSDRV_Pie
(
DC
*
dc
,
INT
left
,
INT
top
,
INT
right
,
INT
bottom
,
INT
xstart
,
INT
ystart
,
INT
xend
,
INT
yend
);
...
...
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