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
ef50aa33
Commit
ef50aa33
authored
Aug 27, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipGetClip.
parent
740bc043
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
35 deletions
+59
-35
gdiplus.c
dlls/gdiplus/gdiplus.c
+22
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+15
-2
graphics.c
dlls/gdiplus/graphics.c
+20
-2
region.c
dlls/gdiplus/region.c
+0
-29
graphics.c
dlls/gdiplus/tests/graphics.c
+2
-2
No files found.
dlls/gdiplus/gdiplus.c
View file @
ef50aa33
...
...
@@ -344,3 +344,25 @@ BOOL lengthen_path(GpPath *path, INT len)
return
TRUE
;
}
/* recursive deletion of GpRegion nodes */
inline
void
delete_element
(
region_element
*
element
)
{
switch
(
element
->
type
)
{
case
RegionDataRect
:
break
;
case
RegionDataPath
:
GdipDeletePath
(
element
->
elementdata
.
pathdata
.
path
);
break
;
case
RegionDataEmptyRect
:
case
RegionDataInfiniteRect
:
break
;
default:
delete_element
(
element
->
elementdata
.
combine
.
left
);
delete_element
(
element
->
elementdata
.
combine
.
right
);
GdipFree
(
element
->
elementdata
.
combine
.
left
);
GdipFree
(
element
->
elementdata
.
combine
.
right
);
break
;
}
}
dlls/gdiplus/gdiplus_private.h
View file @
ef50aa33
...
...
@@ -54,6 +54,9 @@ extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj,
extern
BOOL
lengthen_path
(
GpPath
*
path
,
INT
len
);
typedef
struct
region_element
region_element
;
extern
inline
void
delete_element
(
region_element
*
element
);
static
inline
INT
roundr
(
REAL
x
)
{
return
(
INT
)
floorf
(
x
+
0
.
5
);
...
...
@@ -96,6 +99,7 @@ struct GpGraphics{
REAL
scale
;
/* page scale */
GpMatrix
*
worldtrans
;
/* world transform */
BOOL
busy
;
/* hdc handle obtained by GdipGetDC */
GpRegion
*
clip
;
};
struct
GpBrush
{
...
...
@@ -218,7 +222,16 @@ struct GpFontFamily{
WCHAR
FamilyName
[
LF_FACESIZE
];
};
typedef
struct
region_element
/* internal use */
typedef
enum
RegionType
{
RegionDataRect
=
0x10000000
,
RegionDataPath
=
0x10000001
,
RegionDataEmptyRect
=
0x10000002
,
RegionDataInfiniteRect
=
0x10000003
,
}
RegionType
;
struct
region_element
{
DWORD
type
;
/* Rectangle, Path, SpecialRectangle, or CombineMode */
union
...
...
@@ -241,7 +254,7 @@ typedef struct region_element
struct
region_element
*
right
;
/* what *left was combined with */
}
combine
;
}
elementdata
;
}
region_element
;
};
struct
GpRegion
{
struct
...
...
dlls/gdiplus/graphics.c
View file @
ef50aa33
...
...
@@ -743,6 +743,12 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
return
retval
;
}
if
((
retval
=
GdipCreateRegion
(
&
(
*
graphics
)
->
clip
))
!=
Ok
){
GdipFree
((
*
graphics
)
->
worldtrans
);
GdipFree
(
*
graphics
);
return
retval
;
}
(
*
graphics
)
->
hdc
=
hdc
;
(
*
graphics
)
->
hwnd
=
NULL
;
(
*
graphics
)
->
smoothing
=
SmoothingModeDefault
;
...
...
@@ -894,6 +900,7 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
if
(
graphics
->
hwnd
)
ReleaseDC
(
graphics
->
hwnd
,
graphics
->
hdc
);
GdipDeleteRegion
(
graphics
->
clip
);
GdipDeleteMatrix
(
graphics
->
worldtrans
);
GdipFree
(
graphics
);
...
...
@@ -2874,14 +2881,25 @@ GpStatus WINGDIPAPI GdipReleaseDC(GpGraphics *graphics, HDC hdc)
GpStatus
WINGDIPAPI
GdipGetClip
(
GpGraphics
*
graphics
,
GpRegion
*
region
)
{
GpRegion
*
clip
;
GpStatus
status
;
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
region
);
if
(
!
graphics
||
!
region
)
return
InvalidParameter
;
if
(
graphics
->
busy
)
return
ObjectBusy
;
FIXME
(
"(%p, %p): stub
\n
"
,
graphics
,
region
);
return
NotImplemented
;
if
((
status
=
GdipCloneRegion
(
graphics
->
clip
,
&
clip
))
!=
Ok
)
return
status
;
/* free everything except root node and header */
delete_element
(
&
region
->
node
);
memcpy
(
region
,
clip
,
sizeof
(
GpRegion
));
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipTransformPoints
(
GpGraphics
*
graphics
,
GpCoordinateSpace
dst_space
,
...
...
dlls/gdiplus/region.c
View file @
ef50aa33
...
...
@@ -73,14 +73,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
*
*/
typedef
enum
RegionType
{
RegionDataRect
=
0x10000000
,
RegionDataPath
=
0x10000001
,
RegionDataEmptyRect
=
0x10000002
,
RegionDataInfiniteRect
=
0x10000003
,
}
RegionType
;
#define FLAGS_NOFLAGS 0x0
#define FLAGS_INTPATH 0x4000
...
...
@@ -141,27 +133,6 @@ static inline GpStatus init_region(GpRegion* region, const RegionType type)
return
Ok
;
}
static
inline
void
delete_element
(
region_element
*
element
)
{
switch
(
element
->
type
)
{
case
RegionDataRect
:
break
;
case
RegionDataPath
:
GdipDeletePath
(
element
->
elementdata
.
pathdata
.
path
);
break
;
case
RegionDataEmptyRect
:
case
RegionDataInfiniteRect
:
break
;
default:
delete_element
(
element
->
elementdata
.
combine
.
left
);
delete_element
(
element
->
elementdata
.
combine
.
right
);
GdipFree
(
element
->
elementdata
.
combine
.
left
);
GdipFree
(
element
->
elementdata
.
combine
.
right
);
break
;
}
}
static
inline
GpStatus
clone_element
(
const
region_element
*
element
,
region_element
**
element2
)
{
...
...
dlls/gdiplus/tests/graphics.c
View file @
ef50aa33
...
...
@@ -791,10 +791,10 @@ static void test_getclip(void)
res
=
FALSE
;
status
=
GdipGetClip
(
graphics
,
clip
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
status
=
GdipIsInfiniteRegion
(
clip
,
graphics
,
&
res
);
expect
(
Ok
,
status
);
todo_wine
expect
(
TRUE
,
res
);
expect
(
TRUE
,
res
);
GdipDeleteRegion
(
clip
);
...
...
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