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=2d2041c7571bd613f92c2d80c100e92e7439df6e$
13 //
14
15 #include "libcef_dll/cpptoc/list_value_cpptoc.h"
16 #include "libcef_dll/cpptoc/binary_value_cpptoc.h"
17 #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
18 #include "libcef_dll/cpptoc/value_cpptoc.h"
19 #include "libcef_dll/shutdown_checker.h"
20
21 // GLOBAL FUNCTIONS - Body may be edited by hand.
22
cef_list_value_create()23 CEF_EXPORT cef_list_value_t* cef_list_value_create() {
24 shutdown_checker::AssertNotShutdown();
25
26 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
27
28 // Execute
29 CefRefPtr<CefListValue> _retval = CefListValue::Create();
30
31 // Return type: refptr_same
32 return CefListValueCppToC::Wrap(_retval);
33 }
34
35 namespace {
36
37 // MEMBER FUNCTIONS - Body may be edited by hand.
38
list_value_is_valid(struct _cef_list_value_t * self)39 int CEF_CALLBACK list_value_is_valid(struct _cef_list_value_t* self) {
40 shutdown_checker::AssertNotShutdown();
41
42 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
43
44 DCHECK(self);
45 if (!self)
46 return 0;
47
48 // Execute
49 bool _retval = CefListValueCppToC::Get(self)->IsValid();
50
51 // Return type: bool
52 return _retval;
53 }
54
list_value_is_owned(struct _cef_list_value_t * self)55 int CEF_CALLBACK list_value_is_owned(struct _cef_list_value_t* self) {
56 shutdown_checker::AssertNotShutdown();
57
58 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
59
60 DCHECK(self);
61 if (!self)
62 return 0;
63
64 // Execute
65 bool _retval = CefListValueCppToC::Get(self)->IsOwned();
66
67 // Return type: bool
68 return _retval;
69 }
70
list_value_is_read_only(struct _cef_list_value_t * self)71 int CEF_CALLBACK list_value_is_read_only(struct _cef_list_value_t* self) {
72 shutdown_checker::AssertNotShutdown();
73
74 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
75
76 DCHECK(self);
77 if (!self)
78 return 0;
79
80 // Execute
81 bool _retval = CefListValueCppToC::Get(self)->IsReadOnly();
82
83 // Return type: bool
84 return _retval;
85 }
86
list_value_is_same(struct _cef_list_value_t * self,struct _cef_list_value_t * that)87 int CEF_CALLBACK list_value_is_same(struct _cef_list_value_t* self,
88 struct _cef_list_value_t* that) {
89 shutdown_checker::AssertNotShutdown();
90
91 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
92
93 DCHECK(self);
94 if (!self)
95 return 0;
96 // Verify param: that; type: refptr_same
97 DCHECK(that);
98 if (!that)
99 return 0;
100
101 // Execute
102 bool _retval =
103 CefListValueCppToC::Get(self)->IsSame(CefListValueCppToC::Unwrap(that));
104
105 // Return type: bool
106 return _retval;
107 }
108
list_value_is_equal(struct _cef_list_value_t * self,struct _cef_list_value_t * that)109 int CEF_CALLBACK list_value_is_equal(struct _cef_list_value_t* self,
110 struct _cef_list_value_t* that) {
111 shutdown_checker::AssertNotShutdown();
112
113 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
114
115 DCHECK(self);
116 if (!self)
117 return 0;
118 // Verify param: that; type: refptr_same
119 DCHECK(that);
120 if (!that)
121 return 0;
122
123 // Execute
124 bool _retval =
125 CefListValueCppToC::Get(self)->IsEqual(CefListValueCppToC::Unwrap(that));
126
127 // Return type: bool
128 return _retval;
129 }
130
131 struct _cef_list_value_t* CEF_CALLBACK
list_value_copy(struct _cef_list_value_t * self)132 list_value_copy(struct _cef_list_value_t* self) {
133 shutdown_checker::AssertNotShutdown();
134
135 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
136
137 DCHECK(self);
138 if (!self)
139 return NULL;
140
141 // Execute
142 CefRefPtr<CefListValue> _retval = CefListValueCppToC::Get(self)->Copy();
143
144 // Return type: refptr_same
145 return CefListValueCppToC::Wrap(_retval);
146 }
147
list_value_set_size(struct _cef_list_value_t * self,size_t size)148 int CEF_CALLBACK list_value_set_size(struct _cef_list_value_t* self,
149 size_t size) {
150 shutdown_checker::AssertNotShutdown();
151
152 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
153
154 DCHECK(self);
155 if (!self)
156 return 0;
157
158 // Execute
159 bool _retval = CefListValueCppToC::Get(self)->SetSize(size);
160
161 // Return type: bool
162 return _retval;
163 }
164
list_value_get_size(struct _cef_list_value_t * self)165 size_t CEF_CALLBACK list_value_get_size(struct _cef_list_value_t* self) {
166 shutdown_checker::AssertNotShutdown();
167
168 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
169
170 DCHECK(self);
171 if (!self)
172 return 0;
173
174 // Execute
175 size_t _retval = CefListValueCppToC::Get(self)->GetSize();
176
177 // Return type: simple
178 return _retval;
179 }
180
list_value_clear(struct _cef_list_value_t * self)181 int CEF_CALLBACK list_value_clear(struct _cef_list_value_t* self) {
182 shutdown_checker::AssertNotShutdown();
183
184 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
185
186 DCHECK(self);
187 if (!self)
188 return 0;
189
190 // Execute
191 bool _retval = CefListValueCppToC::Get(self)->Clear();
192
193 // Return type: bool
194 return _retval;
195 }
196
list_value_remove(struct _cef_list_value_t * self,size_t index)197 int CEF_CALLBACK list_value_remove(struct _cef_list_value_t* self,
198 size_t index) {
199 shutdown_checker::AssertNotShutdown();
200
201 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
202
203 DCHECK(self);
204 if (!self)
205 return 0;
206
207 // Execute
208 bool _retval = CefListValueCppToC::Get(self)->Remove(index);
209
210 // Return type: bool
211 return _retval;
212 }
213
214 cef_value_type_t CEF_CALLBACK
list_value_get_type(struct _cef_list_value_t * self,size_t index)215 list_value_get_type(struct _cef_list_value_t* self, size_t index) {
216 shutdown_checker::AssertNotShutdown();
217
218 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
219
220 DCHECK(self);
221 if (!self)
222 return VTYPE_INVALID;
223
224 // Execute
225 cef_value_type_t _retval = CefListValueCppToC::Get(self)->GetType(index);
226
227 // Return type: simple
228 return _retval;
229 }
230
list_value_get_value(struct _cef_list_value_t * self,size_t index)231 cef_value_t* CEF_CALLBACK list_value_get_value(struct _cef_list_value_t* self,
232 size_t index) {
233 shutdown_checker::AssertNotShutdown();
234
235 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
236
237 DCHECK(self);
238 if (!self)
239 return NULL;
240
241 // Execute
242 CefRefPtr<CefValue> _retval = CefListValueCppToC::Get(self)->GetValue(index);
243
244 // Return type: refptr_same
245 return CefValueCppToC::Wrap(_retval);
246 }
247
list_value_get_bool(struct _cef_list_value_t * self,size_t index)248 int CEF_CALLBACK list_value_get_bool(struct _cef_list_value_t* self,
249 size_t index) {
250 shutdown_checker::AssertNotShutdown();
251
252 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
253
254 DCHECK(self);
255 if (!self)
256 return 0;
257
258 // Execute
259 bool _retval = CefListValueCppToC::Get(self)->GetBool(index);
260
261 // Return type: bool
262 return _retval;
263 }
264
list_value_get_int(struct _cef_list_value_t * self,size_t index)265 int CEF_CALLBACK list_value_get_int(struct _cef_list_value_t* self,
266 size_t index) {
267 shutdown_checker::AssertNotShutdown();
268
269 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
270
271 DCHECK(self);
272 if (!self)
273 return 0;
274
275 // Execute
276 int _retval = CefListValueCppToC::Get(self)->GetInt(index);
277
278 // Return type: simple
279 return _retval;
280 }
281
list_value_get_double(struct _cef_list_value_t * self,size_t index)282 double CEF_CALLBACK list_value_get_double(struct _cef_list_value_t* self,
283 size_t index) {
284 shutdown_checker::AssertNotShutdown();
285
286 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
287
288 DCHECK(self);
289 if (!self)
290 return 0;
291
292 // Execute
293 double _retval = CefListValueCppToC::Get(self)->GetDouble(index);
294
295 // Return type: simple
296 return _retval;
297 }
298
299 cef_string_userfree_t CEF_CALLBACK
list_value_get_string(struct _cef_list_value_t * self,size_t index)300 list_value_get_string(struct _cef_list_value_t* self, size_t index) {
301 shutdown_checker::AssertNotShutdown();
302
303 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
304
305 DCHECK(self);
306 if (!self)
307 return NULL;
308
309 // Execute
310 CefString _retval = CefListValueCppToC::Get(self)->GetString(index);
311
312 // Return type: string
313 return _retval.DetachToUserFree();
314 }
315
316 cef_binary_value_t* CEF_CALLBACK
list_value_get_binary(struct _cef_list_value_t * self,size_t index)317 list_value_get_binary(struct _cef_list_value_t* self, size_t index) {
318 shutdown_checker::AssertNotShutdown();
319
320 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
321
322 DCHECK(self);
323 if (!self)
324 return NULL;
325
326 // Execute
327 CefRefPtr<CefBinaryValue> _retval =
328 CefListValueCppToC::Get(self)->GetBinary(index);
329
330 // Return type: refptr_same
331 return CefBinaryValueCppToC::Wrap(_retval);
332 }
333
334 cef_dictionary_value_t* CEF_CALLBACK
list_value_get_dictionary(struct _cef_list_value_t * self,size_t index)335 list_value_get_dictionary(struct _cef_list_value_t* self, size_t index) {
336 shutdown_checker::AssertNotShutdown();
337
338 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
339
340 DCHECK(self);
341 if (!self)
342 return NULL;
343
344 // Execute
345 CefRefPtr<CefDictionaryValue> _retval =
346 CefListValueCppToC::Get(self)->GetDictionary(index);
347
348 // Return type: refptr_same
349 return CefDictionaryValueCppToC::Wrap(_retval);
350 }
351
352 struct _cef_list_value_t* CEF_CALLBACK
list_value_get_list(struct _cef_list_value_t * self,size_t index)353 list_value_get_list(struct _cef_list_value_t* self, size_t index) {
354 shutdown_checker::AssertNotShutdown();
355
356 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
357
358 DCHECK(self);
359 if (!self)
360 return NULL;
361
362 // Execute
363 CefRefPtr<CefListValue> _retval =
364 CefListValueCppToC::Get(self)->GetList(index);
365
366 // Return type: refptr_same
367 return CefListValueCppToC::Wrap(_retval);
368 }
369
list_value_set_value(struct _cef_list_value_t * self,size_t index,cef_value_t * value)370 int CEF_CALLBACK list_value_set_value(struct _cef_list_value_t* self,
371 size_t index,
372 cef_value_t* value) {
373 shutdown_checker::AssertNotShutdown();
374
375 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
376
377 DCHECK(self);
378 if (!self)
379 return 0;
380 // Verify param: value; type: refptr_same
381 DCHECK(value);
382 if (!value)
383 return 0;
384
385 // Execute
386 bool _retval = CefListValueCppToC::Get(self)->SetValue(
387 index, CefValueCppToC::Unwrap(value));
388
389 // Return type: bool
390 return _retval;
391 }
392
list_value_set_null(struct _cef_list_value_t * self,size_t index)393 int CEF_CALLBACK list_value_set_null(struct _cef_list_value_t* self,
394 size_t index) {
395 shutdown_checker::AssertNotShutdown();
396
397 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
398
399 DCHECK(self);
400 if (!self)
401 return 0;
402
403 // Execute
404 bool _retval = CefListValueCppToC::Get(self)->SetNull(index);
405
406 // Return type: bool
407 return _retval;
408 }
409
list_value_set_bool(struct _cef_list_value_t * self,size_t index,int value)410 int CEF_CALLBACK list_value_set_bool(struct _cef_list_value_t* self,
411 size_t index,
412 int value) {
413 shutdown_checker::AssertNotShutdown();
414
415 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
416
417 DCHECK(self);
418 if (!self)
419 return 0;
420
421 // Execute
422 bool _retval =
423 CefListValueCppToC::Get(self)->SetBool(index, value ? true : false);
424
425 // Return type: bool
426 return _retval;
427 }
428
list_value_set_int(struct _cef_list_value_t * self,size_t index,int value)429 int CEF_CALLBACK list_value_set_int(struct _cef_list_value_t* self,
430 size_t index,
431 int value) {
432 shutdown_checker::AssertNotShutdown();
433
434 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
435
436 DCHECK(self);
437 if (!self)
438 return 0;
439
440 // Execute
441 bool _retval = CefListValueCppToC::Get(self)->SetInt(index, value);
442
443 // Return type: bool
444 return _retval;
445 }
446
list_value_set_double(struct _cef_list_value_t * self,size_t index,double value)447 int CEF_CALLBACK list_value_set_double(struct _cef_list_value_t* self,
448 size_t index,
449 double value) {
450 shutdown_checker::AssertNotShutdown();
451
452 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
453
454 DCHECK(self);
455 if (!self)
456 return 0;
457
458 // Execute
459 bool _retval = CefListValueCppToC::Get(self)->SetDouble(index, value);
460
461 // Return type: bool
462 return _retval;
463 }
464
list_value_set_string(struct _cef_list_value_t * self,size_t index,const cef_string_t * value)465 int CEF_CALLBACK list_value_set_string(struct _cef_list_value_t* self,
466 size_t index,
467 const cef_string_t* value) {
468 shutdown_checker::AssertNotShutdown();
469
470 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
471
472 DCHECK(self);
473 if (!self)
474 return 0;
475 // Unverified params: value
476
477 // Execute
478 bool _retval =
479 CefListValueCppToC::Get(self)->SetString(index, CefString(value));
480
481 // Return type: bool
482 return _retval;
483 }
484
list_value_set_binary(struct _cef_list_value_t * self,size_t index,cef_binary_value_t * value)485 int CEF_CALLBACK list_value_set_binary(struct _cef_list_value_t* self,
486 size_t index,
487 cef_binary_value_t* value) {
488 shutdown_checker::AssertNotShutdown();
489
490 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
491
492 DCHECK(self);
493 if (!self)
494 return 0;
495 // Verify param: value; type: refptr_same
496 DCHECK(value);
497 if (!value)
498 return 0;
499
500 // Execute
501 bool _retval = CefListValueCppToC::Get(self)->SetBinary(
502 index, CefBinaryValueCppToC::Unwrap(value));
503
504 // Return type: bool
505 return _retval;
506 }
507
list_value_set_dictionary(struct _cef_list_value_t * self,size_t index,cef_dictionary_value_t * value)508 int CEF_CALLBACK list_value_set_dictionary(struct _cef_list_value_t* self,
509 size_t index,
510 cef_dictionary_value_t* value) {
511 shutdown_checker::AssertNotShutdown();
512
513 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
514
515 DCHECK(self);
516 if (!self)
517 return 0;
518 // Verify param: value; type: refptr_same
519 DCHECK(value);
520 if (!value)
521 return 0;
522
523 // Execute
524 bool _retval = CefListValueCppToC::Get(self)->SetDictionary(
525 index, CefDictionaryValueCppToC::Unwrap(value));
526
527 // Return type: bool
528 return _retval;
529 }
530
list_value_set_list(struct _cef_list_value_t * self,size_t index,struct _cef_list_value_t * value)531 int CEF_CALLBACK list_value_set_list(struct _cef_list_value_t* self,
532 size_t index,
533 struct _cef_list_value_t* value) {
534 shutdown_checker::AssertNotShutdown();
535
536 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
537
538 DCHECK(self);
539 if (!self)
540 return 0;
541 // Verify param: value; type: refptr_same
542 DCHECK(value);
543 if (!value)
544 return 0;
545
546 // Execute
547 bool _retval = CefListValueCppToC::Get(self)->SetList(
548 index, CefListValueCppToC::Unwrap(value));
549
550 // Return type: bool
551 return _retval;
552 }
553
554 } // namespace
555
556 // CONSTRUCTOR - Do not edit by hand.
557
CefListValueCppToC()558 CefListValueCppToC::CefListValueCppToC() {
559 GetStruct()->is_valid = list_value_is_valid;
560 GetStruct()->is_owned = list_value_is_owned;
561 GetStruct()->is_read_only = list_value_is_read_only;
562 GetStruct()->is_same = list_value_is_same;
563 GetStruct()->is_equal = list_value_is_equal;
564 GetStruct()->copy = list_value_copy;
565 GetStruct()->set_size = list_value_set_size;
566 GetStruct()->get_size = list_value_get_size;
567 GetStruct()->clear = list_value_clear;
568 GetStruct()->remove = list_value_remove;
569 GetStruct()->get_type = list_value_get_type;
570 GetStruct()->get_value = list_value_get_value;
571 GetStruct()->get_bool = list_value_get_bool;
572 GetStruct()->get_int = list_value_get_int;
573 GetStruct()->get_double = list_value_get_double;
574 GetStruct()->get_string = list_value_get_string;
575 GetStruct()->get_binary = list_value_get_binary;
576 GetStruct()->get_dictionary = list_value_get_dictionary;
577 GetStruct()->get_list = list_value_get_list;
578 GetStruct()->set_value = list_value_set_value;
579 GetStruct()->set_null = list_value_set_null;
580 GetStruct()->set_bool = list_value_set_bool;
581 GetStruct()->set_int = list_value_set_int;
582 GetStruct()->set_double = list_value_set_double;
583 GetStruct()->set_string = list_value_set_string;
584 GetStruct()->set_binary = list_value_set_binary;
585 GetStruct()->set_dictionary = list_value_set_dictionary;
586 GetStruct()->set_list = list_value_set_list;
587 }
588
589 // DESTRUCTOR - Do not edit by hand.
590
~CefListValueCppToC()591 CefListValueCppToC::~CefListValueCppToC() {
592 shutdown_checker::AssertNotShutdown();
593 }
594
595 template <>
596 CefRefPtr<CefListValue>
597 CefCppToCRefCounted<CefListValueCppToC, CefListValue, cef_list_value_t>::
UnwrapDerived(CefWrapperType type,cef_list_value_t * s)598 UnwrapDerived(CefWrapperType type, cef_list_value_t* s) {
599 NOTREACHED() << "Unexpected class type: " << type;
600 return nullptr;
601 }
602
603 template <>
604 CefWrapperType CefCppToCRefCounted<CefListValueCppToC,
605 CefListValue,
606 cef_list_value_t>::kWrapperType =
607 WT_LIST_VALUE;
608