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 ) {
0 commit comments