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=95678987551b26755e5dc718c3cad2e975b574c7$
13 //
14
15 #include "libcef_dll/cpptoc/views/box_layout_cpptoc.h"
16 #include "libcef_dll/cpptoc/views/fill_layout_cpptoc.h"
17 #include "libcef_dll/cpptoc/views/view_cpptoc.h"
18 #include "libcef_dll/shutdown_checker.h"
19
20 namespace {
21
22 // MEMBER FUNCTIONS - Body may be edited by hand.
23
box_layout_set_flex_for_view(struct _cef_box_layout_t * self,struct _cef_view_t * view,int flex)24 void CEF_CALLBACK box_layout_set_flex_for_view(struct _cef_box_layout_t* self,
25 struct _cef_view_t* view,
26 int flex) {
27 shutdown_checker::AssertNotShutdown();
28
29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30
31 DCHECK(self);
32 if (!self)
33 return;
34 // Verify param: view; type: refptr_same
35 DCHECK(view);
36 if (!view)
37 return;
38
39 // Execute
40 CefBoxLayoutCppToC::Get(self)->SetFlexForView(CefViewCppToC::Unwrap(view),
41 flex);
42 }
43
box_layout_clear_flex_for_view(struct _cef_box_layout_t * self,struct _cef_view_t * view)44 void CEF_CALLBACK box_layout_clear_flex_for_view(struct _cef_box_layout_t* self,
45 struct _cef_view_t* view) {
46 shutdown_checker::AssertNotShutdown();
47
48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
49
50 DCHECK(self);
51 if (!self)
52 return;
53 // Verify param: view; type: refptr_same
54 DCHECK(view);
55 if (!view)
56 return;
57
58 // Execute
59 CefBoxLayoutCppToC::Get(self)->ClearFlexForView(CefViewCppToC::Unwrap(view));
60 }
61
62 cef_box_layout_t* CEF_CALLBACK
box_layout_as_box_layout(struct _cef_layout_t * self)63 box_layout_as_box_layout(struct _cef_layout_t* self) {
64 shutdown_checker::AssertNotShutdown();
65
66 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
67
68 DCHECK(self);
69 if (!self)
70 return NULL;
71
72 // Execute
73 CefRefPtr<CefBoxLayout> _retval =
74 CefBoxLayoutCppToC::Get(reinterpret_cast<cef_box_layout_t*>(self))
75 ->AsBoxLayout();
76
77 // Return type: refptr_same
78 return CefBoxLayoutCppToC::Wrap(_retval);
79 }
80
81 cef_fill_layout_t* CEF_CALLBACK
box_layout_as_fill_layout(struct _cef_layout_t * self)82 box_layout_as_fill_layout(struct _cef_layout_t* self) {
83 shutdown_checker::AssertNotShutdown();
84
85 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
86
87 DCHECK(self);
88 if (!self)
89 return NULL;
90
91 // Execute
92 CefRefPtr<CefFillLayout> _retval =
93 CefBoxLayoutCppToC::Get(reinterpret_cast<cef_box_layout_t*>(self))
94 ->AsFillLayout();
95
96 // Return type: refptr_same
97 return CefFillLayoutCppToC::Wrap(_retval);
98 }
99
box_layout_is_valid(struct _cef_layout_t * self)100 int CEF_CALLBACK box_layout_is_valid(struct _cef_layout_t* self) {
101 shutdown_checker::AssertNotShutdown();
102
103 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
104
105 DCHECK(self);
106 if (!self)
107 return 0;
108
109 // Execute
110 bool _retval =
111 CefBoxLayoutCppToC::Get(reinterpret_cast<cef_box_layout_t*>(self))
112 ->IsValid();
113
114 // Return type: bool
115 return _retval;
116 }
117
118 } // namespace
119
120 // CONSTRUCTOR - Do not edit by hand.
121
CefBoxLayoutCppToC()122 CefBoxLayoutCppToC::CefBoxLayoutCppToC() {
123 GetStruct()->set_flex_for_view = box_layout_set_flex_for_view;
124 GetStruct()->clear_flex_for_view = box_layout_clear_flex_for_view;
125 GetStruct()->base.as_box_layout = box_layout_as_box_layout;
126 GetStruct()->base.as_fill_layout = box_layout_as_fill_layout;
127 GetStruct()->base.is_valid = box_layout_is_valid;
128 }
129
130 // DESTRUCTOR - Do not edit by hand.
131
~CefBoxLayoutCppToC()132 CefBoxLayoutCppToC::~CefBoxLayoutCppToC() {
133 shutdown_checker::AssertNotShutdown();
134 }
135
136 template <>
137 CefRefPtr<CefBoxLayout>
138 CefCppToCRefCounted<CefBoxLayoutCppToC, CefBoxLayout, cef_box_layout_t>::
UnwrapDerived(CefWrapperType type,cef_box_layout_t * s)139 UnwrapDerived(CefWrapperType type, cef_box_layout_t* s) {
140 NOTREACHED() << "Unexpected class type: " << type;
141 return nullptr;
142 }
143
144 template <>
145 CefWrapperType CefCppToCRefCounted<CefBoxLayoutCppToC,
146 CefBoxLayout,
147 cef_box_layout_t>::kWrapperType =
148 WT_BOX_LAYOUT;
149