mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Improve inheritance support in the CEF API (issue #1623).
- Support single parent inheritance in CEF API classes. - Support non-virtual inheritance in CEF API classes. - Support translation of CEF API sub-directories. - Add test sub-directories for testing-only functionality that will be available to unit tests but not exposed via the binary distribution. - Add unit tests for the translator tool. - Fix parsing of template parameter types that include commas.
This commit is contained in:
1096
libcef_dll/cpptoc/test/translator_test_cpptoc.cc
Normal file
1096
libcef_dll/cpptoc/test/translator_test_cpptoc.cc
Normal file
File diff suppressed because it is too large
Load Diff
35
libcef_dll/cpptoc/test/translator_test_cpptoc.h
Normal file
35
libcef_dll/cpptoc/test/translator_test_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefTranslatorTestCppToC
|
||||
: public CefCppToC<CefTranslatorTestCppToC, CefTranslatorTest,
|
||||
cef_translator_test_t> {
|
||||
public:
|
||||
CefTranslatorTestCppToC();
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_
|
@@ -0,0 +1,79 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK translator_test_handler_child_get_other_value(
|
||||
struct _cef_translator_test_handler_child_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestHandlerChildCppToC::Get(self)->GetOtherValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK translator_test_handler_child_get_value(
|
||||
struct _cef_translator_test_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestHandlerChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_handler_child_t*>(self))->GetValue(
|
||||
);
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTranslatorTestHandlerChildCppToC::CefTranslatorTestHandlerChildCppToC() {
|
||||
GetStruct()->get_other_value = translator_test_handler_child_get_other_value;
|
||||
GetStruct()->base.get_value = translator_test_handler_child_get_value;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefTranslatorTestHandlerChild> CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
||||
CefTranslatorTestHandlerChild,
|
||||
cef_translator_test_handler_child_t>::UnwrapDerived(CefWrapperType type,
|
||||
cef_translator_test_handler_child_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
||||
CefTranslatorTestHandlerChild,
|
||||
cef_translator_test_handler_child_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
||||
CefTranslatorTestHandlerChild,
|
||||
cef_translator_test_handler_child_t>::kWrapperType =
|
||||
WT_TRANSLATOR_TEST_HANDLER_CHILD;
|
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefTranslatorTestHandlerChildCppToC
|
||||
: public CefCppToC<CefTranslatorTestHandlerChildCppToC,
|
||||
CefTranslatorTestHandlerChild, cef_translator_test_handler_child_t> {
|
||||
public:
|
||||
CefTranslatorTestHandlerChildCppToC();
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_
|
63
libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc
Normal file
63
libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK translator_test_handler_get_value(
|
||||
struct _cef_translator_test_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestHandlerCppToC::Get(self)->GetValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTranslatorTestHandlerCppToC::CefTranslatorTestHandlerCppToC() {
|
||||
GetStruct()->get_value = translator_test_handler_get_value;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefTranslatorTestHandler> CefCppToC<CefTranslatorTestHandlerCppToC,
|
||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::UnwrapDerived(
|
||||
CefWrapperType type, cef_translator_test_handler_t* s) {
|
||||
if (type == WT_TRANSLATOR_TEST_HANDLER_CHILD) {
|
||||
return CefTranslatorTestHandlerChildCppToC::Unwrap(
|
||||
reinterpret_cast<cef_translator_test_handler_child_t*>(s));
|
||||
}
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestHandlerCppToC,
|
||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToC<CefTranslatorTestHandlerCppToC,
|
||||
CefTranslatorTestHandler, cef_translator_test_handler_t>::kWrapperType =
|
||||
WT_TRANSLATOR_TEST_HANDLER;
|
35
libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h
Normal file
35
libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefTranslatorTestHandlerCppToC
|
||||
: public CefCppToC<CefTranslatorTestHandlerCppToC, CefTranslatorTestHandler,
|
||||
cef_translator_test_handler_t> {
|
||||
public:
|
||||
CefTranslatorTestHandlerCppToC();
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_
|
@@ -0,0 +1,169 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_translator_test_object_child_child_t* cef_translator_test_object_child_child_create(
|
||||
int value, int other_value, int other_other_value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefTranslatorTestObjectChildChild> _retval =
|
||||
CefTranslatorTestObjectChildChild::Create(
|
||||
value,
|
||||
other_value,
|
||||
other_other_value);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefTranslatorTestObjectChildChildCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK translator_test_object_child_child_get_other_other_value(
|
||||
struct _cef_translator_test_object_child_child_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
||||
self)->GetOtherOtherValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_child_child_set_other_other_value(
|
||||
struct _cef_translator_test_object_child_child_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectChildChildCppToC::Get(self)->SetOtherOtherValue(
|
||||
value);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK translator_test_object_child_child_get_other_value(
|
||||
struct _cef_translator_test_object_child_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
||||
self))->GetOtherValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_child_child_set_other_value(
|
||||
struct _cef_translator_test_object_child_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectChildChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
||||
self))->SetOtherValue(
|
||||
value);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK translator_test_object_child_child_get_value(
|
||||
struct _cef_translator_test_object_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectChildChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
||||
self))->GetValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_child_child_set_value(
|
||||
struct _cef_translator_test_object_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectChildChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(
|
||||
self))->SetValue(
|
||||
value);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTranslatorTestObjectChildChildCppToC::CefTranslatorTestObjectChildChildCppToC(
|
||||
) {
|
||||
GetStruct()->get_other_other_value =
|
||||
translator_test_object_child_child_get_other_other_value;
|
||||
GetStruct()->set_other_other_value =
|
||||
translator_test_object_child_child_set_other_other_value;
|
||||
GetStruct()->base.get_other_value =
|
||||
translator_test_object_child_child_get_other_value;
|
||||
GetStruct()->base.set_other_value =
|
||||
translator_test_object_child_child_set_other_value;
|
||||
GetStruct()->base.base.get_value =
|
||||
translator_test_object_child_child_get_value;
|
||||
GetStruct()->base.base.set_value =
|
||||
translator_test_object_child_child_set_value;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefTranslatorTestObjectChildChild> CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
||||
CefTranslatorTestObjectChildChild,
|
||||
cef_translator_test_object_child_child_t>::UnwrapDerived(
|
||||
CefWrapperType type, cef_translator_test_object_child_child_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
||||
CefTranslatorTestObjectChildChild,
|
||||
cef_translator_test_object_child_child_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
||||
CefTranslatorTestObjectChildChild,
|
||||
cef_translator_test_object_child_child_t>::kWrapperType =
|
||||
WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD;
|
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefTranslatorTestObjectChildChildCppToC
|
||||
: public CefCppToC<CefTranslatorTestObjectChildChildCppToC,
|
||||
CefTranslatorTestObjectChildChild,
|
||||
cef_translator_test_object_child_child_t> {
|
||||
public:
|
||||
CefTranslatorTestObjectChildChildCppToC();
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_
|
129
libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc
Normal file
129
libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc
Normal file
@@ -0,0 +1,129 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_translator_test_object_child_t* cef_translator_test_object_child_create(
|
||||
int value, int other_value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefTranslatorTestObjectChild> _retval =
|
||||
CefTranslatorTestObjectChild::Create(
|
||||
value,
|
||||
other_value);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefTranslatorTestObjectChildCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK translator_test_object_child_get_other_value(
|
||||
struct _cef_translator_test_object_child_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectChildCppToC::Get(self)->GetOtherValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_child_set_other_value(
|
||||
struct _cef_translator_test_object_child_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectChildCppToC::Get(self)->SetOtherValue(
|
||||
value);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK translator_test_object_child_get_value(
|
||||
struct _cef_translator_test_object_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_t*>(self))->GetValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_child_set_value(
|
||||
struct _cef_translator_test_object_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectChildCppToC::Get(
|
||||
reinterpret_cast<cef_translator_test_object_child_t*>(self))->SetValue(
|
||||
value);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTranslatorTestObjectChildCppToC::CefTranslatorTestObjectChildCppToC() {
|
||||
GetStruct()->get_other_value = translator_test_object_child_get_other_value;
|
||||
GetStruct()->set_other_value = translator_test_object_child_set_other_value;
|
||||
GetStruct()->base.get_value = translator_test_object_child_get_value;
|
||||
GetStruct()->base.set_value = translator_test_object_child_set_value;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefTranslatorTestObjectChild> CefCppToC<CefTranslatorTestObjectChildCppToC,
|
||||
CefTranslatorTestObjectChild,
|
||||
cef_translator_test_object_child_t>::UnwrapDerived(CefWrapperType type,
|
||||
cef_translator_test_object_child_t* s) {
|
||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
||||
return CefTranslatorTestObjectChildChildCppToC::Unwrap(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(s));
|
||||
}
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectChildCppToC,
|
||||
CefTranslatorTestObjectChild,
|
||||
cef_translator_test_object_child_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectChildCppToC,
|
||||
CefTranslatorTestObjectChild,
|
||||
cef_translator_test_object_child_t>::kWrapperType =
|
||||
WT_TRANSLATOR_TEST_OBJECT_CHILD;
|
35
libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h
Normal file
35
libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefTranslatorTestObjectChildCppToC
|
||||
: public CefCppToC<CefTranslatorTestObjectChildCppToC,
|
||||
CefTranslatorTestObjectChild, cef_translator_test_object_child_t> {
|
||||
public:
|
||||
CefTranslatorTestObjectChildCppToC();
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_
|
97
libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc
Normal file
97
libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc
Normal file
@@ -0,0 +1,97 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
CEF_EXPORT cef_translator_test_object_t* cef_translator_test_object_create(
|
||||
int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefTranslatorTestObject> _retval = CefTranslatorTestObject::Create(
|
||||
value);
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefTranslatorTestObjectCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK translator_test_object_get_value(
|
||||
struct _cef_translator_test_object_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefTranslatorTestObjectCppToC::Get(self)->GetValue();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK translator_test_object_set_value(
|
||||
struct _cef_translator_test_object_t* self, int value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefTranslatorTestObjectCppToC::Get(self)->SetValue(
|
||||
value);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefTranslatorTestObjectCppToC::CefTranslatorTestObjectCppToC() {
|
||||
GetStruct()->get_value = translator_test_object_get_value;
|
||||
GetStruct()->set_value = translator_test_object_set_value;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefTranslatorTestObject> CefCppToC<CefTranslatorTestObjectCppToC,
|
||||
CefTranslatorTestObject, cef_translator_test_object_t>::UnwrapDerived(
|
||||
CefWrapperType type, cef_translator_test_object_t* s) {
|
||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD) {
|
||||
return CefTranslatorTestObjectChildCppToC::Unwrap(
|
||||
reinterpret_cast<cef_translator_test_object_child_t*>(s));
|
||||
}
|
||||
if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) {
|
||||
return CefTranslatorTestObjectChildChildCppToC::Unwrap(
|
||||
reinterpret_cast<cef_translator_test_object_child_child_t*>(s));
|
||||
}
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefTranslatorTestObjectCppToC,
|
||||
CefTranslatorTestObject, cef_translator_test_object_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToC<CefTranslatorTestObjectCppToC,
|
||||
CefTranslatorTestObject, cef_translator_test_object_t>::kWrapperType =
|
||||
WT_TRANSLATOR_TEST_OBJECT;
|
35
libcef_dll/cpptoc/test/translator_test_object_cpptoc.h
Normal file
35
libcef_dll/cpptoc/test/translator_test_object_cpptoc.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/test/cef_translator_test.h"
|
||||
#include "include/capi/test/cef_translator_test_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefTranslatorTestObjectCppToC
|
||||
: public CefCppToC<CefTranslatorTestObjectCppToC, CefTranslatorTestObject,
|
||||
cef_translator_test_object_t> {
|
||||
public:
|
||||
CefTranslatorTestObjectCppToC();
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_
|
Reference in New Issue
Block a user