]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/android/window.cpp
Touchscreen input device
[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_set_touch_input()
37 {
38 }
39
40 void Window::platform_show()
41 {
42 }
43
44 void Window::platform_hide()
45 {
46 }
47
48 bool Window::event(const Event &evnt)
49 {
50         switch(evnt.type)
51         {
52         case INPUT_EVENT:
53                 signal_input_event.emit(evnt);
54                 break;
55         case WINDOW_CREATED:
56                 priv->window = display.get_private().native_window;
57                 display.remove_window(*this);
58                 display.add_window(*this);
59                 priv->signal_window_acquired.emit(priv->window);
60                 break;
61         case WINDOW_RESIZED:
62                 options.width = ANativeWindow_getWidth(priv->window);
63                 options.height = ANativeWindow_getHeight(priv->window);
64                 signal_resize.emit(options.width, options.height);
65                 break;
66         case WINDOW_DESTROYED:
67                 priv->signal_window_lost.emit();
68                 priv->window = 0;
69                 display.remove_window(*this);
70                 display.add_window(*this);
71                 break;
72         default:
73                 return false;
74         }
75
76         return true;
77 }
78
79 } // namespace Graphics
80 } // namespace Msp