Commit 744237ec authored by Alexandre Julliard's avatar Alexandre Julliard

wineandroid.drv: Use nameless unions/structs.

parent e8f82d4d
......@@ -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,
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;
}
......
......@@ -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;
......
......@@ -30,9 +30,6 @@
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include "android.h"
......@@ -677,11 +674,11 @@ 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.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 );
}
......@@ -738,16 +735,16 @@ jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action, jint k
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.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;
}
......
......@@ -24,9 +24,6 @@
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "config.h"
#include <assert.h>
......@@ -314,40 +311,40 @@ 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.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,7 +435,7 @@ 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|
if (event->data.motion.input.mi.dwFlags & (MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_RIGHTDOWN|
MOUSEEVENTF_MIDDLEDOWN|MOUSEEVENTF_LEFTUP|
MOUSEEVENTF_RIGHTUP|MOUSEEVENTF_MIDDLEUP))
{
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment