Skip to content

Commit 043eedd

Browse files
committed
Make public members of FlutterTizenEngine class private (#161)
* Make public members of FlutterTizenEngine class private * Organize includes and clean up
1 parent 38721da commit 043eedd

11 files changed

+157
-123
lines changed

shell/platform/tizen/channels/app_control.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "app_control.h"
6-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_stream_handler_functions.h"
6+
77
#include "flutter/shell/platform/tizen/channels/app_control_channel.h"
88

99
namespace flutter {
@@ -109,8 +109,8 @@ AppControlResult AppControl::SetExtraData(const EncodableMap& map) {
109109
return AppControlResult();
110110
}
111111

112-
void AppControl::SetManager(AppControlChannel* m) {
113-
manager_ = m;
112+
void AppControl::SetManager(AppControlChannel* manager) {
113+
manager_ = manager;
114114
}
115115

116116
AppControlChannel* AppControl::GetManager() {

shell/platform/tizen/channels/app_control.h

-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66
#define EMBEDDER_APP_CONTROL_H_
77

88
#include <app.h>
9-
#include <queue>
10-
#include <unordered_map>
119

12-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
1310
#include "flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h"
1411
#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h"
15-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/method_channel.h"
16-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
1712
#include "flutter/shell/platform/tizen/logger.h"
1813

1914
namespace flutter {

shell/platform/tizen/channels/app_control_channel.cc

+8-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include <app.h>
6-
7-
#include "app_control.h"
85
#include "app_control_channel.h"
96

107
#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_stream_handler_functions.h"
8+
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
119

1210
namespace flutter {
1311

14-
static constexpr char kChannelName[] = "tizen/internal/app_control_method";
15-
static constexpr char kEventChannelName[] = "tizen/internal/app_control_event";
16-
static constexpr char kReplyChannelName[] = "tizen/internal/app_control_reply";
12+
namespace {
13+
14+
constexpr char kChannelName[] = "tizen/internal/app_control_method";
15+
constexpr char kEventChannelName[] = "tizen/internal/app_control_event";
16+
constexpr char kReplyChannelName[] = "tizen/internal/app_control_reply";
17+
18+
} // namespace
1719

1820
AppControlChannel::AppControlChannel(BinaryMessenger* messenger) {
1921
method_channel_ = std::make_unique<MethodChannel<EncodableValue>>(

shell/platform/tizen/channels/app_control_channel.h

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
#ifndef EMBEDDER_APP_CONTROL_CHANNEL_H_
66
#define EMBEDDER_APP_CONTROL_CHANNEL_H_
77

8+
#include <memory>
89
#include <queue>
910
#include <unordered_map>
1011

1112
#include "flutter/shell/platform/common/client_wrapper/include/flutter/binary_messenger.h"
1213
#include "flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h"
1314
#include "flutter/shell/platform/common/client_wrapper/include/flutter/event_channel.h"
1415
#include "flutter/shell/platform/common/client_wrapper/include/flutter/method_channel.h"
15-
#include "flutter/shell/platform/common/client_wrapper/include/flutter/standard_method_codec.h"
16+
#include "flutter/shell/platform/tizen/channels/app_control.h"
1617
#include "flutter/shell/platform/tizen/logger.h"
1718

18-
#include "app_control.h"
19-
2019
namespace flutter {
2120

2221
class AppControlChannel {
@@ -33,13 +32,11 @@ class AppControlChannel {
3332
private:
3433
void HandleMethodCall(const MethodCall<EncodableValue>& method_call,
3534
std::unique_ptr<MethodResult<EncodableValue>> result);
36-
void RegisterEventHandler(
37-
std::unique_ptr<flutter::EventSink<EncodableValue>> events);
35+
void RegisterEventHandler(std::unique_ptr<EventSink<EncodableValue>> events);
3836
void UnregisterEventHandler();
3937
void SendAlreadyQueuedEvents();
4038

41-
void RegisterReplyHandler(
42-
std::unique_ptr<flutter::EventSink<EncodableValue>> events);
39+
void RegisterReplyHandler(std::unique_ptr<EventSink<EncodableValue>> events);
4340
void UnregisterReplyHandler();
4441

4542
template <typename T>

shell/platform/tizen/flutter_tizen.cc

+16-14
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void FlutterDesktopShutdownEngine(FlutterDesktopEngineRef engine_ref) {
5656
void FlutterDesktopPluginRegistrarEnableInputBlocking(
5757
FlutterDesktopPluginRegistrarRef registrar,
5858
const char* channel) {
59-
registrar->engine->message_dispatcher->EnableInputBlockingForChannel(channel);
59+
registrar->engine->message_dispatcher()->EnableInputBlockingForChannel(
60+
channel);
6061
}
6162

6263
FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar(
@@ -65,17 +66,17 @@ FlutterDesktopPluginRegistrarRef FlutterDesktopGetPluginRegistrar(
6566
// Currently, one registrar acts as the registrar for all plugins, so the
6667
// name is ignored. It is part of the API to reduce churn in the future when
6768
// aligning more closely with the Flutter registrar system.
68-
return EngineFromHandle(engine)->GetPluginRegistrar();
69+
return EngineFromHandle(engine)->plugin_registrar();
6970
}
7071

7172
FlutterDesktopMessengerRef FlutterDesktopEngineGetMessenger(
7273
FlutterDesktopEngineRef engine) {
73-
return EngineFromHandle(engine)->messenger.get();
74+
return EngineFromHandle(engine)->messenger();
7475
}
7576

7677
FlutterDesktopMessengerRef FlutterDesktopPluginRegistrarGetMessenger(
7778
FlutterDesktopPluginRegistrarRef registrar) {
78-
return registrar->engine->messenger.get();
79+
return registrar->engine->messenger();
7980
}
8081

8182
void FlutterDesktopPluginRegistrarSetDestructionHandler(
@@ -114,14 +115,15 @@ void FlutterDesktopMessengerSetCallback(FlutterDesktopMessengerRef messenger,
114115
const char* channel,
115116
FlutterDesktopMessageCallback callback,
116117
void* user_data) {
117-
messenger->engine->message_dispatcher->SetMessageCallback(channel, callback,
118-
user_data);
118+
messenger->engine->message_dispatcher()->SetMessageCallback(channel, callback,
119+
user_data);
119120
}
120121

121122
void FlutterDesktopNotifyAppControl(FlutterDesktopEngineRef engine,
122123
void* app_control) {
123124
#ifndef __X64_SHELL__
124-
EngineFromHandle(engine)->app_control_channel->NotifyAppControl(app_control);
125+
EngineFromHandle(engine)->app_control_channel()->NotifyAppControl(
126+
app_control);
125127
#endif
126128
}
127129

@@ -134,27 +136,27 @@ void FlutterDesktopNotifyLowMemoryWarning(FlutterDesktopEngineRef engine) {
134136
}
135137

136138
void FlutterDesktopNotifyAppIsInactive(FlutterDesktopEngineRef engine) {
137-
EngineFromHandle(engine)->lifecycle_channel->AppIsInactive();
139+
EngineFromHandle(engine)->lifecycle_channel()->AppIsInactive();
138140
}
139141

140142
void FlutterDesktopNotifyAppIsResumed(FlutterDesktopEngineRef engine) {
141-
EngineFromHandle(engine)->lifecycle_channel->AppIsResumed();
143+
EngineFromHandle(engine)->lifecycle_channel()->AppIsResumed();
142144
}
143145

144146
void FlutterDesktopNotifyAppIsPaused(FlutterDesktopEngineRef engine) {
145-
EngineFromHandle(engine)->lifecycle_channel->AppIsPaused();
147+
EngineFromHandle(engine)->lifecycle_channel()->AppIsPaused();
146148
}
147149

148150
void FlutterDesktopNotifyAppIsDetached(FlutterDesktopEngineRef engine) {
149-
EngineFromHandle(engine)->lifecycle_channel->AppIsDetached();
151+
EngineFromHandle(engine)->lifecycle_channel()->AppIsDetached();
150152
}
151153

152154
void FlutterRegisterViewFactory(
153155
FlutterDesktopPluginRegistrarRef registrar,
154156
const char* view_type,
155157
std::unique_ptr<PlatformViewFactory> view_factory) {
156-
view_factory->SetWindow(registrar->engine->renderer->GetWindowHandle());
157-
registrar->engine->platform_view_channel->ViewFactories().insert(
158+
view_factory->SetWindow(registrar->engine->renderer()->GetWindowHandle());
159+
registrar->engine->platform_view_channel()->ViewFactories().insert(
158160
std::pair<std::string, std::unique_ptr<PlatformViewFactory>>(
159161
view_type, std::move(view_factory)));
160162
}
@@ -173,7 +175,7 @@ static FlutterDesktopTextureRegistrarRef HandleForTextureRegistrar(
173175

174176
FlutterDesktopTextureRegistrarRef FlutterDesktopRegistrarGetTextureRegistrar(
175177
FlutterDesktopPluginRegistrarRef registrar) {
176-
return HandleForTextureRegistrar(registrar->engine->GetTextureRegistrar());
178+
return HandleForTextureRegistrar(registrar->engine->texture_registrar());
177179
}
178180

179181
int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture(

0 commit comments

Comments
 (0)