Skip to content

Commit 223b9a1

Browse files
authored
Clean up flutter_platform_view.h (#257)
1 parent 1f9fe73 commit 223b9a1

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

shell/platform/tizen/BUILD.gn

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ _public_headers = [
3030
"public/flutter_tizen.h",
3131
]
3232

33+
config("relative_client_wrapper_headers") {
34+
include_dirs = [ "//flutter/shell/platform/common/client_wrapper/include" ]
35+
}
36+
3337
# Tizen native headers assume that the following include dirs are already
3438
# added to the compiler's search paths. Since we are not using the Tizen CLI
3539
# builder, we have to add them manually.
@@ -169,6 +173,7 @@ template("embedder") {
169173
[ "//flutter/shell/platform/common:desktop_library_implementation" ]
170174

171175
public_configs = [
176+
":relative_client_wrapper_headers",
172177
":rootstrap_include_dirs",
173178
"//flutter:config",
174179
]

shell/platform/tizen/channels/platform_view_channel.cc

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#include "platform_view_channel.h"
66

7-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/plugin_registrar.h"
8-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_message_codec.h"
97
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
108
#include "flutter/shell/platform/tizen/channels/encodable_value_holder.h"
119
#include "flutter/shell/platform/tizen/logger.h"

shell/platform/tizen/public/flutter_platform_view.h

+25-15
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,32 @@
55
#ifndef FLUTTER_SHELL_PLATFORM_TIZEN_PUBLIC_FLUTTER_PLATFORM_VIEW_H_
66
#define FLUTTER_SHELL_PLATFORM_TIZEN_PUBLIC_FLUTTER_PLATFORM_VIEW_H_
77

8-
#include <Ecore_IMF.h>
98
#include <Ecore_Input.h>
10-
#include <stddef.h>
9+
#include <flutter/plugin_registrar.h>
10+
#include <flutter/standard_message_codec.h>
1111
#include <stdint.h>
1212

1313
#include "flutter_export.h"
1414

15-
using ByteMessage = std::vector<uint8_t>;
16-
1715
class PlatformView {
1816
public:
1917
PlatformView(flutter::PluginRegistrar* registrar,
2018
int view_id,
2119
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+
2622
virtual ~PlatformView() {}
23+
2724
int GetViewId() { return view_id_; }
25+
2826
int GetTextureId() { return texture_id_; }
27+
2928
void SetTextureId(int texture_id) { texture_id_ = texture_id; }
29+
3030
flutter::PluginRegistrar* GetPluginRegistrar() { return registrar_; }
31+
3132
virtual void Dispose() = 0;
33+
3234
virtual void Resize(double width, double height) = 0;
3335
virtual void Touch(int type,
3436
int button,
@@ -37,35 +39,43 @@ class PlatformView {
3739
double dx,
3840
double dy) = 0;
3941
virtual void SetDirection(int direction) = 0;
42+
4043
virtual void ClearFocus() = 0;
41-
void SetFocus(bool f) { is_focused_ = f; }
44+
45+
void SetFocus(bool focused) { is_focused_ = focused; }
46+
4247
bool IsFocused() { return is_focused_; }
4348

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;
4751

4852
private:
4953
flutter::PluginRegistrar* registrar_;
5054
int view_id_;
51-
int texture_id_;
52-
bool is_focused_;
55+
int texture_id_ = 0;
56+
bool is_focused_ = false;
5357
};
5458

59+
using ByteMessage = std::vector<uint8_t>;
60+
5561
class PlatformViewFactory {
5662
public:
5763
PlatformViewFactory(flutter::PluginRegistrar* registrar)
5864
: registrar_(registrar),
5965
codec_(flutter::StandardMessageCodec::GetInstance(nullptr)) {}
66+
6067
virtual ~PlatformViewFactory() {}
68+
6169
flutter::PluginRegistrar* GetPluginRegistrar() { return registrar_; }
70+
6271
const flutter::MessageCodec<flutter::EncodableValue>& GetCodec() {
6372
return codec_;
6473
}
74+
6575
virtual PlatformView* Create(int view_id,
6676
double width,
6777
double height,
68-
const ByteMessage& parameters) = 0;
78+
const ByteMessage& params) = 0;
6979
virtual void Dispose() = 0;
7080

7181
private:

0 commit comments

Comments
 (0)