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=2fcd1d4d2126285209e1fa782beccbb363693bf3$
13 //
14
15 #include "libcef_dll/cpptoc/views/menu_button_delegate_cpptoc.h"
16 #include "libcef_dll/ctocpp/views/button_ctocpp.h"
17 #include "libcef_dll/ctocpp/views/menu_button_ctocpp.h"
18 #include "libcef_dll/ctocpp/views/menu_button_pressed_lock_ctocpp.h"
19 #include "libcef_dll/ctocpp/views/view_ctocpp.h"
20 #include "libcef_dll/shutdown_checker.h"
21
22 namespace {
23
24 // MEMBER FUNCTIONS - Body may be edited by hand.
25
menu_button_delegate_on_menu_button_pressed(struct _cef_menu_button_delegate_t * self,cef_menu_button_t * menu_button,const cef_point_t * screen_point,cef_menu_button_pressed_lock_t * button_pressed_lock)26 void CEF_CALLBACK menu_button_delegate_on_menu_button_pressed(
27 struct _cef_menu_button_delegate_t* self,
28 cef_menu_button_t* menu_button,
29 const cef_point_t* screen_point,
30 cef_menu_button_pressed_lock_t* button_pressed_lock) {
31 shutdown_checker::AssertNotShutdown();
32
33 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
34
35 DCHECK(self);
36 if (!self)
37 return;
38 // Verify param: menu_button; type: refptr_diff
39 DCHECK(menu_button);
40 if (!menu_button)
41 return;
42 // Verify param: screen_point; type: simple_byref_const
43 DCHECK(screen_point);
44 if (!screen_point)
45 return;
46 // Verify param: button_pressed_lock; type: refptr_diff
47 DCHECK(button_pressed_lock);
48 if (!button_pressed_lock)
49 return;
50
51 // Translate param: screen_point; type: simple_byref_const
52 CefPoint screen_pointVal = screen_point ? *screen_point : CefPoint();
53
54 // Execute
55 CefMenuButtonDelegateCppToC::Get(self)->OnMenuButtonPressed(
56 CefMenuButtonCToCpp::Wrap(menu_button), screen_pointVal,
57 CefMenuButtonPressedLockCToCpp::Wrap(button_pressed_lock));
58 }
59
60 void CEF_CALLBACK
menu_button_delegate_on_button_pressed(struct _cef_button_delegate_t * self,cef_button_t * button)61 menu_button_delegate_on_button_pressed(struct _cef_button_delegate_t* self,
62 cef_button_t* button) {
63 shutdown_checker::AssertNotShutdown();
64
65 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
66
67 DCHECK(self);
68 if (!self)
69 return;
70 // Verify param: button; type: refptr_diff
71 DCHECK(button);
72 if (!button)
73 return;
74
75 // Execute
76 CefMenuButtonDelegateCppToC::Get(
77 reinterpret_cast<cef_menu_button_delegate_t*>(self))
78 ->OnButtonPressed(CefButtonCToCpp::Wrap(button));
79 }
80
menu_button_delegate_on_button_state_changed(struct _cef_button_delegate_t * self,cef_button_t * button)81 void CEF_CALLBACK menu_button_delegate_on_button_state_changed(
82 struct _cef_button_delegate_t* self,
83 cef_button_t* button) {
84 shutdown_checker::AssertNotShutdown();
85
86 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
87
88 DCHECK(self);
89 if (!self)
90 return;
91 // Verify param: button; type: refptr_diff
92 DCHECK(button);
93 if (!button)
94 return;
95
96 // Execute
97 CefMenuButtonDelegateCppToC::Get(
98 reinterpret_cast<cef_menu_button_delegate_t*>(self))
99 ->OnButtonStateChanged(CefButtonCToCpp::Wrap(button));
100 }
101
102 cef_size_t CEF_CALLBACK
menu_button_delegate_get_preferred_size(struct _cef_view_delegate_t * self,cef_view_t * view)103 menu_button_delegate_get_preferred_size(struct _cef_view_delegate_t* self,
104 cef_view_t* view) {
105 shutdown_checker::AssertNotShutdown();
106
107 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
108
109 DCHECK(self);
110 if (!self)
111 return CefSize();
112 // Verify param: view; type: refptr_diff
113 DCHECK(view);
114 if (!view)
115 return CefSize();
116
117 // Execute
118 cef_size_t _retval = CefMenuButtonDelegateCppToC::Get(
119 reinterpret_cast<cef_menu_button_delegate_t*>(self))
120 ->GetPreferredSize(CefViewCToCpp::Wrap(view));
121
122 // Return type: simple
123 return _retval;
124 }
125
126 cef_size_t CEF_CALLBACK
menu_button_delegate_get_minimum_size(struct _cef_view_delegate_t * self,cef_view_t * view)127 menu_button_delegate_get_minimum_size(struct _cef_view_delegate_t* self,
128 cef_view_t* view) {
129 shutdown_checker::AssertNotShutdown();
130
131 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
132
133 DCHECK(self);
134 if (!self)
135 return CefSize();
136 // Verify param: view; type: refptr_diff
137 DCHECK(view);
138 if (!view)
139 return CefSize();
140
141 // Execute
142 cef_size_t _retval = CefMenuButtonDelegateCppToC::Get(
143 reinterpret_cast<cef_menu_button_delegate_t*>(self))
144 ->GetMinimumSize(CefViewCToCpp::Wrap(view));
145
146 // Return type: simple
147 return _retval;
148 }
149
150 cef_size_t CEF_CALLBACK
menu_button_delegate_get_maximum_size(struct _cef_view_delegate_t * self,cef_view_t * view)151 menu_button_delegate_get_maximum_size(struct _cef_view_delegate_t* self,
152 cef_view_t* view) {
153 shutdown_checker::AssertNotShutdown();
154
155 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
156
157 DCHECK(self);
158 if (!self)
159 return CefSize();
160 // Verify param: view; type: refptr_diff
161 DCHECK(view);
162 if (!view)
163 return CefSize();
164
165 // Execute
166 cef_size_t _retval = CefMenuButtonDelegateCppToC::Get(
167 reinterpret_cast<cef_menu_button_delegate_t*>(self))
168 ->GetMaximumSize(CefViewCToCpp::Wrap(view));
169
170 // Return type: simple
171 return _retval;
172 }
173
174 int CEF_CALLBACK
menu_button_delegate_get_height_for_width(struct _cef_view_delegate_t * self,cef_view_t * view,int width)175 menu_button_delegate_get_height_for_width(struct _cef_view_delegate_t* self,
176 cef_view_t* view,
177 int width) {
178 shutdown_checker::AssertNotShutdown();
179
180 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
181
182 DCHECK(self);
183 if (!self)
184 return 0;
185 // Verify param: view; type: refptr_diff
186 DCHECK(view);
187 if (!view)
188 return 0;
189
190 // Execute
191 int _retval = CefMenuButtonDelegateCppToC::Get(
192 reinterpret_cast<cef_menu_button_delegate_t*>(self))
193 ->GetHeightForWidth(CefViewCToCpp::Wrap(view), width);
194
195 // Return type: simple
196 return _retval;
197 }
198
199 void CEF_CALLBACK
menu_button_delegate_on_parent_view_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added,cef_view_t * parent)200 menu_button_delegate_on_parent_view_changed(struct _cef_view_delegate_t* self,
201 cef_view_t* view,
202 int added,
203 cef_view_t* parent) {
204 shutdown_checker::AssertNotShutdown();
205
206 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
207
208 DCHECK(self);
209 if (!self)
210 return;
211 // Verify param: view; type: refptr_diff
212 DCHECK(view);
213 if (!view)
214 return;
215 // Verify param: parent; type: refptr_diff
216 DCHECK(parent);
217 if (!parent)
218 return;
219
220 // Execute
221 CefMenuButtonDelegateCppToC::Get(
222 reinterpret_cast<cef_menu_button_delegate_t*>(self))
223 ->OnParentViewChanged(CefViewCToCpp::Wrap(view), added ? true : false,
224 CefViewCToCpp::Wrap(parent));
225 }
226
227 void CEF_CALLBACK
menu_button_delegate_on_child_view_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added,cef_view_t * child)228 menu_button_delegate_on_child_view_changed(struct _cef_view_delegate_t* self,
229 cef_view_t* view,
230 int added,
231 cef_view_t* child) {
232 shutdown_checker::AssertNotShutdown();
233
234 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
235
236 DCHECK(self);
237 if (!self)
238 return;
239 // Verify param: view; type: refptr_diff
240 DCHECK(view);
241 if (!view)
242 return;
243 // Verify param: child; type: refptr_diff
244 DCHECK(child);
245 if (!child)
246 return;
247
248 // Execute
249 CefMenuButtonDelegateCppToC::Get(
250 reinterpret_cast<cef_menu_button_delegate_t*>(self))
251 ->OnChildViewChanged(CefViewCToCpp::Wrap(view), added ? true : false,
252 CefViewCToCpp::Wrap(child));
253 }
254
255 void CEF_CALLBACK
menu_button_delegate_on_window_changed(struct _cef_view_delegate_t * self,cef_view_t * view,int added)256 menu_button_delegate_on_window_changed(struct _cef_view_delegate_t* self,
257 cef_view_t* view,
258 int added) {
259 shutdown_checker::AssertNotShutdown();
260
261 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
262
263 DCHECK(self);
264 if (!self)
265 return;
266 // Verify param: view; type: refptr_diff
267 DCHECK(view);
268 if (!view)
269 return;
270
271 // Execute
272 CefMenuButtonDelegateCppToC::Get(
273 reinterpret_cast<cef_menu_button_delegate_t*>(self))
274 ->OnWindowChanged(CefViewCToCpp::Wrap(view), added ? true : false);
275 }
276
277 void CEF_CALLBACK
menu_button_delegate_on_focus(struct _cef_view_delegate_t * self,cef_view_t * view)278 menu_button_delegate_on_focus(struct _cef_view_delegate_t* self,
279 cef_view_t* view) {
280 shutdown_checker::AssertNotShutdown();
281
282 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
283
284 DCHECK(self);
285 if (!self)
286 return;
287 // Verify param: view; type: refptr_diff
288 DCHECK(view);
289 if (!view)
290 return;
291
292 // Execute
293 CefMenuButtonDelegateCppToC::Get(
294 reinterpret_cast<cef_menu_button_delegate_t*>(self))
295 ->OnFocus(CefViewCToCpp::Wrap(view));
296 }
297
298 void CEF_CALLBACK
menu_button_delegate_on_blur(struct _cef_view_delegate_t * self,cef_view_t * view)299 menu_button_delegate_on_blur(struct _cef_view_delegate_t* self,
300 cef_view_t* view) {
301 shutdown_checker::AssertNotShutdown();
302
303 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
304
305 DCHECK(self);
306 if (!self)
307 return;
308 // Verify param: view; type: refptr_diff
309 DCHECK(view);
310 if (!view)
311 return;
312
313 // Execute
314 CefMenuButtonDelegateCppToC::Get(
315 reinterpret_cast<cef_menu_button_delegate_t*>(self))
316 ->OnBlur(CefViewCToCpp::Wrap(view));
317 }
318
319 } // namespace
320
321 // CONSTRUCTOR - Do not edit by hand.
322
CefMenuButtonDelegateCppToC()323 CefMenuButtonDelegateCppToC::CefMenuButtonDelegateCppToC() {
324 GetStruct()->on_menu_button_pressed =
325 menu_button_delegate_on_menu_button_pressed;
326 GetStruct()->base.on_button_pressed = menu_button_delegate_on_button_pressed;
327 GetStruct()->base.on_button_state_changed =
328 menu_button_delegate_on_button_state_changed;
329 GetStruct()->base.base.get_preferred_size =
330 menu_button_delegate_get_preferred_size;
331 GetStruct()->base.base.get_minimum_size =
332 menu_button_delegate_get_minimum_size;
333 GetStruct()->base.base.get_maximum_size =
334 menu_button_delegate_get_maximum_size;
335 GetStruct()->base.base.get_height_for_width =
336 menu_button_delegate_get_height_for_width;
337 GetStruct()->base.base.on_parent_view_changed =
338 menu_button_delegate_on_parent_view_changed;
339 GetStruct()->base.base.on_child_view_changed =
340 menu_button_delegate_on_child_view_changed;
341 GetStruct()->base.base.on_window_changed =
342 menu_button_delegate_on_window_changed;
343 GetStruct()->base.base.on_focus = menu_button_delegate_on_focus;
344 GetStruct()->base.base.on_blur = menu_button_delegate_on_blur;
345 }
346
347 // DESTRUCTOR - Do not edit by hand.
348
~CefMenuButtonDelegateCppToC()349 CefMenuButtonDelegateCppToC::~CefMenuButtonDelegateCppToC() {
350 shutdown_checker::AssertNotShutdown();
351 }
352
353 template <>
354 CefRefPtr<CefMenuButtonDelegate> CefCppToCRefCounted<
355 CefMenuButtonDelegateCppToC,
356 CefMenuButtonDelegate,
UnwrapDerived(CefWrapperType type,cef_menu_button_delegate_t * s)357 cef_menu_button_delegate_t>::UnwrapDerived(CefWrapperType type,
358 cef_menu_button_delegate_t* s) {
359 NOTREACHED() << "Unexpected class type: " << type;
360 return nullptr;
361 }
362
363 template <>
364 CefWrapperType CefCppToCRefCounted<CefMenuButtonDelegateCppToC,
365 CefMenuButtonDelegate,
366 cef_menu_button_delegate_t>::kWrapperType =
367 WT_MENU_BUTTON_DELEGATE;
368