• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=0884539e94e09316a9e516d93d77743c6287fe9a$
13 //
14 
15 #include "libcef_dll/cpptoc/views/view_cpptoc.h"
16 #include "libcef_dll/cpptoc/views/browser_view_cpptoc.h"
17 #include "libcef_dll/cpptoc/views/button_cpptoc.h"
18 #include "libcef_dll/cpptoc/views/label_button_cpptoc.h"
19 #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h"
20 #include "libcef_dll/cpptoc/views/panel_cpptoc.h"
21 #include "libcef_dll/cpptoc/views/scroll_view_cpptoc.h"
22 #include "libcef_dll/cpptoc/views/textfield_cpptoc.h"
23 #include "libcef_dll/cpptoc/views/window_cpptoc.h"
24 #include "libcef_dll/ctocpp/views/view_delegate_ctocpp.h"
25 #include "libcef_dll/shutdown_checker.h"
26 
27 namespace {
28 
29 // MEMBER FUNCTIONS - Body may be edited by hand.
30 
31 cef_browser_view_t* CEF_CALLBACK
view_as_browser_view(struct _cef_view_t * self)32 view_as_browser_view(struct _cef_view_t* self) {
33   shutdown_checker::AssertNotShutdown();
34 
35   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
36 
37   DCHECK(self);
38   if (!self)
39     return NULL;
40 
41   // Execute
42   CefRefPtr<CefBrowserView> _retval = CefViewCppToC::Get(self)->AsBrowserView();
43 
44   // Return type: refptr_same
45   return CefBrowserViewCppToC::Wrap(_retval);
46 }
47 
view_as_button(struct _cef_view_t * self)48 cef_button_t* CEF_CALLBACK view_as_button(struct _cef_view_t* self) {
49   shutdown_checker::AssertNotShutdown();
50 
51   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
52 
53   DCHECK(self);
54   if (!self)
55     return NULL;
56 
57   // Execute
58   CefRefPtr<CefButton> _retval = CefViewCppToC::Get(self)->AsButton();
59 
60   // Return type: refptr_same
61   return CefButtonCppToC::Wrap(_retval);
62 }
63 
view_as_panel(struct _cef_view_t * self)64 cef_panel_t* CEF_CALLBACK view_as_panel(struct _cef_view_t* self) {
65   shutdown_checker::AssertNotShutdown();
66 
67   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
68 
69   DCHECK(self);
70   if (!self)
71     return NULL;
72 
73   // Execute
74   CefRefPtr<CefPanel> _retval = CefViewCppToC::Get(self)->AsPanel();
75 
76   // Return type: refptr_same
77   return CefPanelCppToC::Wrap(_retval);
78 }
79 
view_as_scroll_view(struct _cef_view_t * self)80 cef_scroll_view_t* CEF_CALLBACK view_as_scroll_view(struct _cef_view_t* self) {
81   shutdown_checker::AssertNotShutdown();
82 
83   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
84 
85   DCHECK(self);
86   if (!self)
87     return NULL;
88 
89   // Execute
90   CefRefPtr<CefScrollView> _retval = CefViewCppToC::Get(self)->AsScrollView();
91 
92   // Return type: refptr_same
93   return CefScrollViewCppToC::Wrap(_retval);
94 }
95 
view_as_textfield(struct _cef_view_t * self)96 cef_textfield_t* CEF_CALLBACK view_as_textfield(struct _cef_view_t* self) {
97   shutdown_checker::AssertNotShutdown();
98 
99   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
100 
101   DCHECK(self);
102   if (!self)
103     return NULL;
104 
105   // Execute
106   CefRefPtr<CefTextfield> _retval = CefViewCppToC::Get(self)->AsTextfield();
107 
108   // Return type: refptr_same
109   return CefTextfieldCppToC::Wrap(_retval);
110 }
111 
112 cef_string_userfree_t CEF_CALLBACK
view_get_type_string(struct _cef_view_t * self)113 view_get_type_string(struct _cef_view_t* self) {
114   shutdown_checker::AssertNotShutdown();
115 
116   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
117 
118   DCHECK(self);
119   if (!self)
120     return NULL;
121 
122   // Execute
123   CefString _retval = CefViewCppToC::Get(self)->GetTypeString();
124 
125   // Return type: string
126   return _retval.DetachToUserFree();
127 }
128 
view_to_string(struct _cef_view_t * self,int include_children)129 cef_string_userfree_t CEF_CALLBACK view_to_string(struct _cef_view_t* self,
130                                                   int include_children) {
131   shutdown_checker::AssertNotShutdown();
132 
133   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
134 
135   DCHECK(self);
136   if (!self)
137     return NULL;
138 
139   // Execute
140   CefString _retval =
141       CefViewCppToC::Get(self)->ToString(include_children ? true : false);
142 
143   // Return type: string
144   return _retval.DetachToUserFree();
145 }
146 
view_is_valid(struct _cef_view_t * self)147 int CEF_CALLBACK view_is_valid(struct _cef_view_t* self) {
148   shutdown_checker::AssertNotShutdown();
149 
150   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
151 
152   DCHECK(self);
153   if (!self)
154     return 0;
155 
156   // Execute
157   bool _retval = CefViewCppToC::Get(self)->IsValid();
158 
159   // Return type: bool
160   return _retval;
161 }
162 
view_is_attached(struct _cef_view_t * self)163 int CEF_CALLBACK view_is_attached(struct _cef_view_t* self) {
164   shutdown_checker::AssertNotShutdown();
165 
166   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
167 
168   DCHECK(self);
169   if (!self)
170     return 0;
171 
172   // Execute
173   bool _retval = CefViewCppToC::Get(self)->IsAttached();
174 
175   // Return type: bool
176   return _retval;
177 }
178 
view_is_same(struct _cef_view_t * self,struct _cef_view_t * that)179 int CEF_CALLBACK view_is_same(struct _cef_view_t* self,
180                               struct _cef_view_t* that) {
181   shutdown_checker::AssertNotShutdown();
182 
183   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
184 
185   DCHECK(self);
186   if (!self)
187     return 0;
188   // Verify param: that; type: refptr_same
189   DCHECK(that);
190   if (!that)
191     return 0;
192 
193   // Execute
194   bool _retval = CefViewCppToC::Get(self)->IsSame(CefViewCppToC::Unwrap(that));
195 
196   // Return type: bool
197   return _retval;
198 }
199 
200 struct _cef_view_delegate_t* CEF_CALLBACK
view_get_delegate(struct _cef_view_t * self)201 view_get_delegate(struct _cef_view_t* self) {
202   shutdown_checker::AssertNotShutdown();
203 
204   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
205 
206   DCHECK(self);
207   if (!self)
208     return NULL;
209 
210   // Execute
211   CefRefPtr<CefViewDelegate> _retval = CefViewCppToC::Get(self)->GetDelegate();
212 
213   // Return type: refptr_diff
214   return CefViewDelegateCToCpp::Unwrap(_retval);
215 }
216 
view_get_window(struct _cef_view_t * self)217 struct _cef_window_t* CEF_CALLBACK view_get_window(struct _cef_view_t* self) {
218   shutdown_checker::AssertNotShutdown();
219 
220   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
221 
222   DCHECK(self);
223   if (!self)
224     return NULL;
225 
226   // Execute
227   CefRefPtr<CefWindow> _retval = CefViewCppToC::Get(self)->GetWindow();
228 
229   // Return type: refptr_same
230   return CefWindowCppToC::Wrap(_retval);
231 }
232 
view_get_id(struct _cef_view_t * self)233 int CEF_CALLBACK view_get_id(struct _cef_view_t* self) {
234   shutdown_checker::AssertNotShutdown();
235 
236   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
237 
238   DCHECK(self);
239   if (!self)
240     return 0;
241 
242   // Execute
243   int _retval = CefViewCppToC::Get(self)->GetID();
244 
245   // Return type: simple
246   return _retval;
247 }
248 
view_set_id(struct _cef_view_t * self,int id)249 void CEF_CALLBACK view_set_id(struct _cef_view_t* self, int id) {
250   shutdown_checker::AssertNotShutdown();
251 
252   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
253 
254   DCHECK(self);
255   if (!self)
256     return;
257 
258   // Execute
259   CefViewCppToC::Get(self)->SetID(id);
260 }
261 
view_get_group_id(struct _cef_view_t * self)262 int CEF_CALLBACK view_get_group_id(struct _cef_view_t* self) {
263   shutdown_checker::AssertNotShutdown();
264 
265   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
266 
267   DCHECK(self);
268   if (!self)
269     return 0;
270 
271   // Execute
272   int _retval = CefViewCppToC::Get(self)->GetGroupID();
273 
274   // Return type: simple
275   return _retval;
276 }
277 
view_set_group_id(struct _cef_view_t * self,int group_id)278 void CEF_CALLBACK view_set_group_id(struct _cef_view_t* self, int group_id) {
279   shutdown_checker::AssertNotShutdown();
280 
281   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
282 
283   DCHECK(self);
284   if (!self)
285     return;
286 
287   // Execute
288   CefViewCppToC::Get(self)->SetGroupID(group_id);
289 }
290 
291 struct _cef_view_t* CEF_CALLBACK
view_get_parent_view(struct _cef_view_t * self)292 view_get_parent_view(struct _cef_view_t* self) {
293   shutdown_checker::AssertNotShutdown();
294 
295   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
296 
297   DCHECK(self);
298   if (!self)
299     return NULL;
300 
301   // Execute
302   CefRefPtr<CefView> _retval = CefViewCppToC::Get(self)->GetParentView();
303 
304   // Return type: refptr_same
305   return CefViewCppToC::Wrap(_retval);
306 }
307 
view_get_view_for_id(struct _cef_view_t * self,int id)308 struct _cef_view_t* CEF_CALLBACK view_get_view_for_id(struct _cef_view_t* self,
309                                                       int id) {
310   shutdown_checker::AssertNotShutdown();
311 
312   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
313 
314   DCHECK(self);
315   if (!self)
316     return NULL;
317 
318   // Execute
319   CefRefPtr<CefView> _retval = CefViewCppToC::Get(self)->GetViewForID(id);
320 
321   // Return type: refptr_same
322   return CefViewCppToC::Wrap(_retval);
323 }
324 
view_set_bounds(struct _cef_view_t * self,const cef_rect_t * bounds)325 void CEF_CALLBACK view_set_bounds(struct _cef_view_t* self,
326                                   const cef_rect_t* bounds) {
327   shutdown_checker::AssertNotShutdown();
328 
329   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
330 
331   DCHECK(self);
332   if (!self)
333     return;
334   // Verify param: bounds; type: simple_byref_const
335   DCHECK(bounds);
336   if (!bounds)
337     return;
338 
339   // Translate param: bounds; type: simple_byref_const
340   CefRect boundsVal = bounds ? *bounds : CefRect();
341 
342   // Execute
343   CefViewCppToC::Get(self)->SetBounds(boundsVal);
344 }
345 
view_get_bounds(struct _cef_view_t * self)346 cef_rect_t CEF_CALLBACK view_get_bounds(struct _cef_view_t* self) {
347   shutdown_checker::AssertNotShutdown();
348 
349   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
350 
351   DCHECK(self);
352   if (!self)
353     return CefRect();
354 
355   // Execute
356   cef_rect_t _retval = CefViewCppToC::Get(self)->GetBounds();
357 
358   // Return type: simple
359   return _retval;
360 }
361 
view_get_bounds_in_screen(struct _cef_view_t * self)362 cef_rect_t CEF_CALLBACK view_get_bounds_in_screen(struct _cef_view_t* self) {
363   shutdown_checker::AssertNotShutdown();
364 
365   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
366 
367   DCHECK(self);
368   if (!self)
369     return CefRect();
370 
371   // Execute
372   cef_rect_t _retval = CefViewCppToC::Get(self)->GetBoundsInScreen();
373 
374   // Return type: simple
375   return _retval;
376 }
377 
view_set_size(struct _cef_view_t * self,const cef_size_t * size)378 void CEF_CALLBACK view_set_size(struct _cef_view_t* self,
379                                 const cef_size_t* size) {
380   shutdown_checker::AssertNotShutdown();
381 
382   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
383 
384   DCHECK(self);
385   if (!self)
386     return;
387   // Verify param: size; type: simple_byref_const
388   DCHECK(size);
389   if (!size)
390     return;
391 
392   // Translate param: size; type: simple_byref_const
393   CefSize sizeVal = size ? *size : CefSize();
394 
395   // Execute
396   CefViewCppToC::Get(self)->SetSize(sizeVal);
397 }
398 
view_get_size(struct _cef_view_t * self)399 cef_size_t CEF_CALLBACK view_get_size(struct _cef_view_t* self) {
400   shutdown_checker::AssertNotShutdown();
401 
402   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
403 
404   DCHECK(self);
405   if (!self)
406     return CefSize();
407 
408   // Execute
409   cef_size_t _retval = CefViewCppToC::Get(self)->GetSize();
410 
411   // Return type: simple
412   return _retval;
413 }
414 
view_set_position(struct _cef_view_t * self,const cef_point_t * position)415 void CEF_CALLBACK view_set_position(struct _cef_view_t* self,
416                                     const cef_point_t* position) {
417   shutdown_checker::AssertNotShutdown();
418 
419   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
420 
421   DCHECK(self);
422   if (!self)
423     return;
424   // Verify param: position; type: simple_byref_const
425   DCHECK(position);
426   if (!position)
427     return;
428 
429   // Translate param: position; type: simple_byref_const
430   CefPoint positionVal = position ? *position : CefPoint();
431 
432   // Execute
433   CefViewCppToC::Get(self)->SetPosition(positionVal);
434 }
435 
view_get_position(struct _cef_view_t * self)436 cef_point_t CEF_CALLBACK view_get_position(struct _cef_view_t* self) {
437   shutdown_checker::AssertNotShutdown();
438 
439   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
440 
441   DCHECK(self);
442   if (!self)
443     return CefPoint();
444 
445   // Execute
446   cef_point_t _retval = CefViewCppToC::Get(self)->GetPosition();
447 
448   // Return type: simple
449   return _retval;
450 }
451 
view_get_preferred_size(struct _cef_view_t * self)452 cef_size_t CEF_CALLBACK view_get_preferred_size(struct _cef_view_t* self) {
453   shutdown_checker::AssertNotShutdown();
454 
455   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
456 
457   DCHECK(self);
458   if (!self)
459     return CefSize();
460 
461   // Execute
462   cef_size_t _retval = CefViewCppToC::Get(self)->GetPreferredSize();
463 
464   // Return type: simple
465   return _retval;
466 }
467 
view_size_to_preferred_size(struct _cef_view_t * self)468 void CEF_CALLBACK view_size_to_preferred_size(struct _cef_view_t* self) {
469   shutdown_checker::AssertNotShutdown();
470 
471   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
472 
473   DCHECK(self);
474   if (!self)
475     return;
476 
477   // Execute
478   CefViewCppToC::Get(self)->SizeToPreferredSize();
479 }
480 
view_get_minimum_size(struct _cef_view_t * self)481 cef_size_t CEF_CALLBACK view_get_minimum_size(struct _cef_view_t* self) {
482   shutdown_checker::AssertNotShutdown();
483 
484   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
485 
486   DCHECK(self);
487   if (!self)
488     return CefSize();
489 
490   // Execute
491   cef_size_t _retval = CefViewCppToC::Get(self)->GetMinimumSize();
492 
493   // Return type: simple
494   return _retval;
495 }
496 
view_get_maximum_size(struct _cef_view_t * self)497 cef_size_t CEF_CALLBACK view_get_maximum_size(struct _cef_view_t* self) {
498   shutdown_checker::AssertNotShutdown();
499 
500   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
501 
502   DCHECK(self);
503   if (!self)
504     return CefSize();
505 
506   // Execute
507   cef_size_t _retval = CefViewCppToC::Get(self)->GetMaximumSize();
508 
509   // Return type: simple
510   return _retval;
511 }
512 
view_get_height_for_width(struct _cef_view_t * self,int width)513 int CEF_CALLBACK view_get_height_for_width(struct _cef_view_t* self,
514                                            int width) {
515   shutdown_checker::AssertNotShutdown();
516 
517   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
518 
519   DCHECK(self);
520   if (!self)
521     return 0;
522 
523   // Execute
524   int _retval = CefViewCppToC::Get(self)->GetHeightForWidth(width);
525 
526   // Return type: simple
527   return _retval;
528 }
529 
view_invalidate_layout(struct _cef_view_t * self)530 void CEF_CALLBACK view_invalidate_layout(struct _cef_view_t* self) {
531   shutdown_checker::AssertNotShutdown();
532 
533   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
534 
535   DCHECK(self);
536   if (!self)
537     return;
538 
539   // Execute
540   CefViewCppToC::Get(self)->InvalidateLayout();
541 }
542 
view_set_visible(struct _cef_view_t * self,int visible)543 void CEF_CALLBACK view_set_visible(struct _cef_view_t* self, int visible) {
544   shutdown_checker::AssertNotShutdown();
545 
546   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
547 
548   DCHECK(self);
549   if (!self)
550     return;
551 
552   // Execute
553   CefViewCppToC::Get(self)->SetVisible(visible ? true : false);
554 }
555 
view_is_visible(struct _cef_view_t * self)556 int CEF_CALLBACK view_is_visible(struct _cef_view_t* self) {
557   shutdown_checker::AssertNotShutdown();
558 
559   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
560 
561   DCHECK(self);
562   if (!self)
563     return 0;
564 
565   // Execute
566   bool _retval = CefViewCppToC::Get(self)->IsVisible();
567 
568   // Return type: bool
569   return _retval;
570 }
571 
view_is_drawn(struct _cef_view_t * self)572 int CEF_CALLBACK view_is_drawn(struct _cef_view_t* self) {
573   shutdown_checker::AssertNotShutdown();
574 
575   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
576 
577   DCHECK(self);
578   if (!self)
579     return 0;
580 
581   // Execute
582   bool _retval = CefViewCppToC::Get(self)->IsDrawn();
583 
584   // Return type: bool
585   return _retval;
586 }
587 
view_set_enabled(struct _cef_view_t * self,int enabled)588 void CEF_CALLBACK view_set_enabled(struct _cef_view_t* self, int enabled) {
589   shutdown_checker::AssertNotShutdown();
590 
591   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
592 
593   DCHECK(self);
594   if (!self)
595     return;
596 
597   // Execute
598   CefViewCppToC::Get(self)->SetEnabled(enabled ? true : false);
599 }
600 
view_is_enabled(struct _cef_view_t * self)601 int CEF_CALLBACK view_is_enabled(struct _cef_view_t* self) {
602   shutdown_checker::AssertNotShutdown();
603 
604   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
605 
606   DCHECK(self);
607   if (!self)
608     return 0;
609 
610   // Execute
611   bool _retval = CefViewCppToC::Get(self)->IsEnabled();
612 
613   // Return type: bool
614   return _retval;
615 }
616 
view_set_focusable(struct _cef_view_t * self,int focusable)617 void CEF_CALLBACK view_set_focusable(struct _cef_view_t* self, int focusable) {
618   shutdown_checker::AssertNotShutdown();
619 
620   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
621 
622   DCHECK(self);
623   if (!self)
624     return;
625 
626   // Execute
627   CefViewCppToC::Get(self)->SetFocusable(focusable ? true : false);
628 }
629 
view_is_focusable(struct _cef_view_t * self)630 int CEF_CALLBACK view_is_focusable(struct _cef_view_t* self) {
631   shutdown_checker::AssertNotShutdown();
632 
633   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
634 
635   DCHECK(self);
636   if (!self)
637     return 0;
638 
639   // Execute
640   bool _retval = CefViewCppToC::Get(self)->IsFocusable();
641 
642   // Return type: bool
643   return _retval;
644 }
645 
view_is_accessibility_focusable(struct _cef_view_t * self)646 int CEF_CALLBACK view_is_accessibility_focusable(struct _cef_view_t* self) {
647   shutdown_checker::AssertNotShutdown();
648 
649   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
650 
651   DCHECK(self);
652   if (!self)
653     return 0;
654 
655   // Execute
656   bool _retval = CefViewCppToC::Get(self)->IsAccessibilityFocusable();
657 
658   // Return type: bool
659   return _retval;
660 }
661 
view_request_focus(struct _cef_view_t * self)662 void CEF_CALLBACK view_request_focus(struct _cef_view_t* self) {
663   shutdown_checker::AssertNotShutdown();
664 
665   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
666 
667   DCHECK(self);
668   if (!self)
669     return;
670 
671   // Execute
672   CefViewCppToC::Get(self)->RequestFocus();
673 }
674 
view_set_background_color(struct _cef_view_t * self,cef_color_t color)675 void CEF_CALLBACK view_set_background_color(struct _cef_view_t* self,
676                                             cef_color_t color) {
677   shutdown_checker::AssertNotShutdown();
678 
679   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
680 
681   DCHECK(self);
682   if (!self)
683     return;
684 
685   // Execute
686   CefViewCppToC::Get(self)->SetBackgroundColor(color);
687 }
688 
view_get_background_color(struct _cef_view_t * self)689 cef_color_t CEF_CALLBACK view_get_background_color(struct _cef_view_t* self) {
690   shutdown_checker::AssertNotShutdown();
691 
692   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
693 
694   DCHECK(self);
695   if (!self)
696     return 0;
697 
698   // Execute
699   cef_color_t _retval = CefViewCppToC::Get(self)->GetBackgroundColor();
700 
701   // Return type: simple
702   return _retval;
703 }
704 
view_convert_point_to_screen(struct _cef_view_t * self,cef_point_t * point)705 int CEF_CALLBACK view_convert_point_to_screen(struct _cef_view_t* self,
706                                               cef_point_t* point) {
707   shutdown_checker::AssertNotShutdown();
708 
709   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
710 
711   DCHECK(self);
712   if (!self)
713     return 0;
714   // Verify param: point; type: simple_byref
715   DCHECK(point);
716   if (!point)
717     return 0;
718 
719   // Translate param: point; type: simple_byref
720   CefPoint pointVal = point ? *point : CefPoint();
721 
722   // Execute
723   bool _retval = CefViewCppToC::Get(self)->ConvertPointToScreen(pointVal);
724 
725   // Restore param: point; type: simple_byref
726   if (point)
727     *point = pointVal;
728 
729   // Return type: bool
730   return _retval;
731 }
732 
view_convert_point_from_screen(struct _cef_view_t * self,cef_point_t * point)733 int CEF_CALLBACK view_convert_point_from_screen(struct _cef_view_t* self,
734                                                 cef_point_t* point) {
735   shutdown_checker::AssertNotShutdown();
736 
737   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
738 
739   DCHECK(self);
740   if (!self)
741     return 0;
742   // Verify param: point; type: simple_byref
743   DCHECK(point);
744   if (!point)
745     return 0;
746 
747   // Translate param: point; type: simple_byref
748   CefPoint pointVal = point ? *point : CefPoint();
749 
750   // Execute
751   bool _retval = CefViewCppToC::Get(self)->ConvertPointFromScreen(pointVal);
752 
753   // Restore param: point; type: simple_byref
754   if (point)
755     *point = pointVal;
756 
757   // Return type: bool
758   return _retval;
759 }
760 
view_convert_point_to_window(struct _cef_view_t * self,cef_point_t * point)761 int CEF_CALLBACK view_convert_point_to_window(struct _cef_view_t* self,
762                                               cef_point_t* point) {
763   shutdown_checker::AssertNotShutdown();
764 
765   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
766 
767   DCHECK(self);
768   if (!self)
769     return 0;
770   // Verify param: point; type: simple_byref
771   DCHECK(point);
772   if (!point)
773     return 0;
774 
775   // Translate param: point; type: simple_byref
776   CefPoint pointVal = point ? *point : CefPoint();
777 
778   // Execute
779   bool _retval = CefViewCppToC::Get(self)->ConvertPointToWindow(pointVal);
780 
781   // Restore param: point; type: simple_byref
782   if (point)
783     *point = pointVal;
784 
785   // Return type: bool
786   return _retval;
787 }
788 
view_convert_point_from_window(struct _cef_view_t * self,cef_point_t * point)789 int CEF_CALLBACK view_convert_point_from_window(struct _cef_view_t* self,
790                                                 cef_point_t* point) {
791   shutdown_checker::AssertNotShutdown();
792 
793   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
794 
795   DCHECK(self);
796   if (!self)
797     return 0;
798   // Verify param: point; type: simple_byref
799   DCHECK(point);
800   if (!point)
801     return 0;
802 
803   // Translate param: point; type: simple_byref
804   CefPoint pointVal = point ? *point : CefPoint();
805 
806   // Execute
807   bool _retval = CefViewCppToC::Get(self)->ConvertPointFromWindow(pointVal);
808 
809   // Restore param: point; type: simple_byref
810   if (point)
811     *point = pointVal;
812 
813   // Return type: bool
814   return _retval;
815 }
816 
view_convert_point_to_view(struct _cef_view_t * self,struct _cef_view_t * view,cef_point_t * point)817 int CEF_CALLBACK view_convert_point_to_view(struct _cef_view_t* self,
818                                             struct _cef_view_t* view,
819                                             cef_point_t* point) {
820   shutdown_checker::AssertNotShutdown();
821 
822   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
823 
824   DCHECK(self);
825   if (!self)
826     return 0;
827   // Verify param: view; type: refptr_same
828   DCHECK(view);
829   if (!view)
830     return 0;
831   // Verify param: point; type: simple_byref
832   DCHECK(point);
833   if (!point)
834     return 0;
835 
836   // Translate param: point; type: simple_byref
837   CefPoint pointVal = point ? *point : CefPoint();
838 
839   // Execute
840   bool _retval = CefViewCppToC::Get(self)->ConvertPointToView(
841       CefViewCppToC::Unwrap(view), pointVal);
842 
843   // Restore param: point; type: simple_byref
844   if (point)
845     *point = pointVal;
846 
847   // Return type: bool
848   return _retval;
849 }
850 
view_convert_point_from_view(struct _cef_view_t * self,struct _cef_view_t * view,cef_point_t * point)851 int CEF_CALLBACK view_convert_point_from_view(struct _cef_view_t* self,
852                                               struct _cef_view_t* view,
853                                               cef_point_t* point) {
854   shutdown_checker::AssertNotShutdown();
855 
856   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
857 
858   DCHECK(self);
859   if (!self)
860     return 0;
861   // Verify param: view; type: refptr_same
862   DCHECK(view);
863   if (!view)
864     return 0;
865   // Verify param: point; type: simple_byref
866   DCHECK(point);
867   if (!point)
868     return 0;
869 
870   // Translate param: point; type: simple_byref
871   CefPoint pointVal = point ? *point : CefPoint();
872 
873   // Execute
874   bool _retval = CefViewCppToC::Get(self)->ConvertPointFromView(
875       CefViewCppToC::Unwrap(view), pointVal);
876 
877   // Restore param: point; type: simple_byref
878   if (point)
879     *point = pointVal;
880 
881   // Return type: bool
882   return _retval;
883 }
884 
885 }  // namespace
886 
887 // CONSTRUCTOR - Do not edit by hand.
888 
CefViewCppToC()889 CefViewCppToC::CefViewCppToC() {
890   GetStruct()->as_browser_view = view_as_browser_view;
891   GetStruct()->as_button = view_as_button;
892   GetStruct()->as_panel = view_as_panel;
893   GetStruct()->as_scroll_view = view_as_scroll_view;
894   GetStruct()->as_textfield = view_as_textfield;
895   GetStruct()->get_type_string = view_get_type_string;
896   GetStruct()->to_string = view_to_string;
897   GetStruct()->is_valid = view_is_valid;
898   GetStruct()->is_attached = view_is_attached;
899   GetStruct()->is_same = view_is_same;
900   GetStruct()->get_delegate = view_get_delegate;
901   GetStruct()->get_window = view_get_window;
902   GetStruct()->get_id = view_get_id;
903   GetStruct()->set_id = view_set_id;
904   GetStruct()->get_group_id = view_get_group_id;
905   GetStruct()->set_group_id = view_set_group_id;
906   GetStruct()->get_parent_view = view_get_parent_view;
907   GetStruct()->get_view_for_id = view_get_view_for_id;
908   GetStruct()->set_bounds = view_set_bounds;
909   GetStruct()->get_bounds = view_get_bounds;
910   GetStruct()->get_bounds_in_screen = view_get_bounds_in_screen;
911   GetStruct()->set_size = view_set_size;
912   GetStruct()->get_size = view_get_size;
913   GetStruct()->set_position = view_set_position;
914   GetStruct()->get_position = view_get_position;
915   GetStruct()->get_preferred_size = view_get_preferred_size;
916   GetStruct()->size_to_preferred_size = view_size_to_preferred_size;
917   GetStruct()->get_minimum_size = view_get_minimum_size;
918   GetStruct()->get_maximum_size = view_get_maximum_size;
919   GetStruct()->get_height_for_width = view_get_height_for_width;
920   GetStruct()->invalidate_layout = view_invalidate_layout;
921   GetStruct()->set_visible = view_set_visible;
922   GetStruct()->is_visible = view_is_visible;
923   GetStruct()->is_drawn = view_is_drawn;
924   GetStruct()->set_enabled = view_set_enabled;
925   GetStruct()->is_enabled = view_is_enabled;
926   GetStruct()->set_focusable = view_set_focusable;
927   GetStruct()->is_focusable = view_is_focusable;
928   GetStruct()->is_accessibility_focusable = view_is_accessibility_focusable;
929   GetStruct()->request_focus = view_request_focus;
930   GetStruct()->set_background_color = view_set_background_color;
931   GetStruct()->get_background_color = view_get_background_color;
932   GetStruct()->convert_point_to_screen = view_convert_point_to_screen;
933   GetStruct()->convert_point_from_screen = view_convert_point_from_screen;
934   GetStruct()->convert_point_to_window = view_convert_point_to_window;
935   GetStruct()->convert_point_from_window = view_convert_point_from_window;
936   GetStruct()->convert_point_to_view = view_convert_point_to_view;
937   GetStruct()->convert_point_from_view = view_convert_point_from_view;
938 }
939 
940 // DESTRUCTOR - Do not edit by hand.
941 
~CefViewCppToC()942 CefViewCppToC::~CefViewCppToC() {
943   shutdown_checker::AssertNotShutdown();
944 }
945 
946 template <>
947 CefRefPtr<CefView>
UnwrapDerived(CefWrapperType type,cef_view_t * s)948 CefCppToCRefCounted<CefViewCppToC, CefView, cef_view_t>::UnwrapDerived(
949     CefWrapperType type,
950     cef_view_t* s) {
951   if (type == WT_BROWSER_VIEW) {
952     return CefBrowserViewCppToC::Unwrap(
953         reinterpret_cast<cef_browser_view_t*>(s));
954   }
955   if (type == WT_BUTTON) {
956     return CefButtonCppToC::Unwrap(reinterpret_cast<cef_button_t*>(s));
957   }
958   if (type == WT_LABEL_BUTTON) {
959     return CefLabelButtonCppToC::Unwrap(
960         reinterpret_cast<cef_label_button_t*>(s));
961   }
962   if (type == WT_MENU_BUTTON) {
963     return CefMenuButtonCppToC::Unwrap(reinterpret_cast<cef_menu_button_t*>(s));
964   }
965   if (type == WT_PANEL) {
966     return CefPanelCppToC::Unwrap(reinterpret_cast<cef_panel_t*>(s));
967   }
968   if (type == WT_SCROLL_VIEW) {
969     return CefScrollViewCppToC::Unwrap(reinterpret_cast<cef_scroll_view_t*>(s));
970   }
971   if (type == WT_TEXTFIELD) {
972     return CefTextfieldCppToC::Unwrap(reinterpret_cast<cef_textfield_t*>(s));
973   }
974   if (type == WT_WINDOW) {
975     return CefWindowCppToC::Unwrap(reinterpret_cast<cef_window_t*>(s));
976   }
977   NOTREACHED() << "Unexpected class type: " << type;
978   return nullptr;
979 }
980 
981 template <>
982 CefWrapperType
983     CefCppToCRefCounted<CefViewCppToC, CefView, cef_view_t>::kWrapperType =
984         WT_VIEW;
985