Skip to content

Commit e988cf0

Browse files
seungsoo47bwikbs
authored andcommitted
Change method name's first letter (#13)
* According to convention, I change the method name's the first letter from lower case to upper case.
1 parent cb8ee9b commit e988cf0

File tree

4 files changed

+45
-47
lines changed

4 files changed

+45
-47
lines changed

packages/webview_flutter/tizen/src/webview.cc

+29-29
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <Ecore_Input_Evas.h>
2222
#include <Ecore_IMF_Evas.h>
2323

24-
std::string extractStringFromMap(const flutter::EncodableValue& arguments,
24+
std::string ExtractStringFromMap(const flutter::EncodableValue& arguments,
2525
const char* key) {
2626
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
2727
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -31,7 +31,7 @@ std::string extractStringFromMap(const flutter::EncodableValue& arguments,
3131
}
3232
return std::string();
3333
}
34-
int extractIntFromMap(const flutter::EncodableValue& arguments,
34+
int ExtractIntFromMap(const flutter::EncodableValue& arguments,
3535
const char* key) {
3636
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
3737
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -40,7 +40,7 @@ int extractIntFromMap(const flutter::EncodableValue& arguments,
4040
}
4141
return -1;
4242
}
43-
double extractDoubleFromMap(const flutter::EncodableValue& arguments,
43+
double ExtractDoubleFromMap(const flutter::EncodableValue& arguments,
4444
const char* key) {
4545
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
4646
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -59,11 +59,11 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
5959
currentUrl_(initialUrl),
6060
width_(width),
6161
height_(height) {
62-
setTextureId(FlutterRegisterExternalTexture(textureRegistrar_));
63-
initWebView();
62+
SetTextureId(FlutterRegisterExternalTexture(textureRegistrar_));
63+
InitWebView();
6464
auto channel =
6565
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
66-
getPluginRegistrar()->messenger(), getChannelName(),
66+
GetPluginRegistrar()->messenger(), GetChannelName(),
6767
&flutter::StandardMethodCodec::GetInstance());
6868
channel->SetMethodCallHandler(
6969
[webview = this](const auto& call, auto result) {
@@ -72,24 +72,24 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
7272
webViewInstance_->LoadURL(currentUrl_);
7373
}
7474

75-
WebView::~WebView() { dispose(); }
75+
WebView::~WebView() { Dispose(); }
7676

77-
std::string WebView::getChannelName() {
78-
return "plugins.flutter.io/webview_" + std::to_string(getViewId());
77+
std::string WebView::GetChannelName() {
78+
return "plugins.flutter.io/webview_" + std::to_string(GetViewId());
7979
}
8080

81-
void WebView::dispose() {
82-
FlutterUnregisterExternalTexture(textureRegistrar_, getTextureId());
81+
void WebView::Dispose() {
82+
FlutterUnregisterExternalTexture(textureRegistrar_, GetTextureId());
8383

8484
webViewInstance_->Destroy();
8585
webViewInstance_ = nullptr;
8686
}
8787

88-
void WebView::resize(double width, double height) {
89-
LOG_DEBUG("WebView::resize width: %f height: %f \n", width, height);
88+
void WebView::Resize(double width, double height) {
89+
LOG_DEBUG("WebView::Resize width: %f height: %f \n", width, height);
9090
}
9191

92-
void WebView::touch(int type, int button, double x, double y, double dx,
92+
void WebView::Touch(int type, int button, double x, double y, double dx,
9393
double dy) {
9494
// LOG_DEBUG(
9595
// "Widget::Native::Touch type[%s],btn[%d],x[%f],y[%f],dx[%f],dy[%f]",
@@ -117,7 +117,7 @@ void WebView::touch(int type, int button, double x, double y, double dx,
117117
}
118118
}
119119

120-
static LWE::KeyValue ecoreEventKeyToKeyValue(const char* ecoreKeyString,
120+
static LWE::KeyValue EcoreEventKeyToKeyValue(const char* ecoreKeyString,
121121
bool isShiftPressed) {
122122
if (strcmp("Left", ecoreKeyString) == 0) {
123123
return LWE::KeyValue::ArrowLeftKey;
@@ -302,7 +302,7 @@ static LWE::KeyValue ecoreEventKeyToKeyValue(const char* ecoreKeyString,
302302
return LWE::KeyValue::UnidentifiedKey;
303303
}
304304

305-
void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
305+
void WebView::DispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
306306
std::string keyName = keyEvent->keyname;
307307
LOG_DEBUG("ECORE_EVENT_KEY_DOWN [%s, %d]\n", keyName.data(),
308308
(keyEvent->modifiers & 1) || (keyEvent->modifiers & 2));
@@ -313,7 +313,7 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
313313
// webViewInstance_->m_lastInputTime = Starfish::longTickCount();
314314
// }
315315

316-
if (!isFocused()) {
316+
if (!IsFocused()) {
317317
LOG_DEBUG("ignore keydown because we dont have focus");
318318
return;
319319
}
@@ -348,7 +348,7 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
348348
}
349349
}
350350

351-
auto keyValue = ecoreEventKeyToKeyValue(keyName.data(), false);
351+
auto keyValue = EcoreEventKeyToKeyValue(keyName.data(), false);
352352

353353
// if (keyValue >= LWE::KeyValue::ArrowDownKey &&
354354
// keyValue <= LWE::KeyValue::ArrowRightKey) {
@@ -385,12 +385,12 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
385385
}
386386
}
387387

388-
void WebView::dispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
388+
void WebView::DispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
389389
std::string keyName = keyEvent->keyname;
390390
LOG_DEBUG("ECORE_EVENT_KEY_UP [%s, %d]\n", keyName.data(),
391391
(keyEvent->modifiers & 1) || (keyEvent->modifiers & 2));
392392

393-
if (!isFocused()) {
393+
if (!IsFocused()) {
394394
LOG_DEBUG("ignore keyup because we dont have focus");
395395
return;
396396
}
@@ -400,7 +400,7 @@ void WebView::dispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
400400
keyName = "Escape";
401401
}
402402
#endif
403-
auto keyValue = ecoreEventKeyToKeyValue(keyName.data(), false);
403+
auto keyValue = EcoreEventKeyToKeyValue(keyName.data(), false);
404404

405405
// if (keyValue >= LWE::KeyValue::ArrowDownKey &&
406406
// keyValue <= LWE::KeyValue::ArrowRightKey) {
@@ -424,13 +424,13 @@ void WebView::dispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
424424
p);
425425
}
426426

427-
void WebView::clearFocus() { LOG_DEBUG("WebView::clearFocus \n"); }
427+
void WebView::ClearFocus() { LOG_DEBUG("WebView::clearFocus \n"); }
428428

429-
void WebView::setDirection(int direction) {
430-
LOG_DEBUG("WebView::setDirection direction: %d\n", direction);
429+
void WebView::SetDirection(int direction) {
430+
LOG_DEBUG("WebView::SetDirection direction: %d\n", direction);
431431
}
432432

433-
void WebView::initWebView() {
433+
void WebView::InitWebView() {
434434
if (webViewInstance_ != nullptr) {
435435
webViewInstance_->Destroy();
436436
webViewInstance_ = nullptr;
@@ -456,7 +456,7 @@ void WebView::initWebView() {
456456
webViewInstance_->RegisterOnRenderedHandler(
457457
[this](LWE::WebContainer* c, LWE::WebContainer::RenderResult r) {
458458
FlutterMarkExternalTextureFrameAvailable(textureRegistrar_,
459-
getTextureId(), tbmSurface_);
459+
GetTextureId(), tbmSurface_);
460460
tbm_surface_destroy(tbmSurface_);
461461
tbmSurface_ = nullptr;
462462
});
@@ -479,8 +479,8 @@ void WebView::HandleMethodCall(
479479
LOG_DEBUG("HandleMethodCall : %s \n ", methodName.c_str());
480480

481481
if (methodName.compare("loadUrl") == 0) {
482-
currentUrl_ = extractStringFromMap(arguments, "url");
483-
webViewInstance_->LoadURL(getCurrentUrl());
482+
currentUrl_ = ExtractStringFromMap(arguments, "url");
483+
webViewInstance_->LoadURL(GetCurrentUrl());
484484
result->Success();
485485
} else if (methodName.compare("updateSettings") == 0) {
486486
result->NotImplemented();
@@ -498,7 +498,7 @@ void WebView::HandleMethodCall(
498498
webViewInstance_->Reload();
499499
result->Success();
500500
} else if (methodName.compare("currentUrl") == 0) {
501-
result->Success(flutter::EncodableValue(getCurrentUrl().c_str()));
501+
result->Success(flutter::EncodableValue(GetCurrentUrl().c_str()));
502502
} else if (methodName.compare("evaluateJavascript") == 0) {
503503
result->NotImplemented();
504504
} else if (methodName.compare("addJavascriptChannels") == 0) {

packages/webview_flutter/tizen/src/webview.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ class WebView : public PlatformView {
1717
FlutterTextureRegistrar* textureRegistrar, double width,
1818
double height, const std::string initialUrl);
1919
~WebView();
20-
virtual void dispose() override;
21-
virtual void resize(double width, double height) override;
22-
virtual void touch(int type, int button, double x, double y, double dx,
20+
virtual void Dispose() override;
21+
virtual void Resize(double width, double height) override;
22+
virtual void Touch(int type, int button, double x, double y, double dx,
2323
double dy) override;
24-
virtual void setDirection(int direction) override;
25-
virtual void clearFocus() override;
24+
virtual void SetDirection(int direction) override;
25+
virtual void ClearFocus() override;
2626

2727
// Key input event
28-
virtual void dispatchKeyDownEvent(Ecore_Event_Key* key) override;
29-
virtual void dispatchKeyUpEvent(Ecore_Event_Key* key) override;
28+
virtual void DispatchKeyDownEvent(Ecore_Event_Key* key) override;
29+
virtual void DispatchKeyUpEvent(Ecore_Event_Key* key) override;
3030

3131
private:
3232
void HandleMethodCall(
3333
const flutter::MethodCall<flutter::EncodableValue>& method_call,
3434
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
35-
std::string getChannelName();
36-
const std::string& getCurrentUrl() { return currentUrl_; }
37-
void initWebView();
35+
std::string GetChannelName();
36+
const std::string& GetCurrentUrl() { return currentUrl_; }
37+
void InitWebView();
3838
FlutterTextureRegistrar* textureRegistrar_;
3939
LWE::WebContainer* webViewInstance_;
4040
std::string currentUrl_;

packages/webview_flutter/tizen/src/webview_factory.cc

+4-6
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ WebViewFactory::WebViewFactory(flutter::PluginRegistrar* registrar,
2828
cachePath.c_str());
2929
}
3030

31-
PlatformView* WebViewFactory::create(int viewId, double width, double height,
31+
PlatformView* WebViewFactory::Create(int viewId, double width, double height,
3232
const std::vector<uint8_t>& createParams) {
3333
std::string initialUrl = "about:blank";
34-
auto decoded_value = *getCodec().DecodeMessage(createParams);
34+
auto decoded_value = *GetCodec().DecodeMessage(createParams);
3535
if (std::holds_alternative<flutter::EncodableMap>(decoded_value)) {
3636
flutter::EncodableMap createParams =
3737
std::get<flutter::EncodableMap>(decoded_value);
@@ -41,10 +41,8 @@ PlatformView* WebViewFactory::create(int viewId, double width, double height,
4141
initialUrl = std::get<std::string>(initialUrlValue);
4242
}
4343
}
44-
return new WebView(getPluginRegistrar(), viewId, textureRegistrar_, width,
44+
return new WebView(GetPluginRegistrar(), viewId, textureRegistrar_, width,
4545
height, initialUrl);
4646
}
4747

48-
void WebViewFactory::dispose() {
49-
LWE::LWE::Finalize();
50-
}
48+
void WebViewFactory::Dispose() { LWE::LWE::Finalize(); }

packages/webview_flutter/tizen/src/webview_factory.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class WebViewFactory : public PlatformViewFactory {
66
public:
77
WebViewFactory(flutter::PluginRegistrar* registrar,
88
FlutterTextureRegistrar* textureRegistrar);
9-
virtual void dispose() override ;
10-
virtual PlatformView* create(
9+
virtual void Dispose() override;
10+
virtual PlatformView* Create(
1111
int viewId, double width, double height,
1212
const std::vector<uint8_t>& createParams) override;
1313

0 commit comments

Comments
 (0)