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
3009e03d
Commit
3009e03d
authored
Apr 25, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a SetBoundsRect driver entry point.
parent
30acd235
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
68 additions
and
22 deletions
+68
-22
dc.c
dlls/gdi32/dc.c
+16
-20
dc.c
dlls/gdi32/dibdrv/dc.c
+13
-0
driver.c
dlls/gdi32/driver.c
+6
-0
init.c
dlls/gdi32/enhmfdrv/init.c
+1
-0
init.c
dlls/gdi32/mfdrv/init.c
+10
-0
dc.c
dlls/gdi32/tests/dc.c
+4
-1
init.c
dlls/wineps.drv/init.c
+1
-0
init.c
dlls/winex11.drv/init.c
+14
-0
xrender.c
dlls/winex11.drv/xrender.c
+1
-0
gdi_driver.h
include/wine/gdi_driver.h
+2
-1
No files found.
dlls/gdi32/dc.c
View file @
3009e03d
...
...
@@ -222,22 +222,6 @@ void update_dc( DC *dc )
/***********************************************************************
* fetch_device_bounds
*
* Fetch and clear the device-specific bounds, and add them to the DC if necessary.
*/
static
BOOL
fetch_device_bounds
(
DC
*
dc
)
{
RECT
rect
;
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pGetBoundsRect
);
UINT
ret
=
physdev
->
funcs
->
pGetBoundsRect
(
physdev
,
&
rect
,
DCB_RESET
);
if
(
dc
->
bounds_enabled
&&
ret
==
DCB_SET
)
add_bounds_rect
(
&
dc
->
bounds
,
&
rect
);
return
ret
;
}
/***********************************************************************
* DC_DeleteObject
*/
static
BOOL
DC_DeleteObject
(
HGDIOBJ
handle
)
...
...
@@ -262,6 +246,8 @@ void DC_InitDC( DC* dc )
SelectObject
(
dc
->
hSelf
,
dc
->
hFont
);
update_dc_clipping
(
dc
);
SetVirtualResolution
(
dc
->
hSelf
,
0
,
0
,
0
,
0
);
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSetBoundsRect
);
physdev
->
funcs
->
pSetBoundsRect
(
physdev
,
&
dc
->
bounds
,
dc
->
bounds_enabled
?
DCB_ENABLE
:
DCB_DISABLE
);
}
...
...
@@ -1327,16 +1313,21 @@ HCOLORSPACE WINAPI SetColorSpace( HDC hDC, HCOLORSPACE hColorSpace )
*/
UINT
WINAPI
GetBoundsRect
(
HDC
hdc
,
LPRECT
rect
,
UINT
flags
)
{
UINT
ret
=
0
;
PHYSDEV
physdev
;
RECT
device_rect
;
UINT
ret
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
0
;
if
(
!
fetch_device_bounds
(
dc
))
physdev
=
GET_DC_PHYSDEV
(
dc
,
pGetBoundsRect
);
ret
=
physdev
->
funcs
->
pGetBoundsRect
(
physdev
,
&
device_rect
,
DCB_RESET
);
if
(
!
ret
)
{
release_dc_ptr
(
dc
);
return
0
;
}
if
(
dc
->
bounds_enabled
&&
ret
==
DCB_SET
)
add_bounds_rect
(
&
dc
->
bounds
,
&
device_rect
);
if
(
rect
)
{
...
...
@@ -1356,6 +1347,8 @@ UINT WINAPI GetBoundsRect(HDC hdc, LPRECT rect, UINT flags)
}
DPtoLP
(
hdc
,
(
POINT
*
)
rect
,
2
);
}
else
ret
=
0
;
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
dc
->
bounds
);
release_dc_ptr
(
dc
);
return
ret
;
...
...
@@ -1367,20 +1360,23 @@ UINT WINAPI GetBoundsRect(HDC hdc, LPRECT rect, UINT flags)
*/
UINT
WINAPI
SetBoundsRect
(
HDC
hdc
,
const
RECT
*
rect
,
UINT
flags
)
{
PHYSDEV
physdev
;
UINT
ret
;
DC
*
dc
;
if
((
flags
&
DCB_ENABLE
)
&&
(
flags
&
DCB_DISABLE
))
return
0
;
if
(
!
(
dc
=
get_dc_ptr
(
hdc
)))
return
0
;
if
(
!
fetch_device_bounds
(
dc
))
physdev
=
GET_DC_PHYSDEV
(
dc
,
pSetBoundsRect
);
ret
=
physdev
->
funcs
->
pSetBoundsRect
(
physdev
,
&
dc
->
bounds
,
flags
);
if
(
!
ret
)
{
release_dc_ptr
(
dc
);
return
0
;
}
ret
=
(
dc
->
bounds_enabled
?
DCB_ENABLE
:
DCB_DISABLE
)
|
(
is_rect_empty
(
&
dc
->
bounds
)
?
DCB_RE
SET
:
DCB_SET
);
(
is_rect_empty
(
&
dc
->
bounds
)
?
ret
&
DCB_
SET
:
DCB_SET
);
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
dc
->
bounds
);
...
...
dlls/gdi32/dibdrv/dc.c
View file @
3009e03d
...
...
@@ -408,6 +408,18 @@ static UINT dibdrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
}
/***********************************************************************
* dibdrv_SetBoundsRect
*/
static
UINT
dibdrv_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
if
(
is_rect_empty
(
&
pdev
->
bounds
))
return
DCB_RESET
;
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
pdev
->
bounds
);
return
DCB_SET
;
}
/***********************************************************************
* dibdrv_ChoosePixelFormat
*/
static
INT
dibdrv_ChoosePixelFormat
(
PHYSDEV
dev
,
const
PIXELFORMATDESCRIPTOR
*
pfd
)
...
...
@@ -690,6 +702,7 @@ const struct gdi_dc_funcs dib_driver =
NULL
,
/* pSetArcDirection */
NULL
,
/* pSetBkColor */
NULL
,
/* pSetBkMode */
dibdrv_SetBoundsRect
,
/* pSetBoundsRect */
dibdrv_SetDCBrushColor
,
/* pSetDCBrushColor */
dibdrv_SetDCPenColor
,
/* pSetDCPenColor */
NULL
,
/* pSetDIBitsToDevice */
...
...
dlls/gdi32/driver.c
View file @
3009e03d
...
...
@@ -562,6 +562,11 @@ static INT nulldrv_SetBkMode( PHYSDEV dev, INT mode )
return
mode
;
}
static
UINT
nulldrv_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
return
DCB_RESET
;
}
static
COLORREF
nulldrv_SetDCBrushColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
return
color
;
...
...
@@ -825,6 +830,7 @@ const struct gdi_dc_funcs null_driver =
nulldrv_SetArcDirection
,
/* pSetArcDirection */
nulldrv_SetBkColor
,
/* pSetBkColor */
nulldrv_SetBkMode
,
/* pSetBkMode */
nulldrv_SetBoundsRect
,
/* pSetBoundsRect */
nulldrv_SetDCBrushColor
,
/* pSetDCBrushColor */
nulldrv_SetDCPenColor
,
/* pSetDCPenColor */
nulldrv_SetDIBitsToDevice
,
/* pSetDIBitsToDevice */
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
3009e03d
...
...
@@ -137,6 +137,7 @@ static const struct gdi_dc_funcs EMFDRV_Funcs =
EMFDRV_SetArcDirection
,
/* pSetArcDirection */
EMFDRV_SetBkColor
,
/* pSetBkColor */
EMFDRV_SetBkMode
,
/* pSetBkMode */
NULL
,
/* pSetBoundsRect */
EMFDRV_SetDCBrushColor
,
/* pSetDCBrushColor*/
EMFDRV_SetDCPenColor
,
/* pSetDCPenColor*/
EMFDRV_SetDIBitsToDevice
,
/* pSetDIBitsToDevice */
...
...
dlls/gdi32/mfdrv/init.c
View file @
3009e03d
...
...
@@ -69,6 +69,15 @@ static UINT MFDRV_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
/******************************************************************
* MFDRV_SetBoundsRect
*/
static
UINT
MFDRV_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
return
0
;
}
/******************************************************************
* MFDRV_GetDeviceCaps
*
*A very simple implementation that returns DT_METAFILE
...
...
@@ -191,6 +200,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL
,
/* pSetArcDirection */
MFDRV_SetBkColor
,
/* pSetBkColor */
MFDRV_SetBkMode
,
/* pSetBkMode */
MFDRV_SetBoundsRect
,
/* pSetBoundsRect */
MFDRV_SetDCBrushColor
,
/* pSetDCBrushColor*/
MFDRV_SetDCPenColor
,
/* pSetDCPenColor*/
MFDRV_SetDIBitsToDevice
,
/* pSetDIBitsToDevice */
...
...
dlls/gdi32/tests/dc.c
View file @
3009e03d
...
...
@@ -368,6 +368,8 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
Rectangle
(
hdc
,
2
,
2
,
5
,
5
);
type
=
GetBoundsRect
(
hdc
,
&
rect
,
DCB_RESET
);
ok
(
!
type
,
"GetBoundsRect succeeded on %s
\n
"
,
descr
);
type
=
SetBoundsRect
(
hdc
,
&
rect
,
DCB_RESET
|
DCB_ENABLE
);
ok
(
!
type
,
"SetBoundsRect succeeded on %s
\n
"
,
descr
);
}
else
{
...
...
@@ -387,7 +389,8 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
else
ok
(
type
==
SIMPLEREGION
,
"GetClipBox returned %d on memdc for %s
\n
"
,
type
,
descr
);
SetBoundsRect
(
hdc
,
NULL
,
DCB_RESET
|
DCB_ENABLE
);
type
=
SetBoundsRect
(
hdc
,
NULL
,
DCB_RESET
|
DCB_ENABLE
);
ok
(
type
==
(
DCB_RESET
|
DCB_DISABLE
),
"SetBoundsRect returned %x
\n
"
,
type
);
SetMapMode
(
hdc
,
MM_TEXT
);
Rectangle
(
hdc
,
2
,
2
,
4
,
4
);
type
=
GetBoundsRect
(
hdc
,
&
rect
,
DCB_RESET
);
...
...
dlls/wineps.drv/init.c
View file @
3009e03d
...
...
@@ -919,6 +919,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL
,
/* pSetArcDirection */
PSDRV_SetBkColor
,
/* pSetBkColor */
NULL
,
/* pSetBkMode */
NULL
,
/* pSetBoundsRect */
PSDRV_SetDCBrushColor
,
/* pSetDCBrushColor */
PSDRV_SetDCPenColor
,
/* pSetDCPenColor */
NULL
,
/* pSetDIBitsToDevice */
...
...
dlls/winex11.drv/init.c
View file @
3009e03d
...
...
@@ -214,6 +214,19 @@ static UINT X11DRV_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
/***********************************************************************
* X11DRV_SetBoundsRect
*/
static
UINT
X11DRV_SetBoundsRect
(
PHYSDEV
dev
,
RECT
*
rect
,
UINT
flags
)
{
X11DRV_PDEVICE
*
pdev
=
get_x11drv_dev
(
dev
);
if
(
IsRectEmpty
(
&
pdev
->
bounds
))
return
DCB_RESET
;
if
(
flags
&
DCB_RESET
)
reset_bounds
(
&
pdev
->
bounds
);
return
DCB_SET
;
}
/***********************************************************************
* GetDeviceCaps (X11DRV.@)
*/
static
INT
X11DRV_GetDeviceCaps
(
PHYSDEV
dev
,
INT
cap
)
...
...
@@ -565,6 +578,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
NULL
,
/* pSetArcDirection */
NULL
,
/* pSetBkColor */
NULL
,
/* pSetBkMode */
X11DRV_SetBoundsRect
,
/* pSetBoundsRect */
X11DRV_SetDCBrushColor
,
/* pSetDCBrushColor */
X11DRV_SetDCPenColor
,
/* pSetDCPenColor */
NULL
,
/* pSetDIBitsToDevice */
...
...
dlls/winex11.drv/xrender.c
View file @
3009e03d
...
...
@@ -2747,6 +2747,7 @@ static const struct gdi_dc_funcs xrender_funcs =
NULL
,
/* pSetArcDirection */
NULL
,
/* pSetBkColor */
NULL
,
/* pSetBkMode */
NULL
,
/* pSetBoundsRect */
NULL
,
/* pSetDCBrushColor */
NULL
,
/* pSetDCPenColor */
NULL
,
/* pSetDIBitsToDevice */
...
...
include/wine/gdi_driver.h
View file @
3009e03d
...
...
@@ -163,6 +163,7 @@ struct gdi_dc_funcs
INT
(
*
pSetArcDirection
)(
PHYSDEV
,
INT
);
COLORREF
(
*
pSetBkColor
)(
PHYSDEV
,
COLORREF
);
INT
(
*
pSetBkMode
)(
PHYSDEV
,
INT
);
UINT
(
*
pSetBoundsRect
)(
PHYSDEV
,
RECT
*
,
UINT
);
COLORREF
(
*
pSetDCBrushColor
)(
PHYSDEV
,
COLORREF
);
COLORREF
(
*
pSetDCPenColor
)(
PHYSDEV
,
COLORREF
);
INT
(
*
pSetDIBitsToDevice
)(
PHYSDEV
,
INT
,
INT
,
DWORD
,
DWORD
,
INT
,
INT
,
UINT
,
UINT
,
LPCVOID
,
BITMAPINFO
*
,
UINT
);
...
...
@@ -212,7 +213,7 @@ struct gdi_dc_funcs
};
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 2
5
#define WINE_GDI_DRIVER_VERSION 2
6
static
inline
PHYSDEV
get_physdev_entry_point
(
PHYSDEV
dev
,
size_t
offset
)
{
...
...
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