mshtml: Don't use fire_event to dispatch contextmenu event.
[wine.git] / dlls / wineandroid.drv / android.h
blob29daefeb2d4495768fa5b15e16c02b356d310582
1 /*
2 * Android driver definitions
4 * Copyright 2013 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_ANDROID_H
22 #define __WINE_ANDROID_H
24 #include <limits.h>
25 #include <stdarg.h>
26 #include <stdlib.h>
27 #include <jni.h>
28 #include <android/log.h>
29 #include <android/input.h>
30 #include <android/native_window_jni.h>
32 #include "windef.h"
33 #include "winbase.h"
34 #include "wingdi.h"
35 #include "winuser.h"
36 #include "wine/gdi_driver.h"
37 #include "android_native.h"
40 /**************************************************************************
41 * Android interface
44 #define DECL_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN
45 DECL_FUNCPTR( __android_log_print );
46 DECL_FUNCPTR( ANativeWindow_fromSurface );
47 DECL_FUNCPTR( ANativeWindow_release );
48 #undef DECL_FUNCPTR
51 /**************************************************************************
52 * OpenGL driver
55 extern void update_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
56 extern void destroy_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
57 extern struct opengl_funcs *get_wgl_driver( UINT version ) DECLSPEC_HIDDEN;
60 /**************************************************************************
61 * Android pseudo-device
64 extern void start_android_device(void) DECLSPEC_HIDDEN;
65 extern void register_native_window( HWND hwnd, struct ANativeWindow *win, BOOL client ) DECLSPEC_HIDDEN;
66 extern struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl ) DECLSPEC_HIDDEN;
67 extern struct ANativeWindow *grab_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
68 extern void release_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
69 extern void destroy_ioctl_window( HWND hwnd, BOOL opengl ) DECLSPEC_HIDDEN;
70 extern int ioctl_window_pos_changed( HWND hwnd, const RECT *window_rect, const RECT *client_rect,
71 const RECT *visible_rect, UINT style, UINT flags,
72 HWND after, HWND owner ) DECLSPEC_HIDDEN;
73 extern int ioctl_set_window_parent( HWND hwnd, HWND parent ) DECLSPEC_HIDDEN;
74 extern int ioctl_set_capture( HWND hwnd ) DECLSPEC_HIDDEN;
77 /**************************************************************************
78 * USER driver
81 extern unsigned int screen_width DECLSPEC_HIDDEN;
82 extern unsigned int screen_height DECLSPEC_HIDDEN;
83 extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
84 extern MONITORINFOEXW default_monitor DECLSPEC_HIDDEN;
86 enum android_window_messages
88 WM_ANDROID_REFRESH = 0x80001000,
91 extern HWND get_capture_window(void) DECLSPEC_HIDDEN;
92 extern void init_monitors( int width, int height ) DECLSPEC_HIDDEN;
93 extern void set_screen_dpi( DWORD dpi ) DECLSPEC_HIDDEN;
94 extern void update_keyboard_lock_state( WORD vkey, UINT state ) DECLSPEC_HIDDEN;
96 /* JNI entry points */
97 extern void desktop_changed( JNIEnv *env, jobject obj, jint width, jint height ) DECLSPEC_HIDDEN;
98 extern void config_changed( JNIEnv *env, jobject obj, jint dpi ) DECLSPEC_HIDDEN;
99 extern void surface_changed( JNIEnv *env, jobject obj, jint win, jobject surface,
100 jboolean client ) DECLSPEC_HIDDEN;
101 extern jboolean motion_event( JNIEnv *env, jobject obj, jint win, jint action,
102 jint x, jint y, jint state, jint vscroll ) DECLSPEC_HIDDEN;
103 extern jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action,
104 jint keycode, jint state ) DECLSPEC_HIDDEN;
106 enum event_type
108 DESKTOP_CHANGED,
109 CONFIG_CHANGED,
110 SURFACE_CHANGED,
111 MOTION_EVENT,
112 KEYBOARD_EVENT,
115 union event_data
117 enum event_type type;
118 struct
120 enum event_type type;
121 unsigned int width;
122 unsigned int height;
123 } desktop;
124 struct
126 enum event_type type;
127 unsigned int dpi;
128 } cfg;
129 struct
131 enum event_type type;
132 HWND hwnd;
133 ANativeWindow *window;
134 BOOL client;
135 unsigned int width;
136 unsigned int height;
137 } surface;
138 struct
140 enum event_type type;
141 HWND hwnd;
142 INPUT input;
143 } motion;
144 struct
146 enum event_type type;
147 HWND hwnd;
148 UINT lock_state;
149 INPUT input;
150 } kbd;
153 int send_event( const union event_data *data );
155 extern JavaVM *wine_get_java_vm(void);
156 extern jobject wine_get_java_object(void);
158 extern struct gralloc_module_t *gralloc_module;
160 #endif /* __WINE_ANDROID_H */