21
21
#include < Ecore_Input_Evas.h>
22
22
#include < Ecore_IMF_Evas.h>
23
23
24
- std::string extractStringFromMap (const flutter::EncodableValue& arguments,
24
+ std::string ExtractStringFromMap (const flutter::EncodableValue& arguments,
25
25
const char * key) {
26
26
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
27
27
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -31,7 +31,7 @@ std::string extractStringFromMap(const flutter::EncodableValue& arguments,
31
31
}
32
32
return std::string ();
33
33
}
34
- int extractIntFromMap (const flutter::EncodableValue& arguments,
34
+ int ExtractIntFromMap (const flutter::EncodableValue& arguments,
35
35
const char * key) {
36
36
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
37
37
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -40,7 +40,7 @@ int extractIntFromMap(const flutter::EncodableValue& arguments,
40
40
}
41
41
return -1 ;
42
42
}
43
- double extractDoubleFromMap (const flutter::EncodableValue& arguments,
43
+ double ExtractDoubleFromMap (const flutter::EncodableValue& arguments,
44
44
const char * key) {
45
45
if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
46
46
flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -59,11 +59,11 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
59
59
currentUrl_(initialUrl),
60
60
width_(width),
61
61
height_(height) {
62
- setTextureId (FlutterRegisterExternalTexture (textureRegistrar_));
63
- initWebView ();
62
+ SetTextureId (FlutterRegisterExternalTexture (textureRegistrar_));
63
+ InitWebView ();
64
64
auto channel =
65
65
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
66
- getPluginRegistrar ()->messenger (), getChannelName (),
66
+ GetPluginRegistrar ()->messenger (), GetChannelName (),
67
67
&flutter::StandardMethodCodec::GetInstance ());
68
68
channel->SetMethodCallHandler (
69
69
[webview = this ](const auto & call, auto result) {
@@ -72,24 +72,24 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
72
72
webViewInstance_->LoadURL (currentUrl_);
73
73
}
74
74
75
- WebView::~WebView () { dispose (); }
75
+ WebView::~WebView () { Dispose (); }
76
76
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 ());
79
79
}
80
80
81
- void WebView::dispose () {
82
- FlutterUnregisterExternalTexture (textureRegistrar_, getTextureId ());
81
+ void WebView::Dispose () {
82
+ FlutterUnregisterExternalTexture (textureRegistrar_, GetTextureId ());
83
83
84
84
webViewInstance_->Destroy ();
85
85
webViewInstance_ = nullptr ;
86
86
}
87
87
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);
90
90
}
91
91
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,
93
93
double dy) {
94
94
// LOG_DEBUG(
95
95
// "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,
117
117
}
118
118
}
119
119
120
- static LWE::KeyValue ecoreEventKeyToKeyValue (const char * ecoreKeyString,
120
+ static LWE::KeyValue EcoreEventKeyToKeyValue (const char * ecoreKeyString,
121
121
bool isShiftPressed) {
122
122
if (strcmp (" Left" , ecoreKeyString) == 0 ) {
123
123
return LWE::KeyValue::ArrowLeftKey;
@@ -302,7 +302,7 @@ static LWE::KeyValue ecoreEventKeyToKeyValue(const char* ecoreKeyString,
302
302
return LWE::KeyValue::UnidentifiedKey;
303
303
}
304
304
305
- void WebView::dispatchKeyDownEvent (Ecore_Event_Key* keyEvent) {
305
+ void WebView::DispatchKeyDownEvent (Ecore_Event_Key* keyEvent) {
306
306
std::string keyName = keyEvent->keyname ;
307
307
LOG_DEBUG (" ECORE_EVENT_KEY_DOWN [%s, %d]\n " , keyName.data (),
308
308
(keyEvent->modifiers & 1 ) || (keyEvent->modifiers & 2 ));
@@ -313,7 +313,7 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
313
313
// webViewInstance_->m_lastInputTime = Starfish::longTickCount();
314
314
// }
315
315
316
- if (!isFocused ()) {
316
+ if (!IsFocused ()) {
317
317
LOG_DEBUG (" ignore keydown because we dont have focus" );
318
318
return ;
319
319
}
@@ -348,7 +348,7 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
348
348
}
349
349
}
350
350
351
- auto keyValue = ecoreEventKeyToKeyValue (keyName.data (), false );
351
+ auto keyValue = EcoreEventKeyToKeyValue (keyName.data (), false );
352
352
353
353
// if (keyValue >= LWE::KeyValue::ArrowDownKey &&
354
354
// keyValue <= LWE::KeyValue::ArrowRightKey) {
@@ -385,12 +385,12 @@ void WebView::dispatchKeyDownEvent(Ecore_Event_Key* keyEvent) {
385
385
}
386
386
}
387
387
388
- void WebView::dispatchKeyUpEvent (Ecore_Event_Key* keyEvent) {
388
+ void WebView::DispatchKeyUpEvent (Ecore_Event_Key* keyEvent) {
389
389
std::string keyName = keyEvent->keyname ;
390
390
LOG_DEBUG (" ECORE_EVENT_KEY_UP [%s, %d]\n " , keyName.data (),
391
391
(keyEvent->modifiers & 1 ) || (keyEvent->modifiers & 2 ));
392
392
393
- if (!isFocused ()) {
393
+ if (!IsFocused ()) {
394
394
LOG_DEBUG (" ignore keyup because we dont have focus" );
395
395
return ;
396
396
}
@@ -400,7 +400,7 @@ void WebView::dispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
400
400
keyName = " Escape" ;
401
401
}
402
402
#endif
403
- auto keyValue = ecoreEventKeyToKeyValue (keyName.data (), false );
403
+ auto keyValue = EcoreEventKeyToKeyValue (keyName.data (), false );
404
404
405
405
// if (keyValue >= LWE::KeyValue::ArrowDownKey &&
406
406
// keyValue <= LWE::KeyValue::ArrowRightKey) {
@@ -424,13 +424,13 @@ void WebView::dispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
424
424
p);
425
425
}
426
426
427
- void WebView::clearFocus () { LOG_DEBUG (" WebView::clearFocus \n " ); }
427
+ void WebView::ClearFocus () { LOG_DEBUG (" WebView::clearFocus \n " ); }
428
428
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);
431
431
}
432
432
433
- void WebView::initWebView () {
433
+ void WebView::InitWebView () {
434
434
if (webViewInstance_ != nullptr ) {
435
435
webViewInstance_->Destroy ();
436
436
webViewInstance_ = nullptr ;
@@ -456,7 +456,7 @@ void WebView::initWebView() {
456
456
webViewInstance_->RegisterOnRenderedHandler (
457
457
[this ](LWE::WebContainer* c, LWE::WebContainer::RenderResult r) {
458
458
FlutterMarkExternalTextureFrameAvailable (textureRegistrar_,
459
- getTextureId (), tbmSurface_);
459
+ GetTextureId (), tbmSurface_);
460
460
tbm_surface_destroy (tbmSurface_);
461
461
tbmSurface_ = nullptr ;
462
462
});
@@ -479,8 +479,8 @@ void WebView::HandleMethodCall(
479
479
LOG_DEBUG (" HandleMethodCall : %s \n " , methodName.c_str ());
480
480
481
481
if (methodName.compare (" loadUrl" ) == 0 ) {
482
- currentUrl_ = extractStringFromMap (arguments, " url" );
483
- webViewInstance_->LoadURL (getCurrentUrl ());
482
+ currentUrl_ = ExtractStringFromMap (arguments, " url" );
483
+ webViewInstance_->LoadURL (GetCurrentUrl ());
484
484
result->Success ();
485
485
} else if (methodName.compare (" updateSettings" ) == 0 ) {
486
486
result->NotImplemented ();
@@ -498,7 +498,7 @@ void WebView::HandleMethodCall(
498
498
webViewInstance_->Reload ();
499
499
result->Success ();
500
500
} else if (methodName.compare (" currentUrl" ) == 0 ) {
501
- result->Success (flutter::EncodableValue (getCurrentUrl ().c_str ()));
501
+ result->Success (flutter::EncodableValue (GetCurrentUrl ().c_str ()));
502
502
} else if (methodName.compare (" evaluateJavascript" ) == 0 ) {
503
503
result->NotImplemented ();
504
504
} else if (methodName.compare (" addJavascriptChannels" ) == 0 ) {
0 commit comments