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
744237ec
Commit
744237ec
authored
Jul 17, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid.drv: Use nameless unions/structs.
parent
e8f82d4d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
73 deletions
+62
-73
device.c
dlls/wineandroid.drv/device.c
+5
-8
init.c
dlls/wineandroid.drv/init.c
+5
-7
keyboard.c
dlls/wineandroid.drv/keyboard.c
+15
-18
window.c
dlls/wineandroid.drv/window.c
+37
-40
No files found.
dlls/wineandroid.drv/device.c
View file @
744237ec
...
...
@@ -31,9 +31,6 @@
#include <sys/ioctl.h>
#include <unistd.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
...
...
@@ -1138,17 +1135,17 @@ NTSTATUS android_dispatch_ioctl( void *arg )
{
irp
->
IoStatus
.
Information
=
0
;
NtUserGetThreadInfo
()
->
driver_data
=
params
->
client_id
;
irp
->
IoStatus
.
u
.
Status
=
func
(
irp
->
AssociatedIrp
.
SystemBuffer
,
in_size
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
&
irp
->
IoStatus
.
Information
);
irp
->
IoStatus
.
Status
=
func
(
irp
->
AssociatedIrp
.
SystemBuffer
,
in_size
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
&
irp
->
IoStatus
.
Information
);
NtUserGetThreadInfo
()
->
driver_data
=
0
;
}
else
irp
->
IoStatus
.
u
.
Status
=
STATUS_INVALID_PARAMETER
;
else
irp
->
IoStatus
.
Status
=
STATUS_INVALID_PARAMETER
;
}
else
{
FIXME
(
"ioctl %x not supported
\n
"
,
(
int
)
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_NOT_SUPPORTED
;
irp
->
IoStatus
.
Status
=
STATUS_NOT_SUPPORTED
;
}
return
STATUS_SUCCESS
;
}
...
...
dlls/wineandroid.drv/init.c
View file @
744237ec
...
...
@@ -22,8 +22,6 @@
#pragma makedep unix
#endif
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "config.h"
#include <stdarg.h>
...
...
@@ -308,11 +306,11 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag
*/
BOOL
ANDROID_GetCurrentDisplaySettings
(
LPCWSTR
name
,
BOOL
is_primary
,
LPDEVMODEW
devmode
)
{
devmode
->
u2
.
dmDisplayFlags
=
0
;
devmode
->
u1
.
s2
.
dmPosition
.
x
=
0
;
devmode
->
u1
.
s2
.
dmPosition
.
y
=
0
;
devmode
->
u1
.
s2
.
dmDisplayOrientation
=
0
;
devmode
->
u1
.
s2
.
dmDisplayFixedOutput
=
0
;
devmode
->
dmDisplayFlags
=
0
;
devmode
->
dmPosition
.
x
=
0
;
devmode
->
dmPosition
.
y
=
0
;
devmode
->
dmDisplayOrientation
=
0
;
devmode
->
dmDisplayFixedOutput
=
0
;
devmode
->
dmPelsWidth
=
screen_width
;
devmode
->
dmPelsHeight
=
screen_height
;
devmode
->
dmBitsPerPel
=
screen_bpp
;
...
...
dlls/wineandroid.drv/keyboard.c
View file @
744237ec
...
...
@@ -30,9 +30,6 @@
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include "android.h"
...
...
@@ -676,12 +673,12 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags )
{
INPUT
input
;
input
.
type
=
INPUT_KEYBOARD
;
input
.
u
.
ki
.
wVk
=
vkey
;
input
.
u
.
ki
.
wScan
=
scan
;
input
.
u
.
ki
.
dwFlags
=
flags
;
input
.
u
.
ki
.
time
=
0
;
input
.
u
.
ki
.
dwExtraInfo
=
0
;
input
.
type
=
INPUT_KEYBOARD
;
input
.
ki
.
wVk
=
vkey
;
input
.
ki
.
wScan
=
scan
;
input
.
ki
.
dwFlags
=
flags
;
input
.
ki
.
time
=
0
;
input
.
ki
.
dwExtraInfo
=
0
;
__wine_send_input
(
hwnd
,
&
input
,
NULL
);
}
...
...
@@ -736,18 +733,18 @@ jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action, jint k
}
data
.
type
=
KEYBOARD_EVENT
;
data
.
kbd
.
hwnd
=
LongToHandle
(
win
);
data
.
kbd
.
lock_state
=
state
;
data
.
kbd
.
input
.
type
=
INPUT_KEYBOARD
;
data
.
kbd
.
input
.
u
.
ki
.
wVk
=
keycode_to_vkey
[
keycode
];
data
.
kbd
.
input
.
u
.
ki
.
wScan
=
vkey_to_scancode
[
data
.
kbd
.
input
.
u
.
ki
.
wVk
];
data
.
kbd
.
input
.
u
.
ki
.
time
=
0
;
data
.
kbd
.
input
.
u
.
ki
.
dwExtraInfo
=
0
;
data
.
kbd
.
input
.
u
.
ki
.
dwFlags
=
(
data
.
kbd
.
input
.
u
.
ki
.
wScan
&
0x100
)
?
KEYEVENTF_EXTENDEDKEY
:
0
;
if
(
action
==
AKEY_EVENT_ACTION_UP
)
data
.
kbd
.
input
.
u
.
ki
.
dwFlags
|=
KEYEVENTF_KEYUP
;
data
.
kbd
.
lock_state
=
state
;
data
.
kbd
.
input
.
type
=
INPUT_KEYBOARD
;
data
.
kbd
.
input
.
ki
.
wVk
=
keycode_to_vkey
[
keycode
];
data
.
kbd
.
input
.
ki
.
wScan
=
vkey_to_scancode
[
data
.
kbd
.
input
.
ki
.
wVk
];
data
.
kbd
.
input
.
ki
.
time
=
0
;
data
.
kbd
.
input
.
ki
.
dwExtraInfo
=
0
;
data
.
kbd
.
input
.
ki
.
dwFlags
=
(
data
.
kbd
.
input
.
ki
.
wScan
&
0x100
)
?
KEYEVENTF_EXTENDEDKEY
:
0
;
if
(
action
==
AKEY_EVENT_ACTION_UP
)
data
.
kbd
.
input
.
ki
.
dwFlags
|=
KEYEVENTF_KEYUP
;
p__android_log_print
(
ANDROID_LOG_INFO
,
"wine"
,
"keyboard_event: win %x code %u vkey %x scan %x meta %x"
,
win
,
keycode
,
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
data
.
kbd
.
input
.
u
.
ki
.
wScan
,
state
);
win
,
keycode
,
data
.
kbd
.
input
.
ki
.
wVk
,
data
.
kbd
.
input
.
ki
.
wScan
,
state
);
send_event
(
&
data
);
return
JNI_TRUE
;
}
...
...
dlls/wineandroid.drv/window.c
View file @
744237ec
...
...
@@ -24,9 +24,6 @@
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include <assert.h>
...
...
@@ -313,41 +310,41 @@ jboolean motion_event( JNIEnv *env, jobject obj, jint win, jint action, jint x,
data
.
type
=
MOTION_EVENT
;
data
.
motion
.
hwnd
=
LongToHandle
(
win
);
data
.
motion
.
input
.
type
=
INPUT_MOUSE
;
data
.
motion
.
input
.
u
.
mi
.
dx
=
x
;
data
.
motion
.
input
.
u
.
mi
.
dy
=
y
;
data
.
motion
.
input
.
u
.
mi
.
mouseData
=
0
;
data
.
motion
.
input
.
u
.
mi
.
time
=
0
;
data
.
motion
.
input
.
u
.
mi
.
dwExtraInfo
=
0
;
data
.
motion
.
input
.
u
.
mi
.
dwFlags
=
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
;
data
.
motion
.
input
.
type
=
INPUT_MOUSE
;
data
.
motion
.
input
.
mi
.
dx
=
x
;
data
.
motion
.
input
.
mi
.
dy
=
y
;
data
.
motion
.
input
.
mi
.
mouseData
=
0
;
data
.
motion
.
input
.
mi
.
time
=
0
;
data
.
motion
.
input
.
mi
.
dwExtraInfo
=
0
;
data
.
motion
.
input
.
mi
.
dwFlags
=
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
;
switch
(
action
&
AMOTION_EVENT_ACTION_MASK
)
{
case
AMOTION_EVENT_ACTION_DOWN
:
case
AMOTION_EVENT_ACTION_BUTTON_PRESS
:
if
((
state
&
~
prev_state
)
&
AMOTION_EVENT_BUTTON_PRIMARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTDOWN
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTDOWN
;
if
((
state
&
~
prev_state
)
&
AMOTION_EVENT_BUTTON_SECONDARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_RIGHTDOWN
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_RIGHTDOWN
;
if
((
state
&
~
prev_state
)
&
AMOTION_EVENT_BUTTON_TERTIARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_MIDDLEDOWN
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_MIDDLEDOWN
;
if
(
!
(
state
&
~
prev_state
))
/* touch event */
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTDOWN
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTDOWN
;
break
;
case
AMOTION_EVENT_ACTION_UP
:
case
AMOTION_EVENT_ACTION_CANCEL
:
case
AMOTION_EVENT_ACTION_BUTTON_RELEASE
:
if
((
prev_state
&
~
state
)
&
AMOTION_EVENT_BUTTON_PRIMARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTUP
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTUP
;
if
((
prev_state
&
~
state
)
&
AMOTION_EVENT_BUTTON_SECONDARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_RIGHTUP
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_RIGHTUP
;
if
((
prev_state
&
~
state
)
&
AMOTION_EVENT_BUTTON_TERTIARY
)
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_MIDDLEUP
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_MIDDLEUP
;
if
(
!
(
prev_state
&
~
state
))
/* touch event */
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTUP
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_LEFTUP
;
break
;
case
AMOTION_EVENT_ACTION_SCROLL
:
data
.
motion
.
input
.
u
.
mi
.
dwFlags
|=
MOUSEEVENTF_WHEEL
;
data
.
motion
.
input
.
u
.
mi
.
mouseData
=
vscroll
<
0
?
-
WHEEL_DELTA
:
WHEEL_DELTA
;
data
.
motion
.
input
.
mi
.
dwFlags
|=
MOUSEEVENTF_WHEEL
;
data
.
motion
.
input
.
mi
.
mouseData
=
vscroll
<
0
?
-
WHEEL_DELTA
:
WHEEL_DELTA
;
break
;
case
AMOTION_EVENT_ACTION_MOVE
:
case
AMOTION_EVENT_ACTION_HOVER_MOVE
:
...
...
@@ -438,9 +435,9 @@ static int process_events( DWORD mask )
case
SURFACE_CHANGED
:
break
;
/* always process it to unblock other threads */
case
MOTION_EVENT
:
if
(
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_RIGHTDOWN
|
MOUSEEVENTF_MIDDLEDOWN
|
MOUSEEVENTF_LEFTUP
|
MOUSEEVENTF_RIGHTUP
|
MOUSEEVENTF_MIDDLEUP
))
if
(
event
->
data
.
motion
.
input
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_RIGHTDOWN
|
MOUSEEVENTF_MIDDLEDOWN
|
MOUSEEVENTF_LEFTUP
|
MOUSEEVENTF_RIGHTUP
|
MOUSEEVENTF_MIDDLEUP
))
{
if
(
mask
&
QS_MOUSEBUTTON
)
break
;
}
...
...
@@ -488,23 +485,23 @@ static int process_events( DWORD mask )
{
HWND
capture
=
get_capture_window
();
if
(
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_RIGHTDOWN
|
MOUSEEVENTF_MIDDLEDOWN
))
if
(
event
->
data
.
motion
.
input
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTDOWN
|
MOUSEEVENTF_RIGHTDOWN
|
MOUSEEVENTF_MIDDLEDOWN
))
TRACE
(
"BUTTONDOWN pos %d,%d hwnd %p flags %x
\n
"
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
);
else
if
(
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTUP
|
MOUSEEVENTF_RIGHTUP
|
MOUSEEVENTF_MIDDLEUP
))
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dwFlags
);
else
if
(
event
->
data
.
motion
.
input
.
mi
.
dwFlags
&
(
MOUSEEVENTF_LEFTUP
|
MOUSEEVENTF_RIGHTUP
|
MOUSEEVENTF_MIDDLEUP
))
TRACE
(
"BUTTONUP pos %d,%d hwnd %p flags %x
\n
"
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
);
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dwFlags
);
else
TRACE
(
"MOUSEMOVE pos %d,%d hwnd %p flags %x
\n
"
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
);
if
(
!
capture
&&
(
event
->
data
.
motion
.
input
.
u
.
mi
.
dwFlags
&
MOUSEEVENTF_ABSOLUTE
))
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dx
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dy
,
event
->
data
.
motion
.
hwnd
,
(
int
)
event
->
data
.
motion
.
input
.
mi
.
dwFlags
);
if
(
!
capture
&&
(
event
->
data
.
motion
.
input
.
mi
.
dwFlags
&
MOUSEEVENTF_ABSOLUTE
))
{
RECT
rect
;
SetRect
(
&
rect
,
event
->
data
.
motion
.
input
.
u
.
mi
.
dx
,
event
->
data
.
motion
.
input
.
u
.
mi
.
dy
,
event
->
data
.
motion
.
input
.
u
.
mi
.
dx
+
1
,
event
->
data
.
motion
.
input
.
u
.
mi
.
dy
+
1
);
SetRect
(
&
rect
,
event
->
data
.
motion
.
input
.
mi
.
dx
,
event
->
data
.
motion
.
input
.
mi
.
dy
,
event
->
data
.
motion
.
input
.
mi
.
dx
+
1
,
event
->
data
.
motion
.
input
.
mi
.
dy
+
1
);
SERVER_START_REQ
(
update_window_zorder
)
{
...
...
@@ -522,15 +519,15 @@ static int process_events( DWORD mask )
break
;
case
KEYBOARD_EVENT
:
if
(
event
->
data
.
kbd
.
input
.
u
.
ki
.
dwFlags
&
KEYEVENTF_KEYUP
)
if
(
event
->
data
.
kbd
.
input
.
ki
.
dwFlags
&
KEYEVENTF_KEYUP
)
TRACE
(
"KEYUP hwnd %p vkey %x '%c' scancode %x
\n
"
,
event
->
data
.
kbd
.
hwnd
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wScan
);
event
->
data
.
kbd
.
input
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
ki
.
wScan
);
else
TRACE
(
"KEYDOWN hwnd %p vkey %x '%c' scancode %x
\n
"
,
event
->
data
.
kbd
.
hwnd
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
u
.
ki
.
wScan
);
update_keyboard_lock_state
(
event
->
data
.
kbd
.
input
.
u
.
ki
.
wVk
,
event
->
data
.
kbd
.
lock_state
);
event
->
data
.
kbd
.
input
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
ki
.
wVk
,
event
->
data
.
kbd
.
input
.
ki
.
wScan
);
update_keyboard_lock_state
(
event
->
data
.
kbd
.
input
.
ki
.
wVk
,
event
->
data
.
kbd
.
lock_state
);
__wine_send_input
(
0
,
&
event
->
data
.
kbd
.
input
,
NULL
);
break
;
...
...
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