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=442b86286b5b3126fd0a0f0849ca661ef7487fb3$
13 //
14
15 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_cpptoc.h"
16 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
17 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
18
19 // GLOBAL FUNCTIONS - Body may be edited by hand.
20
21 CEF_EXPORT cef_translator_test_scoped_library_t*
cef_translator_test_scoped_library_create(int value)22 cef_translator_test_scoped_library_create(int value) {
23 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
24
25 // Execute
26 CefOwnPtr<CefTranslatorTestScopedLibrary> _retval =
27 CefTranslatorTestScopedLibrary::Create(value);
28
29 // Return type: ownptr_same
30 return CefTranslatorTestScopedLibraryCppToC::WrapOwn(std::move(_retval));
31 }
32
33 namespace {
34
35 // MEMBER FUNCTIONS - Body may be edited by hand.
36
translator_test_scoped_library_get_value(struct _cef_translator_test_scoped_library_t * self)37 int CEF_CALLBACK translator_test_scoped_library_get_value(
38 struct _cef_translator_test_scoped_library_t* self) {
39 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
40
41 DCHECK(self);
42 if (!self)
43 return 0;
44
45 // Execute
46 int _retval = CefTranslatorTestScopedLibraryCppToC::Get(self)->GetValue();
47
48 // Return type: simple
49 return _retval;
50 }
51
translator_test_scoped_library_set_value(struct _cef_translator_test_scoped_library_t * self,int value)52 void CEF_CALLBACK translator_test_scoped_library_set_value(
53 struct _cef_translator_test_scoped_library_t* self,
54 int value) {
55 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
56
57 DCHECK(self);
58 if (!self)
59 return;
60
61 // Execute
62 CefTranslatorTestScopedLibraryCppToC::Get(self)->SetValue(value);
63 }
64
65 } // namespace
66
67 // CONSTRUCTOR - Do not edit by hand.
68
CefTranslatorTestScopedLibraryCppToC()69 CefTranslatorTestScopedLibraryCppToC::CefTranslatorTestScopedLibraryCppToC() {
70 GetStruct()->get_value = translator_test_scoped_library_get_value;
71 GetStruct()->set_value = translator_test_scoped_library_set_value;
72 }
73
74 // DESTRUCTOR - Do not edit by hand.
75
~CefTranslatorTestScopedLibraryCppToC()76 CefTranslatorTestScopedLibraryCppToC::~CefTranslatorTestScopedLibraryCppToC() {}
77
78 template <>
79 CefOwnPtr<CefTranslatorTestScopedLibrary>
80 CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
81 CefTranslatorTestScopedLibrary,
82 cef_translator_test_scoped_library_t>::
UnwrapDerivedOwn(CefWrapperType type,cef_translator_test_scoped_library_t * s)83 UnwrapDerivedOwn(CefWrapperType type,
84 cef_translator_test_scoped_library_t* s) {
85 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
86 return CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
87 reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
88 }
89 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
90 return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
91 reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
92 }
93 NOTREACHED() << "Unexpected class type: " << type;
94 return CefOwnPtr<CefTranslatorTestScopedLibrary>();
95 }
96
97 template <>
98 CefRawPtr<CefTranslatorTestScopedLibrary>
99 CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
100 CefTranslatorTestScopedLibrary,
101 cef_translator_test_scoped_library_t>::
UnwrapDerivedRaw(CefWrapperType type,cef_translator_test_scoped_library_t * s)102 UnwrapDerivedRaw(CefWrapperType type,
103 cef_translator_test_scoped_library_t* s) {
104 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
105 return CefTranslatorTestScopedLibraryChildCppToC::UnwrapRaw(
106 reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
107 }
108 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
109 return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw(
110 reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
111 }
112 NOTREACHED() << "Unexpected class type: " << type;
113 return nullptr;
114 }
115
116 template <>
117 CefWrapperType
118 CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
119 CefTranslatorTestScopedLibrary,
120 cef_translator_test_scoped_library_t>::kWrapperType =
121 WT_TRANSLATOR_TEST_SCOPED_LIBRARY;
122