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