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
30d20795
Commit
30d20795
authored
Sep 02, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Set the DC layout to mirrored when the window has the WS_EX_LAYOUTRTL style.
parent
d0928761
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
painting.c
dlls/user32/painting.c
+2
-0
dce.c
dlls/user32/tests/dce.c
+82
-0
No files found.
dlls/user32/painting.c
View file @
30d20795
...
...
@@ -1030,6 +1030,8 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
bUpdateVisRgn
=
TRUE
;
}
if
(
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_LAYOUTRTL
)
SetLayout
(
dce
->
hdc
,
LAYOUT_RTL
);
dce
->
hwnd
=
hwnd
;
dce
->
flags
=
(
dce
->
flags
&
~
user_flags
)
|
(
flags
&
user_flags
);
...
...
dlls/user32/tests/dce.c
View file @
30d20795
...
...
@@ -424,6 +424,87 @@ static void test_invisible_create(void)
DestroyWindow
(
hwnd_owndc
);
}
static
void
test_dc_layout
(
void
)
{
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
DWORD
(
WINAPI
*
pGetLayout
)(
HDC
hdc
);
HWND
hwnd_cache_rtl
,
hwnd_owndc_rtl
,
hwnd_classdc_rtl
,
hwnd_classdc2_rtl
;
HDC
hdc
;
DWORD
layout
;
HMODULE
mod
=
GetModuleHandleA
(
"gdi32.dll"
);
pGetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"GetLayout"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"SetLayout"
);
if
(
!
pGetLayout
||
!
pSetLayout
)
{
win_skip
(
"Don't have SetLayout
\n
"
);
return
;
}
hdc
=
GetDC
(
hwnd_cache
);
pSetLayout
(
hdc
,
LAYOUT_RTL
);
layout
=
pGetLayout
(
hdc
);
ReleaseDC
(
hwnd_cache
,
hdc
);
if
(
!
layout
)
{
win_skip
(
"SetLayout not supported
\n
"
);
return
;
}
hwnd_cache_rtl
=
CreateWindowExA
(
WS_EX_LAYOUTRTL
,
"cache_class"
,
NULL
,
WS_OVERLAPPED
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
hwnd_owndc_rtl
=
CreateWindowExA
(
WS_EX_LAYOUTRTL
,
"owndc_class"
,
NULL
,
WS_OVERLAPPED
|
WS_VISIBLE
,
0
,
200
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
hwnd_classdc_rtl
=
CreateWindowExA
(
WS_EX_LAYOUTRTL
,
"classdc_class"
,
NULL
,
WS_OVERLAPPED
|
WS_VISIBLE
,
200
,
0
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
hwnd_classdc2_rtl
=
CreateWindowExA
(
WS_EX_LAYOUTRTL
,
"classdc_class"
,
NULL
,
WS_OVERLAPPED
|
WS_VISIBLE
,
200
,
200
,
100
,
100
,
0
,
0
,
GetModuleHandleA
(
0
),
NULL
);
hdc
=
GetDC
(
hwnd_cache_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
pSetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_cache_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_cache_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_cache
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
0
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_cache
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
pSetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_owndc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_owndc_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_owndc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
pSetLayout
(
hdc
,
0
);
ReleaseDC
(
hwnd_classdc_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc2_rtl
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_classdc2_rtl
,
hdc
);
hdc
=
GetDC
(
hwnd_classdc
);
layout
=
pGetLayout
(
hdc
);
ok
(
layout
==
LAYOUT_RTL
,
"wrong layout %x
\n
"
,
layout
);
ReleaseDC
(
hwnd_classdc_rtl
,
hdc
);
DestroyWindow
(
hwnd_classdc2_rtl
);
DestroyWindow
(
hwnd_classdc_rtl
);
DestroyWindow
(
hwnd_owndc_rtl
);
DestroyWindow
(
hwnd_cache_rtl
);
}
static
void
test_destroyed_window
(
void
)
{
HDC
dc
;
...
...
@@ -480,6 +561,7 @@ START_TEST(dce)
test_dc_visrgn
();
test_begin_paint
();
test_invisible_create
();
test_dc_layout
();
DestroyWindow
(
hwnd_classdc2
);
DestroyWindow
(
hwnd_classdc
);
...
...
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