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=9e0c499cc30e7e762de3d5969ab6795ec50ffc08$
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(OWN_PASS(_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 OWN_RETURN_AS(
87 CefTranslatorTestScopedLibraryChildCppToC::UnwrapOwn(
88 reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s)),
89 CefTranslatorTestScopedLibrary);
90 }
91 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
92 return OWN_RETURN_AS(
93 CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
94 reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(
95 s)),
96 CefTranslatorTestScopedLibrary);
97 }
98 NOTREACHED() << "Unexpected class type: " << type;
99 return CefOwnPtr<CefTranslatorTestScopedLibrary>();
100 }
101
102 template <>
103 CefRawPtr<CefTranslatorTestScopedLibrary>
104 CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
105 CefTranslatorTestScopedLibrary,
106 cef_translator_test_scoped_library_t>::
UnwrapDerivedRaw(CefWrapperType type,cef_translator_test_scoped_library_t * s)107 UnwrapDerivedRaw(CefWrapperType type,
108 cef_translator_test_scoped_library_t* s) {
109 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD) {
110 return CefTranslatorTestScopedLibraryChildCppToC::UnwrapRaw(
111 reinterpret_cast<cef_translator_test_scoped_library_child_t*>(s));
112 }
113 if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
114 return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw(
115 reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
116 }
117 NOTREACHED() << "Unexpected class type: " << type;
118 return nullptr;
119 }
120
121 template <>
122 CefWrapperType
123 CefCppToCScoped<CefTranslatorTestScopedLibraryCppToC,
124 CefTranslatorTestScopedLibrary,
125 cef_translator_test_scoped_library_t>::kWrapperType =
126 WT_TRANSLATOR_TEST_SCOPED_LIBRARY;
127