• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=33aeaefa103664f5cead6898d2f957d8a9a97a92$
13 //
14 
15 #include "libcef_dll/ctocpp/image_ctocpp.h"
16 #include "libcef_dll/ctocpp/binary_value_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18 
19 // STATIC METHODS - Body may be edited by hand.
20 
CreateImage()21 NO_SANITIZE("cfi-icall") CefRefPtr<CefImage> CefImage::CreateImage() {
22   shutdown_checker::AssertNotShutdown();
23 
24   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
25 
26   // Execute
27   cef_image_t* _retval = cef_image_create();
28 
29   // Return type: refptr_same
30   return CefImageCToCpp::Wrap(_retval);
31 }
32 
33 // VIRTUAL METHODS - Body may be edited by hand.
34 
IsEmpty()35 NO_SANITIZE("cfi-icall") bool CefImageCToCpp::IsEmpty() {
36   shutdown_checker::AssertNotShutdown();
37 
38   cef_image_t* _struct = GetStruct();
39   if (CEF_MEMBER_MISSING(_struct, is_empty))
40     return false;
41 
42   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
43 
44   // Execute
45   int _retval = _struct->is_empty(_struct);
46 
47   // Return type: bool
48   return _retval ? true : false;
49 }
50 
IsSame(CefRefPtr<CefImage> that)51 NO_SANITIZE("cfi-icall") bool CefImageCToCpp::IsSame(CefRefPtr<CefImage> that) {
52   shutdown_checker::AssertNotShutdown();
53 
54   cef_image_t* _struct = GetStruct();
55   if (CEF_MEMBER_MISSING(_struct, is_same))
56     return false;
57 
58   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
59 
60   // Verify param: that; type: refptr_same
61   DCHECK(that.get());
62   if (!that.get())
63     return false;
64 
65   // Execute
66   int _retval = _struct->is_same(_struct, CefImageCToCpp::Unwrap(that));
67 
68   // Return type: bool
69   return _retval ? true : false;
70 }
71 
72 NO_SANITIZE("cfi-icall")
AddBitmap(float scale_factor,int pixel_width,int pixel_height,cef_color_type_t color_type,cef_alpha_type_t alpha_type,const void * pixel_data,size_t pixel_data_size)73 bool CefImageCToCpp::AddBitmap(float scale_factor,
74                                int pixel_width,
75                                int pixel_height,
76                                cef_color_type_t color_type,
77                                cef_alpha_type_t alpha_type,
78                                const void* pixel_data,
79                                size_t pixel_data_size) {
80   shutdown_checker::AssertNotShutdown();
81 
82   cef_image_t* _struct = GetStruct();
83   if (CEF_MEMBER_MISSING(_struct, add_bitmap))
84     return false;
85 
86   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
87 
88   // Verify param: pixel_data; type: simple_byaddr
89   DCHECK(pixel_data);
90   if (!pixel_data)
91     return false;
92 
93   // Execute
94   int _retval =
95       _struct->add_bitmap(_struct, scale_factor, pixel_width, pixel_height,
96                           color_type, alpha_type, pixel_data, pixel_data_size);
97 
98   // Return type: bool
99   return _retval ? true : false;
100 }
101 
102 NO_SANITIZE("cfi-icall")
AddPNG(float scale_factor,const void * png_data,size_t png_data_size)103 bool CefImageCToCpp::AddPNG(float scale_factor,
104                             const void* png_data,
105                             size_t png_data_size) {
106   shutdown_checker::AssertNotShutdown();
107 
108   cef_image_t* _struct = GetStruct();
109   if (CEF_MEMBER_MISSING(_struct, add_png))
110     return false;
111 
112   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
113 
114   // Verify param: png_data; type: simple_byaddr
115   DCHECK(png_data);
116   if (!png_data)
117     return false;
118 
119   // Execute
120   int _retval =
121       _struct->add_png(_struct, scale_factor, png_data, png_data_size);
122 
123   // Return type: bool
124   return _retval ? true : false;
125 }
126 
127 NO_SANITIZE("cfi-icall")
AddJPEG(float scale_factor,const void * jpeg_data,size_t jpeg_data_size)128 bool CefImageCToCpp::AddJPEG(float scale_factor,
129                              const void* jpeg_data,
130                              size_t jpeg_data_size) {
131   shutdown_checker::AssertNotShutdown();
132 
133   cef_image_t* _struct = GetStruct();
134   if (CEF_MEMBER_MISSING(_struct, add_jpeg))
135     return false;
136 
137   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
138 
139   // Verify param: jpeg_data; type: simple_byaddr
140   DCHECK(jpeg_data);
141   if (!jpeg_data)
142     return false;
143 
144   // Execute
145   int _retval =
146       _struct->add_jpeg(_struct, scale_factor, jpeg_data, jpeg_data_size);
147 
148   // Return type: bool
149   return _retval ? true : false;
150 }
151 
GetWidth()152 NO_SANITIZE("cfi-icall") size_t CefImageCToCpp::GetWidth() {
153   shutdown_checker::AssertNotShutdown();
154 
155   cef_image_t* _struct = GetStruct();
156   if (CEF_MEMBER_MISSING(_struct, get_width))
157     return 0;
158 
159   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
160 
161   // Execute
162   size_t _retval = _struct->get_width(_struct);
163 
164   // Return type: simple
165   return _retval;
166 }
167 
GetHeight()168 NO_SANITIZE("cfi-icall") size_t CefImageCToCpp::GetHeight() {
169   shutdown_checker::AssertNotShutdown();
170 
171   cef_image_t* _struct = GetStruct();
172   if (CEF_MEMBER_MISSING(_struct, get_height))
173     return 0;
174 
175   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
176 
177   // Execute
178   size_t _retval = _struct->get_height(_struct);
179 
180   // Return type: simple
181   return _retval;
182 }
183 
184 NO_SANITIZE("cfi-icall")
HasRepresentation(float scale_factor)185 bool CefImageCToCpp::HasRepresentation(float scale_factor) {
186   shutdown_checker::AssertNotShutdown();
187 
188   cef_image_t* _struct = GetStruct();
189   if (CEF_MEMBER_MISSING(_struct, has_representation))
190     return false;
191 
192   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
193 
194   // Execute
195   int _retval = _struct->has_representation(_struct, scale_factor);
196 
197   // Return type: bool
198   return _retval ? true : false;
199 }
200 
201 NO_SANITIZE("cfi-icall")
RemoveRepresentation(float scale_factor)202 bool CefImageCToCpp::RemoveRepresentation(float scale_factor) {
203   shutdown_checker::AssertNotShutdown();
204 
205   cef_image_t* _struct = GetStruct();
206   if (CEF_MEMBER_MISSING(_struct, remove_representation))
207     return false;
208 
209   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
210 
211   // Execute
212   int _retval = _struct->remove_representation(_struct, scale_factor);
213 
214   // Return type: bool
215   return _retval ? true : false;
216 }
217 
218 NO_SANITIZE("cfi-icall")
GetRepresentationInfo(float scale_factor,float & actual_scale_factor,int & pixel_width,int & pixel_height)219 bool CefImageCToCpp::GetRepresentationInfo(float scale_factor,
220                                            float& actual_scale_factor,
221                                            int& pixel_width,
222                                            int& pixel_height) {
223   shutdown_checker::AssertNotShutdown();
224 
225   cef_image_t* _struct = GetStruct();
226   if (CEF_MEMBER_MISSING(_struct, get_representation_info))
227     return false;
228 
229   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
230 
231   // Execute
232   int _retval = _struct->get_representation_info(
233       _struct, scale_factor, &actual_scale_factor, &pixel_width, &pixel_height);
234 
235   // Return type: bool
236   return _retval ? true : false;
237 }
238 
239 NO_SANITIZE("cfi-icall")
GetAsBitmap(float scale_factor,cef_color_type_t color_type,cef_alpha_type_t alpha_type,int & pixel_width,int & pixel_height)240 CefRefPtr<CefBinaryValue> CefImageCToCpp::GetAsBitmap(
241     float scale_factor,
242     cef_color_type_t color_type,
243     cef_alpha_type_t alpha_type,
244     int& pixel_width,
245     int& pixel_height) {
246   shutdown_checker::AssertNotShutdown();
247 
248   cef_image_t* _struct = GetStruct();
249   if (CEF_MEMBER_MISSING(_struct, get_as_bitmap))
250     return nullptr;
251 
252   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
253 
254   // Execute
255   cef_binary_value_t* _retval =
256       _struct->get_as_bitmap(_struct, scale_factor, color_type, alpha_type,
257                              &pixel_width, &pixel_height);
258 
259   // Return type: refptr_same
260   return CefBinaryValueCToCpp::Wrap(_retval);
261 }
262 
263 NO_SANITIZE("cfi-icall")
GetAsPNG(float scale_factor,bool with_transparency,int & pixel_width,int & pixel_height)264 CefRefPtr<CefBinaryValue> CefImageCToCpp::GetAsPNG(float scale_factor,
265                                                    bool with_transparency,
266                                                    int& pixel_width,
267                                                    int& pixel_height) {
268   shutdown_checker::AssertNotShutdown();
269 
270   cef_image_t* _struct = GetStruct();
271   if (CEF_MEMBER_MISSING(_struct, get_as_png))
272     return nullptr;
273 
274   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
275 
276   // Execute
277   cef_binary_value_t* _retval = _struct->get_as_png(
278       _struct, scale_factor, with_transparency, &pixel_width, &pixel_height);
279 
280   // Return type: refptr_same
281   return CefBinaryValueCToCpp::Wrap(_retval);
282 }
283 
284 NO_SANITIZE("cfi-icall")
GetAsJPEG(float scale_factor,int quality,int & pixel_width,int & pixel_height)285 CefRefPtr<CefBinaryValue> CefImageCToCpp::GetAsJPEG(float scale_factor,
286                                                     int quality,
287                                                     int& pixel_width,
288                                                     int& pixel_height) {
289   shutdown_checker::AssertNotShutdown();
290 
291   cef_image_t* _struct = GetStruct();
292   if (CEF_MEMBER_MISSING(_struct, get_as_jpeg))
293     return nullptr;
294 
295   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
296 
297   // Execute
298   cef_binary_value_t* _retval = _struct->get_as_jpeg(
299       _struct, scale_factor, quality, &pixel_width, &pixel_height);
300 
301   // Return type: refptr_same
302   return CefBinaryValueCToCpp::Wrap(_retval);
303 }
304 
305 // CONSTRUCTOR - Do not edit by hand.
306 
CefImageCToCpp()307 CefImageCToCpp::CefImageCToCpp() {}
308 
309 // DESTRUCTOR - Do not edit by hand.
310 
~CefImageCToCpp()311 CefImageCToCpp::~CefImageCToCpp() {
312   shutdown_checker::AssertNotShutdown();
313 }
314 
315 template <>
316 cef_image_t*
UnwrapDerived(CefWrapperType type,CefImage * c)317 CefCToCppRefCounted<CefImageCToCpp, CefImage, cef_image_t>::UnwrapDerived(
318     CefWrapperType type,
319     CefImage* c) {
320   NOTREACHED() << "Unexpected class type: " << type;
321   return nullptr;
322 }
323 
324 template <>
325 CefWrapperType
326     CefCToCppRefCounted<CefImageCToCpp, CefImage, cef_image_t>::kWrapperType =
327         WT_IMAGE;
328