mshtml: Implement onprogress for XMLHttpRequest.
[wine.git] / dlls / wineandroid.drv / android.h
blob91f6dc837916a02c64c05f42a7ecf097aea98794
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 "ntgdi.h"
35 #include "wine/gdi_driver.h"
36 #include "android_native.h"
39 /**************************************************************************
40 * Android interface
43 #define DECL_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN
44 DECL_FUNCPTR( __android_log_print );
45 DECL_FUNCPTR( ANativeWindow_fromSurface );
46 DECL_FUNCPTR( ANativeWindow_release );
47 #undef DECL_FUNCPTR
50 /**************************************************************************
51 * OpenGL driver
54 extern void update_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
55 extern void destroy_gl_drawable( HWND hwnd ) DECLSPEC_HIDDEN;
56 extern struct opengl_funcs *get_wgl_driver( UINT version ) DECLSPEC_HIDDEN;
59 /**************************************************************************
60 * Android pseudo-device
63 extern void start_android_device(void) DECLSPEC_HIDDEN;
64 extern void register_native_window( HWND hwnd, struct ANativeWindow *win, BOOL client ) DECLSPEC_HIDDEN;
65 extern struct ANativeWindow *create_ioctl_window( HWND hwnd, BOOL opengl, float scale ) DECLSPEC_HIDDEN;
66 extern struct ANativeWindow *grab_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
67 extern void release_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
68 extern void destroy_ioctl_window( HWND hwnd, BOOL opengl ) DECLSPEC_HIDDEN;
69 extern int ioctl_window_pos_changed( HWND hwnd, const RECT *window_rect, const RECT *client_rect,
70 const RECT *visible_rect, UINT style, UINT flags,
71 HWND after, HWND owner ) DECLSPEC_HIDDEN;
72 extern int ioctl_set_window_parent( HWND hwnd, HWND parent, float scale ) DECLSPEC_HIDDEN;
73 extern int ioctl_set_capture( HWND hwnd ) DECLSPEC_HIDDEN;
74 extern int ioctl_set_cursor( int id, int width, int height,
75 int hotspotx, int hotspoty, const unsigned int *bits ) DECLSPEC_HIDDEN;
78 /**************************************************************************
79 * USER driver
82 extern INT ANDROID_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) DECLSPEC_HIDDEN;
83 extern UINT ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl ) DECLSPEC_HIDDEN;
84 extern SHORT ANDROID_VkKeyScanEx( WCHAR ch, HKL hkl ) DECLSPEC_HIDDEN;
85 extern void ANDROID_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
86 extern BOOL ANDROID_CreateWindow( HWND hwnd ) DECLSPEC_HIDDEN;
87 extern void ANDROID_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN;
88 extern NTSTATUS ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
89 const LARGE_INTEGER *timeout,
90 DWORD mask, DWORD flags ) DECLSPEC_HIDDEN;
91 extern LRESULT ANDROID_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) DECLSPEC_HIDDEN;
92 extern void ANDROID_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
93 extern void ANDROID_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha,
94 DWORD flags ) DECLSPEC_HIDDEN;
95 extern void ANDROID_SetParent( HWND hwnd, HWND parent, HWND old_parent ) DECLSPEC_HIDDEN;
96 extern void ANDROID_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) DECLSPEC_HIDDEN;
97 extern void ANDROID_SetCapture( HWND hwnd, UINT flags ) DECLSPEC_HIDDEN;
98 extern void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) DECLSPEC_HIDDEN;
99 extern UINT ANDROID_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) DECLSPEC_HIDDEN;
100 extern BOOL ANDROID_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
101 const RECT *window_rect ) DECLSPEC_HIDDEN;
102 extern LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) DECLSPEC_HIDDEN;
103 extern BOOL ANDROID_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
104 const RECT *window_rect, const RECT *client_rect,
105 RECT *visible_rect, struct window_surface **surface ) DECLSPEC_HIDDEN;
106 extern void ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
107 const RECT *window_rect, const RECT *client_rect,
108 const RECT *visible_rect, const RECT *valid_rects,
109 struct window_surface *surface ) DECLSPEC_HIDDEN;
111 extern unsigned int screen_width DECLSPEC_HIDDEN;
112 extern unsigned int screen_height DECLSPEC_HIDDEN;
113 extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
114 extern MONITORINFOEXW default_monitor DECLSPEC_HIDDEN;
116 enum android_window_messages
118 WM_ANDROID_REFRESH = 0x80001000,
121 extern void init_gralloc( const struct hw_module_t *module ) DECLSPEC_HIDDEN;
122 extern HWND get_capture_window(void) DECLSPEC_HIDDEN;
123 extern void init_monitors( int width, int height ) DECLSPEC_HIDDEN;
124 extern void set_screen_dpi( DWORD dpi ) DECLSPEC_HIDDEN;
125 extern void update_keyboard_lock_state( WORD vkey, UINT state ) DECLSPEC_HIDDEN;
127 /* JNI entry points */
128 extern void desktop_changed( JNIEnv *env, jobject obj, jint width, jint height ) DECLSPEC_HIDDEN;
129 extern void config_changed( JNIEnv *env, jobject obj, jint dpi ) DECLSPEC_HIDDEN;
130 extern void surface_changed( JNIEnv *env, jobject obj, jint win, jobject surface,
131 jboolean client ) DECLSPEC_HIDDEN;
132 extern jboolean motion_event( JNIEnv *env, jobject obj, jint win, jint action,
133 jint x, jint y, jint state, jint vscroll ) DECLSPEC_HIDDEN;
134 extern jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action,
135 jint keycode, jint state ) DECLSPEC_HIDDEN;
137 enum event_type
139 DESKTOP_CHANGED,
140 CONFIG_CHANGED,
141 SURFACE_CHANGED,
142 MOTION_EVENT,
143 KEYBOARD_EVENT,
146 union event_data
148 enum event_type type;
149 struct
151 enum event_type type;
152 unsigned int width;
153 unsigned int height;
154 } desktop;
155 struct
157 enum event_type type;
158 unsigned int dpi;
159 } cfg;
160 struct
162 enum event_type type;
163 HWND hwnd;
164 ANativeWindow *window;
165 BOOL client;
166 unsigned int width;
167 unsigned int height;
168 } surface;
169 struct
171 enum event_type type;
172 HWND hwnd;
173 INPUT input;
174 } motion;
175 struct
177 enum event_type type;
178 HWND hwnd;
179 UINT lock_state;
180 INPUT input;
181 } kbd;
184 int send_event( const union event_data *data ) DECLSPEC_HIDDEN;
186 extern JavaVM **p_java_vm;
187 extern jobject *p_java_object;
188 extern unsigned short *p_java_gdt_sel;
190 /* string helpers */
192 static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
194 while (len--) *dst++ = (unsigned char)*src++;
197 #endif /* __WINE_ANDROID_H */