1212
1313static constexpr char kChannelName [] = " flutter/platform_views" ;
1414
15- std::string extractStringFromMap (const flutter::EncodableValue& arguments,
15+ std::string ExtractStringFromMap (const flutter::EncodableValue& arguments,
1616 const char * key) {
1717 if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
1818 flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -22,7 +22,7 @@ std::string extractStringFromMap(const flutter::EncodableValue& arguments,
2222 }
2323 return std::string ();
2424}
25- int extractIntFromMap (const flutter::EncodableValue& arguments,
25+ int ExtractIntFromMap (const flutter::EncodableValue& arguments,
2626 const char * key) {
2727 if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
2828 flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -31,7 +31,7 @@ int extractIntFromMap(const flutter::EncodableValue& arguments,
3131 }
3232 return -1 ;
3333}
34- double extractDoubleFromMap (const flutter::EncodableValue& arguments,
34+ double ExtractDoubleFromMap (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);
@@ -41,7 +41,7 @@ double extractDoubleFromMap(const flutter::EncodableValue& arguments,
4141 return -1 ;
4242}
4343
44- flutter::EncodableMap extractMapFromMap (
44+ flutter::EncodableMap ExtractMapFromMap (
4545 const flutter::EncodableValue& arguments, const char * key) {
4646 if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
4747 flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -52,7 +52,7 @@ flutter::EncodableMap extractMapFromMap(
5252 return flutter::EncodableMap ();
5353}
5454
55- flutter::EncodableList extractListFromMap (
55+ flutter::EncodableList ExtractListFromMap (
5656 const flutter::EncodableValue& arguments, const char * key) {
5757 if (std::holds_alternative<flutter::EncodableMap>(arguments)) {
5858 flutter::EncodableMap values = std::get<flutter::EncodableMap>(arguments);
@@ -77,34 +77,34 @@ PlatformViewChannel::PlatformViewChannel(flutter::BinaryMessenger* messenger)
7777PlatformViewChannel::~PlatformViewChannel () {
7878 // Clean-up view_factories_
7979 for (auto const & [viewType, viewFactory] : view_factories_) {
80- viewFactory->dispose ();
80+ viewFactory->Dispose ();
8181 }
8282 view_factories_.clear ();
8383
8484 // Clean-up view_instances_
8585 for (auto const & [viewId, viewInstance] : view_instances_) {
86- viewInstance->dispose ();
86+ viewInstance->Dispose ();
8787 delete viewInstance;
8888 }
8989 view_instances_.clear ();
9090}
9191
92- void PlatformViewChannel::sendKeyEvent (Ecore_Event_Key* key, bool is_down) {
93- auto instances = viewInstances ();
94- auto it = instances.find (currentFocusedViewId ());
92+ void PlatformViewChannel::SendKeyEvent (Ecore_Event_Key* key, bool is_down) {
93+ auto instances = ViewInstances ();
94+ auto it = instances.find (CurrentFocusedViewId ());
9595 if (it != instances.end ()) {
9696 if (is_down) {
97- it->second ->dispatchKeyDownEvent (key);
97+ it->second ->DispatchKeyDownEvent (key);
9898 } else {
99- it->second ->dispatchKeyUpEvent (key);
99+ it->second ->DispatchKeyUpEvent (key);
100100 }
101101 }
102102}
103103
104- int PlatformViewChannel::currentFocusedViewId () {
104+ int PlatformViewChannel::CurrentFocusedViewId () {
105105 for (auto it = view_instances_.begin (); it != view_instances_.end (); it++) {
106- if (it->second ->isFocused ()) {
107- return it->second ->getViewId ();
106+ if (it->second ->IsFocused ()) {
107+ return it->second ->GetViewId ();
108108 }
109109 }
110110 return -1 ;
@@ -117,10 +117,10 @@ void PlatformViewChannel::HandleMethodCall(
117117 const auto & arguments = *call.arguments ();
118118
119119 if (method == " create" ) {
120- std::string viewType = extractStringFromMap (arguments, " viewType" );
121- int viewId = extractIntFromMap (arguments, " id" );
122- double width = extractDoubleFromMap (arguments, " width" );
123- double height = extractDoubleFromMap (arguments, " height" );
120+ std::string viewType = ExtractStringFromMap (arguments, " viewType" );
121+ int viewId = ExtractIntFromMap (arguments, " id" );
122+ double width = ExtractDoubleFromMap (arguments, " width" );
123+ double height = ExtractDoubleFromMap (arguments, " height" );
124124
125125 LoggerD (
126126 " PlatformViewChannel create viewType: %s id: %d width: %f height: %f " ,
@@ -134,14 +134,14 @@ void PlatformViewChannel::HandleMethodCall(
134134 }
135135 auto it = view_factories_.find (viewType);
136136 if (it != view_factories_.end ()) {
137- auto focuesdView = view_instances_.find (currentFocusedViewId ());
137+ auto focuesdView = view_instances_.find (CurrentFocusedViewId ());
138138 if (focuesdView != view_instances_.end ()) {
139- focuesdView->second ->setFocus (false );
139+ focuesdView->second ->SetFocus (false );
140140 }
141141
142142 auto viewInstance =
143- it->second ->create (viewId, width, height, byteMessage);
144- viewInstance->setFocus (true );
143+ it->second ->Create (viewId, width, height, byteMessage);
144+ viewInstance->SetFocus (true );
145145 view_instances_.insert (
146146 std::pair<int , PlatformView*>(viewId, viewInstance));
147147
@@ -150,30 +150,30 @@ void PlatformViewChannel::HandleMethodCall(
150150 channel_->InvokeMethod (" viewFocused" , std::move (id));
151151 }
152152
153- result->Success (flutter::EncodableValue (viewInstance->getTextureId ()));
153+ result->Success (flutter::EncodableValue (viewInstance->GetTextureId ()));
154154 } else {
155155 LoggerE (" can't find view type = %s" , viewType.c_str ());
156156 result->Error (" 0" , " can't find view type" );
157157 }
158158 } else {
159- int viewId = extractIntFromMap (arguments, " id" );
159+ int viewId = ExtractIntFromMap (arguments, " id" );
160160 auto it = view_instances_.find (viewId);
161161 if (viewId >= 0 && it != view_instances_.end ()) {
162162 if (method == " dispose" ) {
163163 LoggerD (" PlatformViewChannel dispose" );
164- it->second ->dispose ();
164+ it->second ->Dispose ();
165165 result->Success ();
166166 } else if (method == " resize" ) {
167167 LoggerD (" PlatformViewChannel resize" );
168- double width = extractDoubleFromMap (arguments, " width" );
169- double height = extractDoubleFromMap (arguments, " height" );
170- it->second ->resize (width, height);
168+ double width = ExtractDoubleFromMap (arguments, " width" );
169+ double height = ExtractDoubleFromMap (arguments, " height" );
170+ it->second ->Resize (width, height);
171171 result->NotImplemented ();
172172 } else if (method == " touch" ) {
173173 int type, button;
174174 double x, y, dx, dy;
175175
176- flutter::EncodableList event = extractListFromMap (arguments, " event" );
176+ flutter::EncodableList event = ExtractListFromMap (arguments, " event" );
177177 if (event.size () != 6 ) {
178178 result->Error (" Invalid Arguments" );
179179 return ;
@@ -185,14 +185,14 @@ void PlatformViewChannel::HandleMethodCall(
185185 dx = std::get<double >(event[4 ]);
186186 dy = std::get<double >(event[5 ]);
187187
188- it->second ->touch (type, button, x, y, dx, dy);
188+ it->second ->Touch (type, button, x, y, dx, dy);
189189 result->Success ();
190190 } else if (method == " setDirection" ) {
191191 LoggerD (" PlatformViewChannel setDirection" );
192192 result->NotImplemented ();
193193 } else if (method == " clearFocus" ) {
194194 LoggerD (" PlatformViewChannel clearFocus" );
195- it->second ->clearFocus ();
195+ it->second ->ClearFocus ();
196196 result->NotImplemented ();
197197 } else {
198198 LoggerD (" Unimplemented method: %s" , method.c_str ());
0 commit comments