Skip to content

Commit

Permalink
Minor clean up
Browse files Browse the repository at this point in the history
Signed-off-by: swan.seo <[email protected]>
  • Loading branch information
Swanseo0 committed Feb 9, 2023
1 parent 0f5a10e commit cfd1f69
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 26 deletions.
12 changes: 6 additions & 6 deletions flutter/shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,9 @@ template("embedder") {
minor_version = 0
}

if (major_version >= 6 || (major_version >= 5 && minor_version >= 5)) {
sources += [
"tizen_autofill.cc",
]
if (((major_version >= 5 && minor_version >= 5) || major_version >= 6) &&
target_name != "flutter_tizen_wearable") {
sources += [ "tizen_autofill.cc" ]

libs += [
"capi-ui-autofill",
Expand All @@ -201,11 +200,12 @@ template("embedder") {
defines += [ "AUTOFILL_SUPPORT" ]
}

if ((major_version >= 7 || (major_version >= 6 && minor_version >= 5)) && target_name != "flutter_tizen_wearable") {
if (((major_version >= 6 && minor_version >= 5) || major_version >= 7) &&
target_name != "flutter_tizen_wearable") {
sources += [
"flutter_tizen_nui.cc",
"tizen_view_nui.cc",
"nui_autofill_popup.cc",
"tizen_view_nui.cc",
]

libs += [
Expand Down
3 changes: 1 addition & 2 deletions flutter/shell/platform/tizen/channels/text_input_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ constexpr char kMultilineInputType[] = "TextInputType.multiline";
constexpr char kUpdateEditingStateMethod[] =
"TextInputClient.updateEditingState";
constexpr char kPerformActionMethod[] = "TextInputClient.performAction";
constexpr char kRequestAutofillMethod[] = "TextInput.requestAutofill";
constexpr char kSetPlatformViewClient[] = "TextInput.setPlatformViewClient";
constexpr char kTextCapitalization[] = "textCapitalization";
constexpr char kTextEnableSuggestions[] = "enableSuggestions";
Expand All @@ -45,8 +46,6 @@ constexpr char kSelectionIsDirectionalKey[] = "selectionIsDirectional";
constexpr char kTextKey[] = "text";
constexpr char kBadArgumentError[] = "Bad Arguments";
constexpr char kInternalConsistencyError[] = "Internal Consistency Error";

constexpr char kRequestAutofillMethod[] = "TextInput.requestAutofill";
constexpr char kAutofill[] = "autofill";
constexpr char kUniqueIdentifier[] = "uniqueIdentifier";
constexpr char kHints[] = "hints";
Expand Down
6 changes: 4 additions & 2 deletions flutter/shell/platform/tizen/nui_autofill_popup.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2023 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "flutter/shell/platform/tizen/nui_autofill_popup.h"

#include <dali-toolkit/dali-toolkit.h>
Expand All @@ -6,8 +10,6 @@

#include "flutter/shell/platform/tizen/tizen_autofill.h"

#include "flutter/shell/platform/tizen/logger.h"

namespace flutter {
bool NuiAutofillPopup::OnTouch(Dali::Actor actor,
const Dali::TouchEvent& event) {
Expand Down
18 changes: 7 additions & 11 deletions flutter/shell/platform/tizen/tizen_autofill.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <autofill_common.h>

#include <functional>
#include <memory>

#include "flutter/shell/platform/tizen/logger.h"

Expand All @@ -17,15 +16,14 @@ TizenAutofill::TizenAutofill() {
}

TizenAutofill::~TizenAutofill() {
autofill_destroy(ah_);
autofill_destroy(autofill_);
}

void TizenAutofill::InitailizeAutofill() {
autofill_create(&ah_);
autofill_create(&autofill_);

int ret;
ret = autofill_connect(
ah_,
int ret = autofill_connect(
autofill_,
[](autofill_h ah, autofill_connection_status_e status, void* user_data) {
},
NULL);
Expand All @@ -34,7 +32,7 @@ void TizenAutofill::InitailizeAutofill() {
}

autofill_fill_response_set_received_cb(
ah_,
autofill_,
[](autofill_h ah, autofill_fill_response_h fill_response, void* data) {
int count = 0;
autofill_fill_response_get_group_count(fill_response, &count);
Expand Down Expand Up @@ -110,7 +108,7 @@ void TizenAutofill::RequestAutofill(std::vector<std::string> hints,
}
}

int ret = autofill_fill_request(ah_, view_info);
int ret = autofill_fill_request(autofill_, view_info);
if (ret != AUTOFILL_ERROR_NONE) {
FT_LOG(Error) << "autofill_fill_request error";
}
Expand Down Expand Up @@ -145,9 +143,7 @@ void TizenAutofill::RegisterAutofillItem(std::string view_id,
free(app_id);
}

int ret;

ret = autofill_commit(ah_, svi_h);
int ret = autofill_commit(autofill_, svi_h);
if (ret != AUTOFILL_ERROR_NONE) {
FT_LOG(Error) << "autofill_commit error";
}
Expand Down
2 changes: 1 addition & 1 deletion flutter/shell/platform/tizen/tizen_autofill.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TizenAutofill {
// TODO : implement convert flutter hint to tizen hint function
std::optional<autofill_hint_e> ConvertAutofillHint(std::string hint);

autofill_h ah_;
autofill_h autofill_;

std::vector<std::unique_ptr<AutofillItem>> response_items_;

Expand Down
1 change: 1 addition & 0 deletions flutter/shell/platform/tizen/tizen_view_nui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "flutter/shell/platform/tizen/tizen_view_nui.h"

#include <dali/devel-api/common/stage.h>

#include <string>

#include "flutter/shell/platform/tizen/logger.h"
Expand Down
15 changes: 11 additions & 4 deletions tools/generate_sysroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
'capi-system-system-settings-devel',
'capi-ui-efl-util',
'capi-ui-efl-util-devel',
'capi-ui-autofill',
'capi-ui-autofill-devel',
'capi-ui-autofill-common',
'capi-ui-autofill-common-devel',
'cbhm',
'cbhm-devel',
'coregl',
Expand Down Expand Up @@ -117,6 +113,14 @@
'wayland-devel',
]

# Only available for Tizen 5.5 and above.
autofill_packages = [
'capi-ui-autofill',
'capi-ui-autofill-devel',
'capi-ui-autofill-common',
'capi-ui-autofill-common-devel',
]

# Only available for Tizen 6.5 and above.
dali_packages = [
'dali2',
Expand Down Expand Up @@ -159,6 +163,9 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
existing_rpms = [f for f in download_path.iterdir() if f.suffix == '.rpm']

packages = base_packages + unified_packages
if api_version >= 5.5:
packages += autofill_packages

if api_version >= 6.5:
packages += dali_packages

Expand Down

0 comments on commit cfd1f69

Please sign in to comment.