1
- #ifndef __NBL_C_WINDOW_ANDROID_H_INCLUDED__
2
- #define __NBL_C_WINDOW_ANDROID_H_INCLUDED__
1
+ #ifndef _NBL_C_WINDOW_ANDROID_H_INCLUDED_
2
+ #define _NBL_C_WINDOW_ANDROID_H_INCLUDED_
3
3
4
4
#include " nbl/ui/IWindowAndroid.h"
5
5
@@ -13,59 +13,60 @@ namespace nbl::ui
13
13
14
14
class CWindowAndroid : public IWindowAndroid
15
15
{
16
- public:
17
- constexpr static uint32_t CIRCULAR_BUFFER_CAPACITY = 256 ;
18
- explicit CWindowAndroid (SCreationParams&& params, native_handle_t anw) : m_native(anw), IWindowAndroid(std::move(params))
19
- {
20
- m_width = ANativeWindow_getWidth (anw);
21
- m_height = ANativeWindow_getHeight (anw);
22
- }
16
+ public:
17
+ constexpr static uint32_t CIRCULAR_BUFFER_CAPACITY = 256 ;
18
+ explicit CWindowAndroid (SCreationParams&& params, native_handle_t anw) : m_native(anw), IWindowAndroid(std::move(params))
19
+ {
20
+ m_width = ANativeWindow_getWidth (anw);
21
+ m_height = ANativeWindow_getHeight (anw);
22
+ }
23
+
24
+ virtual IClipboardManager* getClipboardManager () override { return nullptr ; }
25
+ virtual ICursorControl* getCursorControl () override { return nullptr ; }
23
26
24
- virtual IClipboardManager* getClipboardManager () { return nullptr ; }
25
- virtual ICursorControl* getCursorControl () { return nullptr ; }
26
- const native_handle_t & getNativeHandle () const override { return m_native; }
27
- void setCaption (const std::string_view& caption) override {}
28
- core::map<uint32_t , core::smart_refctd_ptr<IMouseEventChannel>> m_mouseEventChannels;
29
- core::map<uint32_t , core::smart_refctd_ptr<IKeyboardEventChannel>> m_keyboardEventChannels;
30
- bool hasMouseEventChannel (uint32_t deviceId)
31
- {
32
- return m_mouseEventChannels.find (deviceId) != m_mouseEventChannels.end ();
33
- }
34
- bool hasKeyboardEventChannel (uint32_t deviceId)
35
- {
36
- return m_keyboardEventChannels.find (deviceId) != m_keyboardEventChannels.end ();
37
- }
38
- bool addMouseEventChannel (uint32_t deviceId, const core::smart_refctd_ptr<IMouseEventChannel>& channel)
39
- {
40
- if (m_mouseEventChannels.find (deviceId) == m_mouseEventChannels.end ())
27
+ const native_handle_t & getNativeHandle () const override { return m_native; }
28
+ void setCaption (const std::string_view& caption) override {}
29
+ core::map<uint32_t , core::smart_refctd_ptr<IMouseEventChannel>> m_mouseEventChannels;
30
+ core::map<uint32_t , core::smart_refctd_ptr<IKeyboardEventChannel>> m_keyboardEventChannels;
31
+ bool hasMouseEventChannel (uint32_t deviceId)
41
32
{
42
- m_mouseEventChannels.emplace (deviceId, channel);
43
- return true ;
33
+ return m_mouseEventChannels.find (deviceId) != m_mouseEventChannels.end ();
44
34
}
45
- return false ;
46
- }
47
- bool addKeyboardEventChannel (uint32_t deviceId, const core::smart_refctd_ptr<IKeyboardEventChannel>& channel)
48
- {
49
- if (m_keyboardEventChannels.find (deviceId) == m_keyboardEventChannels.end ())
35
+ bool hasKeyboardEventChannel (uint32_t deviceId)
50
36
{
51
- m_keyboardEventChannels.emplace (deviceId, channel);
52
- return true ;
37
+ return m_keyboardEventChannels.find (deviceId) != m_keyboardEventChannels.end ();
38
+ }
39
+ bool addMouseEventChannel (uint32_t deviceId, const core::smart_refctd_ptr<IMouseEventChannel>& channel)
40
+ {
41
+ if (m_mouseEventChannels.find (deviceId) == m_mouseEventChannels.end ())
42
+ {
43
+ m_mouseEventChannels.emplace (deviceId, channel);
44
+ return true ;
45
+ }
46
+ return false ;
47
+ }
48
+ bool addKeyboardEventChannel (uint32_t deviceId, const core::smart_refctd_ptr<IKeyboardEventChannel>& channel)
49
+ {
50
+ if (m_keyboardEventChannels.find (deviceId) == m_keyboardEventChannels.end ())
51
+ {
52
+ m_keyboardEventChannels.emplace (deviceId, channel);
53
+ return true ;
54
+ }
55
+ return false ;
56
+ }
57
+ IMouseEventChannel* getMouseEventChannel (uint32_t deviceId)
58
+ {
59
+ auto ch = m_mouseEventChannels.find (deviceId);
60
+ return m_mouseEventChannels.find (deviceId)->second .get ();
53
61
}
54
- return false ;
55
- }
56
- IMouseEventChannel* getMouseEventChannel (uint32_t deviceId)
57
- {
58
- auto ch = m_mouseEventChannels.find (deviceId);
59
- return m_mouseEventChannels.find (deviceId)->second .get ();
60
- }
61
62
62
- IKeyboardEventChannel* getKeyboardEventChannel (uint32_t deviceId)
63
- {
64
- auto ch = m_keyboardEventChannels.find (deviceId);
65
- return m_keyboardEventChannels.find (deviceId)->second .get ();
66
- }
67
- private:
68
- native_handle_t m_native;
63
+ IKeyboardEventChannel* getKeyboardEventChannel (uint32_t deviceId)
64
+ {
65
+ auto ch = m_keyboardEventChannels.find (deviceId);
66
+ return m_keyboardEventChannels.find (deviceId)->second .get ();
67
+ }
68
+ private:
69
+ native_handle_t m_native;
69
70
};
70
71
71
72
}
0 commit comments