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