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
cb4ecc87
Commit
cb4ecc87
authored
Mar 03, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Get/SetBoundsRect based on a patch by Ken Belleau.
parent
e6d93da7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
23 deletions
+95
-23
gdi16.c
dlls/gdi/gdi16.c
+27
-0
gdi_private.h
dlls/gdi/gdi_private.h
+4
-2
gdi.h
include/gdi.h
+1
-0
dc.c
objects/dc.c
+63
-21
No files found.
dlls/gdi/gdi16.c
View file @
cb4ecc87
...
...
@@ -1547,6 +1547,33 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
/***********************************************************************
* SetBoundsRect (GDI.193)
*/
UINT16
WINAPI
SetBoundsRect16
(
HDC16
hdc
,
const
RECT16
*
rect
,
UINT16
flags
)
{
if
(
rect
)
{
RECT
rect32
;
CONV_RECT16TO32
(
rect
,
&
rect32
);
return
SetBoundsRect
(
HDC_32
(
hdc
),
&
rect32
,
flags
);
}
else
return
SetBoundsRect
(
HDC_32
(
hdc
),
NULL
,
flags
);
}
/***********************************************************************
* GetBoundsRect (GDI.194)
*/
UINT16
WINAPI
GetBoundsRect16
(
HDC16
hdc
,
LPRECT16
rect
,
UINT16
flags
)
{
RECT
rect32
;
UINT
ret
=
GetBoundsRect
(
HDC_32
(
hdc
),
&
rect32
,
flags
);
if
(
rect
)
CONV_RECT32TO16
(
&
rect32
,
rect
);
return
ret
;
}
/***********************************************************************
* EngineEnumerateFont (GDI.300)
*/
WORD
WINAPI
EngineEnumerateFont16
(
LPSTR
fontname
,
FARPROC16
proc
,
DWORD
data
)
...
...
dlls/gdi/gdi_private.h
View file @
cb4ecc87
...
...
@@ -171,8 +171,10 @@ typedef struct tagDC_FUNCS
}
DC_FUNCTIONS
;
/* DC flags */
#define DC_SAVED 0x0002
/* It is a saved DC */
#define DC_DIRTY 0x0004
/* hVisRgn has to be updated */
#define DC_SAVED 0x0002
/* It is a saved DC */
#define DC_DIRTY 0x0004
/* hVisRgn has to be updated */
#define DC_BOUNDS_ENABLE 0x0008
/* Bounding rectangle tracking is enabled */
#define DC_BOUNDS_SET 0x0010
/* Bounding rectangle has been set */
/* Certain functions will do no further processing if the driver returns this.
Used by mfdrv for example. */
...
...
include/gdi.h
View file @
cb4ecc87
...
...
@@ -153,6 +153,7 @@ typedef struct tagDC
XFORM
xformWorld2Vport
;
/* World-to-viewport transformation */
XFORM
xformVport2World
;
/* Inverse of the above transformation */
BOOL
vport2WorldValid
;
/* Is xformVport2World valid? */
RECT
BoundsRect
;
/* Current bounding rect */
}
DC
;
/* extra stock object: default 1x1 bitmap for memory DCs */
...
...
objects/dc.c
View file @
cb4ecc87
...
...
@@ -116,6 +116,10 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs, WORD magic )
dc
->
xformWorld2Vport
=
dc
->
xformWorld2Wnd
;
dc
->
xformVport2World
=
dc
->
xformWorld2Wnd
;
dc
->
vport2WorldValid
=
TRUE
;
dc
->
BoundsRect
.
left
=
0
;
dc
->
BoundsRect
.
top
=
0
;
dc
->
BoundsRect
.
right
=
0
;
dc
->
BoundsRect
.
bottom
=
0
;
PATH_InitGdiPath
(
&
dc
->
path
);
return
dc
;
}
...
...
@@ -322,6 +326,7 @@ HDC WINAPI GetDCState( HDC hdc )
newdc
->
vportOrgY
=
dc
->
vportOrgY
;
newdc
->
vportExtX
=
dc
->
vportExtX
;
newdc
->
vportExtY
=
dc
->
vportExtY
;
newdc
->
BoundsRect
=
dc
->
BoundsRect
;
newdc
->
hSelf
=
(
HDC
)
handle
;
newdc
->
saveLevel
=
0
;
...
...
@@ -402,6 +407,7 @@ void WINAPI SetDCState( HDC hdc, HDC hdcs )
dc
->
xformWorld2Vport
=
dcs
->
xformWorld2Vport
;
dc
->
xformVport2World
=
dcs
->
xformVport2World
;
dc
->
vport2WorldValid
=
dcs
->
vport2WorldValid
;
dc
->
BoundsRect
=
dcs
->
BoundsRect
;
dc
->
wndOrgX
=
dcs
->
wndOrgX
;
dc
->
wndOrgY
=
dcs
->
wndOrgY
;
...
...
@@ -1372,40 +1378,76 @@ HCOLORSPACE WINAPI SetColorSpace( HDC hDC, HCOLORSPACE hColorSpace )
}
/***********************************************************************
* GetBoundsRect (GDI.194)
*/
UINT16
WINAPI
GetBoundsRect16
(
HDC16
hdc
,
LPRECT16
rect
,
UINT16
flags
)
{
return
DCB_RESET
|
DCB_DISABLE
;
/* bounding rectangle always empty and disabled*/
}
/***********************************************************************
* GetBoundsRect (GDI32.@)
*/
UINT
WINAPI
GetBoundsRect
(
HDC
hdc
,
LPRECT
rect
,
UINT
flags
)
{
FIXME
(
"(): stub
\n
"
);
return
DCB_RESET
;
/* bounding rectangle always empty */
}
UINT
ret
;
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
/***********************************************************************
* SetBoundsRect (GDI.193)
*/
UINT16
WINAPI
SetBoundsRect16
(
HDC16
hdc
,
const
RECT16
*
rect
,
UINT16
flags
)
{
if
(
(
flags
&
DCB_ACCUMULATE
)
||
(
flags
&
DCB_ENABLE
)
)
FIXME
(
"(%04x, %p, %04x): stub
\n
"
,
hdc
,
rect
,
flags
);
if
(
!
dc
)
return
0
;
if
(
rect
)
*
rect
=
dc
->
BoundsRect
;
ret
=
((
dc
->
flags
&
DC_BOUNDS_SET
)
?
DCB_SET
:
DCB_RESET
);
return
DCB_RESET
|
DCB_DISABLE
;
/* bounding rectangle always empty and disabled*/
if
(
flags
&
DCB_RESET
)
{
dc
->
BoundsRect
.
left
=
0
;
dc
->
BoundsRect
.
top
=
0
;
dc
->
BoundsRect
.
right
=
0
;
dc
->
BoundsRect
.
bottom
=
0
;
dc
->
flags
&=
~
DC_BOUNDS_SET
;
}
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
/***********************************************************************
* SetBoundsRect (GDI32.@)
*/
UINT
WINAPI
SetBoundsRect
(
HDC
hdc
,
const
RECT
*
rect
,
UINT
flags
)
{
FIXME
(
"(): stub
\n
"
);
return
DCB_DISABLE
;
/* bounding rectangle always empty */
UINT
ret
;
DC
*
dc
;
if
((
flags
&
DCB_ENABLE
)
&&
(
flags
&
DCB_DISABLE
))
return
0
;
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
0
;
ret
=
((
dc
->
flags
&
DC_BOUNDS_ENABLE
)
?
DCB_ENABLE
:
DCB_DISABLE
)
|
((
dc
->
flags
&
DC_BOUNDS_SET
)
?
DCB_SET
:
DCB_RESET
);
if
(
flags
&
DCB_RESET
)
{
dc
->
BoundsRect
.
left
=
0
;
dc
->
BoundsRect
.
top
=
0
;
dc
->
BoundsRect
.
right
=
0
;
dc
->
BoundsRect
.
bottom
=
0
;
dc
->
flags
&=
~
DC_BOUNDS_SET
;
}
if
((
flags
&
DCB_ACCUMULATE
)
&&
rect
&&
rect
->
left
<
rect
->
right
&&
rect
->
top
<
rect
->
bottom
)
{
if
(
dc
->
flags
&
DC_BOUNDS_SET
)
{
dc
->
BoundsRect
.
left
=
min
(
dc
->
BoundsRect
.
left
,
rect
->
left
);
dc
->
BoundsRect
.
top
=
min
(
dc
->
BoundsRect
.
top
,
rect
->
top
);
dc
->
BoundsRect
.
right
=
max
(
dc
->
BoundsRect
.
right
,
rect
->
right
);
dc
->
BoundsRect
.
bottom
=
max
(
dc
->
BoundsRect
.
bottom
,
rect
->
bottom
);
}
else
{
dc
->
BoundsRect
=
*
rect
;
dc
->
flags
|=
DC_BOUNDS_SET
;
}
}
if
(
flags
&
DCB_ENABLE
)
dc
->
flags
|=
DC_BOUNDS_ENABLE
;
if
(
flags
&
DCB_DISABLE
)
dc
->
flags
&=
~
DC_BOUNDS_ENABLE
;
GDI_ReleaseObj
(
hdc
);
return
ret
;
}
...
...
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