• 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=9ecd07954f90dc14ddf36072285c942f2ee8082f$
13 //
14 
15 #include "libcef_dll/ctocpp/views/menu_button_delegate_ctocpp.h"
16 #include "libcef_dll/cpptoc/views/button_cpptoc.h"
17 #include "libcef_dll/cpptoc/views/menu_button_cpptoc.h"
18 #include "libcef_dll/cpptoc/views/menu_button_pressed_lock_cpptoc.h"
19 #include "libcef_dll/cpptoc/views/view_cpptoc.h"
20 #include "libcef_dll/shutdown_checker.h"
21 
22 // VIRTUAL METHODS - Body may be edited by hand.
23 
24 NO_SANITIZE("cfi-icall")
OnMenuButtonPressed(CefRefPtr<CefMenuButton> menu_button,const CefPoint & screen_point,CefRefPtr<CefMenuButtonPressedLock> button_pressed_lock)25 void CefMenuButtonDelegateCToCpp::OnMenuButtonPressed(
26     CefRefPtr<CefMenuButton> menu_button,
27     const CefPoint& screen_point,
28     CefRefPtr<CefMenuButtonPressedLock> button_pressed_lock) {
29   shutdown_checker::AssertNotShutdown();
30 
31   cef_menu_button_delegate_t* _struct = GetStruct();
32   if (CEF_MEMBER_MISSING(_struct, on_menu_button_pressed))
33     return;
34 
35   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
36 
37   // Verify param: menu_button; type: refptr_diff
38   DCHECK(menu_button.get());
39   if (!menu_button.get())
40     return;
41   // Verify param: button_pressed_lock; type: refptr_diff
42   DCHECK(button_pressed_lock.get());
43   if (!button_pressed_lock.get())
44     return;
45 
46   // Execute
47   _struct->on_menu_button_pressed(
48       _struct, CefMenuButtonCppToC::Wrap(menu_button), &screen_point,
49       CefMenuButtonPressedLockCppToC::Wrap(button_pressed_lock));
50 }
51 
52 NO_SANITIZE("cfi-icall")
OnButtonPressed(CefRefPtr<CefButton> button)53 void CefMenuButtonDelegateCToCpp::OnButtonPressed(CefRefPtr<CefButton> button) {
54   shutdown_checker::AssertNotShutdown();
55 
56   cef_button_delegate_t* _struct =
57       reinterpret_cast<cef_button_delegate_t*>(GetStruct());
58   if (CEF_MEMBER_MISSING(_struct, on_button_pressed))
59     return;
60 
61   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62 
63   // Verify param: button; type: refptr_diff
64   DCHECK(button.get());
65   if (!button.get())
66     return;
67 
68   // Execute
69   _struct->on_button_pressed(_struct, CefButtonCppToC::Wrap(button));
70 }
71 
72 NO_SANITIZE("cfi-icall")
OnButtonStateChanged(CefRefPtr<CefButton> button)73 void CefMenuButtonDelegateCToCpp::OnButtonStateChanged(
74     CefRefPtr<CefButton> button) {
75   shutdown_checker::AssertNotShutdown();
76 
77   cef_button_delegate_t* _struct =
78       reinterpret_cast<cef_button_delegate_t*>(GetStruct());
79   if (CEF_MEMBER_MISSING(_struct, on_button_state_changed))
80     return;
81 
82   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
83 
84   // Verify param: button; type: refptr_diff
85   DCHECK(button.get());
86   if (!button.get())
87     return;
88 
89   // Execute
90   _struct->on_button_state_changed(_struct, CefButtonCppToC::Wrap(button));
91 }
92 
93 NO_SANITIZE("cfi-icall")
GetPreferredSize(CefRefPtr<CefView> view)94 CefSize CefMenuButtonDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
95   shutdown_checker::AssertNotShutdown();
96 
97   cef_view_delegate_t* _struct =
98       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
99   if (CEF_MEMBER_MISSING(_struct, get_preferred_size))
100     return CefSize();
101 
102   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
103 
104   // Verify param: view; type: refptr_diff
105   DCHECK(view.get());
106   if (!view.get())
107     return CefSize();
108 
109   // Execute
110   cef_size_t _retval =
111       _struct->get_preferred_size(_struct, CefViewCppToC::Wrap(view));
112 
113   // Return type: simple
114   return _retval;
115 }
116 
117 NO_SANITIZE("cfi-icall")
GetMinimumSize(CefRefPtr<CefView> view)118 CefSize CefMenuButtonDelegateCToCpp::GetMinimumSize(CefRefPtr<CefView> view) {
119   shutdown_checker::AssertNotShutdown();
120 
121   cef_view_delegate_t* _struct =
122       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
123   if (CEF_MEMBER_MISSING(_struct, get_minimum_size))
124     return CefSize();
125 
126   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
127 
128   // Verify param: view; type: refptr_diff
129   DCHECK(view.get());
130   if (!view.get())
131     return CefSize();
132 
133   // Execute
134   cef_size_t _retval =
135       _struct->get_minimum_size(_struct, CefViewCppToC::Wrap(view));
136 
137   // Return type: simple
138   return _retval;
139 }
140 
141 NO_SANITIZE("cfi-icall")
GetMaximumSize(CefRefPtr<CefView> view)142 CefSize CefMenuButtonDelegateCToCpp::GetMaximumSize(CefRefPtr<CefView> view) {
143   shutdown_checker::AssertNotShutdown();
144 
145   cef_view_delegate_t* _struct =
146       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
147   if (CEF_MEMBER_MISSING(_struct, get_maximum_size))
148     return CefSize();
149 
150   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
151 
152   // Verify param: view; type: refptr_diff
153   DCHECK(view.get());
154   if (!view.get())
155     return CefSize();
156 
157   // Execute
158   cef_size_t _retval =
159       _struct->get_maximum_size(_struct, CefViewCppToC::Wrap(view));
160 
161   // Return type: simple
162   return _retval;
163 }
164 
165 NO_SANITIZE("cfi-icall")
GetHeightForWidth(CefRefPtr<CefView> view,int width)166 int CefMenuButtonDelegateCToCpp::GetHeightForWidth(CefRefPtr<CefView> view,
167                                                    int width) {
168   shutdown_checker::AssertNotShutdown();
169 
170   cef_view_delegate_t* _struct =
171       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
172   if (CEF_MEMBER_MISSING(_struct, get_height_for_width))
173     return 0;
174 
175   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
176 
177   // Verify param: view; type: refptr_diff
178   DCHECK(view.get());
179   if (!view.get())
180     return 0;
181 
182   // Execute
183   int _retval =
184       _struct->get_height_for_width(_struct, CefViewCppToC::Wrap(view), width);
185 
186   // Return type: simple
187   return _retval;
188 }
189 
190 NO_SANITIZE("cfi-icall")
OnParentViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> parent)191 void CefMenuButtonDelegateCToCpp::OnParentViewChanged(
192     CefRefPtr<CefView> view,
193     bool added,
194     CefRefPtr<CefView> parent) {
195   shutdown_checker::AssertNotShutdown();
196 
197   cef_view_delegate_t* _struct =
198       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
199   if (CEF_MEMBER_MISSING(_struct, on_parent_view_changed))
200     return;
201 
202   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
203 
204   // Verify param: view; type: refptr_diff
205   DCHECK(view.get());
206   if (!view.get())
207     return;
208   // Verify param: parent; type: refptr_diff
209   DCHECK(parent.get());
210   if (!parent.get())
211     return;
212 
213   // Execute
214   _struct->on_parent_view_changed(_struct, CefViewCppToC::Wrap(view), added,
215                                   CefViewCppToC::Wrap(parent));
216 }
217 
218 NO_SANITIZE("cfi-icall")
OnChildViewChanged(CefRefPtr<CefView> view,bool added,CefRefPtr<CefView> child)219 void CefMenuButtonDelegateCToCpp::OnChildViewChanged(CefRefPtr<CefView> view,
220                                                      bool added,
221                                                      CefRefPtr<CefView> child) {
222   shutdown_checker::AssertNotShutdown();
223 
224   cef_view_delegate_t* _struct =
225       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
226   if (CEF_MEMBER_MISSING(_struct, on_child_view_changed))
227     return;
228 
229   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
230 
231   // Verify param: view; type: refptr_diff
232   DCHECK(view.get());
233   if (!view.get())
234     return;
235   // Verify param: child; type: refptr_diff
236   DCHECK(child.get());
237   if (!child.get())
238     return;
239 
240   // Execute
241   _struct->on_child_view_changed(_struct, CefViewCppToC::Wrap(view), added,
242                                  CefViewCppToC::Wrap(child));
243 }
244 
245 NO_SANITIZE("cfi-icall")
OnWindowChanged(CefRefPtr<CefView> view,bool added)246 void CefMenuButtonDelegateCToCpp::OnWindowChanged(CefRefPtr<CefView> view,
247                                                   bool added) {
248   shutdown_checker::AssertNotShutdown();
249 
250   cef_view_delegate_t* _struct =
251       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
252   if (CEF_MEMBER_MISSING(_struct, on_window_changed))
253     return;
254 
255   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
256 
257   // Verify param: view; type: refptr_diff
258   DCHECK(view.get());
259   if (!view.get())
260     return;
261 
262   // Execute
263   _struct->on_window_changed(_struct, CefViewCppToC::Wrap(view), added);
264 }
265 
266 NO_SANITIZE("cfi-icall")
OnFocus(CefRefPtr<CefView> view)267 void CefMenuButtonDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
268   shutdown_checker::AssertNotShutdown();
269 
270   cef_view_delegate_t* _struct =
271       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
272   if (CEF_MEMBER_MISSING(_struct, on_focus))
273     return;
274 
275   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
276 
277   // Verify param: view; type: refptr_diff
278   DCHECK(view.get());
279   if (!view.get())
280     return;
281 
282   // Execute
283   _struct->on_focus(_struct, CefViewCppToC::Wrap(view));
284 }
285 
286 NO_SANITIZE("cfi-icall")
OnBlur(CefRefPtr<CefView> view)287 void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
288   shutdown_checker::AssertNotShutdown();
289 
290   cef_view_delegate_t* _struct =
291       reinterpret_cast<cef_view_delegate_t*>(GetStruct());
292   if (CEF_MEMBER_MISSING(_struct, on_blur))
293     return;
294 
295   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
296 
297   // Verify param: view; type: refptr_diff
298   DCHECK(view.get());
299   if (!view.get())
300     return;
301 
302   // Execute
303   _struct->on_blur(_struct, CefViewCppToC::Wrap(view));
304 }
305 
306 // CONSTRUCTOR - Do not edit by hand.
307 
CefMenuButtonDelegateCToCpp()308 CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() {}
309 
310 // DESTRUCTOR - Do not edit by hand.
311 
~CefMenuButtonDelegateCToCpp()312 CefMenuButtonDelegateCToCpp::~CefMenuButtonDelegateCToCpp() {
313   shutdown_checker::AssertNotShutdown();
314 }
315 
316 template <>
317 cef_menu_button_delegate_t* CefCToCppRefCounted<
318     CefMenuButtonDelegateCToCpp,
319     CefMenuButtonDelegate,
UnwrapDerived(CefWrapperType type,CefMenuButtonDelegate * c)320     cef_menu_button_delegate_t>::UnwrapDerived(CefWrapperType type,
321                                                CefMenuButtonDelegate* c) {
322   NOTREACHED() << "Unexpected class type: " << type;
323   return nullptr;
324 }
325 
326 template <>
327 CefWrapperType CefCToCppRefCounted<CefMenuButtonDelegateCToCpp,
328                                    CefMenuButtonDelegate,
329                                    cef_menu_button_delegate_t>::kWrapperType =
330     WT_MENU_BUTTON_DELEGATE;
331