• 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=c7dafd30c4f75e38e507feabdc40dc234d21a06b$
13 //
14 
15 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_cpptoc.h"
16 #include "libcef_dll/cpptoc/test/translator_test_scoped_library_child_child_cpptoc.h"
17 
18 // GLOBAL FUNCTIONS - Body may be edited by hand.
19 
20 CEF_EXPORT cef_translator_test_scoped_library_child_t*
cef_translator_test_scoped_library_child_create(int value,int other_value)21 cef_translator_test_scoped_library_child_create(int value, int other_value) {
22   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
23 
24   // Execute
25   CefOwnPtr<CefTranslatorTestScopedLibraryChild> _retval =
26       CefTranslatorTestScopedLibraryChild::Create(value, other_value);
27 
28   // Return type: ownptr_same
29   return CefTranslatorTestScopedLibraryChildCppToC::WrapOwn(std::move(_retval));
30 }
31 
32 namespace {
33 
34 // MEMBER FUNCTIONS - Body may be edited by hand.
35 
translator_test_scoped_library_child_get_other_value(struct _cef_translator_test_scoped_library_child_t * self)36 int CEF_CALLBACK translator_test_scoped_library_child_get_other_value(
37     struct _cef_translator_test_scoped_library_child_t* self) {
38   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
39 
40   DCHECK(self);
41   if (!self)
42     return 0;
43 
44   // Execute
45   int _retval =
46       CefTranslatorTestScopedLibraryChildCppToC::Get(self)->GetOtherValue();
47 
48   // Return type: simple
49   return _retval;
50 }
51 
translator_test_scoped_library_child_set_other_value(struct _cef_translator_test_scoped_library_child_t * self,int value)52 void CEF_CALLBACK translator_test_scoped_library_child_set_other_value(
53     struct _cef_translator_test_scoped_library_child_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   CefTranslatorTestScopedLibraryChildCppToC::Get(self)->SetOtherValue(value);
63 }
64 
translator_test_scoped_library_child_get_value(struct _cef_translator_test_scoped_library_t * self)65 int CEF_CALLBACK translator_test_scoped_library_child_get_value(
66     struct _cef_translator_test_scoped_library_t* self) {
67   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
68 
69   DCHECK(self);
70   if (!self)
71     return 0;
72 
73   // Execute
74   int _retval =
75       CefTranslatorTestScopedLibraryChildCppToC::Get(
76           reinterpret_cast<cef_translator_test_scoped_library_child_t*>(self))
77           ->GetValue();
78 
79   // Return type: simple
80   return _retval;
81 }
82 
translator_test_scoped_library_child_set_value(struct _cef_translator_test_scoped_library_t * self,int value)83 void CEF_CALLBACK translator_test_scoped_library_child_set_value(
84     struct _cef_translator_test_scoped_library_t* self,
85     int value) {
86   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
87 
88   DCHECK(self);
89   if (!self)
90     return;
91 
92   // Execute
93   CefTranslatorTestScopedLibraryChildCppToC::Get(
94       reinterpret_cast<cef_translator_test_scoped_library_child_t*>(self))
95       ->SetValue(value);
96 }
97 
98 }  // namespace
99 
100 // CONSTRUCTOR - Do not edit by hand.
101 
102 CefTranslatorTestScopedLibraryChildCppToC::
CefTranslatorTestScopedLibraryChildCppToC()103     CefTranslatorTestScopedLibraryChildCppToC() {
104   GetStruct()->get_other_value =
105       translator_test_scoped_library_child_get_other_value;
106   GetStruct()->set_other_value =
107       translator_test_scoped_library_child_set_other_value;
108   GetStruct()->base.get_value = translator_test_scoped_library_child_get_value;
109   GetStruct()->base.set_value = translator_test_scoped_library_child_set_value;
110 }
111 
112 // DESTRUCTOR - Do not edit by hand.
113 
114 CefTranslatorTestScopedLibraryChildCppToC::
~CefTranslatorTestScopedLibraryChildCppToC()115     ~CefTranslatorTestScopedLibraryChildCppToC() {}
116 
117 template <>
118 CefOwnPtr<CefTranslatorTestScopedLibraryChild>
119 CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
120                 CefTranslatorTestScopedLibraryChild,
121                 cef_translator_test_scoped_library_child_t>::
UnwrapDerivedOwn(CefWrapperType type,cef_translator_test_scoped_library_child_t * s)122     UnwrapDerivedOwn(CefWrapperType type,
123                      cef_translator_test_scoped_library_child_t* s) {
124   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
125     return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapOwn(
126         reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
127   }
128   NOTREACHED() << "Unexpected class type: " << type;
129   return CefOwnPtr<CefTranslatorTestScopedLibraryChild>();
130 }
131 
132 template <>
133 CefRawPtr<CefTranslatorTestScopedLibraryChild>
134 CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
135                 CefTranslatorTestScopedLibraryChild,
136                 cef_translator_test_scoped_library_child_t>::
UnwrapDerivedRaw(CefWrapperType type,cef_translator_test_scoped_library_child_t * s)137     UnwrapDerivedRaw(CefWrapperType type,
138                      cef_translator_test_scoped_library_child_t* s) {
139   if (type == WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD_CHILD) {
140     return CefTranslatorTestScopedLibraryChildChildCppToC::UnwrapRaw(
141         reinterpret_cast<cef_translator_test_scoped_library_child_child_t*>(s));
142   }
143   NOTREACHED() << "Unexpected class type: " << type;
144   return nullptr;
145 }
146 
147 template <>
148 CefWrapperType
149     CefCppToCScoped<CefTranslatorTestScopedLibraryChildCppToC,
150                     CefTranslatorTestScopedLibraryChild,
151                     cef_translator_test_scoped_library_child_t>::kWrapperType =
152         WT_TRANSLATOR_TEST_SCOPED_LIBRARY_CHILD;
153