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
07ada9a8
Commit
07ada9a8
authored
Jul 19, 2016
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use SetRect() instead of open coding it.
Signed-off-by:
Michael Stefaniuc
<
mstefani@redhat.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3223e152
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
47 deletions
+12
-47
button.c
dlls/user32/button.c
+1
-4
cursoricon.c
dlls/user32/cursoricon.c
+1
-4
dialog.c
dlls/user32/dialog.c
+1
-3
mdi.c
dlls/user32/mdi.c
+1
-4
menu.c
dlls/user32/menu.c
+1
-4
uitools.c
dlls/user32/uitools.c
+6
-23
win.c
dlls/user32/win.c
+1
-5
No files found.
dlls/user32/button.c
View file @
07ada9a8
...
...
@@ -690,11 +690,8 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
static
BOOL
CALLBACK
BUTTON_DrawTextCallback
(
HDC
hdc
,
LPARAM
lp
,
WPARAM
wp
,
int
cx
,
int
cy
)
{
RECT
rc
;
rc
.
left
=
0
;
rc
.
top
=
0
;
rc
.
right
=
cx
;
rc
.
bottom
=
cy
;
SetRect
(
&
rc
,
0
,
0
,
cx
,
cy
);
DrawTextW
(
hdc
,
(
LPCWSTR
)
lp
,
-
1
,
&
rc
,
(
UINT
)
wp
);
return
TRUE
;
}
...
...
dlls/user32/cursoricon.c
View file @
07ada9a8
...
...
@@ -2289,10 +2289,7 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
if
(
DoOffscreen
)
{
RECT
r
;
r
.
left
=
0
;
r
.
top
=
0
;
r
.
right
=
cxWidth
;
r
.
bottom
=
cxWidth
;
SetRect
(
&
r
,
0
,
0
,
cxWidth
,
cxWidth
);
if
(
!
(
hdc_dest
=
CreateCompatibleDC
(
hdc
)))
goto
failed
;
if
(
!
(
hB_off
=
CreateCompatibleBitmap
(
hdc
,
cxWidth
,
cyWidth
)))
...
...
dlls/user32/dialog.c
View file @
07ada9a8
...
...
@@ -517,9 +517,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
/* Create dialog main window */
rect
.
left
=
rect
.
top
=
0
;
rect
.
right
=
MulDiv
(
template
.
cx
,
xBaseUnit
,
4
);
rect
.
bottom
=
MulDiv
(
template
.
cy
,
yBaseUnit
,
8
);
SetRect
(
&
rect
,
0
,
0
,
MulDiv
(
template
.
cx
,
xBaseUnit
,
4
),
MulDiv
(
template
.
cy
,
yBaseUnit
,
8
));
if
(
template
.
style
&
DS_CONTROL
)
template
.
style
&=
~
(
WS_CAPTION
|
WS_SYSMENU
);
...
...
dlls/user32/mdi.c
View file @
07ada9a8
...
...
@@ -1244,10 +1244,7 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
RECT
rect
;
rect
.
left
=
0
;
rect
.
top
=
0
;
rect
.
right
=
LOWORD
(
lParam
);
rect
.
bottom
=
HIWORD
(
lParam
);
SetRect
(
&
rect
,
0
,
0
,
LOWORD
(
lParam
),
HIWORD
(
lParam
));
AdjustWindowRectEx
(
&
rect
,
GetWindowLongA
(
ci
->
hwndActiveChild
,
GWL_STYLE
),
0
,
GetWindowLongA
(
ci
->
hwndActiveChild
,
GWL_EXSTYLE
)
);
MoveWindow
(
ci
->
hwndActiveChild
,
rect
.
left
,
rect
.
top
,
...
...
dlls/user32/menu.c
View file @
07ada9a8
...
...
@@ -1343,10 +1343,7 @@ MENU_DrawScrollArrows(const POPUPMENU *lppop, HDC hdc)
hOrigBitmap
=
SelectObject
(
hdcMem
,
get_up_arrow_bitmap
());
else
hOrigBitmap
=
SelectObject
(
hdcMem
,
get_up_arrow_inactive_bitmap
());
rect
.
left
=
0
;
rect
.
top
=
0
;
rect
.
right
=
lppop
->
Width
;
rect
.
bottom
=
arrow_bitmap_height
;
SetRect
(
&
rect
,
0
,
0
,
lppop
->
Width
,
arrow_bitmap_height
);
FillRect
(
hdc
,
&
rect
,
GetSysColorBrush
(
COLOR_MENU
));
BitBlt
(
hdc
,
(
lppop
->
Width
-
arrow_bitmap_width
)
/
2
,
0
,
arrow_bitmap_width
,
arrow_bitmap_height
,
hdcMem
,
0
,
0
,
SRCCOPY
);
...
...
dlls/user32/uitools.c
View file @
07ada9a8
...
...
@@ -796,10 +796,7 @@ static BOOL UITOOLS95_DFC_ButtonRadio(HDC dc, LPRECT r, UINT uFlags)
/* Define bounding box */
i
=
14
*
SmallDiam
/
16
;
myr
.
left
=
xc
-
i
+
i
/
2
;
myr
.
right
=
xc
+
i
/
2
;
myr
.
top
=
yc
-
i
+
i
/
2
;
myr
.
bottom
=
yc
+
i
/
2
;
SetRect
(
&
myr
,
xc
-
i
+
i
/
2
,
yc
-
i
+
i
/
2
,
xc
+
i
/
2
,
yc
+
i
/
2
);
if
((
uFlags
&
0xff
)
==
DFCS_BUTTONRADIOMASK
)
{
...
...
@@ -840,10 +837,7 @@ static BOOL UITOOLS95_DFC_ButtonRadio(HDC dc, LPRECT r, UINT uFlags)
}
i
=
10
*
SmallDiam
/
16
;
myr
.
left
=
xc
-
i
+
i
/
2
;
myr
.
right
=
xc
+
i
/
2
;
myr
.
top
=
yc
-
i
+
i
/
2
;
myr
.
bottom
=
yc
+
i
/
2
;
SetRect
(
&
myr
,
xc
-
i
+
i
/
2
,
yc
-
i
+
i
/
2
,
xc
+
i
/
2
,
yc
+
i
/
2
);
i
=
!
(
uFlags
&
(
DFCS_INACTIVE
|
DFCS_PUSHED
))
?
COLOR_WINDOW
:
COLOR_BTNFACE
;
hpsave
=
SelectObject
(
dc
,
SYSCOLOR_GetPen
(
i
));
hbsave
=
SelectObject
(
dc
,
GetSysColorBrush
(
i
));
...
...
@@ -856,10 +850,7 @@ static BOOL UITOOLS95_DFC_ButtonRadio(HDC dc, LPRECT r, UINT uFlags)
{
i
=
6
*
SmallDiam
/
16
;
i
=
i
<
1
?
1
:
i
;
myr
.
left
=
xc
-
i
+
i
/
2
;
myr
.
right
=
xc
+
i
/
2
;
myr
.
top
=
yc
-
i
+
i
/
2
;
myr
.
bottom
=
yc
+
i
/
2
;
SetRect
(
&
myr
,
xc
-
i
+
i
/
2
,
yc
-
i
+
i
/
2
,
xc
+
i
/
2
,
yc
+
i
/
2
);
i
=
uFlags
&
DFCS_INACTIVE
?
COLOR_BTNSHADOW
:
COLOR_WINDOWTEXT
;
hbsave
=
SelectObject
(
dc
,
GetSysColorBrush
(
i
));
...
...
@@ -1189,10 +1180,7 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
yc
=
myr
.
top
+
SmallDiam
-
SmallDiam
/
2
;
i
=
234
*
SmallDiam
/
750
;
i
=
i
<
1
?
1
:
i
;
myr
.
left
=
xc
-
i
+
i
/
2
;
myr
.
right
=
xc
+
i
/
2
;
myr
.
top
=
yc
-
i
+
i
/
2
;
myr
.
bottom
=
yc
+
i
/
2
;
SetRect
(
&
myr
,
xc
-
i
+
i
/
2
,
yc
-
i
+
i
/
2
,
xc
+
i
/
2
,
yc
+
i
/
2
);
Pie
(
dc
,
myr
.
left
,
myr
.
top
,
myr
.
right
,
myr
.
bottom
,
xe
,
ye
,
xe
,
ye
);
break
;
...
...
@@ -1648,10 +1636,7 @@ static BOOL UITOOLS_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp
if
(
!
cy
)
cy
=
s
.
cy
;
}
rc
.
left
=
x
;
rc
.
top
=
y
;
rc
.
right
=
x
+
cx
;
rc
.
bottom
=
y
+
cy
;
SetRect
(
&
rc
,
x
,
y
,
x
+
cx
,
y
+
cy
);
if
(
flags
&
DSS_RIGHT
)
/* This one is not documented in the win32.hlp file */
dtflags
|=
DT_RIGHT
;
...
...
@@ -1679,9 +1664,7 @@ static BOOL UITOOLS_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp
if
(
!
memdc
)
goto
cleanup
;
hbmsave
=
SelectObject
(
memdc
,
hbm
);
if
(
!
hbmsave
)
goto
cleanup
;
rc
.
left
=
rc
.
top
=
0
;
rc
.
right
=
cx
;
rc
.
bottom
=
cy
;
SetRect
(
&
rc
,
0
,
0
,
cx
,
cy
);
if
(
!
FillRect
(
memdc
,
&
rc
,
GetStockObject
(
WHITE_BRUSH
)))
goto
cleanup
;
SetBkColor
(
memdc
,
RGB
(
255
,
255
,
255
));
SetTextColor
(
memdc
,
RGB
(
0
,
0
,
0
));
...
...
dlls/user32/win.c
View file @
07ada9a8
...
...
@@ -3567,11 +3567,7 @@ BOOL WINAPI DragDetect( HWND hWnd, POINT pt )
WORD
wDragWidth
=
GetSystemMetrics
(
SM_CXDRAG
);
WORD
wDragHeight
=
GetSystemMetrics
(
SM_CYDRAG
);
rect
.
left
=
pt
.
x
-
wDragWidth
;
rect
.
right
=
pt
.
x
+
wDragWidth
;
rect
.
top
=
pt
.
y
-
wDragHeight
;
rect
.
bottom
=
pt
.
y
+
wDragHeight
;
SetRect
(
&
rect
,
pt
.
x
-
wDragWidth
,
pt
.
y
-
wDragHeight
,
pt
.
x
+
wDragWidth
,
pt
.
y
+
wDragHeight
);
SetCapture
(
hWnd
);
...
...
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