2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- #include " flutter/shell/platform/tizen/ tizen_input_method_context.h"
5
+ #include " tizen_input_method_context.h"
6
6
7
7
#include " flutter/shell/platform/tizen/flutter_tizen_engine.h"
8
- #include " flutter/shell/platform/tizen/tizen_log .h"
8
+ #include " flutter/shell/platform/tizen/logger .h"
9
9
10
10
namespace {
11
11
@@ -44,10 +44,8 @@ bool TextInputTypeToEcoreIMFInputPanelLayout(
44
44
*panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD;
45
45
} else if (text_input_type == " TextInputType.name" ||
46
46
text_input_type == " TextInputType.address" ) {
47
- FT_LOGW (
48
- " Actual requested text input type is [%s], but select "
49
- " TextInputType.text as fallback type" ,
50
- text_input_type.c_str ());
47
+ FT_LOG (Warn) << " The requested input type " << text_input_type
48
+ << " is not supported." ;
51
49
*panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
52
50
} else {
53
51
return false ;
@@ -138,6 +136,7 @@ void InputPanelStateChangedCallback(void* data,
138
136
139
137
self->OnInputPannelStateChanged (value);
140
138
}
139
+
141
140
} // namespace
142
141
143
142
namespace flutter {
@@ -158,18 +157,17 @@ void TizenInputMethodContext::Init() {
158
157
159
158
const char * imf_id = ecore_imf_context_default_id_get ();
160
159
if (imf_id == nullptr ) {
161
- // Try to get fallback id
160
+ // Try to get a fallback ID.
162
161
imf_id = GetEcoreImfContextAvailableID ();
163
162
}
164
-
165
163
if (imf_id == nullptr ) {
166
- FT_LOGE ( " Failed to get imf context id " ) ;
164
+ FT_LOG (Error) << " Failed to get an IMF context ID. " ;
167
165
return ;
168
166
}
169
167
170
168
imf_context_ = ecore_imf_context_add (imf_id);
171
169
if (imf_context_ == nullptr ) {
172
- FT_LOGE ( " Failed to create Ecore_IMF_Context" ) ;
170
+ FT_LOG (Error) << " Failed to create Ecore_IMF_Context. " ;
173
171
return ;
174
172
}
175
173
@@ -241,23 +239,24 @@ void TizenInputMethodContext::HideInputPannel() {
241
239
242
240
void TizenInputMethodContext::OnCommit (std::string str) {
243
241
if (!on_commit_callback_) {
244
- FT_LOGW ( " Please, set OnCommitCallback " ) ;
242
+ FT_LOG (Warn) << " SetOnCommitCallback() has not been called. " ;
245
243
return ;
246
244
}
247
245
on_commit_callback_ (str);
248
246
}
249
247
250
248
void TizenInputMethodContext::OnPreedit (std::string str, int cursor_pos) {
251
249
if (!on_preedit_callback_) {
252
- FT_LOGW ( " Please, set OnInputPannelStateChangedCallback " ) ;
250
+ FT_LOG (Warn) << " SetOnPreeditCallback() has not been called. " ;
253
251
return ;
254
252
}
255
253
on_preedit_callback_ (str, cursor_pos);
256
254
}
257
255
258
256
void TizenInputMethodContext::OnInputPannelStateChanged (int state) {
259
257
if (!on_input_pannel_state_changed_callback_) {
260
- FT_LOGW (" Please, set OnPreeditCallback" );
258
+ FT_LOG (Warn)
259
+ << " SetOnInputPannelStateChangedCallback() has not been called." ;
261
260
return ;
262
261
}
263
262
on_input_pannel_state_changed_callback_ (state);
@@ -310,4 +309,5 @@ void TizenInputMethodContext::SetInputPannelOptions() {
310
309
ecore_imf_context_input_panel_language_set (
311
310
imf_context_, ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC);
312
311
}
312
+
313
313
} // namespace flutter
0 commit comments