wineandroid: Allocate a native window wrapper in the client process for every window.
[wine.git] / dlls / wineandroid.drv / android.h
blob3d9ac5adee6cdf8b2e686437a3e7142f21c55910
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/native_window_jni.h>
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "winuser.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 * Android pseudo-device
54 extern void start_android_device(void) DECLSPEC_HIDDEN;
55 extern void register_native_window( HWND hwnd, struct ANativeWindow *win ) DECLSPEC_HIDDEN;
56 extern struct ANativeWindow *create_ioctl_window( HWND hwnd ) DECLSPEC_HIDDEN;
57 extern struct ANativeWindow *grab_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
58 extern void release_ioctl_window( struct ANativeWindow *window ) DECLSPEC_HIDDEN;
59 extern void destroy_ioctl_window( HWND hwnd ) DECLSPEC_HIDDEN;
60 extern int ioctl_window_pos_changed( HWND hwnd, const RECT *window_rect, const RECT *client_rect,
61 const RECT *visible_rect, UINT style, UINT flags,
62 HWND after, HWND owner ) DECLSPEC_HIDDEN;
65 /**************************************************************************
66 * USER driver
69 extern unsigned int screen_width DECLSPEC_HIDDEN;
70 extern unsigned int screen_height DECLSPEC_HIDDEN;
71 extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
72 extern MONITORINFOEXW default_monitor DECLSPEC_HIDDEN;
74 extern void init_monitors( int width, int height ) DECLSPEC_HIDDEN;
76 /* JNI entry points */
77 extern void desktop_changed( JNIEnv *env, jobject obj, jint width, jint height ) DECLSPEC_HIDDEN;
78 extern void surface_changed( JNIEnv *env, jobject obj, jint win, jobject surface ) DECLSPEC_HIDDEN;
80 enum event_type
82 DESKTOP_CHANGED,
83 SURFACE_CHANGED,
86 union event_data
88 enum event_type type;
89 struct
91 enum event_type type;
92 unsigned int width;
93 unsigned int height;
94 } desktop;
95 struct
97 enum event_type type;
98 HWND hwnd;
99 ANativeWindow *window;
100 unsigned int width;
101 unsigned int height;
102 } surface;
105 int send_event( const union event_data *data );
107 extern JavaVM *wine_get_java_vm(void);
108 extern jobject wine_get_java_object(void);
110 #endif /* __WINE_ANDROID_H */