Skip to content

Commit 6850c77

Browse files
authored
Remove cbhm dependency (#64)
1 parent d53f19c commit 6850c77

File tree

4 files changed

+3
-75
lines changed

4 files changed

+3
-75
lines changed

flutter/shell/platform/tizen/BUILD.gn

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ config("flutter_tizen_config") {
1313
include_dirs = [
1414
"${sysroot_path}/usr/include/appfw",
1515
"${sysroot_path}/usr/include/base",
16-
"${sysroot_path}/usr/include/cbhm",
1716
"${sysroot_path}/usr/include/dali",
1817
"${sysroot_path}/usr/include/dali-adaptor",
1918
"${sysroot_path}/usr/include/dali-toolkit",
@@ -170,11 +169,6 @@ template("embedder") {
170169
]
171170
}
172171

173-
if (target_name == "flutter_tizen_mobile" ||
174-
target_name == "flutter_tizen_common") {
175-
libs += [ "cbhm" ]
176-
}
177-
178172
defines += invoker.defines
179173
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
180174

flutter/shell/platform/tizen/channels/platform_channel.cc

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,14 @@ PlatformChannel::PlatformChannel(BinaryMessenger* messenger,
8181
kChannelName,
8282
&JsonMethodCodec::GetInstance())),
8383
view_(view) {
84-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
85-
int ret = cbhm_open_service(&cbhm_handle_);
86-
if (ret != CBHM_ERROR_NONE) {
87-
FT_LOG(Error) << "Failed to initialize the clipboard service.";
88-
}
89-
#endif
90-
9184
channel_->SetMethodCallHandler(
9285
[this](const MethodCall<rapidjson::Document>& call,
9386
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
9487
HandleMethodCall(call, std::move(result));
9588
});
9689
}
9790

98-
PlatformChannel::~PlatformChannel() {
99-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
100-
cbhm_close_service(cbhm_handle_);
101-
#endif
102-
}
91+
PlatformChannel::~PlatformChannel() {}
10392

10493
void PlatformChannel::HandleMethodCall(
10594
const MethodCall<rapidjson::Document>& method_call,
@@ -231,56 +220,15 @@ void PlatformChannel::HapticFeedbackVibrate(const std::string& feedback_type) {
231220
}
232221

233222
void PlatformChannel::GetClipboardData(ClipboardCallback on_data) {
234-
on_clipboard_data_ = std::move(on_data);
235-
236-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
237-
int ret = cbhm_selection_get(
238-
cbhm_handle_, CBHM_SEL_TYPE_TEXT,
239-
[](cbhm_h cbhm_handle, const char* buf, size_t len,
240-
void* user_data) -> int {
241-
auto* self = static_cast<PlatformChannel*>(user_data);
242-
std::string data;
243-
if (buf) {
244-
data = std::string(buf, len);
245-
}
246-
self->on_clipboard_data_(data);
247-
self->on_clipboard_data_ = nullptr;
248-
return CBHM_ERROR_NONE;
249-
},
250-
this);
251-
if (ret != CBHM_ERROR_NONE) {
252-
if (ret == CBHM_ERROR_NO_DATA) {
253-
FT_LOG(Info) << "No clipboard data available.";
254-
} else {
255-
FT_LOG(Error) << "Failed to get clipboard data.";
256-
}
257-
on_clipboard_data_("");
258-
on_clipboard_data_ = nullptr;
259-
}
260-
#else
261-
on_clipboard_data_(clipboard_);
262-
on_clipboard_data_ = nullptr;
263-
#endif
223+
on_data(clipboard_);
264224
}
265225

266226
void PlatformChannel::SetClipboardData(const std::string& data) {
267-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
268-
int ret = cbhm_selection_set(cbhm_handle_, CBHM_SEL_TYPE_TEXT, data.c_str(),
269-
data.length());
270-
if (ret != CBHM_ERROR_NONE) {
271-
FT_LOG(Error) << "Failed to set clipboard data.";
272-
}
273-
#else
274227
clipboard_ = data;
275-
#endif
276228
}
277229

278230
bool PlatformChannel::ClipboardHasStrings() {
279-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
280-
return cbhm_item_count_get(cbhm_handle_) > 0;
281-
#else
282231
return !clipboard_.empty();
283-
#endif
284232
}
285233

286234
void PlatformChannel::RestoreSystemUiOverlays() {

flutter/shell/platform/tizen/channels/platform_channel.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
#ifndef EMBEDDER_PLATFORM_CHANNEL_H_
66
#define EMBEDDER_PLATFORM_CHANNEL_H_
77

8-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
9-
#include <cbhm.h>
10-
#endif
11-
128
#include <functional>
139
#include <memory>
1410
#include <string>
@@ -53,18 +49,10 @@ class PlatformChannel {
5349
// A reference to the native view managed by FlutterTizenView.
5450
TizenViewBase* view_ = nullptr;
5551

56-
#if defined(MOBILE_PROFILE) || defined(COMMON_PROFILE)
57-
// The clipboard history manager.
58-
cbhm_h cbhm_handle_ = nullptr;
59-
#else
6052
// A container that holds clipboard data during the engine lifetime.
6153
//
62-
// Only used by profiles that do not support the Tizen clipboard API
63-
// (wearable and TV).
54+
// TODO(JSUYA): Remove after implementing the ecore_wl2 based clipboard.
6455
std::string clipboard_;
65-
#endif
66-
67-
ClipboardCallback on_clipboard_data_ = nullptr;
6856
};
6957

7058
} // namespace flutter

tools/generate_sysroot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
'capi-system-system-settings-devel',
4444
'capi-ui-efl-util',
4545
'capi-ui-efl-util-devel',
46-
'cbhm',
47-
'cbhm-devel',
4846
'coregl',
4947
'coregl-devel',
5048
'ecore-con-devel',

0 commit comments

Comments
 (0)