]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/android/window.cpp
Android support
[libs/gui.git] / source / graphics / android / window.cpp
1 #include "display.h"
2 #include "display_private.h"
3 #include "window.h"
4 #include "window_private.h"
5
6 using namespace std;
7
8 namespace Msp {
9 namespace Graphics {
10
11 void Window::platform_init()
12 {
13         priv->window = 0;
14 }
15
16 void Window::platform_cleanup()
17 {
18 }
19
20 void Window::set_title(const string &)
21 {
22 }
23
24 void Window::platform_reconfigure(bool)
25 {
26 }
27
28 void Window::show_cursor(bool)
29 {
30 }
31
32 void Window::warp_pointer(int, int)
33 {
34 }
35
36 void Window::platform_show()
37 {
38 }
39
40 void Window::platform_hide()
41 {
42 }
43
44 bool Window::event(const Event &evnt)
45 {
46         switch(evnt.type)
47         {
48         case INPUT_EVENT:
49                 signal_input_event.emit(evnt);
50                 break;
51         case WINDOW_CREATED:
52                 priv->window = display.get_private().native_window;
53                 display.remove_window(*this);
54                 display.add_window(*this);
55                 priv->signal_window_acquired.emit(priv->window);
56                 break;
57         case WINDOW_RESIZED:
58                 options.width = ANativeWindow_getWidth(priv->window);
59                 options.height = ANativeWindow_getHeight(priv->window);
60                 signal_resize.emit(options.width, options.height);
61                 break;
62         case WINDOW_DESTROYED:
63                 priv->signal_window_lost.emit();
64                 priv->window = 0;
65                 display.remove_window(*this);
66                 display.add_window(*this);
67                 break;
68         default:
69                 return false;
70         }
71
72         return true;
73 }
74
75 } // namespace Graphics
76 } // namespace Msp