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
a3d3ff8d
Commit
a3d3ff8d
authored
Apr 18, 2000
by
Huw D M Davies
Committed by
Alexandre Julliard
Apr 18, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement StrokeAndFillPath.
Call DeleteObject when finished with hrgn in PATH_FillPath.
parent
008c388a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
83 deletions
+93
-83
path.c
graphics/path.c
+93
-83
No files found.
graphics/path.c
View file @
a3d3ff8d
...
...
@@ -244,8 +244,6 @@ BOOL WINAPI CloseFigure(HDC hdc)
return
FALSE
;
}
/* FIXME: Shouldn't we draw a line to the beginning of the figure? */
/* Set PT_CLOSEFIGURE on the last entry and start a new stroke */
if
(
pPath
->
numEntriesUsed
)
{
...
...
@@ -360,39 +358,13 @@ HRGN WINAPI PathToRegion(HDC hdc)
return
hrgnRval
;
}
/***********************************************************************
* FillPath16 (GDI.515)
*/
BOOL16
WINAPI
FillPath16
(
HDC16
hdc
)
{
return
(
BOOL16
)
FillPath
((
HDC
)
hdc
);
}
/***********************************************************************
* FillPath (GDI32.100)
*
* FIXME
* Check that SetLastError is being called correctly
*/
BOOL
WINAPI
FillPath
(
HDC
hdc
)
static
BOOL
PATH_FillPath
(
HDC
hdc
,
GdiPath
*
pPath
)
{
GdiPath
*
pPath
;
INT
mapMode
,
graphicsMode
;
SIZE
ptViewportExt
,
ptWindowExt
;
POINT
ptViewportOrg
,
ptWindowOrg
;
XFORM
xform
;
XFORM
xform
;
HRGN
hrgn
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
dc
->
funcs
->
pFillPath
)
return
dc
->
funcs
->
pFillPath
(
dc
);
pPath
=
&
dc
->
w
.
path
;
/* Check that path is closed */
if
(
pPath
->
state
!=
PATH_Closed
)
...
...
@@ -434,7 +406,7 @@ BOOL WINAPI FillPath(HDC hdc)
/* Paint the region */
PaintRgn
(
hdc
,
hrgn
);
DeleteObject
(
hrgn
);
/* Restore the old mapping mode */
SetMapMode
(
hdc
,
mapMode
);
SetViewportExtEx
(
hdc
,
ptViewportExt
.
cx
,
ptViewportExt
.
cy
,
NULL
);
...
...
@@ -447,17 +419,43 @@ BOOL WINAPI FillPath(HDC hdc)
SetGraphicsMode
(
hdc
,
GM_ADVANCED
);
SetWorldTransform
(
hdc
,
&
xform
);
SetGraphicsMode
(
hdc
,
graphicsMode
);
/* Empty the path */
PATH_EmptyPath
(
pPath
);
return
TRUE
;
}
else
{
/* FIXME: Should the path be emptied even if conversion failed? */
/* PATH_EmptyPath(pPath); */
return
FALSE
;
return
FALSE
;
}
/***********************************************************************
* FillPath16 (GDI.515)
*/
BOOL16
WINAPI
FillPath16
(
HDC16
hdc
)
{
return
(
BOOL16
)
FillPath
((
HDC
)
hdc
);
}
/***********************************************************************
* FillPath (GDI32.100)
*
* FIXME
* Check that SetLastError is being called correctly
*/
BOOL
WINAPI
FillPath
(
HDC
hdc
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
dc
->
funcs
->
pFillPath
)
return
dc
->
funcs
->
pFillPath
(
dc
);
if
(
!
PATH_FillPath
(
hdc
,
&
dc
->
w
.
path
))
return
FALSE
;
/* FIXME: Should the path be emptied even if conversion failed? */
PATH_EmptyPath
(
&
dc
->
w
.
path
);
return
TRUE
;
}
/***********************************************************************
...
...
@@ -1454,6 +1452,55 @@ BOOL WINAPI FlattenPath(HDC hdc)
return
PATH_FlattenPath
(
pPath
);
}
static
BOOL
PATH_StrokePath
(
HDC
hdc
,
GdiPath
*
pPath
)
{
INT
i
;
POINT
ptLastMove
=
{
0
,
0
};
if
(
pPath
->
state
!=
PATH_Closed
)
return
FALSE
;
SaveDC
(
hdc
);
SetMapMode
(
hdc
,
MM_TEXT
);
SetViewportOrgEx
(
hdc
,
0
,
0
,
NULL
);
SetWindowOrgEx
(
hdc
,
0
,
0
,
NULL
);
for
(
i
=
0
;
i
<
pPath
->
numEntriesUsed
;
i
++
)
{
switch
(
pPath
->
pFlags
[
i
])
{
case
PT_MOVETO
:
TRACE
(
"Got PT_MOVETO (%ld, %ld)
\n
"
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
MoveToEx
(
hdc
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
,
NULL
);
ptLastMove
=
pPath
->
pPoints
[
i
];
break
;
case
PT_LINETO
:
case
(
PT_LINETO
|
PT_CLOSEFIGURE
):
TRACE
(
"Got PT_LINETO (%ld, %ld)
\n
"
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
LineTo
(
hdc
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
break
;
case
PT_BEZIERTO
:
TRACE
(
"Got PT_BEZIERTO
\n
"
);
if
(
pPath
->
pFlags
[
i
+
1
]
!=
PT_BEZIERTO
||
(
pPath
->
pFlags
[
i
+
2
]
&
~
PT_CLOSEFIGURE
)
!=
PT_BEZIERTO
)
{
ERR
(
"Path didn't contain 3 successive PT_BEZIERTOs
\n
"
);
return
FALSE
;
}
PolyBezierTo
(
hdc
,
&
pPath
->
pPoints
[
i
],
3
);
i
+=
2
;
break
;
default:
ERR
(
"Got path flag %d
\n
"
,
(
INT
)
pPath
->
pFlags
[
i
]);
return
FALSE
;
}
if
(
pPath
->
pFlags
[
i
]
&
PT_CLOSEFIGURE
)
LineTo
(
hdc
,
ptLastMove
.
x
,
ptLastMove
.
y
);
}
RestoreDC
(
hdc
,
-
1
);
return
TRUE
;
}
/*******************************************************************
* StrokeAndFillPath16 [GDI.520]
*
...
...
@@ -1472,7 +1519,8 @@ BOOL16 WINAPI StrokeAndFillPath16(HDC16 hdc)
BOOL
WINAPI
StrokeAndFillPath
(
HDC
hdc
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
BOOL
bRet
;
if
(
!
dc
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
...
...
@@ -1481,8 +1529,10 @@ BOOL WINAPI StrokeAndFillPath(HDC hdc)
if
(
dc
->
funcs
->
pStrokeAndFillPath
)
return
dc
->
funcs
->
pStrokeAndFillPath
(
dc
);
FIXME
(
"stub
\n
"
);
return
StrokePath
(
hdc
);
bRet
=
PATH_FillPath
(
hdc
,
&
dc
->
w
.
path
);
if
(
bRet
)
bRet
=
PATH_StrokePath
(
hdc
,
&
dc
->
w
.
path
);
if
(
bRet
)
PATH_EmptyPath
(
&
dc
->
w
.
path
);
return
bRet
;
}
/*******************************************************************
...
...
@@ -1504,8 +1554,6 @@ BOOL WINAPI StrokePath(HDC hdc)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
GdiPath
*
pPath
;
INT
i
;
POINT
ptLastMove
=
{
0
,
0
};
TRACE
(
"(%08x)
\n
"
,
hdc
);
if
(
!
dc
)
{
...
...
@@ -1517,45 +1565,7 @@ BOOL WINAPI StrokePath(HDC hdc)
return
dc
->
funcs
->
pStrokePath
(
dc
);
pPath
=
&
dc
->
w
.
path
;
if
(
pPath
->
state
!=
PATH_Closed
)
return
FALSE
;
SaveDC
(
hdc
);
SetMapMode
(
hdc
,
MM_TEXT
);
SetViewportOrgEx
(
hdc
,
0
,
0
,
NULL
);
SetWindowOrgEx
(
hdc
,
0
,
0
,
NULL
);
for
(
i
=
0
;
i
<
pPath
->
numEntriesUsed
;
i
++
)
{
switch
(
pPath
->
pFlags
[
i
])
{
case
PT_MOVETO
:
TRACE
(
"Got PT_MOVETO (%ld, %ld)
\n
"
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
MoveToEx
(
hdc
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
,
NULL
);
ptLastMove
=
pPath
->
pPoints
[
i
];
break
;
case
PT_LINETO
:
case
(
PT_LINETO
|
PT_CLOSEFIGURE
):
TRACE
(
"Got PT_LINETO (%ld, %ld)
\n
"
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
LineTo
(
hdc
,
pPath
->
pPoints
[
i
].
x
,
pPath
->
pPoints
[
i
].
y
);
break
;
case
PT_BEZIERTO
:
TRACE
(
"Got PT_BEZIERTO
\n
"
);
if
(
pPath
->
pFlags
[
i
+
1
]
!=
PT_BEZIERTO
||
(
pPath
->
pFlags
[
i
+
2
]
&
~
PT_CLOSEFIGURE
)
!=
PT_BEZIERTO
)
{
ERR
(
"Path didn't contain 3 successive PT_BEZIERTOs
\n
"
);
return
FALSE
;
}
PolyBezierTo
(
hdc
,
&
pPath
->
pPoints
[
i
],
3
);
i
+=
2
;
break
;
default:
ERR
(
"Got path flag %d
\n
"
,
(
INT
)
pPath
->
pFlags
[
i
]);
return
FALSE
;
}
if
(
pPath
->
pFlags
[
i
]
&
PT_CLOSEFIGURE
)
LineTo
(
hdc
,
ptLastMove
.
x
,
ptLastMove
.
y
);
}
RestoreDC
(
hdc
,
-
1
);
PATH_StrokePath
(
hdc
,
pPath
);
PATH_EmptyPath
(
pPath
);
return
TRUE
;
}
...
...
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