2017-05-31 11:15:17 +02:00
|
|
|
/*
|
|
|
|
* Android driver definitions
|
|
|
|
*
|
|
|
|
* Copyright 2013 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_ANDROID_H
|
|
|
|
#define __WINE_ANDROID_H
|
|
|
|
|
|
|
|
#include <limits.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <jni.h>
|
2017-05-31 11:47:49 +02:00
|
|
|
#include <android/log.h>
|
2017-06-08 10:16:41 +02:00
|
|
|
#include <android/input.h>
|
2017-06-02 11:37:16 +02:00
|
|
|
#include <android/native_window_jni.h>
|
2017-05-31 11:15:17 +02:00
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "wine/gdi_driver.h"
|
2017-06-02 11:46:21 +02:00
|
|
|
#include "android_native.h"
|
2017-05-31 11:15:17 +02:00
|
|
|
|
|
|
|
|
2017-05-31 11:47:49 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* Android interface
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define DECL_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN
|
|
|
|
DECL_FUNCPTR( __android_log_print );
|
2017-06-02 11:37:16 +02:00
|
|
|
DECL_FUNCPTR( ANativeWindow_fromSurface );
|
|
|
|
DECL_FUNCPTR( ANativeWindow_release );
|
2017-05-31 11:47:49 +02:00
|
|
|
#undef DECL_FUNCPTR
|
|
|
|
|
|
|
|
|
2017-06-22 21:39:08 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* OpenGL driver
|
|
|
|
*/
|
|
|
|
|
2017-06-22 22:50:32 +02:00
|
|
|
extern void update_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
|
2017-06-22 21:39:08 +02:00
|
|
|
extern void destroy_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
|
|
|
|
extern struct opengl_funcs *get_wgl_driver( UINT version ) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
|
2017-06-01 09:39:20 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* Android pseudo-device
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern void start_android_device(void) DECLSPEC_HIDDEN;
|
2017-06-22 19:28:57 +02:00
|
|
|
extern void register_native_window( HWND hwnd, struct ANativeWindow *win, BOOL client ) DECLSPEC_HIDDEN;
|
2018-08-23 11:11:30 +02:00
|
|
|
extern struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl, float scale ) DECLSPEC_HIDDEN;
|
2017-06-05 12:21:26 +02:00
|
|
|
extern struct ANativeWindow *grab_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
|
|
|
|
extern void release_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
|
2017-06-22 19:28:57 +02:00
|
|
|
extern void destroy_ioctl_window( HWND hwnd, BOOL opengl ) DECLSPEC_HIDDEN;
|
2017-06-02 11:34:23 +02:00
|
|
|
extern int ioctl_window_pos_changed( HWND hwnd, const RECT *window_rect, const RECT *client_rect,
|
|
|
|
const RECT *visible_rect, UINT style, UINT flags,
|
|
|
|
HWND after, HWND owner ) DECLSPEC_HIDDEN;
|
2018-08-23 11:11:30 +02:00
|
|
|
extern int ioctl_set_window_parent( HWND hwnd, HWND parent, float scale ) DECLSPEC_HIDDEN;
|
2017-06-08 10:08:40 +02:00
|
|
|
extern int ioctl_set_capture( HWND hwnd ) DECLSPEC_HIDDEN;
|
2017-06-01 09:39:20 +02:00
|
|
|
|
|
|
|
|
2017-05-31 11:15:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* USER driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern unsigned int screen_width DECLSPEC_HIDDEN;
|
|
|
|
extern unsigned int screen_height DECLSPEC_HIDDEN;
|
|
|
|
extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
|
|
|
|
extern MONITORINFOEXW default_monitor DECLSPEC_HIDDEN;
|
|
|
|
|
2017-06-06 08:33:09 +02:00
|
|
|
enum android_window_messages
|
|
|
|
{
|
|
|
|
WM_ANDROID_REFRESH = 0x80001000,
|
|
|
|
};
|
|
|
|
|
2017-06-08 10:08:40 +02:00
|
|
|
extern HWND get_capture_window(void) DECLSPEC_HIDDEN;
|
2017-05-31 11:15:17 +02:00
|
|
|
extern void init_monitors( int width, int height ) DECLSPEC_HIDDEN;
|
2017-06-12 19:12:30 +02:00
|
|
|
extern void set_screen_dpi( DWORD dpi ) DECLSPEC_HIDDEN;
|
2017-06-09 09:21:52 +02:00
|
|
|
extern void update_keyboard_lock_state( WORD vkey, UINT state ) DECLSPEC_HIDDEN;
|
2017-05-31 11:15:17 +02:00
|
|
|
|
2017-05-31 11:47:49 +02:00
|
|
|
/* JNI entry points */
|
|
|
|
extern void desktop_changed( JNIEnv *env, jobject obj, jint width, jint height ) DECLSPEC_HIDDEN;
|
2017-06-12 19:12:30 +02:00
|
|
|
extern void config_changed( JNIEnv *env, jobject obj, jint dpi ) DECLSPEC_HIDDEN;
|
2017-06-22 19:36:54 +02:00
|
|
|
extern void surface_changed( JNIEnv *env, jobject obj, jint win, jobject surface,
|
|
|
|
jboolean client ) DECLSPEC_HIDDEN;
|
2017-06-08 10:16:41 +02:00
|
|
|
extern jboolean motion_event( JNIEnv *env, jobject obj, jint win, jint action,
|
|
|
|
jint x, jint y, jint state, jint vscroll ) DECLSPEC_HIDDEN;
|
2017-06-08 16:44:20 +02:00
|
|
|
extern jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action,
|
|
|
|
jint keycode, jint state ) DECLSPEC_HIDDEN;
|
2017-05-31 11:47:49 +02:00
|
|
|
|
2017-05-31 11:49:12 +02:00
|
|
|
enum event_type
|
|
|
|
{
|
|
|
|
DESKTOP_CHANGED,
|
2017-06-12 19:12:30 +02:00
|
|
|
CONFIG_CHANGED,
|
2017-06-02 11:37:16 +02:00
|
|
|
SURFACE_CHANGED,
|
2017-06-08 10:16:41 +02:00
|
|
|
MOTION_EVENT,
|
2017-06-08 16:44:20 +02:00
|
|
|
KEYBOARD_EVENT,
|
2017-05-31 11:49:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
union event_data
|
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
unsigned int width;
|
|
|
|
unsigned int height;
|
|
|
|
} desktop;
|
2017-06-02 11:37:16 +02:00
|
|
|
struct
|
2017-06-12 19:12:30 +02:00
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
unsigned int dpi;
|
|
|
|
} cfg;
|
|
|
|
struct
|
2017-06-02 11:37:16 +02:00
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
HWND hwnd;
|
|
|
|
ANativeWindow *window;
|
2017-06-22 19:36:54 +02:00
|
|
|
BOOL client;
|
2017-06-02 11:37:16 +02:00
|
|
|
unsigned int width;
|
|
|
|
unsigned int height;
|
|
|
|
} surface;
|
2017-06-08 10:16:41 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
HWND hwnd;
|
|
|
|
INPUT input;
|
|
|
|
} motion;
|
2017-06-08 16:44:20 +02:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
enum event_type type;
|
|
|
|
HWND hwnd;
|
2017-06-09 09:21:52 +02:00
|
|
|
UINT lock_state;
|
2017-06-08 16:44:20 +02:00
|
|
|
INPUT input;
|
|
|
|
} kbd;
|
2017-05-31 11:49:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
int send_event( const union event_data *data );
|
|
|
|
|
2017-05-31 11:15:17 +02:00
|
|
|
extern JavaVM *wine_get_java_vm(void);
|
|
|
|
extern jobject wine_get_java_object(void);
|
|
|
|
|
2017-06-06 08:30:23 +02:00
|
|
|
extern struct gralloc_module_t *gralloc_module;
|
|
|
|
|
2017-05-31 11:15:17 +02:00
|
|
|
#endif /* __WINE_ANDROID_H */
|