1 // Copyright (c) 2022 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=795437425153e56d1c82e30510922399fef0c673$
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")
OnLayoutChanged(CefRefPtr<CefView> view,const CefRect & new_bounds)267 void CefMenuButtonDelegateCToCpp::OnLayoutChanged(CefRefPtr<CefView> view,
268 const CefRect& new_bounds) {
269 shutdown_checker::AssertNotShutdown();
270
271 cef_view_delegate_t* _struct =
272 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
273 if (CEF_MEMBER_MISSING(_struct, on_layout_changed))
274 return;
275
276 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
277
278 // Verify param: view; type: refptr_diff
279 DCHECK(view.get());
280 if (!view.get())
281 return;
282
283 // Execute
284 _struct->on_layout_changed(_struct, CefViewCppToC::Wrap(view), &new_bounds);
285 }
286
287 NO_SANITIZE("cfi-icall")
OnFocus(CefRefPtr<CefView> view)288 void CefMenuButtonDelegateCToCpp::OnFocus(CefRefPtr<CefView> view) {
289 shutdown_checker::AssertNotShutdown();
290
291 cef_view_delegate_t* _struct =
292 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
293 if (CEF_MEMBER_MISSING(_struct, on_focus))
294 return;
295
296 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
297
298 // Verify param: view; type: refptr_diff
299 DCHECK(view.get());
300 if (!view.get())
301 return;
302
303 // Execute
304 _struct->on_focus(_struct, CefViewCppToC::Wrap(view));
305 }
306
307 NO_SANITIZE("cfi-icall")
OnBlur(CefRefPtr<CefView> view)308 void CefMenuButtonDelegateCToCpp::OnBlur(CefRefPtr<CefView> view) {
309 shutdown_checker::AssertNotShutdown();
310
311 cef_view_delegate_t* _struct =
312 reinterpret_cast<cef_view_delegate_t*>(GetStruct());
313 if (CEF_MEMBER_MISSING(_struct, on_blur))
314 return;
315
316 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
317
318 // Verify param: view; type: refptr_diff
319 DCHECK(view.get());
320 if (!view.get())
321 return;
322
323 // Execute
324 _struct->on_blur(_struct, CefViewCppToC::Wrap(view));
325 }
326
327 // CONSTRUCTOR - Do not edit by hand.
328
CefMenuButtonDelegateCToCpp()329 CefMenuButtonDelegateCToCpp::CefMenuButtonDelegateCToCpp() {}
330
331 // DESTRUCTOR - Do not edit by hand.
332
~CefMenuButtonDelegateCToCpp()333 CefMenuButtonDelegateCToCpp::~CefMenuButtonDelegateCToCpp() {
334 shutdown_checker::AssertNotShutdown();
335 }
336
337 template <>
338 cef_menu_button_delegate_t* CefCToCppRefCounted<
339 CefMenuButtonDelegateCToCpp,
340 CefMenuButtonDelegate,
UnwrapDerived(CefWrapperType type,CefMenuButtonDelegate * c)341 cef_menu_button_delegate_t>::UnwrapDerived(CefWrapperType type,
342 CefMenuButtonDelegate* c) {
343 NOTREACHED() << "Unexpected class type: " << type;
344 return nullptr;
345 }
346
347 template <>
348 CefWrapperType CefCToCppRefCounted<CefMenuButtonDelegateCToCpp,
349 CefMenuButtonDelegate,
350 cef_menu_button_delegate_t>::kWrapperType =
351 WT_MENU_BUTTON_DELEGATE;
352