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
59e5ce9d
Commit
59e5ce9d
authored
Aug 03, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement support for the ST_TILE background stretching mode.
parent
fa9c730c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
16 deletions
+53
-16
draw.c
dlls/uxtheme/draw.c
+53
-16
No files found.
dlls/uxtheme/draw.c
View file @
59e5ce9d
...
...
@@ -248,7 +248,7 @@ static HRESULT UXTHEME_LoadImage(HTHEME hTheme, HDC hdc, int iPartId, int iState
/***********************************************************************
* UXTHEME_StretchBlt
*
* Psudo TransparentBlt/StretchBlt
* Ps
e
udo TransparentBlt/StretchBlt
*/
static
inline
BOOL
UXTHEME_StretchBlt
(
HDC
hdcDst
,
int
nXOriginDst
,
int
nYOriginDst
,
int
nWidthDst
,
int
nHeightDst
,
HDC
hdcSrc
,
int
nXOriginSrc
,
int
nYOriginSrc
,
int
nWidthSrc
,
int
nHeightSrc
,
...
...
@@ -280,6 +280,47 @@ static inline BOOL UXTHEME_Blt(HDC hdcDest, int nXOriginDest, int nYOriginDest,
transparent
,
transcolor
);
}
/***********************************************************************
* UXTHEME_SizedBlt
*
* Stretches or tiles, depending on sizingtype.
*/
static
inline
BOOL
UXTHEME_SizedBlt
(
HDC
hdcDst
,
int
nXOriginDst
,
int
nYOriginDst
,
int
nWidthDst
,
int
nHeightDst
,
HDC
hdcSrc
,
int
nXOriginSrc
,
int
nYOriginSrc
,
int
nWidthSrc
,
int
nHeightSrc
,
int
sizingtype
)
{
if
(
sizingtype
==
ST_TILE
)
{
int
yOfs
=
nYOriginDst
;
int
yRemaining
=
nHeightDst
;
while
(
yRemaining
>
0
)
{
int
bltHeight
=
min
(
yRemaining
,
nHeightSrc
);
int
xOfs
=
nXOriginDst
;
int
xRemaining
=
nWidthDst
;
while
(
xRemaining
>
0
)
{
int
bltWidth
=
min
(
xRemaining
,
nWidthSrc
);
if
(
!
BitBlt
(
hdcDst
,
xOfs
,
yOfs
,
bltWidth
,
bltHeight
,
hdcSrc
,
nXOriginSrc
,
nYOriginSrc
,
SRCCOPY
))
return
FALSE
;
xOfs
+=
nWidthSrc
;
xRemaining
-=
nWidthSrc
;
}
yOfs
+=
nHeightSrc
;
yRemaining
-=
nHeightSrc
;
}
return
TRUE
;
}
else
{
return
StretchBlt
(
hdcDst
,
nXOriginDst
,
nYOriginDst
,
nWidthDst
,
nHeightDst
,
hdcSrc
,
nXOriginSrc
,
nYOriginSrc
,
nWidthSrc
,
nHeightSrc
,
SRCCOPY
);
}
}
/***********************************************************************
* UXTHEME_DrawImageGlyph
...
...
@@ -573,11 +614,7 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
goto
draw_error
;
}
if
(
sizingtype
==
ST_TILE
)
{
FIXME
(
"Tile
\n
"
);
sizingtype
=
ST_STRETCH
;
/* Just use stretch for now */
}
if
(
sizingtype
==
ST_STRETCH
)
{
if
((
sizingtype
==
ST_STRETCH
)
||
(
sizingtype
==
ST_TILE
))
{
int
destCenterWidth
=
dstSize
.
x
-
(
sm
.
cxLeftWidth
+
sm
.
cxRightWidth
);
int
srcCenterWidth
=
srcSize
.
x
-
(
sm
.
cxLeftWidth
+
sm
.
cxRightWidth
);
int
destCenterHeight
=
dstSize
.
y
-
(
sm
.
cyTopHeight
+
sm
.
cyBottomHeight
);
...
...
@@ -585,28 +622,28 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
if
(
destCenterWidth
>
0
)
{
/* Center top */
if
(
!
Stretch
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
0
,
destCenterWidth
,
sm
.
cyTopHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
top
,
srcCenterWidth
,
sm
.
cyTopHeight
,
SRCCOPY
))
{
if
(
!
UXTHEME_Sized
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
0
,
destCenterWidth
,
sm
.
cyTopHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
top
,
srcCenterWidth
,
sm
.
cyTopHeight
,
sizingtype
))
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
draw_error
;
}
/* Center bottom */
if
(
!
Stretch
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
dstSize
.
y
-
sm
.
cyBottomHeight
,
destCenterWidth
,
sm
.
cyBottomHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
bottom
-
sm
.
cyBottomHeight
,
srcCenterWidth
,
sm
.
cyTopHeight
,
SRCCOPY
))
{
if
(
!
UXTHEME_Sized
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
dstSize
.
y
-
sm
.
cyBottomHeight
,
destCenterWidth
,
sm
.
cyBottomHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
bottom
-
sm
.
cyBottomHeight
,
srcCenterWidth
,
sm
.
cyTopHeight
,
sizingtype
))
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
draw_error
;
}
}
if
(
destCenterHeight
>
0
)
{
/* Left center */
if
(
!
Stretch
Blt
(
hdcDst
,
0
,
sm
.
cyTopHeight
,
sm
.
cxLeftWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
left
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
sm
.
cxLeftWidth
,
srcCenterHeight
,
SRCCOPY
))
{
if
(
!
UXTHEME_Sized
Blt
(
hdcDst
,
0
,
sm
.
cyTopHeight
,
sm
.
cxLeftWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
left
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
sm
.
cxLeftWidth
,
srcCenterHeight
,
sizingtype
))
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
draw_error
;
}
/* Right center */
if
(
!
Stretch
Blt
(
hdcDst
,
dstSize
.
x
-
sm
.
cxRightWidth
,
sm
.
cyTopHeight
,
sm
.
cxRightWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
right
-
sm
.
cxRightWidth
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
sm
.
cxRightWidth
,
srcCenterHeight
,
SRCCOPY
))
{
if
(
!
UXTHEME_Sized
Blt
(
hdcDst
,
dstSize
.
x
-
sm
.
cxRightWidth
,
sm
.
cyTopHeight
,
sm
.
cxRightWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
right
-
sm
.
cxRightWidth
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
sm
.
cxRightWidth
,
srcCenterHeight
,
sizingtype
))
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
draw_error
;
}
...
...
@@ -616,8 +653,8 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
GetThemeBool
(
hTheme
,
iPartId
,
iStateId
,
TMT_BORDERONLY
,
&
borderonly
);
if
(
!
borderonly
)
{
/* Center */
if
(
!
Stretch
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
sm
.
cyTopHeight
,
destCenterWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
srcCenterWidth
,
srcCenterHeight
,
SRCCOPY
))
{
if
(
!
UXTHEME_Sized
Blt
(
hdcDst
,
sm
.
cxLeftWidth
,
sm
.
cyTopHeight
,
destCenterWidth
,
destCenterHeight
,
hdcSrc
,
rcSrc
.
left
+
sm
.
cxLeftWidth
,
rcSrc
.
top
+
sm
.
cyTopHeight
,
srcCenterWidth
,
srcCenterHeight
,
sizingtype
))
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
draw_error
;
}
...
...
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