5
5
#ifndef FLUTTER_SHELL_PLATFORM_TIZEN_PUBLIC_FLUTTER_PLATFORM_VIEW_H_
6
6
#define FLUTTER_SHELL_PLATFORM_TIZEN_PUBLIC_FLUTTER_PLATFORM_VIEW_H_
7
7
8
- #include < Ecore_IMF.h>
9
8
#include < Ecore_Input.h>
10
- #include < stddef.h>
9
+ #include < flutter/plugin_registrar.h>
10
+ #include < flutter/standard_message_codec.h>
11
11
#include < stdint.h>
12
12
13
13
#include " flutter_export.h"
14
14
15
- using ByteMessage = std::vector<uint8_t >;
16
-
17
15
class PlatformView {
18
16
public:
19
17
PlatformView (flutter::PluginRegistrar* registrar,
20
18
int view_id,
21
19
void * platform_window)
22
- : registrar_(registrar),
23
- view_id_ (view_id),
24
- texture_id_(0 ),
25
- is_focused_(false ) {}
20
+ : registrar_(registrar), view_id_(view_id) {}
21
+
26
22
virtual ~PlatformView () {}
23
+
27
24
int GetViewId () { return view_id_; }
25
+
28
26
int GetTextureId () { return texture_id_; }
27
+
29
28
void SetTextureId (int texture_id) { texture_id_ = texture_id; }
29
+
30
30
flutter::PluginRegistrar* GetPluginRegistrar () { return registrar_; }
31
+
31
32
virtual void Dispose () = 0;
33
+
32
34
virtual void Resize (double width, double height) = 0;
33
35
virtual void Touch (int type,
34
36
int button,
@@ -37,35 +39,43 @@ class PlatformView {
37
39
double dx,
38
40
double dy) = 0;
39
41
virtual void SetDirection (int direction) = 0;
42
+
40
43
virtual void ClearFocus () = 0;
41
- void SetFocus (bool f) { is_focused_ = f; }
44
+
45
+ void SetFocus (bool focused) { is_focused_ = focused; }
46
+
42
47
bool IsFocused () { return is_focused_; }
43
48
44
- // Key input event
45
- virtual void DispatchKeyDownEvent (Ecore_Event_Key* key) = 0;
46
- virtual void DispatchKeyUpEvent (Ecore_Event_Key* key) = 0;
49
+ virtual void DispatchKeyDownEvent (Ecore_Event_Key* event) = 0;
50
+ virtual void DispatchKeyUpEvent (Ecore_Event_Key* event) = 0;
47
51
48
52
private:
49
53
flutter::PluginRegistrar* registrar_;
50
54
int view_id_;
51
- int texture_id_;
52
- bool is_focused_;
55
+ int texture_id_ = 0 ;
56
+ bool is_focused_ = false ;
53
57
};
54
58
59
+ using ByteMessage = std::vector<uint8_t >;
60
+
55
61
class PlatformViewFactory {
56
62
public:
57
63
PlatformViewFactory (flutter::PluginRegistrar* registrar)
58
64
: registrar_(registrar),
59
65
codec_ (flutter::StandardMessageCodec::GetInstance(nullptr )) {}
66
+
60
67
virtual ~PlatformViewFactory () {}
68
+
61
69
flutter::PluginRegistrar* GetPluginRegistrar () { return registrar_; }
70
+
62
71
const flutter::MessageCodec<flutter::EncodableValue>& GetCodec () {
63
72
return codec_;
64
73
}
74
+
65
75
virtual PlatformView* Create (int view_id,
66
76
double width,
67
77
double height,
68
- const ByteMessage& parameters ) = 0;
78
+ const ByteMessage& params ) = 0;
69
79
virtual void Dispose () = 0;
70
80
71
81
private:
0 commit comments