]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/android/window.cpp
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / graphics / android / window.cpp
1 #include "window.h"
2 #include "window_private.h"
3 #include "display.h"
4 #include "display_private.h"
5
6 using namespace std;
7
8 namespace Msp {
9 namespace Graphics {
10
11 void Window::platform_init()
12 {
13 }
14
15 void Window::platform_cleanup()
16 {
17 }
18
19 void Window::set_title(const string &)
20 {
21 }
22
23 void Window::platform_reconfigure(bool)
24 {
25 }
26
27 void Window::show_cursor(bool)
28 {
29 }
30
31 void Window::warp_pointer(int, int)
32 {
33 }
34
35 void Window::platform_set_touch_input()
36 {
37 }
38
39 void Window::platform_show()
40 {
41 }
42
43 void Window::platform_hide()
44 {
45 }
46
47 bool Window::event(const Event &evnt)
48 {
49         switch(evnt.type)
50         {
51         case INPUT_EVENT:
52                 signal_input_event.emit(evnt);
53                 break;
54         case WINDOW_CREATED:
55                 priv->window = display.get_private().native_window;
56                 display.remove_window(*this);
57                 display.add_window(*this);
58                 priv->signal_window_acquired.emit(priv->window);
59                 signal_got_focus.emit();
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                 signal_lost_focus.emit();
68                 priv->signal_window_lost.emit();
69                 priv->window = nullptr;
70                 display.remove_window(*this);
71                 display.add_window(*this);
72                 break;
73         default:
74                 return false;
75         }
76
77         return true;
78 }
79
80 } // namespace Graphics
81 } // namespace Msp