diff --git a/cef.gyp b/cef.gyp index d2e73f724..6033b1e8e 100644 --- a/cef.gyp +++ b/cef.gyp @@ -444,6 +444,7 @@ 'tests/unittests/test_util.cc', 'tests/unittests/test_util.h', 'tests/unittests/tracing_unittest.cc', + 'tests/unittests/translator_unittest.cc', 'tests/unittests/urlrequest_unittest.cc', 'tests/unittests/v8_unittest.cc', 'tests/unittests/values_unittest.cc', @@ -1088,6 +1089,7 @@ 'libcef/common/task_impl.cc', 'libcef/common/task_runner_impl.cc', 'libcef/common/task_runner_impl.h', + 'libcef/common/test/translator_test_impl.cc', 'libcef/common/time_impl.cc', 'libcef/common/time_util.h', 'libcef/common/tracker.cc', diff --git a/cef_paths.gypi b/cef_paths.gypi index 066bbf746..75f5222f9 100644 --- a/cef_paths.gypi +++ b/cef_paths.gypi @@ -67,6 +67,7 @@ 'include/cef_web_plugin.h', 'include/cef_xml_reader.h', 'include/cef_zip_reader.h', + 'include/test/cef_translator_test.h', ], 'autogen_capi_includes': [ 'include/capi/cef_app_capi.h', @@ -124,6 +125,7 @@ 'include/capi/cef_web_plugin_capi.h', 'include/capi/cef_xml_reader_capi.h', 'include/capi/cef_zip_reader_capi.h', + 'include/capi/test/cef_translator_test_capi.h', ], 'autogen_library_side': [ 'libcef_dll/ctocpp/app_ctocpp.cc', @@ -272,6 +274,18 @@ 'libcef_dll/ctocpp/task_ctocpp.h', 'libcef_dll/cpptoc/task_runner_cpptoc.cc', 'libcef_dll/cpptoc/task_runner_cpptoc.h', + 'libcef_dll/cpptoc/test/translator_test_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_cpptoc.h', + 'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h', + 'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h', + 'libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_object_cpptoc.h', + 'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h', + 'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h', 'libcef_dll/cpptoc/urlrequest_cpptoc.cc', 'libcef_dll/cpptoc/urlrequest_cpptoc.h', 'libcef_dll/ctocpp/urlrequest_client_ctocpp.cc', @@ -452,6 +466,18 @@ 'libcef_dll/cpptoc/task_cpptoc.h', 'libcef_dll/ctocpp/task_runner_ctocpp.cc', 'libcef_dll/ctocpp/task_runner_ctocpp.h', + 'libcef_dll/ctocpp/test/translator_test_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_ctocpp.h', + 'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h', + 'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc', + 'libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h', + 'libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_object_ctocpp.h', + 'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h', + 'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc', + 'libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h', 'libcef_dll/ctocpp/urlrequest_ctocpp.cc', 'libcef_dll/ctocpp/urlrequest_ctocpp.h', 'libcef_dll/cpptoc/urlrequest_client_cpptoc.cc', diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 5000eb4d0..57cd7d458 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -95,12 +95,15 @@ ], 'libcef_sources_common': [ 'libcef_dll/cpptoc/cpptoc.h', + 'libcef_dll/ctocpp/base_ctocpp.cc', + 'libcef_dll/ctocpp/base_ctocpp.h', 'libcef_dll/ctocpp/ctocpp.h', 'libcef_dll/libcef_dll.cc', 'libcef_dll/libcef_dll2.cc', 'libcef_dll/resource.h', 'libcef_dll/transfer_util.cc', 'libcef_dll/transfer_util.h', + 'libcef_dll/wrapper_types.h', '<@(autogen_library_side)', ], 'libcef_dll_wrapper_sources_common': [ @@ -116,12 +119,13 @@ 'libcef_dll/base/cef_thread_checker_impl.cc', 'libcef_dll/base/cef_thread_collision_warner.cc', 'libcef_dll/base/cef_weak_ptr.cc', + 'libcef_dll/cpptoc/base_cpptoc.cc', 'libcef_dll/cpptoc/base_cpptoc.h', 'libcef_dll/cpptoc/cpptoc.h', - 'libcef_dll/ctocpp/base_ctocpp.h', 'libcef_dll/ctocpp/ctocpp.h', 'libcef_dll/transfer_util.cc', 'libcef_dll/transfer_util.h', + 'libcef_dll/wrapper_types.h', 'libcef_dll/wrapper/cef_browser_info_map.h', 'libcef_dll/wrapper/cef_byte_read_handler.cc', 'libcef_dll/wrapper/cef_closure_task.cc', diff --git a/include/capi/cef_base_capi.h b/include/capi/cef_base_capi.h index edeef3c0e..ba3a39cb1 100644 --- a/include/capi/cef_base_capi.h +++ b/include/capi/cef_base_capi.h @@ -77,7 +77,8 @@ typedef struct _cef_base_t { // Check that the structure |s|, which is defined with a cef_base_t member named // |base|, is large enough to contain the specified member |f|. #define CEF_MEMBER_EXISTS(s, f) \ - ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size) + ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \ + reinterpret_cast(s)->size) #define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) diff --git a/include/capi/test/cef_translator_test_capi.h b/include/capi/test/cef_translator_test_capi.h new file mode 100644 index 000000000..da6f23863 --- /dev/null +++ b/include/capi/test/cef_translator_test_capi.h @@ -0,0 +1,493 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_translator_test_handler_child_t; +struct _cef_translator_test_handler_t; +struct _cef_translator_test_object_child_t; +struct _cef_translator_test_object_t; + +/// +// Structure for testing all of the possible data transfer types. +/// +typedef struct _cef_translator_test_t { + /// + // Base structure. + /// + cef_base_t base; + + + // PRIMITIVE VALUES + + /// + // Return a void value. + /// + void (CEF_CALLBACK *get_void)(struct _cef_translator_test_t* self); + + /// + // Return a bool value. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_translator_test_t* self); + + /// + // Return an int value. + /// + int (CEF_CALLBACK *get_int)(struct _cef_translator_test_t* self); + + /// + // Return a double value. + /// + double (CEF_CALLBACK *get_double)(struct _cef_translator_test_t* self); + + /// + // Return a long value. + /// + long (CEF_CALLBACK *get_long)(struct _cef_translator_test_t* self); + + /// + // Return a size_t value. + /// + size_t (CEF_CALLBACK *get_sizet)(struct _cef_translator_test_t* self); + + /// + // Set a void value. + /// + int (CEF_CALLBACK *set_void)(struct _cef_translator_test_t* self); + + /// + // Set a bool value. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_translator_test_t* self, int val); + + /// + // Set an int value. + /// + int (CEF_CALLBACK *set_int)(struct _cef_translator_test_t* self, int val); + + /// + // Set a double value. + /// + int (CEF_CALLBACK *set_double)(struct _cef_translator_test_t* self, + double val); + + /// + // Set a long value. + /// + int (CEF_CALLBACK *set_long)(struct _cef_translator_test_t* self, long val); + + /// + // Set a size_t value. + /// + int (CEF_CALLBACK *set_sizet)(struct _cef_translator_test_t* self, + size_t val); + + /// + // Set a int list value. + /// + int (CEF_CALLBACK *set_int_list)(struct _cef_translator_test_t* self, + size_t valCount, int const* val); + + /// + // Return an int list value by out-param. + /// + int (CEF_CALLBACK *get_int_list_by_ref)(struct _cef_translator_test_t* self, + size_t* valCount, int* val); + + /// + // Return the number of points that will be output above. + /// + size_t (CEF_CALLBACK *get_int_list_size)(struct _cef_translator_test_t* self); + + + // STRING VALUES + + /// + // Return a string value. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)( + struct _cef_translator_test_t* self); + + /// + // Set a string value. + /// + int (CEF_CALLBACK *set_string)(struct _cef_translator_test_t* self, + const cef_string_t* val); + + /// + // Return a string value by out-param. + /// + void (CEF_CALLBACK *get_string_by_ref)(struct _cef_translator_test_t* self, + cef_string_t* val); + + /// + // Set a string list value. + /// + int (CEF_CALLBACK *set_string_list)(struct _cef_translator_test_t* self, + cef_string_list_t val); + + /// + // Return a string list value by out-param. + /// + int (CEF_CALLBACK *get_string_list_by_ref)( + struct _cef_translator_test_t* self, cef_string_list_t val); + + /// + // Set a string map value. + /// + int (CEF_CALLBACK *set_string_map)(struct _cef_translator_test_t* self, + cef_string_map_t val); + + /// + // Return a string map value by out-param. + /// + int (CEF_CALLBACK *get_string_map_by_ref)(struct _cef_translator_test_t* self, + cef_string_map_t val); + + /// + // Set a string multimap value. + /// + int (CEF_CALLBACK *set_string_multimap)(struct _cef_translator_test_t* self, + cef_string_multimap_t val); + + /// + // Return a string multimap value by out-param. + /// + int (CEF_CALLBACK *get_string_multimap_by_ref)( + struct _cef_translator_test_t* self, cef_string_multimap_t val); + + + // STRUCT VALUES + + /// + // Return a point value. + /// + cef_point_t (CEF_CALLBACK *get_point)(struct _cef_translator_test_t* self); + + /// + // Set a point value. + /// + int (CEF_CALLBACK *set_point)(struct _cef_translator_test_t* self, + const cef_point_t* val); + + /// + // Return a point value by out-param. + /// + void (CEF_CALLBACK *get_point_by_ref)(struct _cef_translator_test_t* self, + cef_point_t* val); + + /// + // Set a point list vlaue. + /// + int (CEF_CALLBACK *set_point_list)(struct _cef_translator_test_t* self, + size_t valCount, cef_point_t const* val); + + /// + // Return a point list value by out-param. + /// + int (CEF_CALLBACK *get_point_list_by_ref)(struct _cef_translator_test_t* self, + size_t* valCount, cef_point_t* val); + + /// + // Return the number of points that will be output above. + /// + size_t (CEF_CALLBACK *get_point_list_size)( + struct _cef_translator_test_t* self); + + + // LIBRARY-SIDE OBJECT VALUES + + /// + // Return an new library-side object. + /// + struct _cef_translator_test_object_t* (CEF_CALLBACK *get_object)( + struct _cef_translator_test_t* self, int val); + + /// + // Set an object. Returns the value from + // cef_translator_test_object_t::get_value(). This tests input and execution + // of a library-side object type. + /// + int (CEF_CALLBACK *set_object)(struct _cef_translator_test_t* self, + struct _cef_translator_test_object_t* val); + + /// + // Set an object. Returns the object passed in. This tests input and output of + // a library-side object type. + /// + struct _cef_translator_test_object_t* (CEF_CALLBACK *set_object_and_return)( + struct _cef_translator_test_t* self, + struct _cef_translator_test_object_t* val); + + /// + // Set a child object. Returns the value from + // cef_translator_test_object_t::get_value(). This tests input of a library- + // side child object type and execution as the parent type. + /// + int (CEF_CALLBACK *set_child_object)(struct _cef_translator_test_t* self, + struct _cef_translator_test_object_child_t* val); + + /// + // Set a child object. Returns the object as the parent type. This tests input + // of a library-side child object type and return as the parent type. + /// + struct _cef_translator_test_object_t* ( + CEF_CALLBACK *set_child_object_and_return_parent)( + struct _cef_translator_test_t* self, + struct _cef_translator_test_object_child_t* val); + + /// + // Set an object list vlaue. + /// + int (CEF_CALLBACK *set_object_list)(struct _cef_translator_test_t* self, + size_t valCount, struct _cef_translator_test_object_t* const* val, + int val1, int val2); + + /// + // Return an object list value by out-param. + /// + int (CEF_CALLBACK *get_object_list_by_ref)( + struct _cef_translator_test_t* self, size_t* valCount, + struct _cef_translator_test_object_t** val, int val1, int val2); + + /// + // Return the number of object that will be output above. + /// + size_t (CEF_CALLBACK *get_object_list_size)( + struct _cef_translator_test_t* self); + + + // CLIENT-SIDE OBJECT VALUES + + /// + // Set an object. Returns the value from + // cef_translator_test_handler_t::get_value(). This tests input and execution + // of a client-side object type. + /// + int (CEF_CALLBACK *set_handler)(struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_t* val); + + /// + // Set an object. Returns the handler passed in. This tests input and output + // of a client-side object type. + /// + struct _cef_translator_test_handler_t* (CEF_CALLBACK *set_handler_and_return)( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_t* val); + + /// + // Set a child object. Returns the value from + // cef_translator_test_handler_t::get_value(). This tests input of a client- + // side child object type and execution as the parent type. + /// + int (CEF_CALLBACK *set_child_handler)(struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_child_t* val); + + /// + // Set a child object. Returns the object as the parent type. This tests input + // of a client-side child object type and return as the parent type. + /// + struct _cef_translator_test_handler_t* ( + CEF_CALLBACK *set_child_handler_and_return_parent)( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_child_t* val); + + /// + // Set an object list vlaue. + /// + int (CEF_CALLBACK *set_handler_list)(struct _cef_translator_test_t* self, + size_t valCount, struct _cef_translator_test_handler_t* const* val, + int val1, int val2); + + /// + // Return an object list value by out-param. + /// + int (CEF_CALLBACK *get_handler_list_by_ref)( + struct _cef_translator_test_t* self, size_t* valCount, + struct _cef_translator_test_handler_t** val, + struct _cef_translator_test_handler_t* val1, + struct _cef_translator_test_handler_t* val2); + + /// + // Return the number of object that will be output above. + /// + size_t (CEF_CALLBACK *get_handler_list_size)( + struct _cef_translator_test_t* self); +} cef_translator_test_t; + + +/// +// Create the test object. +/// +CEF_EXPORT cef_translator_test_t* cef_translator_test_create(); + + +/// +// Library-side test object. +/// +typedef struct _cef_translator_test_object_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return a value. + /// + int (CEF_CALLBACK *get_value)(struct _cef_translator_test_object_t* self); + + /// + // Set a value. + /// + void (CEF_CALLBACK *set_value)(struct _cef_translator_test_object_t* self, + int value); +} cef_translator_test_object_t; + + +/// +// Create the test object. +/// +CEF_EXPORT cef_translator_test_object_t* cef_translator_test_object_create( + int value); + + +/// +// Library-side child test object. +/// +typedef struct _cef_translator_test_object_child_t { + /// + // Base structure. + /// + cef_translator_test_object_t base; + + /// + // Return a value. + /// + int (CEF_CALLBACK *get_other_value)( + struct _cef_translator_test_object_child_t* self); + + /// + // Set a value. + /// + void (CEF_CALLBACK *set_other_value)( + struct _cef_translator_test_object_child_t* self, int value); +} cef_translator_test_object_child_t; + + +/// +// Create the test object. +/// +CEF_EXPORT cef_translator_test_object_child_t* cef_translator_test_object_child_create( + int value, int other_value); + + +/// +// Another library-side child test object. +/// +typedef struct _cef_translator_test_object_child_child_t { + /// + // Base structure. + /// + cef_translator_test_object_child_t base; + + /// + // Return a value. + /// + int (CEF_CALLBACK *get_other_other_value)( + struct _cef_translator_test_object_child_child_t* self); + + /// + // Set a value. + /// + void (CEF_CALLBACK *set_other_other_value)( + struct _cef_translator_test_object_child_child_t* self, int value); +} cef_translator_test_object_child_child_t; + + +/// +// Create the test object. +/// +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); + + +/// +// Client-side test object. +/// +typedef struct _cef_translator_test_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return a value. + /// + int (CEF_CALLBACK *get_value)(struct _cef_translator_test_handler_t* self); +} cef_translator_test_handler_t; + + +/// +// Client-side child test object. +/// +typedef struct _cef_translator_test_handler_child_t { + /// + // Base structure. + /// + cef_translator_test_handler_t base; + + /// + // Return a value. + /// + int (CEF_CALLBACK *get_other_value)( + struct _cef_translator_test_handler_child_t* self); +} cef_translator_test_handler_child_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_ diff --git a/include/test/cef_translator_test.h b/include/test/cef_translator_test.h new file mode 100644 index 000000000..5357cc915 --- /dev/null +++ b/include/test/cef_translator_test.h @@ -0,0 +1,543 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// +// THIS FILE IS FOR TESTING PURPOSES ONLY. +// +// The APIs defined in this file are for testing purposes only. They will not be +// exposed via the binary distribution. All classes in this file must include +// the 'no_debugct_check' attribute to avoid problems when building the binary +// distribution. +// + +#ifndef CEF_INCLUDE_TEST_CEF_TEST_H_ +#define CEF_INCLUDE_TEST_CEF_TEST_H_ +#pragma once + +#include +#include + +#include "include/cef_base.h" + +class CefTranslatorTestHandler; +class CefTranslatorTestHandlerChild; +class CefTranslatorTestObject; +class CefTranslatorTestObjectChild; + +// Test values. +#define TEST_INT_VAL 5 +#define TEST_INT_VAL2 60 +#define TEST_BOOL_VAL true +#define TEST_DOUBLE_VAL 4.543 +#define TEST_LONG_VAL -65 +#define TEST_SIZET_VAL 3U +#define TEST_STRING_VAL "My test string" +#define TEST_STRING_VAL2 "My 2nd test string" +#define TEST_STRING_VAL3 "My 3rd test string" +#define TEST_STRING_KEY "key0" +#define TEST_STRING_KEY2 "key1" +#define TEST_STRING_KEY3 "key2" +#define TEST_X_VAL 44 +#define TEST_Y_VAL 754 +#define TEST_X_VAL2 900 +#define TEST_Y_VAL2 300 + +/// +// Class for testing all of the possible data transfer types. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefTranslatorTest : public CefBase { + public: + /// + // Create the test object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + + // PRIMITIVE VALUES + + /// + // Return a void value. + /// + /*--cef()--*/ + virtual void GetVoid() =0; + + /// + // Return a bool value. + /// + /*--cef()--*/ + virtual bool GetBool() =0; + + /// + // Return an int value. + /// + /*--cef()--*/ + virtual int GetInt() =0; + + /// + // Return a double value. + /// + /*--cef()--*/ + virtual double GetDouble() =0; + + /// + // Return a long value. + /// + /*--cef()--*/ + virtual long GetLong() =0; + + /// + // Return a size_t value. + /// + /*--cef()--*/ + virtual size_t GetSizet() =0; + + /// + // Set a void value. + /// + /*--cef()--*/ + virtual bool SetVoid() =0; + + /// + // Set a bool value. + /// + /*--cef()--*/ + virtual bool SetBool(bool val) =0; + + /// + // Set an int value. + /// + /*--cef()--*/ + virtual bool SetInt(int val) =0; + + /// + // Set a double value. + /// + /*--cef()--*/ + virtual bool SetDouble(double val) =0; + + /// + // Set a long value. + /// + /*--cef()--*/ + virtual bool SetLong(long val) =0; + + /// + // Set a size_t value. + /// + /*--cef()--*/ + virtual bool SetSizet(size_t val) =0; + + + // PRIMITIVE LIST VALUES + + // Test both with and without a typedef. + typedef std::vector IntList; + + /// + // Set a int list value. + /// + /*--cef()--*/ + virtual bool SetIntList(const std::vector& val) =0; + + /// + // Return an int list value by out-param. + /// + /*--cef(count_func=val:GetIntListSize)--*/ + virtual bool GetIntListByRef(IntList& val) =0; + + /// + // Return the number of points that will be output above. + /// + /*--cef()--*/ + virtual size_t GetIntListSize() = 0; + + + // STRING VALUES + + /// + // Return a string value. + /// + /*--cef()--*/ + virtual CefString GetString() =0; + + /// + // Set a string value. + /// + /*--cef()--*/ + virtual bool SetString(const CefString& val) =0; + + /// + // Return a string value by out-param. + /// + /*--cef()--*/ + virtual void GetStringByRef(CefString& val) =0; + + + // STRING LIST VALUES + + // Test both with and without a typedef. + typedef std::vector StringList; + + /// + // Set a string list value. + /// + /*--cef()--*/ + virtual bool SetStringList(const std::vector& val) =0; + + /// + // Return a string list value by out-param. + /// + /*--cef()--*/ + virtual bool GetStringListByRef(StringList& val) =0; + + + // STRING MAP VALUES + + // Test both with and without a typedef. + typedef std::map StringMap; + + /// + // Set a string map value. + /// + /*--cef()--*/ + virtual bool SetStringMap(const StringMap& val) =0; + + /// + // Return a string map value by out-param. + /// + /*--cef()--*/ + virtual bool GetStringMapByRef(std::map& val) =0; + + + // STRING MULTIMAP VALUES + + // Test both with and without a typedef. + typedef std::multimap StringMultimap; + + /// + // Set a string multimap value. + /// + /*--cef()--*/ + virtual bool SetStringMultimap( + const std::multimap& val) =0; + + /// + // Return a string multimap value by out-param. + /// + /*--cef()--*/ + virtual bool GetStringMultimapByRef(StringMultimap& val) =0; + + + // STRUCT VALUES + + /// + // Return a point value. + /// + /*--cef()--*/ + virtual CefPoint GetPoint() =0; + + /// + // Set a point value. + /// + /*--cef()--*/ + virtual bool SetPoint(const CefPoint& val) =0; + + /// + // Return a point value by out-param. + /// + /*--cef()--*/ + virtual void GetPointByRef(CefPoint& val) =0; + + + // STRUCT LIST VALUES + + // Test both with and without a typedef. + typedef std::vector PointList; + + /// + // Set a point list vlaue. + /// + /*--cef()--*/ + virtual bool SetPointList(const std::vector& val) =0; + + /// + // Return a point list value by out-param. + /// + /*--cef(count_func=val:GetPointListSize)--*/ + virtual bool GetPointListByRef(PointList& val) =0; + + /// + // Return the number of points that will be output above. + /// + /*--cef()--*/ + virtual size_t GetPointListSize() = 0; + + + // LIBRARY-SIDE OBJECT VALUES + + /// + // Return an new library-side object. + /// + /*--cef()--*/ + virtual CefRefPtr GetObject(int val) =0; + + /// + // Set an object. Returns the value from CefTranslatorTestObject::GetValue(). + // This tests input and execution of a library-side object type. + /// + /*--cef()--*/ + virtual int SetObject(CefRefPtr val) =0; + + /// + // Set an object. Returns the object passed in. This tests input and output + // of a library-side object type. + /// + /*--cef()--*/ + virtual CefRefPtr SetObjectAndReturn( + CefRefPtr val) =0; + + /// + // Set a child object. Returns the value from + // CefTranslatorTestObject::GetValue(). This tests input of a library-side + // child object type and execution as the parent type. + /// + /*--cef()--*/ + virtual int SetChildObject(CefRefPtr val) =0; + + /// + // Set a child object. Returns the object as the parent type. This tests input + // of a library-side child object type and return as the parent type. + /// + /*--cef()--*/ + virtual CefRefPtr SetChildObjectAndReturnParent( + CefRefPtr val) =0; + + + // LIBRARY-SIDE OBJECT LIST VALUES + + // Test both with and without a typedef. + typedef std::vector > ObjectList; + + /// + // Set an object list vlaue. + /// + /*--cef()--*/ + virtual bool SetObjectList( + const std::vector >& val, + int val1, int val2) =0; + + /// + // Return an object list value by out-param. + /// + /*--cef(count_func=val:GetObjectListSize)--*/ + virtual bool GetObjectListByRef(ObjectList& val, int val1, int val2) =0; + + /// + // Return the number of object that will be output above. + /// + /*--cef()--*/ + virtual size_t GetObjectListSize() = 0; + + + // CLIENT-SIDE OBJECT VALUES + + /// + // Set an object. Returns the value from CefTranslatorTestHandler::GetValue(). + // This tests input and execution of a client-side object type. + /// + /*--cef()--*/ + virtual int SetHandler(CefRefPtr val) =0; + + /// + // Set an object. Returns the handler passed in. This tests input and output + // of a client-side object type. + /// + /*--cef()--*/ + virtual CefRefPtr SetHandlerAndReturn( + CefRefPtr val) =0; + + /// + // Set a child object. Returns the value from + // CefTranslatorTestHandler::GetValue(). This tests input of a client-side + // child object type and execution as the parent type. + /// + /*--cef()--*/ + virtual int SetChildHandler(CefRefPtr val) =0; + + /// + // Set a child object. Returns the object as the parent type. This tests + // input of a client-side child object type and return as the parent type. + /// + /*--cef()--*/ + virtual CefRefPtr SetChildHandlerAndReturnParent( + CefRefPtr val) =0; + + + // CLIENT-SIDE OBJECT LIST VALUES + + // Test both with and without a typedef. + typedef std::vector > HandlerList; + + /// + // Set an object list vlaue. + /// + /*--cef()--*/ + virtual bool SetHandlerList( + const std::vector >& val, + int val1, int val2) =0; + + /// + // Return an object list value by out-param. + /// + /*--cef(count_func=val:GetObjectListSize)--*/ + virtual bool GetHandlerListByRef( + HandlerList& val, + CefRefPtr val1, + CefRefPtr val2) =0; + + /// + // Return the number of object that will be output above. + /// + /*--cef()--*/ + virtual size_t GetHandlerListSize() = 0; +}; + +/// +// Library-side test object. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefTranslatorTestObject : public CefBase { + public: + /// + // Create the test object. + /// + /*--cef()--*/ + static CefRefPtr Create(int value); + + /// + // Return a value. + /// + /*--cef()--*/ + virtual int GetValue() =0; + + /// + // Set a value. + /// + /*--cef()--*/ + virtual void SetValue(int value) =0; +}; + +/// +// Library-side child test object. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefTranslatorTestObjectChild : public CefTranslatorTestObject { + public: + /// + // Create the test object. + /// + /*--cef()--*/ + static CefRefPtr Create(int value, + int other_value); + + /// + // Return a value. + /// + /*--cef()--*/ + virtual int GetOtherValue() =0; + + /// + // Set a value. + /// + /*--cef()--*/ + virtual void SetOtherValue(int value) =0; +}; + +/// +// Another library-side child test object. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefTranslatorTestObjectChildChild : public CefTranslatorTestObjectChild { + public: + /// + // Create the test object. + /// + /*--cef()--*/ + static CefRefPtr Create( + int value, + int other_value, + int other_other_value); + + /// + // Return a value. + /// + /*--cef()--*/ + virtual int GetOtherOtherValue() =0; + + /// + // Set a value. + /// + /*--cef()--*/ + virtual void SetOtherOtherValue(int value) =0; +}; + +/// +// Client-side test object. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefTranslatorTestHandler : public virtual CefBase { + public: + /// + // Return a value. + /// + /*--cef()--*/ + virtual int GetValue() =0; +}; + +/// +// Client-side child test object. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefTranslatorTestHandlerChild : public CefTranslatorTestHandler { + public: + /// + // Return a value. + /// + /*--cef()--*/ + virtual int GetOtherValue() =0; +}; + +#endif // CEF_INCLUDE_TEST_CEF_TEST_H_ diff --git a/libcef/common/test/translator_test_impl.cc b/libcef/common/test/translator_test_impl.cc new file mode 100644 index 000000000..d82411f90 --- /dev/null +++ b/libcef/common/test/translator_test_impl.cc @@ -0,0 +1,445 @@ +// 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. + +#include "include/test/cef_translator_test.h" + +class CefTranslatorTestObjectImpl : public CefTranslatorTestObject { + public: + explicit CefTranslatorTestObjectImpl(int value) + : value_(value) { + } + + int GetValue() override { + return value_; + } + + void SetValue(int value) override { + value_ = value; + } + + protected: + int value_; + + private: + DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectImpl); + IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectImpl); +}; + +// static +CefRefPtr CefTranslatorTestObject::Create(int value) { + return new CefTranslatorTestObjectImpl(value); +} + +class CefTranslatorTestObjectChildImpl : public CefTranslatorTestObjectChild { + public: + CefTranslatorTestObjectChildImpl(int value, int other_value) + : value_(value), + other_value_(other_value) { + } + + int GetValue() override { + return value_; + } + + void SetValue(int value) override { + value_ = value; + } + + int GetOtherValue() override { + return other_value_; + } + + void SetOtherValue(int value) override { + other_value_ = value; + } + + protected: + int value_; + int other_value_; + + private: + DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectChildImpl); + IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectChildImpl); +}; + +// static +CefRefPtr CefTranslatorTestObjectChild::Create( + int value, + int other_value) { + return new CefTranslatorTestObjectChildImpl(value, other_value); +} + +class CefTranslatorTestObjectChildChildImpl : + public CefTranslatorTestObjectChildChild { + public: + CefTranslatorTestObjectChildChildImpl(int value, + int other_value, + int other_other_value) + : value_(value), + other_value_(other_value), + other_other_value_(other_other_value) { + } + + int GetValue() override { + return value_; + } + + void SetValue(int value) override { + value_ = value; + } + + int GetOtherValue() override { + return other_value_; + } + + void SetOtherValue(int value) override { + other_value_ = value; + } + + int GetOtherOtherValue() override { + return other_other_value_; + } + + void SetOtherOtherValue(int value) override { + other_other_value_ = value; + } + + protected: + int value_; + int other_value_; + int other_other_value_; + + private: + DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestObjectChildChildImpl); + IMPLEMENT_REFCOUNTING(CefTranslatorTestObjectChildChildImpl); +}; + +// static +CefRefPtr +CefTranslatorTestObjectChildChild::Create( + int value, + int other_value, + int other_other_value) { + return new CefTranslatorTestObjectChildChildImpl(value, other_value, + other_other_value); +} + +class CefTranslatorTestImpl : public CefTranslatorTest { + public: + CefTranslatorTestImpl() { + } + + // PRIMITIVE VALUES + + void GetVoid() override { + } + + bool GetBool() override { + return TEST_BOOL_VAL; + } + + int GetInt() override { + return TEST_INT_VAL; + } + + double GetDouble() override { + return TEST_DOUBLE_VAL; + } + + long GetLong() override { + return TEST_LONG_VAL; + } + + size_t GetSizet() override { + return TEST_SIZET_VAL; + } + + bool SetVoid() override { + return true; + } + + bool SetBool(bool val) override { + return (val == TEST_BOOL_VAL); + } + + bool SetInt(int val) override { + return (val == TEST_INT_VAL); + } + + bool SetDouble(double val) override { + return (val == TEST_DOUBLE_VAL); + } + + bool SetLong(long val) override { + return (val == TEST_LONG_VAL); + } + + bool SetSizet(size_t val) override { + return (val == TEST_SIZET_VAL); + } + + + // PRIMITIVE LIST VALUES + + bool SetIntList(const std::vector& val) override { + if (val.size() != 2U) + return false; + return val[0] == TEST_INT_VAL && val[1] == TEST_INT_VAL2; + } + + bool GetIntListByRef(IntList& val) override { + if (val.size() != GetIntListSize()) + return false; + val.clear(); + val.push_back(TEST_INT_VAL); + val.push_back(TEST_INT_VAL2); + return true; + } + + size_t GetIntListSize() override { + return 2U; + } + + + // STRING VALUES + + CefString GetString() override { + return TEST_STRING_VAL; + } + + bool SetString(const CefString& val) override { + return (val.ToString() == TEST_STRING_VAL); + } + + void GetStringByRef(CefString& val) override { + val = TEST_STRING_VAL; + } + + + // STRING LIST VALUES + + bool SetStringList(const std::vector& val) override { + if (val.size() != 3U) + return false; + return val[0] == TEST_STRING_VAL && + val[1] == TEST_STRING_VAL2 && + val[2] == TEST_STRING_VAL3; + } + + bool GetStringListByRef(StringList& val) override { + if (val.size() != 0U) + return false; + val.push_back(TEST_STRING_VAL); + val.push_back(TEST_STRING_VAL2); + val.push_back(TEST_STRING_VAL3); + return true; + } + + + // STRING MAP VALUES + + bool SetStringMap(const StringMap& val) override { + if (val.size() != 3U) + return false; + + StringMap::const_iterator it; + + it = val.find(TEST_STRING_KEY); + if (it == val.end() || it->second != TEST_STRING_VAL) + return false; + it = val.find(TEST_STRING_KEY2); + if (it == val.end() || it->second != TEST_STRING_VAL2) + return false; + it = val.find(TEST_STRING_KEY3); + if (it == val.end() || it->second != TEST_STRING_VAL3) + return false; + return true; + } + + bool GetStringMapByRef(std::map& val) override { + if (val.size() != 0U) + return false; + + val.insert(std::make_pair(TEST_STRING_KEY, TEST_STRING_VAL)); + val.insert(std::make_pair(TEST_STRING_KEY2, TEST_STRING_VAL2)); + val.insert(std::make_pair(TEST_STRING_KEY3, TEST_STRING_VAL3)); + return true; + } + + + // STRING MULTIMAP VALUES + + bool SetStringMultimap( + const std::multimap& val) override { + if (val.size() != 3U) + return false; + + StringMultimap::const_iterator it; + + it = val.find(TEST_STRING_KEY); + if (it == val.end() || it->second != TEST_STRING_VAL) + return false; + it = val.find(TEST_STRING_KEY2); + if (it == val.end() || it->second != TEST_STRING_VAL2) + return false; + it = val.find(TEST_STRING_KEY3); + if (it == val.end() || it->second != TEST_STRING_VAL3) + return false; + return true; + } + + bool GetStringMultimapByRef(StringMultimap& val) override { + if (val.size() != 0U) + return false; + + val.insert(std::make_pair(TEST_STRING_KEY, TEST_STRING_VAL)); + val.insert(std::make_pair(TEST_STRING_KEY2, TEST_STRING_VAL2)); + val.insert(std::make_pair(TEST_STRING_KEY3, TEST_STRING_VAL3)); + return true; + } + + + // STRUCT VALUES + + CefPoint GetPoint() override { + return CefPoint(TEST_X_VAL, TEST_Y_VAL); + } + + bool SetPoint(const CefPoint& val) override { + return val.x == TEST_X_VAL && val.y == TEST_Y_VAL; + } + + void GetPointByRef(CefPoint& val) override { + val = CefPoint(TEST_X_VAL, TEST_Y_VAL); + } + + + // STRUCT LIST VALUES + + bool SetPointList(const std::vector& val) override { + if (val.size() != 2U) + return false; + return val[0].x == TEST_X_VAL && val[0].y == TEST_Y_VAL && + val[1].x == TEST_X_VAL2 && val[1].y == TEST_Y_VAL2; + } + + bool GetPointListByRef(PointList& val) override { + if (val.size() != GetPointListSize()) + return false; + val.clear(); + val.push_back(CefPoint(TEST_X_VAL, TEST_Y_VAL)); + val.push_back(CefPoint(TEST_X_VAL2, TEST_Y_VAL2)); + return true; + } + + size_t GetPointListSize() override { + return 2U; + } + + + // LIBRARY-SIDE OBJECT VALUES + + CefRefPtr GetObject(int val) override { + return new CefTranslatorTestObjectChildImpl(val, 0); + } + + int SetObject(CefRefPtr val) override { + return val->GetValue(); + } + + CefRefPtr SetObjectAndReturn( + CefRefPtr val) override { + return val; + } + + int SetChildObject(CefRefPtr val) override { + return val->GetValue(); + } + + CefRefPtr SetChildObjectAndReturnParent( + CefRefPtr val) override { + return val; + } + + + // LIBRARY-SIDE OBJECT LIST VALUES + + bool SetObjectList( + const std::vector >& val, + int val1, int val2) override { + if (val.size() != 2U) + return false; + return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; + } + + bool GetObjectListByRef(ObjectList& val, int val1, int val2) override { + if (val.size() != GetObjectListSize()) + return false; + val.clear(); + val.push_back(new CefTranslatorTestObjectChildImpl(val1, 0)); + val.push_back(new CefTranslatorTestObjectImpl(val2)); + return true; + } + + size_t GetObjectListSize() override { + return 2U; + } + + + // CLIENT-SIDE OBJECT VALUES + + int SetHandler(CefRefPtr val) override { + return val->GetValue(); + } + + CefRefPtr SetHandlerAndReturn( + CefRefPtr val) override { + return val; + } + + int SetChildHandler(CefRefPtr val) override { + return val->GetValue(); + } + + CefRefPtr SetChildHandlerAndReturnParent( + CefRefPtr val) override { + return val; + } + + + // CLIENT-SIDE OBJECT LIST VALUES + + bool SetHandlerList( + const std::vector >& val, + int val1, int val2) override { + if (val.size() != 2U) + return false; + return val[0]->GetValue() == val1 && val[1]->GetValue() == val2; + } + + bool GetHandlerListByRef( + HandlerList& val, + CefRefPtr val1, + CefRefPtr val2) override { + if (val.size() != GetHandlerListSize()) + return false; + val.clear(); + val.push_back(val1); + val.push_back(val2); + return true; + } + + size_t GetHandlerListSize() override { + return 2U; + } + + private: + IMPLEMENT_REFCOUNTING(CefTranslatorTestImpl); + DISALLOW_COPY_AND_ASSIGN(CefTranslatorTestImpl); +}; + +// static +CefRefPtr CefTranslatorTest::Create() { + return new CefTranslatorTestImpl(); +} diff --git a/libcef_dll/cpptoc/app_cpptoc.cc b/libcef_dll/cpptoc/app_cpptoc.cc index f1e2c8a56..4f4d01ad7 100644 --- a/libcef_dll/cpptoc/app_cpptoc.cc +++ b/libcef_dll/cpptoc/app_cpptoc.cc @@ -18,6 +18,8 @@ #include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK app_on_before_command_line_processing(struct _cef_app_t* self, @@ -105,17 +107,24 @@ struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handle return CefRenderProcessHandlerCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefAppCppToC::CefAppCppToC(CefApp* cls) - : CefCppToC(cls) { - struct_.struct_.on_before_command_line_processing = +CefAppCppToC::CefAppCppToC() { + GetStruct()->on_before_command_line_processing = app_on_before_command_line_processing; - struct_.struct_.on_register_custom_schemes = app_on_register_custom_schemes; - struct_.struct_.get_resource_bundle_handler = app_get_resource_bundle_handler; - struct_.struct_.get_browser_process_handler = app_get_browser_process_handler; - struct_.struct_.get_render_process_handler = app_get_render_process_handler; + GetStruct()->on_register_custom_schemes = app_on_register_custom_schemes; + GetStruct()->get_resource_bundle_handler = app_get_resource_bundle_handler; + GetStruct()->get_browser_process_handler = app_get_browser_process_handler; + GetStruct()->get_render_process_handler = app_get_render_process_handler; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_app_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -123,3 +132,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_APP; diff --git a/libcef_dll/cpptoc/app_cpptoc.h b/libcef_dll/cpptoc/app_cpptoc.h index 9fc731c09..59772d55e 100644 --- a/libcef_dll/cpptoc/app_cpptoc.h +++ b/libcef_dll/cpptoc/app_cpptoc.h @@ -27,9 +27,8 @@ class CefAppCppToC : public CefCppToC { public: - explicit CefAppCppToC(CefApp* cls); + CefAppCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.cc b/libcef_dll/cpptoc/auth_callback_cpptoc.cc index 87c4ec2a0..92af3ab8a 100644 --- a/libcef_dll/cpptoc/auth_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/auth_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/auth_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK auth_callback_cont(struct _cef_auth_callback_t* self, @@ -48,14 +50,21 @@ void CEF_CALLBACK auth_callback_cancel(struct _cef_auth_callback_t* self) { CefAuthCallbackCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefAuthCallbackCppToC::CefAuthCallbackCppToC(CefAuthCallback* cls) - : CefCppToC( - cls) { - struct_.struct_.cont = auth_callback_cont; - struct_.struct_.cancel = auth_callback_cancel; +CefAuthCallbackCppToC::CefAuthCallbackCppToC() { + GetStruct()->cont = auth_callback_cont; + GetStruct()->cancel = auth_callback_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_auth_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -63,3 +72,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_AUTH_CALLBACK; diff --git a/libcef_dll/cpptoc/auth_callback_cpptoc.h b/libcef_dll/cpptoc/auth_callback_cpptoc.h index 5dd75e20e..03c2bfad3 100644 --- a/libcef_dll/cpptoc/auth_callback_cpptoc.h +++ b/libcef_dll/cpptoc/auth_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefAuthCallbackCppToC : public CefCppToC { public: - explicit CefAuthCallbackCppToC(CefAuthCallback* cls); + CefAuthCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_AUTH_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/base_cpptoc.cc b/libcef_dll/cpptoc/base_cpptoc.cc new file mode 100644 index 000000000..b7fe2cdeb --- /dev/null +++ b/libcef_dll/cpptoc/base_cpptoc.cc @@ -0,0 +1,22 @@ +// 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. + +#include "libcef_dll/cpptoc/base_cpptoc.h" + +CefBaseCppToC::CefBaseCppToC() { +} + +template<> CefRefPtr CefCppToC:: + UnwrapDerived(CefWrapperType type, cef_base_t* s) { + NOTREACHED(); + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC:: + kWrapperType = WT_BASE; diff --git a/libcef_dll/cpptoc/base_cpptoc.h b/libcef_dll/cpptoc/base_cpptoc.h index fc20cb7ca..c8c00b627 100644 --- a/libcef_dll/cpptoc/base_cpptoc.h +++ b/libcef_dll/cpptoc/base_cpptoc.h @@ -6,143 +6,20 @@ #define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ #pragma once -#include "include/base/cef_logging.h" -#include "include/base/cef_macros.h" #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" -// CefCppToC implementation for CefBase. -class CefBaseCppToC : public CefBase { +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +// Wrap a C++ class with a C structure. +class CefBaseCppToC + : public CefCppToC { public: - // Use this method to retrieve the underlying class instance from our - // own structure when the structure is passed as the required first - // parameter of a C API function call. No explicit reference counting - // is done in this case. - static CefRefPtr Get(cef_base_t* s) { - DCHECK(s); - - // Cast our structure to the wrapper structure type. - CefBaseCppToC::Struct* wrapperStruct = - reinterpret_cast(s); - // Return the underlying object instance. - return wrapperStruct->class_->GetClass(); - } - - // Use this method to create a wrapper structure for passing our class - // instance to the other side. - static cef_base_t* Wrap(CefRefPtr c) { - if (!c.get()) - return NULL; - - // Wrap our object with the CefCppToC class. - CefBaseCppToC* wrapper = new CefBaseCppToC(c); - // Add a reference to our wrapper object that will be released once our - // structure arrives on the other side. - wrapper->AddRef(); - // Return the structure pointer that can now be passed to the other side. - return wrapper->GetStruct(); - } - - // Use this method to retrieve the underlying class instance when receiving - // our wrapper structure back from the other side. - static CefRefPtr Unwrap(cef_base_t* s) { - if (!s) - return NULL; - - // Cast our structure to the wrapper structure type. - CefBaseCppToC::Struct* wrapperStruct = - reinterpret_cast(s); - // Add the underlying object instance to a smart pointer. - CefRefPtr objectPtr(wrapperStruct->class_->GetClass()); - // Release the reference to our wrapper object that was added before the - // structure was passed back to us. - wrapperStruct->class_->Release(); - // Return the underlying object instance. - return objectPtr; - } - - // Structure representation with pointer to the C++ class. - struct Struct { - cef_base_t struct_; - CefBaseCppToC* class_; - }; - - explicit CefBaseCppToC(CefBase* cls) - : class_(cls) { - DCHECK(cls); - - struct_.class_ = this; - - // zero the underlying structure and set base members - memset(&struct_.struct_, 0, sizeof(cef_base_t)); - struct_.struct_.size = sizeof(cef_base_t); - struct_.struct_.add_ref = struct_add_ref; - struct_.struct_.release = struct_release; - struct_.struct_.has_one_ref = struct_has_one_ref; - } - virtual ~CefBaseCppToC() {} - - CefBase* GetClass() { return class_; } - - // If returning the structure across the DLL boundary you should call - // AddRef() on this CefCppToC object. On the other side of the DLL boundary, - // call UnderlyingRelease() on the wrapping CefCToCpp object. - cef_base_t* GetStruct() { return &struct_.struct_; } - - // CefBase methods increment/decrement reference counts on both this object - // and the underlying wrapper class. - void AddRef() const { - UnderlyingAddRef(); - ref_count_.AddRef(); - } - bool Release() const { - UnderlyingRelease(); - if (ref_count_.Release()) { - delete this; - return true; - } - return false; - } - bool HasOneRef() const { return ref_count_.HasOneRef(); } - - // Increment/decrement reference counts on only the underlying class. - void UnderlyingAddRef() const { class_->AddRef(); } - bool UnderlyingRelease() const { return class_->Release(); } - bool UnderlyingHasOneRef() const { return class_->HasOneRef(); } - - private: - static void CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { - DCHECK(base); - if (!base) - return; - - Struct* impl = reinterpret_cast(base); - impl->class_->AddRef(); - } - - static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { - DCHECK(base); - if (!base) - return 0; - - Struct* impl = reinterpret_cast(base); - return impl->class_->Release(); - } - - static int CEF_CALLBACK struct_has_one_ref(struct _cef_base_t* base) { - DCHECK(base); - if (!base) - return 0; - - Struct* impl = reinterpret_cast(base); - return impl->class_->HasOneRef(); - } - - CefRefCount ref_count_; - Struct struct_; - CefBase* class_; - - DISALLOW_COPY_AND_ASSIGN(CefBaseCppToC); + CefBaseCppToC(); }; +#endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc index 85efc93fe..9861e2957 100644 --- a/libcef_dll/cpptoc/before_download_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/before_download_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK before_download_callback_cont( @@ -31,14 +33,20 @@ void CEF_CALLBACK before_download_callback_cont( show_dialog?true:false); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefBeforeDownloadCallbackCppToC::CefBeforeDownloadCallbackCppToC( - CefBeforeDownloadCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = before_download_callback_cont; +CefBeforeDownloadCallbackCppToC::CefBeforeDownloadCallbackCppToC() { + GetStruct()->cont = before_download_callback_cont; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_before_download_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -47,3 +55,6 @@ template<> base::AtomicRefCount CefCppToC CefWrapperType CefCppToC::kWrapperType = + WT_BEFORE_DOWNLOAD_CALLBACK; diff --git a/libcef_dll/cpptoc/before_download_callback_cpptoc.h b/libcef_dll/cpptoc/before_download_callback_cpptoc.h index 9aada2e1d..ad49eb233 100644 --- a/libcef_dll/cpptoc/before_download_callback_cpptoc.h +++ b/libcef_dll/cpptoc/before_download_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefBeforeDownloadCallbackCppToC : public CefCppToC { public: - explicit CefBeforeDownloadCallbackCppToC(CefBeforeDownloadCallback* cls); + CefBeforeDownloadCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BEFORE_DOWNLOAD_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.cc b/libcef_dll/cpptoc/binary_value_cpptoc.cc index d46b82a11..ab8dd12e1 100644 --- a/libcef_dll/cpptoc/binary_value_cpptoc.cc +++ b/libcef_dll/cpptoc/binary_value_cpptoc.cc @@ -34,6 +34,8 @@ CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK binary_value_is_valid(struct _cef_binary_value_t* self) { @@ -155,18 +157,26 @@ size_t CEF_CALLBACK binary_value_get_data(struct _cef_binary_value_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefBinaryValueCppToC::CefBinaryValueCppToC(CefBinaryValue* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = binary_value_is_valid; - struct_.struct_.is_owned = binary_value_is_owned; - struct_.struct_.is_same = binary_value_is_same; - struct_.struct_.is_equal = binary_value_is_equal; - struct_.struct_.copy = binary_value_copy; - struct_.struct_.get_size = binary_value_get_size; - struct_.struct_.get_data = binary_value_get_data; +CefBinaryValueCppToC::CefBinaryValueCppToC() { + GetStruct()->is_valid = binary_value_is_valid; + GetStruct()->is_owned = binary_value_is_owned; + GetStruct()->is_same = binary_value_is_same; + GetStruct()->is_equal = binary_value_is_equal; + GetStruct()->copy = binary_value_copy; + GetStruct()->get_size = binary_value_get_size; + GetStruct()->get_data = binary_value_get_data; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_binary_value_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -174,3 +184,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_BINARY_VALUE; diff --git a/libcef_dll/cpptoc/binary_value_cpptoc.h b/libcef_dll/cpptoc/binary_value_cpptoc.h index a4df9b293..04b6e27ed 100644 --- a/libcef_dll/cpptoc/binary_value_cpptoc.h +++ b/libcef_dll/cpptoc/binary_value_cpptoc.h @@ -28,9 +28,8 @@ class CefBinaryValueCppToC : public CefCppToC { public: - explicit CefBinaryValueCppToC(CefBinaryValue* cls); + CefBinaryValueCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BINARY_VALUE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index 79ccc316c..0583dd967 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -18,6 +18,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. struct _cef_browser_host_t* CEF_CALLBACK browser_get_host( @@ -352,32 +354,39 @@ int CEF_CALLBACK browser_send_process_message(struct _cef_browser_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls) - : CefCppToC(cls) { - struct_.struct_.get_host = browser_get_host; - struct_.struct_.can_go_back = browser_can_go_back; - struct_.struct_.go_back = browser_go_back; - struct_.struct_.can_go_forward = browser_can_go_forward; - struct_.struct_.go_forward = browser_go_forward; - struct_.struct_.is_loading = browser_is_loading; - struct_.struct_.reload = browser_reload; - struct_.struct_.reload_ignore_cache = browser_reload_ignore_cache; - struct_.struct_.stop_load = browser_stop_load; - struct_.struct_.get_identifier = browser_get_identifier; - struct_.struct_.is_same = browser_is_same; - struct_.struct_.is_popup = browser_is_popup; - struct_.struct_.has_document = browser_has_document; - struct_.struct_.get_main_frame = browser_get_main_frame; - struct_.struct_.get_focused_frame = browser_get_focused_frame; - struct_.struct_.get_frame_byident = browser_get_frame_byident; - struct_.struct_.get_frame = browser_get_frame; - struct_.struct_.get_frame_count = browser_get_frame_count; - struct_.struct_.get_frame_identifiers = browser_get_frame_identifiers; - struct_.struct_.get_frame_names = browser_get_frame_names; - struct_.struct_.send_process_message = browser_send_process_message; +CefBrowserCppToC::CefBrowserCppToC() { + GetStruct()->get_host = browser_get_host; + GetStruct()->can_go_back = browser_can_go_back; + GetStruct()->go_back = browser_go_back; + GetStruct()->can_go_forward = browser_can_go_forward; + GetStruct()->go_forward = browser_go_forward; + GetStruct()->is_loading = browser_is_loading; + GetStruct()->reload = browser_reload; + GetStruct()->reload_ignore_cache = browser_reload_ignore_cache; + GetStruct()->stop_load = browser_stop_load; + GetStruct()->get_identifier = browser_get_identifier; + GetStruct()->is_same = browser_is_same; + GetStruct()->is_popup = browser_is_popup; + GetStruct()->has_document = browser_has_document; + GetStruct()->get_main_frame = browser_get_main_frame; + GetStruct()->get_focused_frame = browser_get_focused_frame; + GetStruct()->get_frame_byident = browser_get_frame_byident; + GetStruct()->get_frame = browser_get_frame; + GetStruct()->get_frame_count = browser_get_frame_count; + GetStruct()->get_frame_identifiers = browser_get_frame_identifiers; + GetStruct()->get_frame_names = browser_get_frame_names; + GetStruct()->send_process_message = browser_send_process_message; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_browser_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -385,3 +394,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_BROWSER; diff --git a/libcef_dll/cpptoc/browser_cpptoc.h b/libcef_dll/cpptoc/browser_cpptoc.h index a3ee8a4dd..6f98ce316 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.h +++ b/libcef_dll/cpptoc/browser_cpptoc.h @@ -29,9 +29,8 @@ class CefBrowserCppToC : public CefCppToC { public: - explicit CefBrowserCppToC(CefBrowser* cls); + CefBrowserCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.cc b/libcef_dll/cpptoc/browser_host_cpptoc.cc index d49cf73a7..71f86381a 100644 --- a/libcef_dll/cpptoc/browser_host_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_host_cpptoc.cc @@ -97,6 +97,8 @@ CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_browser_t* CEF_CALLBACK browser_host_get_browser( @@ -832,69 +834,76 @@ void CEF_CALLBACK browser_host_drag_source_system_drag_ended( CefBrowserHostCppToC::Get(self)->DragSourceSystemDragEnded(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefBrowserHostCppToC::CefBrowserHostCppToC(CefBrowserHost* cls) - : CefCppToC(cls) { - struct_.struct_.get_browser = browser_host_get_browser; - struct_.struct_.close_browser = browser_host_close_browser; - struct_.struct_.set_focus = browser_host_set_focus; - struct_.struct_.set_window_visibility = browser_host_set_window_visibility; - struct_.struct_.get_window_handle = browser_host_get_window_handle; - struct_.struct_.get_opener_window_handle = - browser_host_get_opener_window_handle; - struct_.struct_.get_client = browser_host_get_client; - struct_.struct_.get_request_context = browser_host_get_request_context; - struct_.struct_.get_zoom_level = browser_host_get_zoom_level; - struct_.struct_.set_zoom_level = browser_host_set_zoom_level; - struct_.struct_.run_file_dialog = browser_host_run_file_dialog; - struct_.struct_.start_download = browser_host_start_download; - struct_.struct_.print = browser_host_print; - struct_.struct_.find = browser_host_find; - struct_.struct_.stop_finding = browser_host_stop_finding; - struct_.struct_.show_dev_tools = browser_host_show_dev_tools; - struct_.struct_.close_dev_tools = browser_host_close_dev_tools; - struct_.struct_.get_navigation_entries = browser_host_get_navigation_entries; - struct_.struct_.set_mouse_cursor_change_disabled = +CefBrowserHostCppToC::CefBrowserHostCppToC() { + GetStruct()->get_browser = browser_host_get_browser; + GetStruct()->close_browser = browser_host_close_browser; + GetStruct()->set_focus = browser_host_set_focus; + GetStruct()->set_window_visibility = browser_host_set_window_visibility; + GetStruct()->get_window_handle = browser_host_get_window_handle; + GetStruct()->get_opener_window_handle = browser_host_get_opener_window_handle; + GetStruct()->get_client = browser_host_get_client; + GetStruct()->get_request_context = browser_host_get_request_context; + GetStruct()->get_zoom_level = browser_host_get_zoom_level; + GetStruct()->set_zoom_level = browser_host_set_zoom_level; + GetStruct()->run_file_dialog = browser_host_run_file_dialog; + GetStruct()->start_download = browser_host_start_download; + GetStruct()->print = browser_host_print; + GetStruct()->find = browser_host_find; + GetStruct()->stop_finding = browser_host_stop_finding; + GetStruct()->show_dev_tools = browser_host_show_dev_tools; + GetStruct()->close_dev_tools = browser_host_close_dev_tools; + GetStruct()->get_navigation_entries = browser_host_get_navigation_entries; + GetStruct()->set_mouse_cursor_change_disabled = browser_host_set_mouse_cursor_change_disabled; - struct_.struct_.is_mouse_cursor_change_disabled = + GetStruct()->is_mouse_cursor_change_disabled = browser_host_is_mouse_cursor_change_disabled; - struct_.struct_.replace_misspelling = browser_host_replace_misspelling; - struct_.struct_.add_word_to_dictionary = browser_host_add_word_to_dictionary; - struct_.struct_.is_window_rendering_disabled = + GetStruct()->replace_misspelling = browser_host_replace_misspelling; + GetStruct()->add_word_to_dictionary = browser_host_add_word_to_dictionary; + GetStruct()->is_window_rendering_disabled = browser_host_is_window_rendering_disabled; - struct_.struct_.was_resized = browser_host_was_resized; - struct_.struct_.was_hidden = browser_host_was_hidden; - struct_.struct_.notify_screen_info_changed = + GetStruct()->was_resized = browser_host_was_resized; + GetStruct()->was_hidden = browser_host_was_hidden; + GetStruct()->notify_screen_info_changed = browser_host_notify_screen_info_changed; - struct_.struct_.invalidate = browser_host_invalidate; - struct_.struct_.send_key_event = browser_host_send_key_event; - struct_.struct_.send_mouse_click_event = browser_host_send_mouse_click_event; - struct_.struct_.send_mouse_move_event = browser_host_send_mouse_move_event; - struct_.struct_.send_mouse_wheel_event = browser_host_send_mouse_wheel_event; - struct_.struct_.send_focus_event = browser_host_send_focus_event; - struct_.struct_.send_capture_lost_event = - browser_host_send_capture_lost_event; - struct_.struct_.notify_move_or_resize_started = + GetStruct()->invalidate = browser_host_invalidate; + GetStruct()->send_key_event = browser_host_send_key_event; + GetStruct()->send_mouse_click_event = browser_host_send_mouse_click_event; + GetStruct()->send_mouse_move_event = browser_host_send_mouse_move_event; + GetStruct()->send_mouse_wheel_event = browser_host_send_mouse_wheel_event; + GetStruct()->send_focus_event = browser_host_send_focus_event; + GetStruct()->send_capture_lost_event = browser_host_send_capture_lost_event; + GetStruct()->notify_move_or_resize_started = browser_host_notify_move_or_resize_started; - struct_.struct_.get_nstext_input_context = - browser_host_get_nstext_input_context; - struct_.struct_.handle_key_event_before_text_input_client = + GetStruct()->get_nstext_input_context = browser_host_get_nstext_input_context; + GetStruct()->handle_key_event_before_text_input_client = browser_host_handle_key_event_before_text_input_client; - struct_.struct_.handle_key_event_after_text_input_client = + GetStruct()->handle_key_event_after_text_input_client = browser_host_handle_key_event_after_text_input_client; - struct_.struct_.drag_target_drag_enter = browser_host_drag_target_drag_enter; - struct_.struct_.drag_target_drag_over = browser_host_drag_target_drag_over; - struct_.struct_.drag_target_drag_leave = browser_host_drag_target_drag_leave; - struct_.struct_.drag_target_drop = browser_host_drag_target_drop; - struct_.struct_.drag_source_ended_at = browser_host_drag_source_ended_at; - struct_.struct_.drag_source_system_drag_ended = + GetStruct()->drag_target_drag_enter = browser_host_drag_target_drag_enter; + GetStruct()->drag_target_drag_over = browser_host_drag_target_drag_over; + GetStruct()->drag_target_drag_leave = browser_host_drag_target_drag_leave; + GetStruct()->drag_target_drop = browser_host_drag_target_drop; + GetStruct()->drag_source_ended_at = browser_host_drag_source_ended_at; + GetStruct()->drag_source_system_drag_ended = browser_host_drag_source_system_drag_ended; } +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_browser_host_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_BROWSER_HOST; diff --git a/libcef_dll/cpptoc/browser_host_cpptoc.h b/libcef_dll/cpptoc/browser_host_cpptoc.h index e9a12860c..d93e5e634 100644 --- a/libcef_dll/cpptoc/browser_host_cpptoc.h +++ b/libcef_dll/cpptoc/browser_host_cpptoc.h @@ -30,9 +30,8 @@ class CefBrowserHostCppToC : public CefCppToC { public: - explicit CefBrowserHostCppToC(CefBrowserHost* cls); + CefBrowserHostCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_HOST_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc index dda5544d6..e20f92c2b 100644 --- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/ctocpp/list_value_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK browser_process_handler_on_context_initialized( @@ -82,20 +84,26 @@ struct _cef_print_handler_t* CEF_CALLBACK browser_process_handler_get_print_hand return CefPrintHandlerCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC( - CefBrowserProcessHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_context_initialized = +CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC() { + GetStruct()->on_context_initialized = browser_process_handler_on_context_initialized; - struct_.struct_.on_before_child_process_launch = + GetStruct()->on_before_child_process_launch = browser_process_handler_on_before_child_process_launch; - struct_.struct_.on_render_process_thread_created = + GetStruct()->on_render_process_thread_created = browser_process_handler_on_render_process_thread_created; - struct_.struct_.get_print_handler = browser_process_handler_get_print_handler; + GetStruct()->get_print_handler = browser_process_handler_get_print_handler; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_browser_process_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -103,3 +111,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_BROWSER_PROCESS_HANDLER; diff --git a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h index fdc471b9b..df6da1dc1 100644 --- a/libcef_dll/cpptoc/browser_process_handler_cpptoc.h +++ b/libcef_dll/cpptoc/browser_process_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefBrowserProcessHandlerCppToC : public CefCppToC { public: - explicit CefBrowserProcessHandlerCppToC(CefBrowserProcessHandler* cls); + CefBrowserProcessHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/callback_cpptoc.cc b/libcef_dll/cpptoc/callback_cpptoc.cc index 9fdad966a..c538a54f0 100644 --- a/libcef_dll/cpptoc/callback_cpptoc.cc +++ b/libcef_dll/cpptoc/callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK callback_cont(struct _cef_callback_t* self) { @@ -37,13 +39,20 @@ void CEF_CALLBACK callback_cancel(struct _cef_callback_t* self) { CefCallbackCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefCallbackCppToC::CefCallbackCppToC(CefCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = callback_cont; - struct_.struct_.cancel = callback_cancel; +CefCallbackCppToC::CefCallbackCppToC() { + GetStruct()->cont = callback_cont; + GetStruct()->cancel = callback_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -51,3 +60,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_CALLBACK; diff --git a/libcef_dll/cpptoc/callback_cpptoc.h b/libcef_dll/cpptoc/callback_cpptoc.h index 375927b2a..7d9953c26 100644 --- a/libcef_dll/cpptoc/callback_cpptoc.h +++ b/libcef_dll/cpptoc/callback_cpptoc.h @@ -27,9 +27,8 @@ class CefCallbackCppToC : public CefCppToC { public: - explicit CefCallbackCppToC(CefCallback* cls); + CefCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/client_cpptoc.cc b/libcef_dll/cpptoc/client_cpptoc.cc index 5d7d4820f..7fc273089 100644 --- a/libcef_dll/cpptoc/client_cpptoc.cc +++ b/libcef_dll/cpptoc/client_cpptoc.cc @@ -29,6 +29,8 @@ #include "libcef_dll/ctocpp/process_message_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. struct _cef_context_menu_handler_t* CEF_CALLBACK client_get_context_menu_handler( @@ -282,27 +284,33 @@ int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefClientCppToC::CefClientCppToC(CefClient* cls) - : CefCppToC(cls) { - struct_.struct_.get_context_menu_handler = client_get_context_menu_handler; - struct_.struct_.get_dialog_handler = client_get_dialog_handler; - struct_.struct_.get_display_handler = client_get_display_handler; - struct_.struct_.get_download_handler = client_get_download_handler; - struct_.struct_.get_drag_handler = client_get_drag_handler; - struct_.struct_.get_find_handler = client_get_find_handler; - struct_.struct_.get_focus_handler = client_get_focus_handler; - struct_.struct_.get_geolocation_handler = client_get_geolocation_handler; - struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler; - struct_.struct_.get_keyboard_handler = client_get_keyboard_handler; - struct_.struct_.get_life_span_handler = client_get_life_span_handler; - struct_.struct_.get_load_handler = client_get_load_handler; - struct_.struct_.get_render_handler = client_get_render_handler; - struct_.struct_.get_request_handler = client_get_request_handler; - struct_.struct_.on_process_message_received = - client_on_process_message_received; +CefClientCppToC::CefClientCppToC() { + GetStruct()->get_context_menu_handler = client_get_context_menu_handler; + GetStruct()->get_dialog_handler = client_get_dialog_handler; + GetStruct()->get_display_handler = client_get_display_handler; + GetStruct()->get_download_handler = client_get_download_handler; + GetStruct()->get_drag_handler = client_get_drag_handler; + GetStruct()->get_find_handler = client_get_find_handler; + GetStruct()->get_focus_handler = client_get_focus_handler; + GetStruct()->get_geolocation_handler = client_get_geolocation_handler; + GetStruct()->get_jsdialog_handler = client_get_jsdialog_handler; + GetStruct()->get_keyboard_handler = client_get_keyboard_handler; + GetStruct()->get_life_span_handler = client_get_life_span_handler; + GetStruct()->get_load_handler = client_get_load_handler; + GetStruct()->get_render_handler = client_get_render_handler; + GetStruct()->get_request_handler = client_get_request_handler; + GetStruct()->on_process_message_received = client_on_process_message_received; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_client_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -310,3 +318,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_CLIENT; diff --git a/libcef_dll/cpptoc/client_cpptoc.h b/libcef_dll/cpptoc/client_cpptoc.h index ae3135ec5..5491c6390 100644 --- a/libcef_dll/cpptoc/client_cpptoc.h +++ b/libcef_dll/cpptoc/client_cpptoc.h @@ -27,9 +27,8 @@ class CefClientCppToC : public CefCppToC { public: - explicit CefClientCppToC(CefClient* cls); + CefClientCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/command_line_cpptoc.cc b/libcef_dll/cpptoc/command_line_cpptoc.cc index 561c050b2..202355869 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.cc +++ b/libcef_dll/cpptoc/command_line_cpptoc.cc @@ -37,6 +37,8 @@ CEF_EXPORT cef_command_line_t* cef_command_line_get_global() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK command_line_is_valid(struct _cef_command_line_t* self) { @@ -392,33 +394,39 @@ void CEF_CALLBACK command_line_prepend_wrapper(struct _cef_command_line_t* self, CefString(wrapper)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefCommandLineCppToC::CefCommandLineCppToC(CefCommandLine* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = command_line_is_valid; - struct_.struct_.is_read_only = command_line_is_read_only; - struct_.struct_.copy = command_line_copy; - struct_.struct_.init_from_argv = command_line_init_from_argv; - struct_.struct_.init_from_string = command_line_init_from_string; - struct_.struct_.reset = command_line_reset; - struct_.struct_.get_argv = command_line_get_argv; - struct_.struct_.get_command_line_string = - command_line_get_command_line_string; - struct_.struct_.get_program = command_line_get_program; - struct_.struct_.set_program = command_line_set_program; - struct_.struct_.has_switches = command_line_has_switches; - struct_.struct_.has_switch = command_line_has_switch; - struct_.struct_.get_switch_value = command_line_get_switch_value; - struct_.struct_.get_switches = command_line_get_switches; - struct_.struct_.append_switch = command_line_append_switch; - struct_.struct_.append_switch_with_value = - command_line_append_switch_with_value; - struct_.struct_.has_arguments = command_line_has_arguments; - struct_.struct_.get_arguments = command_line_get_arguments; - struct_.struct_.append_argument = command_line_append_argument; - struct_.struct_.prepend_wrapper = command_line_prepend_wrapper; +CefCommandLineCppToC::CefCommandLineCppToC() { + GetStruct()->is_valid = command_line_is_valid; + GetStruct()->is_read_only = command_line_is_read_only; + GetStruct()->copy = command_line_copy; + GetStruct()->init_from_argv = command_line_init_from_argv; + GetStruct()->init_from_string = command_line_init_from_string; + GetStruct()->reset = command_line_reset; + GetStruct()->get_argv = command_line_get_argv; + GetStruct()->get_command_line_string = command_line_get_command_line_string; + GetStruct()->get_program = command_line_get_program; + GetStruct()->set_program = command_line_set_program; + GetStruct()->has_switches = command_line_has_switches; + GetStruct()->has_switch = command_line_has_switch; + GetStruct()->get_switch_value = command_line_get_switch_value; + GetStruct()->get_switches = command_line_get_switches; + GetStruct()->append_switch = command_line_append_switch; + GetStruct()->append_switch_with_value = command_line_append_switch_with_value; + GetStruct()->has_arguments = command_line_has_arguments; + GetStruct()->get_arguments = command_line_get_arguments; + GetStruct()->append_argument = command_line_append_argument; + GetStruct()->prepend_wrapper = command_line_prepend_wrapper; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_command_line_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -426,3 +434,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_COMMAND_LINE; diff --git a/libcef_dll/cpptoc/command_line_cpptoc.h b/libcef_dll/cpptoc/command_line_cpptoc.h index f7ae49f7c..7cf699283 100644 --- a/libcef_dll/cpptoc/command_line_cpptoc.h +++ b/libcef_dll/cpptoc/command_line_cpptoc.h @@ -28,9 +28,8 @@ class CefCommandLineCppToC : public CefCppToC { public: - explicit CefCommandLineCppToC(CefCommandLine* cls); + CefCommandLineCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_COMMAND_LINE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.cc b/libcef_dll/cpptoc/completion_callback_cpptoc.cc index ff217b148..a469782c3 100644 --- a/libcef_dll/cpptoc/completion_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/completion_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/completion_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK completion_callback_on_complete( @@ -27,14 +29,20 @@ void CEF_CALLBACK completion_callback_on_complete( CefCompletionCallbackCppToC::Get(self)->OnComplete(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefCompletionCallbackCppToC::CefCompletionCallbackCppToC( - CefCompletionCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_complete = completion_callback_on_complete; +CefCompletionCallbackCppToC::CefCompletionCallbackCppToC() { + GetStruct()->on_complete = completion_callback_on_complete; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_completion_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -42,3 +50,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_COMPLETION_CALLBACK; diff --git a/libcef_dll/cpptoc/completion_callback_cpptoc.h b/libcef_dll/cpptoc/completion_callback_cpptoc.h index cc5acfecd..e1fc0fc0a 100644 --- a/libcef_dll/cpptoc/completion_callback_cpptoc.h +++ b/libcef_dll/cpptoc/completion_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefCompletionCallbackCppToC : public CefCppToC { public: - explicit CefCompletionCallbackCppToC(CefCompletionCallback* cls); + CefCompletionCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc index 5cf6447b8..7cedc854c 100644 --- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc @@ -17,6 +17,8 @@ #include "libcef_dll/ctocpp/menu_model_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK context_menu_handler_on_before_context_menu( @@ -110,23 +112,32 @@ void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed( CefFrameCToCpp::Wrap(frame)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC( - CefContextMenuHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_before_context_menu = +CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC() { + GetStruct()->on_before_context_menu = context_menu_handler_on_before_context_menu; - struct_.struct_.on_context_menu_command = + GetStruct()->on_context_menu_command = context_menu_handler_on_context_menu_command; - struct_.struct_.on_context_menu_dismissed = + GetStruct()->on_context_menu_dismissed = context_menu_handler_on_context_menu_dismissed; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_context_menu_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_CONTEXT_MENU_HANDLER; diff --git a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h index 6931f39c6..8cd4a217c 100644 --- a/libcef_dll/cpptoc/context_menu_handler_cpptoc.h +++ b/libcef_dll/cpptoc/context_menu_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefContextMenuHandlerCppToC : public CefCppToC { public: - explicit CefContextMenuHandlerCppToC(CefContextMenuHandler* cls); + CefContextMenuHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc index f107c99be..bcf92b0c0 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK context_menu_params_get_xcoord( @@ -306,36 +308,41 @@ cef_context_menu_edit_state_flags_t CEF_CALLBACK context_menu_params_get_edit_st return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefContextMenuParamsCppToC::CefContextMenuParamsCppToC( - CefContextMenuParams* cls) - : CefCppToC(cls) { - struct_.struct_.get_xcoord = context_menu_params_get_xcoord; - struct_.struct_.get_ycoord = context_menu_params_get_ycoord; - struct_.struct_.get_type_flags = context_menu_params_get_type_flags; - struct_.struct_.get_link_url = context_menu_params_get_link_url; - struct_.struct_.get_unfiltered_link_url = +CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() { + GetStruct()->get_xcoord = context_menu_params_get_xcoord; + GetStruct()->get_ycoord = context_menu_params_get_ycoord; + GetStruct()->get_type_flags = context_menu_params_get_type_flags; + GetStruct()->get_link_url = context_menu_params_get_link_url; + GetStruct()->get_unfiltered_link_url = context_menu_params_get_unfiltered_link_url; - struct_.struct_.get_source_url = context_menu_params_get_source_url; - struct_.struct_.has_image_contents = context_menu_params_has_image_contents; - struct_.struct_.get_page_url = context_menu_params_get_page_url; - struct_.struct_.get_frame_url = context_menu_params_get_frame_url; - struct_.struct_.get_frame_charset = context_menu_params_get_frame_charset; - struct_.struct_.get_media_type = context_menu_params_get_media_type; - struct_.struct_.get_media_state_flags = + GetStruct()->get_source_url = context_menu_params_get_source_url; + GetStruct()->has_image_contents = context_menu_params_has_image_contents; + GetStruct()->get_page_url = context_menu_params_get_page_url; + GetStruct()->get_frame_url = context_menu_params_get_frame_url; + GetStruct()->get_frame_charset = context_menu_params_get_frame_charset; + GetStruct()->get_media_type = context_menu_params_get_media_type; + GetStruct()->get_media_state_flags = context_menu_params_get_media_state_flags; - struct_.struct_.get_selection_text = context_menu_params_get_selection_text; - struct_.struct_.get_misspelled_word = context_menu_params_get_misspelled_word; - struct_.struct_.get_dictionary_suggestions = + GetStruct()->get_selection_text = context_menu_params_get_selection_text; + GetStruct()->get_misspelled_word = context_menu_params_get_misspelled_word; + GetStruct()->get_dictionary_suggestions = context_menu_params_get_dictionary_suggestions; - struct_.struct_.is_editable = context_menu_params_is_editable; - struct_.struct_.is_spell_check_enabled = + GetStruct()->is_editable = context_menu_params_is_editable; + GetStruct()->is_spell_check_enabled = context_menu_params_is_spell_check_enabled; - struct_.struct_.get_edit_state_flags = - context_menu_params_get_edit_state_flags; + GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_context_menu_params_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -343,3 +350,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_CONTEXT_MENU_PARAMS; diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.h b/libcef_dll/cpptoc/context_menu_params_cpptoc.h index 9420c46c1..e07b8e592 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.h +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.h @@ -28,9 +28,8 @@ class CefContextMenuParamsCppToC : public CefCppToC { public: - explicit CefContextMenuParamsCppToC(CefContextMenuParams* cls); + CefContextMenuParamsCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_PARAMS_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc index 2575b805a..7805214e8 100644 --- a/libcef_dll/cpptoc/cookie_manager_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.cc @@ -52,6 +52,8 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK cookie_manager_set_supported_schemes( @@ -217,19 +219,26 @@ int CEF_CALLBACK cookie_manager_flush_store(struct _cef_cookie_manager_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefCookieManagerCppToC::CefCookieManagerCppToC(CefCookieManager* cls) - : CefCppToC( - cls) { - struct_.struct_.set_supported_schemes = cookie_manager_set_supported_schemes; - struct_.struct_.visit_all_cookies = cookie_manager_visit_all_cookies; - struct_.struct_.visit_url_cookies = cookie_manager_visit_url_cookies; - struct_.struct_.set_cookie = cookie_manager_set_cookie; - struct_.struct_.delete_cookies = cookie_manager_delete_cookies; - struct_.struct_.set_storage_path = cookie_manager_set_storage_path; - struct_.struct_.flush_store = cookie_manager_flush_store; +CefCookieManagerCppToC::CefCookieManagerCppToC() { + GetStruct()->set_supported_schemes = cookie_manager_set_supported_schemes; + GetStruct()->visit_all_cookies = cookie_manager_visit_all_cookies; + GetStruct()->visit_url_cookies = cookie_manager_visit_url_cookies; + GetStruct()->set_cookie = cookie_manager_set_cookie; + GetStruct()->delete_cookies = cookie_manager_delete_cookies; + GetStruct()->set_storage_path = cookie_manager_set_storage_path; + GetStruct()->flush_store = cookie_manager_flush_store; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_cookie_manager_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -237,3 +246,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_COOKIE_MANAGER; diff --git a/libcef_dll/cpptoc/cookie_manager_cpptoc.h b/libcef_dll/cpptoc/cookie_manager_cpptoc.h index 440bb9fd3..8ca7dcacf 100644 --- a/libcef_dll/cpptoc/cookie_manager_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_manager_cpptoc.h @@ -28,9 +28,8 @@ class CefCookieManagerCppToC : public CefCppToC { public: - explicit CefCookieManagerCppToC(CefCookieManager* cls); + CefCookieManagerCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_COOKIE_MANAGER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc index a67434411..13c3708a2 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, @@ -54,13 +56,20 @@ int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls) - : CefCppToC( - cls) { - struct_.struct_.visit = cookie_visitor_visit; +CefCookieVisitorCppToC::CefCookieVisitorCppToC() { + GetStruct()->visit = cookie_visitor_visit; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_cookie_visitor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -68,3 +77,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_COOKIE_VISITOR; diff --git a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h index af6729efd..88ca15393 100644 --- a/libcef_dll/cpptoc/cookie_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -28,9 +28,8 @@ class CefCookieVisitorCppToC : public CefCppToC { public: - explicit CefCookieVisitorCppToC(CefCookieVisitor* cls); + CefCookieVisitorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/cpptoc.h b/libcef_dll/cpptoc/cpptoc.h index a1b37d99e..a3e094e53 100644 --- a/libcef_dll/cpptoc/cpptoc.h +++ b/libcef_dll/cpptoc/cpptoc.h @@ -10,7 +10,7 @@ #include "include/base/cef_macros.h" #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" - +#include "libcef_dll/wrapper_types.h" // Wrap a C++ class with a C structure. This is used when the class // implementation exists on this side of the DLL boundary but will have methods @@ -18,33 +18,15 @@ template class CefCppToC : public CefBase { public: - // Structure representation with pointer to the C++ class. - struct Struct { - StructName struct_; - CefCppToC* class_; - }; - - // Use this method to retrieve the underlying class instance from our - // own structure when the structure is passed as the required first - // parameter of a C API function call. No explicit reference counting - // is done in this case. - static CefRefPtr Get(StructName* s) { - DCHECK(s); - - // Cast our structure to the wrapper structure type. - Struct* wrapperStruct = reinterpret_cast(s); - // Return the underlying object instance. - return wrapperStruct->class_->GetClass(); - } - - // Use this method to create a wrapper structure for passing our class - // instance to the other side. + // Create a new wrapper instance and associated structure reference for + // passing an object instance the other side. static StructName* Wrap(CefRefPtr c) { if (!c.get()) return NULL; // Wrap our object with the CefCppToC class. - ClassName* wrapper = new ClassName(c.get()); + ClassName* wrapper = new ClassName(); + wrapper->wrapper_struct_.object_ = c.get(); // Add a reference to our wrapper object that will be released once our // structure arrives on the other side. wrapper->AddRef(); @@ -52,52 +34,44 @@ class CefCppToC : public CefBase { return wrapper->GetStruct(); } - // Use this method to retrieve the underlying class instance when receiving - // our wrapper structure back from the other side. + // Retrieve the underlying object instance for a structure reference passed + // back from the other side. static CefRefPtr Unwrap(StructName* s) { if (!s) return NULL; // Cast our structure to the wrapper structure type. - Struct* wrapperStruct = reinterpret_cast(s); + WrapperStruct* wrapperStruct = GetWrapperStruct(s); + + // If the type does not match this object then we need to unwrap as the + // derived type. + if (wrapperStruct->type_ != kWrapperType) + return UnwrapDerived(wrapperStruct->type_, s); + // Add the underlying object instance to a smart pointer. - CefRefPtr objectPtr(wrapperStruct->class_->GetClass()); + CefRefPtr objectPtr(wrapperStruct->object_); // Release the reference to our wrapper object that was added before the // structure was passed back to us. - wrapperStruct->class_->Release(); + wrapperStruct->wrapper_->Release(); // Return the underlying object instance. return objectPtr; } - explicit CefCppToC(BaseName* cls) - : class_(cls) { - DCHECK(cls); - - struct_.class_ = this; - - // zero the underlying structure and set base members - memset(&struct_.struct_, 0, sizeof(StructName)); - struct_.struct_.base.size = sizeof(StructName); - struct_.struct_.base.add_ref = struct_add_ref; - struct_.struct_.base.release = struct_release; - struct_.struct_.base.has_one_ref = struct_has_one_ref; - -#ifndef NDEBUG - base::AtomicRefCountInc(&DebugObjCt); -#endif + // Retrieve the underlying object instance from our own structure reference + // when the reference is passed as the required first parameter of a C API + // function call. No explicit reference counting is done in this case. + static CefRefPtr Get(StructName* s) { + DCHECK(s); + WrapperStruct* wrapperStruct = GetWrapperStruct(s); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + return wrapperStruct->object_; } - virtual ~CefCppToC() { -#ifndef NDEBUG - base::AtomicRefCountDec(&DebugObjCt); -#endif - } - - BaseName* GetClass() { return class_; } // If returning the structure across the DLL boundary you should call // AddRef() on this CefCppToC object. On the other side of the DLL boundary, // call UnderlyingRelease() on the wrapping CefCToCpp object. - StructName* GetStruct() { return &struct_.struct_; } + StructName* GetStruct() { return &wrapper_struct_.struct_; } // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapper class. @@ -113,12 +87,7 @@ class CefCppToC : public CefBase { } return false; } - bool HasOneRef() const { return ref_count_.HasOneRef(); } - - // Increment/decrement reference counts on only the underlying class. - void UnderlyingAddRef() const { class_->AddRef(); } - bool UnderlyingRelease() const { return class_->Release(); } - bool UnderlyingHasOneRef() const { return class_->HasOneRef(); } + bool HasOneRef() const { return UnderlyingHasOneRef(); } #ifndef NDEBUG // Simple tracking of allocated objects. @@ -126,39 +95,105 @@ class CefCppToC : public CefBase { #endif protected: - Struct struct_; - BaseName* class_; + CefCppToC() { + wrapper_struct_.type_ = kWrapperType; + wrapper_struct_.wrapper_ = this; + memset(GetStruct(), 0, sizeof(StructName)); + + cef_base_t* base = reinterpret_cast(GetStruct()); + base->size = sizeof(StructName); + base->add_ref = struct_add_ref; + base->release = struct_release; + base->has_one_ref = struct_has_one_ref; + +#ifndef NDEBUG + base::AtomicRefCountInc(&DebugObjCt); +#endif + } + + virtual ~CefCppToC() { +#ifndef NDEBUG + base::AtomicRefCountDec(&DebugObjCt); +#endif + } private: - static void CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { + // Used to associate this wrapper object, the underlying object instance and + // the structure that will be passed to the other side. + struct WrapperStruct { + CefWrapperType type_; + BaseName* object_; + CefCppToC* wrapper_; + StructName struct_; + }; + + static WrapperStruct* GetWrapperStruct(StructName* s) { + // Offset using the WrapperStruct size instead of individual member sizes + // to avoid problems due to platform/compiler differences in structure + // padding. + return reinterpret_cast( + reinterpret_cast(s) - + (sizeof(WrapperStruct) - sizeof(StructName))); + } + + // Unwrap as the derived type. + static CefRefPtr UnwrapDerived(CefWrapperType type, StructName* s); + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { + wrapper_struct_.object_->AddRef(); + } + bool UnderlyingRelease() const { + return wrapper_struct_.object_->Release(); + } + bool UnderlyingHasOneRef() const { + return wrapper_struct_.object_->HasOneRef(); + } + + static void CEF_CALLBACK struct_add_ref(cef_base_t* base) { DCHECK(base); if (!base) return; - Struct* impl = reinterpret_cast(base); - impl->class_->AddRef(); + WrapperStruct* wrapperStruct = + GetWrapperStruct(reinterpret_cast(base)); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + + wrapperStruct->wrapper_->AddRef(); } - static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { + static int CEF_CALLBACK struct_release(cef_base_t* base) { DCHECK(base); if (!base) return 0; - Struct* impl = reinterpret_cast(base); - return impl->class_->Release(); + WrapperStruct* wrapperStruct = + GetWrapperStruct(reinterpret_cast(base)); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + + return wrapperStruct->wrapper_->Release(); } - static int CEF_CALLBACK struct_has_one_ref(struct _cef_base_t* base) { + static int CEF_CALLBACK struct_has_one_ref(cef_base_t* base) { DCHECK(base); if (!base) return 0; - Struct* impl = reinterpret_cast(base); - return impl->class_->HasOneRef(); + WrapperStruct* wrapperStruct = + GetWrapperStruct(reinterpret_cast(base)); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + + return wrapperStruct->wrapper_->HasOneRef(); } + WrapperStruct wrapper_struct_; CefRefCount ref_count_; + static CefWrapperType kWrapperType; + DISALLOW_COPY_AND_ASSIGN(CefCppToC); }; diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc index e3c24a685..12bd8e65c 100644 --- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK delete_cookies_callback_on_complete( @@ -28,14 +30,20 @@ void CEF_CALLBACK delete_cookies_callback_on_complete( num_deleted); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDeleteCookiesCallbackCppToC::CefDeleteCookiesCallbackCppToC( - CefDeleteCookiesCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_complete = delete_cookies_callback_on_complete; +CefDeleteCookiesCallbackCppToC::CefDeleteCookiesCallbackCppToC() { + GetStruct()->on_complete = delete_cookies_callback_on_complete; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_delete_cookies_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -43,3 +51,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_DELETE_COOKIES_CALLBACK; diff --git a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h index 9217083a5..aedb3c0f5 100644 --- a/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h +++ b/libcef_dll/cpptoc/delete_cookies_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefDeleteCookiesCallbackCppToC : public CefCppToC { public: - explicit CefDeleteCookiesCallbackCppToC(CefDeleteCookiesCallback* cls); + CefDeleteCookiesCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DELETE_COOKIES_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc index f5b2aa374..73020825f 100644 --- a/libcef_dll/cpptoc/dialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK dialog_handler_on_file_dialog( @@ -60,13 +62,20 @@ int CEF_CALLBACK dialog_handler_on_file_dialog( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDialogHandlerCppToC::CefDialogHandlerCppToC(CefDialogHandler* cls) - : CefCppToC( - cls) { - struct_.struct_.on_file_dialog = dialog_handler_on_file_dialog; +CefDialogHandlerCppToC::CefDialogHandlerCppToC() { + GetStruct()->on_file_dialog = dialog_handler_on_file_dialog; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_dialog_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -74,3 +83,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DIALOG_HANDLER; diff --git a/libcef_dll/cpptoc/dialog_handler_cpptoc.h b/libcef_dll/cpptoc/dialog_handler_cpptoc.h index 235997380..327031bc0 100644 --- a/libcef_dll/cpptoc/dialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/dialog_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefDialogHandlerCppToC : public CefCppToC { public: - explicit CefDialogHandlerCppToC(CefDialogHandler* cls); + CefDialogHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc index d8e6a9169..cebc28c4a 100644 --- a/libcef_dll/cpptoc/dictionary_value_cpptoc.cc +++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.cc @@ -30,6 +30,8 @@ CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK dictionary_value_is_valid( @@ -624,41 +626,48 @@ int CEF_CALLBACK dictionary_value_set_list(struct _cef_dictionary_value_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDictionaryValueCppToC::CefDictionaryValueCppToC(CefDictionaryValue* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = dictionary_value_is_valid; - struct_.struct_.is_owned = dictionary_value_is_owned; - struct_.struct_.is_read_only = dictionary_value_is_read_only; - struct_.struct_.is_same = dictionary_value_is_same; - struct_.struct_.is_equal = dictionary_value_is_equal; - struct_.struct_.copy = dictionary_value_copy; - struct_.struct_.get_size = dictionary_value_get_size; - struct_.struct_.clear = dictionary_value_clear; - struct_.struct_.has_key = dictionary_value_has_key; - struct_.struct_.get_keys = dictionary_value_get_keys; - struct_.struct_.remove = dictionary_value_remove; - struct_.struct_.get_type = dictionary_value_get_type; - struct_.struct_.get_value = dictionary_value_get_value; - struct_.struct_.get_bool = dictionary_value_get_bool; - struct_.struct_.get_int = dictionary_value_get_int; - struct_.struct_.get_double = dictionary_value_get_double; - struct_.struct_.get_string = dictionary_value_get_string; - struct_.struct_.get_binary = dictionary_value_get_binary; - struct_.struct_.get_dictionary = dictionary_value_get_dictionary; - struct_.struct_.get_list = dictionary_value_get_list; - struct_.struct_.set_value = dictionary_value_set_value; - struct_.struct_.set_null = dictionary_value_set_null; - struct_.struct_.set_bool = dictionary_value_set_bool; - struct_.struct_.set_int = dictionary_value_set_int; - struct_.struct_.set_double = dictionary_value_set_double; - struct_.struct_.set_string = dictionary_value_set_string; - struct_.struct_.set_binary = dictionary_value_set_binary; - struct_.struct_.set_dictionary = dictionary_value_set_dictionary; - struct_.struct_.set_list = dictionary_value_set_list; +CefDictionaryValueCppToC::CefDictionaryValueCppToC() { + GetStruct()->is_valid = dictionary_value_is_valid; + GetStruct()->is_owned = dictionary_value_is_owned; + GetStruct()->is_read_only = dictionary_value_is_read_only; + GetStruct()->is_same = dictionary_value_is_same; + GetStruct()->is_equal = dictionary_value_is_equal; + GetStruct()->copy = dictionary_value_copy; + GetStruct()->get_size = dictionary_value_get_size; + GetStruct()->clear = dictionary_value_clear; + GetStruct()->has_key = dictionary_value_has_key; + GetStruct()->get_keys = dictionary_value_get_keys; + GetStruct()->remove = dictionary_value_remove; + GetStruct()->get_type = dictionary_value_get_type; + GetStruct()->get_value = dictionary_value_get_value; + GetStruct()->get_bool = dictionary_value_get_bool; + GetStruct()->get_int = dictionary_value_get_int; + GetStruct()->get_double = dictionary_value_get_double; + GetStruct()->get_string = dictionary_value_get_string; + GetStruct()->get_binary = dictionary_value_get_binary; + GetStruct()->get_dictionary = dictionary_value_get_dictionary; + GetStruct()->get_list = dictionary_value_get_list; + GetStruct()->set_value = dictionary_value_set_value; + GetStruct()->set_null = dictionary_value_set_null; + GetStruct()->set_bool = dictionary_value_set_bool; + GetStruct()->set_int = dictionary_value_set_int; + GetStruct()->set_double = dictionary_value_set_double; + GetStruct()->set_string = dictionary_value_set_string; + GetStruct()->set_binary = dictionary_value_set_binary; + GetStruct()->set_dictionary = dictionary_value_set_dictionary; + GetStruct()->set_list = dictionary_value_set_list; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_dictionary_value_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -666,3 +675,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_DICTIONARY_VALUE; diff --git a/libcef_dll/cpptoc/dictionary_value_cpptoc.h b/libcef_dll/cpptoc/dictionary_value_cpptoc.h index 86ba43f1b..bd14b3085 100644 --- a/libcef_dll/cpptoc/dictionary_value_cpptoc.h +++ b/libcef_dll/cpptoc/dictionary_value_cpptoc.h @@ -28,9 +28,8 @@ class CefDictionaryValueCppToC : public CefCppToC { public: - explicit CefDictionaryValueCppToC(CefDictionaryValue* cls); + CefDictionaryValueCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DICTIONARY_VALUE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.cc b/libcef_dll/cpptoc/display_handler_cpptoc.cc index 0a64e2f0a..f5e1c0312 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK display_handler_on_address_change( @@ -160,18 +162,25 @@ int CEF_CALLBACK display_handler_on_console_message( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_address_change = display_handler_on_address_change; - struct_.struct_.on_title_change = display_handler_on_title_change; - struct_.struct_.on_favicon_urlchange = display_handler_on_favicon_urlchange; - struct_.struct_.on_tooltip = display_handler_on_tooltip; - struct_.struct_.on_status_message = display_handler_on_status_message; - struct_.struct_.on_console_message = display_handler_on_console_message; +CefDisplayHandlerCppToC::CefDisplayHandlerCppToC() { + GetStruct()->on_address_change = display_handler_on_address_change; + GetStruct()->on_title_change = display_handler_on_title_change; + GetStruct()->on_favicon_urlchange = display_handler_on_favicon_urlchange; + GetStruct()->on_tooltip = display_handler_on_tooltip; + GetStruct()->on_status_message = display_handler_on_status_message; + GetStruct()->on_console_message = display_handler_on_console_message; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_display_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -179,3 +188,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DISPLAY_HANDLER; diff --git a/libcef_dll/cpptoc/display_handler_cpptoc.h b/libcef_dll/cpptoc/display_handler_cpptoc.h index c80b2427c..78810c716 100644 --- a/libcef_dll/cpptoc/display_handler_cpptoc.h +++ b/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefDisplayHandlerCppToC : public CefCppToC { public: - explicit CefDisplayHandlerCppToC(CefDisplayHandler* cls); + CefDisplayHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.cc b/libcef_dll/cpptoc/domdocument_cpptoc.cc index a665eb557..391ddc830 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.cc +++ b/libcef_dll/cpptoc/domdocument_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/cpptoc/domnode_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_dom_document_type_t CEF_CALLBACK domdocument_get_type( @@ -238,27 +240,34 @@ cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url( return _retval.DetachToUserFree(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDOMDocumentCppToC::CefDOMDocumentCppToC(CefDOMDocument* cls) - : CefCppToC(cls) { - struct_.struct_.get_type = domdocument_get_type; - struct_.struct_.get_document = domdocument_get_document; - struct_.struct_.get_body = domdocument_get_body; - struct_.struct_.get_head = domdocument_get_head; - struct_.struct_.get_title = domdocument_get_title; - struct_.struct_.get_element_by_id = domdocument_get_element_by_id; - struct_.struct_.get_focused_node = domdocument_get_focused_node; - struct_.struct_.has_selection = domdocument_has_selection; - struct_.struct_.get_selection_start_offset = +CefDOMDocumentCppToC::CefDOMDocumentCppToC() { + GetStruct()->get_type = domdocument_get_type; + GetStruct()->get_document = domdocument_get_document; + GetStruct()->get_body = domdocument_get_body; + GetStruct()->get_head = domdocument_get_head; + GetStruct()->get_title = domdocument_get_title; + GetStruct()->get_element_by_id = domdocument_get_element_by_id; + GetStruct()->get_focused_node = domdocument_get_focused_node; + GetStruct()->has_selection = domdocument_has_selection; + GetStruct()->get_selection_start_offset = domdocument_get_selection_start_offset; - struct_.struct_.get_selection_end_offset = - domdocument_get_selection_end_offset; - struct_.struct_.get_selection_as_markup = domdocument_get_selection_as_markup; - struct_.struct_.get_selection_as_text = domdocument_get_selection_as_text; - struct_.struct_.get_base_url = domdocument_get_base_url; - struct_.struct_.get_complete_url = domdocument_get_complete_url; + GetStruct()->get_selection_end_offset = domdocument_get_selection_end_offset; + GetStruct()->get_selection_as_markup = domdocument_get_selection_as_markup; + GetStruct()->get_selection_as_text = domdocument_get_selection_as_text; + GetStruct()->get_base_url = domdocument_get_base_url; + GetStruct()->get_complete_url = domdocument_get_complete_url; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_domdocument_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -266,3 +275,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DOMDOCUMENT; diff --git a/libcef_dll/cpptoc/domdocument_cpptoc.h b/libcef_dll/cpptoc/domdocument_cpptoc.h index 695de554c..a2063bc3e 100644 --- a/libcef_dll/cpptoc/domdocument_cpptoc.h +++ b/libcef_dll/cpptoc/domdocument_cpptoc.h @@ -28,9 +28,8 @@ class CefDOMDocumentCppToC : public CefCppToC { public: - explicit CefDOMDocumentCppToC(CefDOMDocument* cls); + CefDOMDocumentCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOMDOCUMENT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/domnode_cpptoc.cc b/libcef_dll/cpptoc/domnode_cpptoc.cc index fb128c956..93b81b0fa 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.cc +++ b/libcef_dll/cpptoc/domnode_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_dom_node_type_t CEF_CALLBACK domnode_get_type(struct _cef_domnode_t* self) { @@ -427,37 +429,44 @@ cef_string_userfree_t CEF_CALLBACK domnode_get_element_inner_text( return _retval.DetachToUserFree(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls) - : CefCppToC(cls) { - struct_.struct_.get_type = domnode_get_type; - struct_.struct_.is_text = domnode_is_text; - struct_.struct_.is_element = domnode_is_element; - struct_.struct_.is_editable = domnode_is_editable; - struct_.struct_.is_form_control_element = domnode_is_form_control_element; - struct_.struct_.get_form_control_element_type = +CefDOMNodeCppToC::CefDOMNodeCppToC() { + GetStruct()->get_type = domnode_get_type; + GetStruct()->is_text = domnode_is_text; + GetStruct()->is_element = domnode_is_element; + GetStruct()->is_editable = domnode_is_editable; + GetStruct()->is_form_control_element = domnode_is_form_control_element; + GetStruct()->get_form_control_element_type = domnode_get_form_control_element_type; - struct_.struct_.is_same = domnode_is_same; - struct_.struct_.get_name = domnode_get_name; - struct_.struct_.get_value = domnode_get_value; - struct_.struct_.set_value = domnode_set_value; - struct_.struct_.get_as_markup = domnode_get_as_markup; - struct_.struct_.get_document = domnode_get_document; - struct_.struct_.get_parent = domnode_get_parent; - struct_.struct_.get_previous_sibling = domnode_get_previous_sibling; - struct_.struct_.get_next_sibling = domnode_get_next_sibling; - struct_.struct_.has_children = domnode_has_children; - struct_.struct_.get_first_child = domnode_get_first_child; - struct_.struct_.get_last_child = domnode_get_last_child; - struct_.struct_.get_element_tag_name = domnode_get_element_tag_name; - struct_.struct_.has_element_attributes = domnode_has_element_attributes; - struct_.struct_.has_element_attribute = domnode_has_element_attribute; - struct_.struct_.get_element_attribute = domnode_get_element_attribute; - struct_.struct_.get_element_attributes = domnode_get_element_attributes; - struct_.struct_.set_element_attribute = domnode_set_element_attribute; - struct_.struct_.get_element_inner_text = domnode_get_element_inner_text; + GetStruct()->is_same = domnode_is_same; + GetStruct()->get_name = domnode_get_name; + GetStruct()->get_value = domnode_get_value; + GetStruct()->set_value = domnode_set_value; + GetStruct()->get_as_markup = domnode_get_as_markup; + GetStruct()->get_document = domnode_get_document; + GetStruct()->get_parent = domnode_get_parent; + GetStruct()->get_previous_sibling = domnode_get_previous_sibling; + GetStruct()->get_next_sibling = domnode_get_next_sibling; + GetStruct()->has_children = domnode_has_children; + GetStruct()->get_first_child = domnode_get_first_child; + GetStruct()->get_last_child = domnode_get_last_child; + GetStruct()->get_element_tag_name = domnode_get_element_tag_name; + GetStruct()->has_element_attributes = domnode_has_element_attributes; + GetStruct()->has_element_attribute = domnode_has_element_attribute; + GetStruct()->get_element_attribute = domnode_get_element_attribute; + GetStruct()->get_element_attributes = domnode_get_element_attributes; + GetStruct()->set_element_attribute = domnode_set_element_attribute; + GetStruct()->get_element_inner_text = domnode_get_element_inner_text; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_domnode_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -465,3 +474,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DOMNODE; diff --git a/libcef_dll/cpptoc/domnode_cpptoc.h b/libcef_dll/cpptoc/domnode_cpptoc.h index 780f7cc16..07108716e 100644 --- a/libcef_dll/cpptoc/domnode_cpptoc.h +++ b/libcef_dll/cpptoc/domnode_cpptoc.h @@ -27,9 +27,8 @@ class CefDOMNodeCppToC : public CefCppToC { public: - explicit CefDOMNodeCppToC(CefDOMNode* cls); + CefDOMNodeCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOMNODE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/libcef_dll/cpptoc/domvisitor_cpptoc.cc index fdf60cdd0..0c2627089 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.cc +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/domdocument_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, @@ -33,12 +35,20 @@ void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, CefDOMDocumentCToCpp::Wrap(document)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls) - : CefCppToC(cls) { - struct_.struct_.visit = domvisitor_visit; +CefDOMVisitorCppToC::CefDOMVisitorCppToC() { + GetStruct()->visit = domvisitor_visit; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_domvisitor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -46,3 +56,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DOMVISITOR; diff --git a/libcef_dll/cpptoc/domvisitor_cpptoc.h b/libcef_dll/cpptoc/domvisitor_cpptoc.h index 3bdbe7168..f4e020321 100644 --- a/libcef_dll/cpptoc/domvisitor_cpptoc.h +++ b/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -27,9 +27,8 @@ class CefDOMVisitorCppToC : public CefCppToC { public: - explicit CefDOMVisitorCppToC(CefDOMVisitor* cls); + CefDOMVisitorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.cc b/libcef_dll/cpptoc/download_handler_cpptoc.cc index 572bf7e02..eeda76694 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -17,6 +17,8 @@ #include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK download_handler_on_before_download( @@ -83,14 +85,21 @@ void CEF_CALLBACK download_handler_on_download_updated( CefDownloadItemCallbackCToCpp::Wrap(callback)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_before_download = download_handler_on_before_download; - struct_.struct_.on_download_updated = download_handler_on_download_updated; +CefDownloadHandlerCppToC::CefDownloadHandlerCppToC() { + GetStruct()->on_before_download = download_handler_on_before_download; + GetStruct()->on_download_updated = download_handler_on_download_updated; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_download_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -98,3 +107,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_DOWNLOAD_HANDLER; diff --git a/libcef_dll/cpptoc/download_handler_cpptoc.h b/libcef_dll/cpptoc/download_handler_cpptoc.h index b3acda7c8..d672bbdb7 100644 --- a/libcef_dll/cpptoc/download_handler_cpptoc.h +++ b/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefDownloadHandlerCppToC : public CefCppToC { public: - explicit CefDownloadHandlerCppToC(CefDownloadHandler* cls); + CefDownloadHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc index b62d476a5..3ef60fb91 100644 --- a/libcef_dll/cpptoc/download_item_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/download_item_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK download_item_callback_cancel( @@ -51,16 +53,22 @@ void CEF_CALLBACK download_item_callback_resume( CefDownloadItemCallbackCppToC::Get(self)->Resume(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDownloadItemCallbackCppToC::CefDownloadItemCallbackCppToC( - CefDownloadItemCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cancel = download_item_callback_cancel; - struct_.struct_.pause = download_item_callback_pause; - struct_.struct_.resume = download_item_callback_resume; +CefDownloadItemCallbackCppToC::CefDownloadItemCallbackCppToC() { + GetStruct()->cancel = download_item_callback_cancel; + GetStruct()->pause = download_item_callback_pause; + GetStruct()->resume = download_item_callback_resume; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_download_item_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -68,3 +76,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_DOWNLOAD_ITEM_CALLBACK; diff --git a/libcef_dll/cpptoc/download_item_callback_cpptoc.h b/libcef_dll/cpptoc/download_item_callback_cpptoc.h index 4c5a0a064..6c4cdd58f 100644 --- a/libcef_dll/cpptoc/download_item_callback_cpptoc.h +++ b/libcef_dll/cpptoc/download_item_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefDownloadItemCallbackCppToC : public CefCppToC { public: - explicit CefDownloadItemCallbackCppToC(CefDownloadItemCallback* cls); + CefDownloadItemCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/download_item_cpptoc.cc b/libcef_dll/cpptoc/download_item_cpptoc.cc index d060e81bc..2fdc55415 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.cc +++ b/libcef_dll/cpptoc/download_item_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/download_item_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK download_item_is_valid(struct _cef_download_item_t* self) { @@ -266,31 +268,36 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_mime_type( return _retval.DetachToUserFree(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDownloadItemCppToC::CefDownloadItemCppToC(CefDownloadItem* cls) - : CefCppToC( - cls) { - struct_.struct_.is_valid = download_item_is_valid; - struct_.struct_.is_in_progress = download_item_is_in_progress; - struct_.struct_.is_complete = download_item_is_complete; - struct_.struct_.is_canceled = download_item_is_canceled; - struct_.struct_.get_current_speed = download_item_get_current_speed; - struct_.struct_.get_percent_complete = download_item_get_percent_complete; - struct_.struct_.get_total_bytes = download_item_get_total_bytes; - struct_.struct_.get_received_bytes = download_item_get_received_bytes; - struct_.struct_.get_start_time = download_item_get_start_time; - struct_.struct_.get_end_time = download_item_get_end_time; - struct_.struct_.get_full_path = download_item_get_full_path; - struct_.struct_.get_id = download_item_get_id; - struct_.struct_.get_url = download_item_get_url; - struct_.struct_.get_original_url = download_item_get_original_url; - struct_.struct_.get_suggested_file_name = - download_item_get_suggested_file_name; - struct_.struct_.get_content_disposition = - download_item_get_content_disposition; - struct_.struct_.get_mime_type = download_item_get_mime_type; +CefDownloadItemCppToC::CefDownloadItemCppToC() { + GetStruct()->is_valid = download_item_is_valid; + GetStruct()->is_in_progress = download_item_is_in_progress; + GetStruct()->is_complete = download_item_is_complete; + GetStruct()->is_canceled = download_item_is_canceled; + GetStruct()->get_current_speed = download_item_get_current_speed; + GetStruct()->get_percent_complete = download_item_get_percent_complete; + GetStruct()->get_total_bytes = download_item_get_total_bytes; + GetStruct()->get_received_bytes = download_item_get_received_bytes; + GetStruct()->get_start_time = download_item_get_start_time; + GetStruct()->get_end_time = download_item_get_end_time; + GetStruct()->get_full_path = download_item_get_full_path; + GetStruct()->get_id = download_item_get_id; + GetStruct()->get_url = download_item_get_url; + GetStruct()->get_original_url = download_item_get_original_url; + GetStruct()->get_suggested_file_name = download_item_get_suggested_file_name; + GetStruct()->get_content_disposition = download_item_get_content_disposition; + GetStruct()->get_mime_type = download_item_get_mime_type; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_download_item_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -298,3 +305,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DOWNLOAD_ITEM; diff --git a/libcef_dll/cpptoc/download_item_cpptoc.h b/libcef_dll/cpptoc/download_item_cpptoc.h index 1560928aa..42be9cd7d 100644 --- a/libcef_dll/cpptoc/download_item_cpptoc.h +++ b/libcef_dll/cpptoc/download_item_cpptoc.h @@ -28,9 +28,8 @@ class CefDownloadItemCppToC : public CefCppToC { public: - explicit CefDownloadItemCppToC(CefDownloadItem* cls); + CefDownloadItemCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_ITEM_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.cc b/libcef_dll/cpptoc/drag_data_cpptoc.cc index f53b0f53b..8573b70be 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_data_cpptoc.cc @@ -28,6 +28,8 @@ CEF_EXPORT cef_drag_data_t* cef_drag_data_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. struct _cef_drag_data_t* CEF_CALLBACK drag_data_clone( @@ -365,33 +367,40 @@ void CEF_CALLBACK drag_data_add_file(struct _cef_drag_data_t* self, CefString(display_name)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDragDataCppToC::CefDragDataCppToC(CefDragData* cls) - : CefCppToC(cls) { - struct_.struct_.clone = drag_data_clone; - struct_.struct_.is_read_only = drag_data_is_read_only; - struct_.struct_.is_link = drag_data_is_link; - struct_.struct_.is_fragment = drag_data_is_fragment; - struct_.struct_.is_file = drag_data_is_file; - struct_.struct_.get_link_url = drag_data_get_link_url; - struct_.struct_.get_link_title = drag_data_get_link_title; - struct_.struct_.get_link_metadata = drag_data_get_link_metadata; - struct_.struct_.get_fragment_text = drag_data_get_fragment_text; - struct_.struct_.get_fragment_html = drag_data_get_fragment_html; - struct_.struct_.get_fragment_base_url = drag_data_get_fragment_base_url; - struct_.struct_.get_file_name = drag_data_get_file_name; - struct_.struct_.get_file_contents = drag_data_get_file_contents; - struct_.struct_.get_file_names = drag_data_get_file_names; - struct_.struct_.set_link_url = drag_data_set_link_url; - struct_.struct_.set_link_title = drag_data_set_link_title; - struct_.struct_.set_link_metadata = drag_data_set_link_metadata; - struct_.struct_.set_fragment_text = drag_data_set_fragment_text; - struct_.struct_.set_fragment_html = drag_data_set_fragment_html; - struct_.struct_.set_fragment_base_url = drag_data_set_fragment_base_url; - struct_.struct_.reset_file_contents = drag_data_reset_file_contents; - struct_.struct_.add_file = drag_data_add_file; +CefDragDataCppToC::CefDragDataCppToC() { + GetStruct()->clone = drag_data_clone; + GetStruct()->is_read_only = drag_data_is_read_only; + GetStruct()->is_link = drag_data_is_link; + GetStruct()->is_fragment = drag_data_is_fragment; + GetStruct()->is_file = drag_data_is_file; + GetStruct()->get_link_url = drag_data_get_link_url; + GetStruct()->get_link_title = drag_data_get_link_title; + GetStruct()->get_link_metadata = drag_data_get_link_metadata; + GetStruct()->get_fragment_text = drag_data_get_fragment_text; + GetStruct()->get_fragment_html = drag_data_get_fragment_html; + GetStruct()->get_fragment_base_url = drag_data_get_fragment_base_url; + GetStruct()->get_file_name = drag_data_get_file_name; + GetStruct()->get_file_contents = drag_data_get_file_contents; + GetStruct()->get_file_names = drag_data_get_file_names; + GetStruct()->set_link_url = drag_data_set_link_url; + GetStruct()->set_link_title = drag_data_set_link_title; + GetStruct()->set_link_metadata = drag_data_set_link_metadata; + GetStruct()->set_fragment_text = drag_data_set_fragment_text; + GetStruct()->set_fragment_html = drag_data_set_fragment_html; + GetStruct()->set_fragment_base_url = drag_data_set_fragment_base_url; + GetStruct()->reset_file_contents = drag_data_reset_file_contents; + GetStruct()->add_file = drag_data_add_file; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_drag_data_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -399,3 +408,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DRAG_DATA; diff --git a/libcef_dll/cpptoc/drag_data_cpptoc.h b/libcef_dll/cpptoc/drag_data_cpptoc.h index 2bc9b84e9..f12825139 100644 --- a/libcef_dll/cpptoc/drag_data_cpptoc.h +++ b/libcef_dll/cpptoc/drag_data_cpptoc.h @@ -27,9 +27,8 @@ class CefDragDataCppToC : public CefCppToC { public: - explicit CefDragDataCppToC(CefDragData* cls); + CefDragDataCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DRAG_DATA_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/libcef_dll/cpptoc/drag_handler_cpptoc.cc index bd217f0d7..e7186f8cd 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/drag_data_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, @@ -44,12 +46,20 @@ int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefDragHandlerCppToC::CefDragHandlerCppToC(CefDragHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_drag_enter = drag_handler_on_drag_enter; +CefDragHandlerCppToC::CefDragHandlerCppToC() { + GetStruct()->on_drag_enter = drag_handler_on_drag_enter; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_drag_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -57,3 +67,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_DRAG_HANDLER; diff --git a/libcef_dll/cpptoc/drag_handler_cpptoc.h b/libcef_dll/cpptoc/drag_handler_cpptoc.h index 9af149902..72e9ceb34 100644 --- a/libcef_dll/cpptoc/drag_handler_cpptoc.h +++ b/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefDragHandlerCppToC : public CefCppToC { public: - explicit CefDragHandlerCppToC(CefDragHandler* cls); + CefDragHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc index a4379a7ee..a1a7c8c60 100644 --- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK end_tracing_callback_on_end_tracing_complete( @@ -33,19 +35,28 @@ void CEF_CALLBACK end_tracing_callback_on_end_tracing_complete( CefString(tracing_file)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC( - CefEndTracingCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_end_tracing_complete = +CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC() { + GetStruct()->on_end_tracing_complete = end_tracing_callback_on_end_tracing_complete; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_end_tracing_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_END_TRACING_CALLBACK; diff --git a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h index b05e16d9c..82f2fce99 100644 --- a/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h +++ b/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefEndTracingCallbackCppToC : public CefCppToC { public: - explicit CefEndTracingCallbackCppToC(CefEndTracingCallback* cls); + CefEndTracingCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc index 40f7b1562..29ad7e48a 100644 --- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK file_dialog_callback_cont( @@ -52,15 +54,21 @@ void CEF_CALLBACK file_dialog_callback_cancel( CefFileDialogCallbackCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC( - CefFileDialogCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = file_dialog_callback_cont; - struct_.struct_.cancel = file_dialog_callback_cancel; +CefFileDialogCallbackCppToC::CefFileDialogCallbackCppToC() { + GetStruct()->cont = file_dialog_callback_cont; + GetStruct()->cancel = file_dialog_callback_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_file_dialog_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -68,3 +76,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h index 2883a501d..aaea4a1f1 100644 --- a/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/file_dialog_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefFileDialogCallbackCppToC : public CefCppToC { public: - explicit CefFileDialogCallbackCppToC(CefFileDialogCallback* cls); + CefFileDialogCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_FILE_DIALOG_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.cc b/libcef_dll/cpptoc/find_handler_cpptoc.cc index 1645c8b47..9ca4301a2 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/find_handler_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/browser_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, @@ -47,12 +49,20 @@ void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self, finalUpdate?true:false); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_find_result = find_handler_on_find_result; +CefFindHandlerCppToC::CefFindHandlerCppToC() { + GetStruct()->on_find_result = find_handler_on_find_result; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_find_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -60,3 +70,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_FIND_HANDLER; diff --git a/libcef_dll/cpptoc/find_handler_cpptoc.h b/libcef_dll/cpptoc/find_handler_cpptoc.h index aff1edc46..38bc6ecaa 100644 --- a/libcef_dll/cpptoc/find_handler_cpptoc.h +++ b/libcef_dll/cpptoc/find_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefFindHandlerCppToC : public CefCppToC { public: - explicit CefFindHandlerCppToC(CefFindHandler* cls); + CefFindHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/libcef_dll/cpptoc/focus_handler_cpptoc.cc index fa5cfb88b..0f5fbac08 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/browser_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, @@ -72,15 +74,22 @@ void CEF_CALLBACK focus_handler_on_got_focus(struct _cef_focus_handler_t* self, CefBrowserCToCpp::Wrap(browser)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls) - : CefCppToC( - cls) { - struct_.struct_.on_take_focus = focus_handler_on_take_focus; - struct_.struct_.on_set_focus = focus_handler_on_set_focus; - struct_.struct_.on_got_focus = focus_handler_on_got_focus; +CefFocusHandlerCppToC::CefFocusHandlerCppToC() { + GetStruct()->on_take_focus = focus_handler_on_take_focus; + GetStruct()->on_set_focus = focus_handler_on_set_focus; + GetStruct()->on_got_focus = focus_handler_on_got_focus; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_focus_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -88,3 +97,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_FOCUS_HANDLER; diff --git a/libcef_dll/cpptoc/focus_handler_cpptoc.h b/libcef_dll/cpptoc/focus_handler_cpptoc.h index e0c98564e..ee2cfecda 100644 --- a/libcef_dll/cpptoc/focus_handler_cpptoc.h +++ b/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefFocusHandlerCppToC : public CefCppToC { public: - explicit CefFocusHandlerCppToC(CefFocusHandler* cls); + CefFocusHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index 9b9d54a13..8dd267c9d 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -18,6 +18,8 @@ #include "libcef_dll/ctocpp/string_visitor_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK frame_is_valid(struct _cef_frame_t* self) { @@ -363,35 +365,42 @@ void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self, CefDOMVisitorCToCpp::Wrap(visitor)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefFrameCppToC::CefFrameCppToC(CefFrame* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = frame_is_valid; - struct_.struct_.undo = frame_undo; - struct_.struct_.redo = frame_redo; - struct_.struct_.cut = frame_cut; - struct_.struct_.copy = frame_copy; - struct_.struct_.paste = frame_paste; - struct_.struct_.del = frame_del; - struct_.struct_.select_all = frame_select_all; - struct_.struct_.view_source = frame_view_source; - struct_.struct_.get_source = frame_get_source; - struct_.struct_.get_text = frame_get_text; - struct_.struct_.load_request = frame_load_request; - struct_.struct_.load_url = frame_load_url; - struct_.struct_.load_string = frame_load_string; - struct_.struct_.execute_java_script = frame_execute_java_script; - struct_.struct_.is_main = frame_is_main; - struct_.struct_.is_focused = frame_is_focused; - struct_.struct_.get_name = frame_get_name; - struct_.struct_.get_identifier = frame_get_identifier; - struct_.struct_.get_parent = frame_get_parent; - struct_.struct_.get_url = frame_get_url; - struct_.struct_.get_browser = frame_get_browser; - struct_.struct_.get_v8context = frame_get_v8context; - struct_.struct_.visit_dom = frame_visit_dom; +CefFrameCppToC::CefFrameCppToC() { + GetStruct()->is_valid = frame_is_valid; + GetStruct()->undo = frame_undo; + GetStruct()->redo = frame_redo; + GetStruct()->cut = frame_cut; + GetStruct()->copy = frame_copy; + GetStruct()->paste = frame_paste; + GetStruct()->del = frame_del; + GetStruct()->select_all = frame_select_all; + GetStruct()->view_source = frame_view_source; + GetStruct()->get_source = frame_get_source; + GetStruct()->get_text = frame_get_text; + GetStruct()->load_request = frame_load_request; + GetStruct()->load_url = frame_load_url; + GetStruct()->load_string = frame_load_string; + GetStruct()->execute_java_script = frame_execute_java_script; + GetStruct()->is_main = frame_is_main; + GetStruct()->is_focused = frame_is_focused; + GetStruct()->get_name = frame_get_name; + GetStruct()->get_identifier = frame_get_identifier; + GetStruct()->get_parent = frame_get_parent; + GetStruct()->get_url = frame_get_url; + GetStruct()->get_browser = frame_get_browser; + GetStruct()->get_v8context = frame_get_v8context; + GetStruct()->visit_dom = frame_visit_dom; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_frame_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -399,3 +408,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_FRAME; diff --git a/libcef_dll/cpptoc/frame_cpptoc.h b/libcef_dll/cpptoc/frame_cpptoc.h index d6821297d..c9deab1bc 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.h +++ b/libcef_dll/cpptoc/frame_cpptoc.h @@ -31,9 +31,8 @@ class CefFrameCppToC : public CefCppToC { public: - explicit CefFrameCppToC(CefFrame* cls); + CefFrameCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_FRAME_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc index 5865e8754..69d6862a6 100644 --- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/geolocation_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK geolocation_callback_cont( @@ -28,14 +30,20 @@ void CEF_CALLBACK geolocation_callback_cont( allow?true:false); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefGeolocationCallbackCppToC::CefGeolocationCallbackCppToC( - CefGeolocationCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = geolocation_callback_cont; +CefGeolocationCallbackCppToC::CefGeolocationCallbackCppToC() { + GetStruct()->cont = geolocation_callback_cont; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_geolocation_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -43,3 +51,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h index 251b2a1c2..798690d87 100644 --- a/libcef_dll/cpptoc/geolocation_callback_cpptoc.h +++ b/libcef_dll/cpptoc/geolocation_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefGeolocationCallbackCppToC : public CefCppToC { public: - explicit CefGeolocationCallbackCppToC(CefGeolocationCallback* cls); + CefGeolocationCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc index 3116df65a..99fc335fa 100644 --- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK geolocation_handler_on_request_geolocation_permission( @@ -75,21 +77,30 @@ void CEF_CALLBACK geolocation_handler_on_cancel_geolocation_permission( request_id); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC( - CefGeolocationHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_request_geolocation_permission = +CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC() { + GetStruct()->on_request_geolocation_permission = geolocation_handler_on_request_geolocation_permission; - struct_.struct_.on_cancel_geolocation_permission = + GetStruct()->on_cancel_geolocation_permission = geolocation_handler_on_cancel_geolocation_permission; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_geolocation_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_GEOLOCATION_HANDLER; diff --git a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h index 21fc13281..a7355b256 100644 --- a/libcef_dll/cpptoc/geolocation_handler_cpptoc.h +++ b/libcef_dll/cpptoc/geolocation_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefGeolocationHandlerCppToC : public CefCppToC { public: - explicit CefGeolocationHandlerCppToC(CefGeolocationHandler* cls); + CefGeolocationHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc index bb4a265d5..5b9c16204 100644 --- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK get_geolocation_callback_on_location_update( @@ -38,15 +40,20 @@ void CEF_CALLBACK get_geolocation_callback_on_location_update( positionObj); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefGetGeolocationCallbackCppToC::CefGetGeolocationCallbackCppToC( - CefGetGeolocationCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_location_update = - get_geolocation_callback_on_location_update; +CefGetGeolocationCallbackCppToC::CefGetGeolocationCallbackCppToC() { + GetStruct()->on_location_update = get_geolocation_callback_on_location_update; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_get_geolocation_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -55,3 +62,6 @@ template<> base::AtomicRefCount CefCppToC CefWrapperType CefCppToC::kWrapperType = + WT_GET_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h index 72c2264d3..24095c16d 100644 --- a/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h +++ b/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefGetGeolocationCallbackCppToC : public CefCppToC { public: - explicit CefGetGeolocationCallbackCppToC(CefGetGeolocationCallback* cls); + CefGetGeolocationCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc index 5a53232f1..68e4333d5 100644 --- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/jsdialog_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK jsdialog_callback_cont(struct _cef_jsdialog_callback_t* self, @@ -30,13 +32,20 @@ void CEF_CALLBACK jsdialog_callback_cont(struct _cef_jsdialog_callback_t* self, CefString(user_input)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefJSDialogCallbackCppToC::CefJSDialogCallbackCppToC(CefJSDialogCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = jsdialog_callback_cont; +CefJSDialogCallbackCppToC::CefJSDialogCallbackCppToC() { + GetStruct()->cont = jsdialog_callback_cont; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_jsdialog_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -44,3 +53,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_JSDIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h index 0528e59e8..e266635be 100644 --- a/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefJSDialogCallbackCppToC : public CefCppToC { public: - explicit CefJSDialogCallbackCppToC(CefJSDialogCallback* cls); + CefJSDialogCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc index ff8b523c6..e0da4a7ef 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK jsdialog_handler_on_jsdialog( @@ -130,18 +132,24 @@ void CEF_CALLBACK jsdialog_handler_on_dialog_closed( CefBrowserCToCpp::Wrap(browser)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_jsdialog = jsdialog_handler_on_jsdialog; - struct_.struct_.on_before_unload_dialog = +CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC() { + GetStruct()->on_jsdialog = jsdialog_handler_on_jsdialog; + GetStruct()->on_before_unload_dialog = jsdialog_handler_on_before_unload_dialog; - struct_.struct_.on_reset_dialog_state = - jsdialog_handler_on_reset_dialog_state; - struct_.struct_.on_dialog_closed = jsdialog_handler_on_dialog_closed; + GetStruct()->on_reset_dialog_state = jsdialog_handler_on_reset_dialog_state; + GetStruct()->on_dialog_closed = jsdialog_handler_on_dialog_closed; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_jsdialog_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -149,3 +157,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_JSDIALOG_HANDLER; diff --git a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h index f4dae2033..ccd46210b 100644 --- a/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h +++ b/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefJSDialogHandlerCppToC : public CefCppToC { public: - explicit CefJSDialogHandlerCppToC(CefJSDialogHandler* cls); + CefJSDialogHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc index 9b4e07f30..d569dda0e 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/browser_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK keyboard_handler_on_pre_key_event( @@ -93,14 +95,21 @@ int CEF_CALLBACK keyboard_handler_on_key_event( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_pre_key_event = keyboard_handler_on_pre_key_event; - struct_.struct_.on_key_event = keyboard_handler_on_key_event; +CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC() { + GetStruct()->on_pre_key_event = keyboard_handler_on_pre_key_event; + GetStruct()->on_key_event = keyboard_handler_on_key_event; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_keyboard_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -108,3 +117,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_KEYBOARD_HANDLER; diff --git a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h index 1ead2dd56..ad5e34322 100644 --- a/libcef_dll/cpptoc/keyboard_handler_cpptoc.h +++ b/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefKeyboardHandlerCppToC : public CefCppToC { public: - explicit CefKeyboardHandlerCppToC(CefKeyboardHandler* cls); + CefKeyboardHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc index 7729800a0..6e0b8086c 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/ctocpp/frame_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK life_span_handler_on_before_popup( @@ -194,17 +196,24 @@ void CEF_CALLBACK life_span_handler_on_before_close( CefBrowserCToCpp::Wrap(browser)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_before_popup = life_span_handler_on_before_popup; - struct_.struct_.on_after_created = life_span_handler_on_after_created; - struct_.struct_.run_modal = life_span_handler_run_modal; - struct_.struct_.do_close = life_span_handler_do_close; - struct_.struct_.on_before_close = life_span_handler_on_before_close; +CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC() { + GetStruct()->on_before_popup = life_span_handler_on_before_popup; + GetStruct()->on_after_created = life_span_handler_on_after_created; + GetStruct()->run_modal = life_span_handler_run_modal; + GetStruct()->do_close = life_span_handler_do_close; + GetStruct()->on_before_close = life_span_handler_on_before_close; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_life_span_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -212,3 +221,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_LIFE_SPAN_HANDLER; diff --git a/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/libcef_dll/cpptoc/life_span_handler_cpptoc.h index 7c37562d6..577e4539e 100644 --- a/libcef_dll/cpptoc/life_span_handler_cpptoc.h +++ b/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -30,9 +30,8 @@ class CefLifeSpanHandlerCppToC : public CefCppToC { public: - explicit CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls); + CefLifeSpanHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/list_value_cpptoc.cc b/libcef_dll/cpptoc/list_value_cpptoc.cc index 67fb24ae4..668df891f 100644 --- a/libcef_dll/cpptoc/list_value_cpptoc.cc +++ b/libcef_dll/cpptoc/list_value_cpptoc.cc @@ -29,6 +29,8 @@ CEF_EXPORT cef_list_value_t* cef_list_value_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK list_value_is_valid(struct _cef_list_value_t* self) { @@ -576,39 +578,47 @@ int CEF_CALLBACK list_value_set_list(struct _cef_list_value_t* self, int index, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefListValueCppToC::CefListValueCppToC(CefListValue* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = list_value_is_valid; - struct_.struct_.is_owned = list_value_is_owned; - struct_.struct_.is_read_only = list_value_is_read_only; - struct_.struct_.is_same = list_value_is_same; - struct_.struct_.is_equal = list_value_is_equal; - struct_.struct_.copy = list_value_copy; - struct_.struct_.set_size = list_value_set_size; - struct_.struct_.get_size = list_value_get_size; - struct_.struct_.clear = list_value_clear; - struct_.struct_.remove = list_value_remove; - struct_.struct_.get_type = list_value_get_type; - struct_.struct_.get_value = list_value_get_value; - struct_.struct_.get_bool = list_value_get_bool; - struct_.struct_.get_int = list_value_get_int; - struct_.struct_.get_double = list_value_get_double; - struct_.struct_.get_string = list_value_get_string; - struct_.struct_.get_binary = list_value_get_binary; - struct_.struct_.get_dictionary = list_value_get_dictionary; - struct_.struct_.get_list = list_value_get_list; - struct_.struct_.set_value = list_value_set_value; - struct_.struct_.set_null = list_value_set_null; - struct_.struct_.set_bool = list_value_set_bool; - struct_.struct_.set_int = list_value_set_int; - struct_.struct_.set_double = list_value_set_double; - struct_.struct_.set_string = list_value_set_string; - struct_.struct_.set_binary = list_value_set_binary; - struct_.struct_.set_dictionary = list_value_set_dictionary; - struct_.struct_.set_list = list_value_set_list; +CefListValueCppToC::CefListValueCppToC() { + GetStruct()->is_valid = list_value_is_valid; + GetStruct()->is_owned = list_value_is_owned; + GetStruct()->is_read_only = list_value_is_read_only; + GetStruct()->is_same = list_value_is_same; + GetStruct()->is_equal = list_value_is_equal; + GetStruct()->copy = list_value_copy; + GetStruct()->set_size = list_value_set_size; + GetStruct()->get_size = list_value_get_size; + GetStruct()->clear = list_value_clear; + GetStruct()->remove = list_value_remove; + GetStruct()->get_type = list_value_get_type; + GetStruct()->get_value = list_value_get_value; + GetStruct()->get_bool = list_value_get_bool; + GetStruct()->get_int = list_value_get_int; + GetStruct()->get_double = list_value_get_double; + GetStruct()->get_string = list_value_get_string; + GetStruct()->get_binary = list_value_get_binary; + GetStruct()->get_dictionary = list_value_get_dictionary; + GetStruct()->get_list = list_value_get_list; + GetStruct()->set_value = list_value_set_value; + GetStruct()->set_null = list_value_set_null; + GetStruct()->set_bool = list_value_set_bool; + GetStruct()->set_int = list_value_set_int; + GetStruct()->set_double = list_value_set_double; + GetStruct()->set_string = list_value_set_string; + GetStruct()->set_binary = list_value_set_binary; + GetStruct()->set_dictionary = list_value_set_dictionary; + GetStruct()->set_list = list_value_set_list; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_list_value_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -616,3 +626,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_LIST_VALUE; diff --git a/libcef_dll/cpptoc/list_value_cpptoc.h b/libcef_dll/cpptoc/list_value_cpptoc.h index a6dd5705f..26e5e9080 100644 --- a/libcef_dll/cpptoc/list_value_cpptoc.h +++ b/libcef_dll/cpptoc/list_value_cpptoc.h @@ -27,9 +27,8 @@ class CefListValueCppToC : public CefCppToC { public: - explicit CefListValueCppToC(CefListValue* cls); + CefListValueCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_LIST_VALUE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.cc b/libcef_dll/cpptoc/load_handler_cpptoc.cc index 791cd19e1..9d27e039a 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/frame_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK load_handler_on_loading_state_change( @@ -114,16 +116,23 @@ void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, CefString(failedUrl)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_loading_state_change = - load_handler_on_loading_state_change; - struct_.struct_.on_load_start = load_handler_on_load_start; - struct_.struct_.on_load_end = load_handler_on_load_end; - struct_.struct_.on_load_error = load_handler_on_load_error; +CefLoadHandlerCppToC::CefLoadHandlerCppToC() { + GetStruct()->on_loading_state_change = load_handler_on_loading_state_change; + GetStruct()->on_load_start = load_handler_on_load_start; + GetStruct()->on_load_end = load_handler_on_load_end; + GetStruct()->on_load_error = load_handler_on_load_error; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_load_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -131,3 +140,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_LOAD_HANDLER; diff --git a/libcef_dll/cpptoc/load_handler_cpptoc.h b/libcef_dll/cpptoc/load_handler_cpptoc.h index 171468dde..96ac4d66a 100644 --- a/libcef_dll/cpptoc/load_handler_cpptoc.h +++ b/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefLoadHandlerCppToC : public CefCppToC { public: - explicit CefLoadHandlerCppToC(CefLoadHandler* cls); + CefLoadHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.cc b/libcef_dll/cpptoc/menu_model_cpptoc.cc index 6507f7a06..c4dbdce8f 100644 --- a/libcef_dll/cpptoc/menu_model_cpptoc.cc +++ b/libcef_dll/cpptoc/menu_model_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/menu_model_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK menu_model_clear(struct _cef_menu_model_t* self) { @@ -957,60 +959,68 @@ int CEF_CALLBACK menu_model_get_accelerator_at(struct _cef_menu_model_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefMenuModelCppToC::CefMenuModelCppToC(CefMenuModel* cls) - : CefCppToC(cls) { - struct_.struct_.clear = menu_model_clear; - struct_.struct_.get_count = menu_model_get_count; - struct_.struct_.add_separator = menu_model_add_separator; - struct_.struct_.add_item = menu_model_add_item; - struct_.struct_.add_check_item = menu_model_add_check_item; - struct_.struct_.add_radio_item = menu_model_add_radio_item; - struct_.struct_.add_sub_menu = menu_model_add_sub_menu; - struct_.struct_.insert_separator_at = menu_model_insert_separator_at; - struct_.struct_.insert_item_at = menu_model_insert_item_at; - struct_.struct_.insert_check_item_at = menu_model_insert_check_item_at; - struct_.struct_.insert_radio_item_at = menu_model_insert_radio_item_at; - struct_.struct_.insert_sub_menu_at = menu_model_insert_sub_menu_at; - struct_.struct_.remove = menu_model_remove; - struct_.struct_.remove_at = menu_model_remove_at; - struct_.struct_.get_index_of = menu_model_get_index_of; - struct_.struct_.get_command_id_at = menu_model_get_command_id_at; - struct_.struct_.set_command_id_at = menu_model_set_command_id_at; - struct_.struct_.get_label = menu_model_get_label; - struct_.struct_.get_label_at = menu_model_get_label_at; - struct_.struct_.set_label = menu_model_set_label; - struct_.struct_.set_label_at = menu_model_set_label_at; - struct_.struct_.get_type = menu_model_get_type; - struct_.struct_.get_type_at = menu_model_get_type_at; - struct_.struct_.get_group_id = menu_model_get_group_id; - struct_.struct_.get_group_id_at = menu_model_get_group_id_at; - struct_.struct_.set_group_id = menu_model_set_group_id; - struct_.struct_.set_group_id_at = menu_model_set_group_id_at; - struct_.struct_.get_sub_menu = menu_model_get_sub_menu; - struct_.struct_.get_sub_menu_at = menu_model_get_sub_menu_at; - struct_.struct_.is_visible = menu_model_is_visible; - struct_.struct_.is_visible_at = menu_model_is_visible_at; - struct_.struct_.set_visible = menu_model_set_visible; - struct_.struct_.set_visible_at = menu_model_set_visible_at; - struct_.struct_.is_enabled = menu_model_is_enabled; - struct_.struct_.is_enabled_at = menu_model_is_enabled_at; - struct_.struct_.set_enabled = menu_model_set_enabled; - struct_.struct_.set_enabled_at = menu_model_set_enabled_at; - struct_.struct_.is_checked = menu_model_is_checked; - struct_.struct_.is_checked_at = menu_model_is_checked_at; - struct_.struct_.set_checked = menu_model_set_checked; - struct_.struct_.set_checked_at = menu_model_set_checked_at; - struct_.struct_.has_accelerator = menu_model_has_accelerator; - struct_.struct_.has_accelerator_at = menu_model_has_accelerator_at; - struct_.struct_.set_accelerator = menu_model_set_accelerator; - struct_.struct_.set_accelerator_at = menu_model_set_accelerator_at; - struct_.struct_.remove_accelerator = menu_model_remove_accelerator; - struct_.struct_.remove_accelerator_at = menu_model_remove_accelerator_at; - struct_.struct_.get_accelerator = menu_model_get_accelerator; - struct_.struct_.get_accelerator_at = menu_model_get_accelerator_at; +CefMenuModelCppToC::CefMenuModelCppToC() { + GetStruct()->clear = menu_model_clear; + GetStruct()->get_count = menu_model_get_count; + GetStruct()->add_separator = menu_model_add_separator; + GetStruct()->add_item = menu_model_add_item; + GetStruct()->add_check_item = menu_model_add_check_item; + GetStruct()->add_radio_item = menu_model_add_radio_item; + GetStruct()->add_sub_menu = menu_model_add_sub_menu; + GetStruct()->insert_separator_at = menu_model_insert_separator_at; + GetStruct()->insert_item_at = menu_model_insert_item_at; + GetStruct()->insert_check_item_at = menu_model_insert_check_item_at; + GetStruct()->insert_radio_item_at = menu_model_insert_radio_item_at; + GetStruct()->insert_sub_menu_at = menu_model_insert_sub_menu_at; + GetStruct()->remove = menu_model_remove; + GetStruct()->remove_at = menu_model_remove_at; + GetStruct()->get_index_of = menu_model_get_index_of; + GetStruct()->get_command_id_at = menu_model_get_command_id_at; + GetStruct()->set_command_id_at = menu_model_set_command_id_at; + GetStruct()->get_label = menu_model_get_label; + GetStruct()->get_label_at = menu_model_get_label_at; + GetStruct()->set_label = menu_model_set_label; + GetStruct()->set_label_at = menu_model_set_label_at; + GetStruct()->get_type = menu_model_get_type; + GetStruct()->get_type_at = menu_model_get_type_at; + GetStruct()->get_group_id = menu_model_get_group_id; + GetStruct()->get_group_id_at = menu_model_get_group_id_at; + GetStruct()->set_group_id = menu_model_set_group_id; + GetStruct()->set_group_id_at = menu_model_set_group_id_at; + GetStruct()->get_sub_menu = menu_model_get_sub_menu; + GetStruct()->get_sub_menu_at = menu_model_get_sub_menu_at; + GetStruct()->is_visible = menu_model_is_visible; + GetStruct()->is_visible_at = menu_model_is_visible_at; + GetStruct()->set_visible = menu_model_set_visible; + GetStruct()->set_visible_at = menu_model_set_visible_at; + GetStruct()->is_enabled = menu_model_is_enabled; + GetStruct()->is_enabled_at = menu_model_is_enabled_at; + GetStruct()->set_enabled = menu_model_set_enabled; + GetStruct()->set_enabled_at = menu_model_set_enabled_at; + GetStruct()->is_checked = menu_model_is_checked; + GetStruct()->is_checked_at = menu_model_is_checked_at; + GetStruct()->set_checked = menu_model_set_checked; + GetStruct()->set_checked_at = menu_model_set_checked_at; + GetStruct()->has_accelerator = menu_model_has_accelerator; + GetStruct()->has_accelerator_at = menu_model_has_accelerator_at; + GetStruct()->set_accelerator = menu_model_set_accelerator; + GetStruct()->set_accelerator_at = menu_model_set_accelerator_at; + GetStruct()->remove_accelerator = menu_model_remove_accelerator; + GetStruct()->remove_accelerator_at = menu_model_remove_accelerator_at; + GetStruct()->get_accelerator = menu_model_get_accelerator; + GetStruct()->get_accelerator_at = menu_model_get_accelerator_at; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_menu_model_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -1018,3 +1028,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_MENU_MODEL; diff --git a/libcef_dll/cpptoc/menu_model_cpptoc.h b/libcef_dll/cpptoc/menu_model_cpptoc.h index d4684935d..35f985626 100644 --- a/libcef_dll/cpptoc/menu_model_cpptoc.h +++ b/libcef_dll/cpptoc/menu_model_cpptoc.h @@ -27,9 +27,8 @@ class CefMenuModelCppToC : public CefCppToC { public: - explicit CefMenuModelCppToC(CefMenuModel* cls); + CefMenuModelCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_MENU_MODEL_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc index beb1d9224..6f030d9a7 100644 --- a/libcef_dll/cpptoc/navigation_entry_cpptoc.cc +++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/navigation_entry_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK navigation_entry_is_valid( @@ -166,22 +168,29 @@ int CEF_CALLBACK navigation_entry_get_http_status_code( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefNavigationEntryCppToC::CefNavigationEntryCppToC(CefNavigationEntry* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = navigation_entry_is_valid; - struct_.struct_.get_url = navigation_entry_get_url; - struct_.struct_.get_display_url = navigation_entry_get_display_url; - struct_.struct_.get_original_url = navigation_entry_get_original_url; - struct_.struct_.get_title = navigation_entry_get_title; - struct_.struct_.get_transition_type = navigation_entry_get_transition_type; - struct_.struct_.has_post_data = navigation_entry_has_post_data; - struct_.struct_.get_frame_name = navigation_entry_get_frame_name; - struct_.struct_.get_completion_time = navigation_entry_get_completion_time; - struct_.struct_.get_http_status_code = navigation_entry_get_http_status_code; +CefNavigationEntryCppToC::CefNavigationEntryCppToC() { + GetStruct()->is_valid = navigation_entry_is_valid; + GetStruct()->get_url = navigation_entry_get_url; + GetStruct()->get_display_url = navigation_entry_get_display_url; + GetStruct()->get_original_url = navigation_entry_get_original_url; + GetStruct()->get_title = navigation_entry_get_title; + GetStruct()->get_transition_type = navigation_entry_get_transition_type; + GetStruct()->has_post_data = navigation_entry_has_post_data; + GetStruct()->get_frame_name = navigation_entry_get_frame_name; + GetStruct()->get_completion_time = navigation_entry_get_completion_time; + GetStruct()->get_http_status_code = navigation_entry_get_http_status_code; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_navigation_entry_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -189,3 +198,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_NAVIGATION_ENTRY; diff --git a/libcef_dll/cpptoc/navigation_entry_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_cpptoc.h index e6fae6775..6a615c8ff 100644 --- a/libcef_dll/cpptoc/navigation_entry_cpptoc.h +++ b/libcef_dll/cpptoc/navigation_entry_cpptoc.h @@ -28,9 +28,8 @@ class CefNavigationEntryCppToC : public CefCppToC { public: - explicit CefNavigationEntryCppToC(CefNavigationEntry* cls); + CefNavigationEntryCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc index ae2d0c78e..742363d96 100644 --- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK navigation_entry_visitor_visit( @@ -41,14 +43,20 @@ int CEF_CALLBACK navigation_entry_visitor_visit( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC( - CefNavigationEntryVisitor* cls) - : CefCppToC(cls) { - struct_.struct_.visit = navigation_entry_visitor_visit; +CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC() { + GetStruct()->visit = navigation_entry_visitor_visit; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_navigation_entry_visitor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -57,3 +65,6 @@ template<> base::AtomicRefCount CefCppToC CefWrapperType CefCppToC::kWrapperType = + WT_NAVIGATION_ENTRY_VISITOR; diff --git a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h index 574303278..04c98747d 100644 --- a/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h @@ -30,9 +30,8 @@ class CefNavigationEntryVisitorCppToC : public CefCppToC { public: - explicit CefNavigationEntryVisitorCppToC(CefNavigationEntryVisitor* cls); + CefNavigationEntryVisitorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/post_data_cpptoc.cc b/libcef_dll/cpptoc/post_data_cpptoc.cc index a0994b1a0..0276e3125 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_cpptoc.cc @@ -28,6 +28,8 @@ CEF_EXPORT cef_post_data_t* cef_post_data_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK post_data_is_read_only(struct _cef_post_data_t* self) { @@ -144,17 +146,24 @@ void CEF_CALLBACK post_data_remove_elements(struct _cef_post_data_t* self) { CefPostDataCppToC::Get(self)->RemoveElements(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls) - : CefCppToC(cls) { - struct_.struct_.is_read_only = post_data_is_read_only; - struct_.struct_.get_element_count = post_data_get_element_count; - struct_.struct_.get_elements = post_data_get_elements; - struct_.struct_.remove_element = post_data_remove_element; - struct_.struct_.add_element = post_data_add_element; - struct_.struct_.remove_elements = post_data_remove_elements; +CefPostDataCppToC::CefPostDataCppToC() { + GetStruct()->is_read_only = post_data_is_read_only; + GetStruct()->get_element_count = post_data_get_element_count; + GetStruct()->get_elements = post_data_get_elements; + GetStruct()->remove_element = post_data_remove_element; + GetStruct()->add_element = post_data_add_element; + GetStruct()->remove_elements = post_data_remove_elements; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_post_data_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -162,3 +171,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_POST_DATA; diff --git a/libcef_dll/cpptoc/post_data_cpptoc.h b/libcef_dll/cpptoc/post_data_cpptoc.h index 48edf2119..9c5c0e58f 100644 --- a/libcef_dll/cpptoc/post_data_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_cpptoc.h @@ -27,9 +27,8 @@ class CefPostDataCppToC : public CefCppToC { public: - explicit CefPostDataCppToC(CefPostData* cls); + CefPostDataCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_POST_DATA_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.cc b/libcef_dll/cpptoc/post_data_element_cpptoc.cc index 4a4c2a7f6..72ab71024 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.cc +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.cc @@ -26,6 +26,8 @@ CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK post_data_element_is_read_only( @@ -157,20 +159,27 @@ size_t CEF_CALLBACK post_data_element_get_bytes( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls) - : CefCppToC(cls) { - struct_.struct_.is_read_only = post_data_element_is_read_only; - struct_.struct_.set_to_empty = post_data_element_set_to_empty; - struct_.struct_.set_to_file = post_data_element_set_to_file; - struct_.struct_.set_to_bytes = post_data_element_set_to_bytes; - struct_.struct_.get_type = post_data_element_get_type; - struct_.struct_.get_file = post_data_element_get_file; - struct_.struct_.get_bytes_count = post_data_element_get_bytes_count; - struct_.struct_.get_bytes = post_data_element_get_bytes; +CefPostDataElementCppToC::CefPostDataElementCppToC() { + GetStruct()->is_read_only = post_data_element_is_read_only; + GetStruct()->set_to_empty = post_data_element_set_to_empty; + GetStruct()->set_to_file = post_data_element_set_to_file; + GetStruct()->set_to_bytes = post_data_element_set_to_bytes; + GetStruct()->get_type = post_data_element_get_type; + GetStruct()->get_file = post_data_element_get_file; + GetStruct()->get_bytes_count = post_data_element_get_bytes_count; + GetStruct()->get_bytes = post_data_element_get_bytes; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_post_data_element_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -178,3 +187,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_POST_DATA_ELEMENT; diff --git a/libcef_dll/cpptoc/post_data_element_cpptoc.h b/libcef_dll/cpptoc/post_data_element_cpptoc.h index 322368cfd..619c07292 100644 --- a/libcef_dll/cpptoc/post_data_element_cpptoc.h +++ b/libcef_dll/cpptoc/post_data_element_cpptoc.h @@ -28,9 +28,8 @@ class CefPostDataElementCppToC : public CefCppToC { public: - explicit CefPostDataElementCppToC(CefPostDataElement* cls); + CefPostDataElementCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_POST_DATA_ELEMENT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc index 6cb888446..dd58cb658 100644 --- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/cpptoc/print_settings_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK print_dialog_callback_cont( @@ -46,15 +48,21 @@ void CEF_CALLBACK print_dialog_callback_cancel( CefPrintDialogCallbackCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC( - CefPrintDialogCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = print_dialog_callback_cont; - struct_.struct_.cancel = print_dialog_callback_cancel; +CefPrintDialogCallbackCppToC::CefPrintDialogCallbackCppToC() { + GetStruct()->cont = print_dialog_callback_cont; + GetStruct()->cancel = print_dialog_callback_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_print_dialog_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -62,3 +70,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_PRINT_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h index 48748778a..cf00c2824 100644 --- a/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/print_dialog_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefPrintDialogCallbackCppToC : public CefCppToC { public: - explicit CefPrintDialogCallbackCppToC(CefPrintDialogCallback* cls); + CefPrintDialogCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_DIALOG_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.cc b/libcef_dll/cpptoc/print_handler_cpptoc.cc index 6f896aef8..c0939ed7e 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/ctocpp/print_settings_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK print_handler_on_print_settings( @@ -102,16 +104,23 @@ void CEF_CALLBACK print_handler_on_print_reset( CefPrintHandlerCppToC::Get(self)->OnPrintReset(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls) - : CefCppToC( - cls) { - struct_.struct_.on_print_settings = print_handler_on_print_settings; - struct_.struct_.on_print_dialog = print_handler_on_print_dialog; - struct_.struct_.on_print_job = print_handler_on_print_job; - struct_.struct_.on_print_reset = print_handler_on_print_reset; +CefPrintHandlerCppToC::CefPrintHandlerCppToC() { + GetStruct()->on_print_settings = print_handler_on_print_settings; + GetStruct()->on_print_dialog = print_handler_on_print_dialog; + GetStruct()->on_print_job = print_handler_on_print_job; + GetStruct()->on_print_reset = print_handler_on_print_reset; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_print_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -119,3 +128,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_PRINT_HANDLER; diff --git a/libcef_dll/cpptoc/print_handler_cpptoc.h b/libcef_dll/cpptoc/print_handler_cpptoc.h index 64fc718e5..25587ab72 100644 --- a/libcef_dll/cpptoc/print_handler_cpptoc.h +++ b/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefPrintHandlerCppToC : public CefCppToC { public: - explicit CefPrintHandlerCppToC(CefPrintHandler* cls); + CefPrintHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc index 0f03a855e..2edbe98ca 100644 --- a/libcef_dll/cpptoc/print_job_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/print_job_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK print_job_callback_cont( @@ -27,13 +29,20 @@ void CEF_CALLBACK print_job_callback_cont( CefPrintJobCallbackCppToC::Get(self)->Continue(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPrintJobCallbackCppToC::CefPrintJobCallbackCppToC(CefPrintJobCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = print_job_callback_cont; +CefPrintJobCallbackCppToC::CefPrintJobCallbackCppToC() { + GetStruct()->cont = print_job_callback_cont; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_print_job_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -41,3 +50,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_PRINT_JOB_CALLBACK; diff --git a/libcef_dll/cpptoc/print_job_callback_cpptoc.h b/libcef_dll/cpptoc/print_job_callback_cpptoc.h index f16f09b5b..c4c2bd19d 100644 --- a/libcef_dll/cpptoc/print_job_callback_cpptoc.h +++ b/libcef_dll/cpptoc/print_job_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefPrintJobCallbackCppToC : public CefCppToC { public: - explicit CefPrintJobCallbackCppToC(CefPrintJobCallback* cls); + CefPrintJobCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_JOB_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.cc b/libcef_dll/cpptoc/print_settings_cpptoc.cc index 82da835c6..c742fa824 100644 --- a/libcef_dll/cpptoc/print_settings_cpptoc.cc +++ b/libcef_dll/cpptoc/print_settings_cpptoc.cc @@ -27,6 +27,8 @@ CEF_EXPORT cef_print_settings_t* cef_print_settings_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK print_settings_is_valid(struct _cef_print_settings_t* self) { @@ -408,36 +410,43 @@ cef_duplex_mode_t CEF_CALLBACK print_settings_get_duplex_mode( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefPrintSettingsCppToC::CefPrintSettingsCppToC(CefPrintSettings* cls) - : CefCppToC( - cls) { - struct_.struct_.is_valid = print_settings_is_valid; - struct_.struct_.is_read_only = print_settings_is_read_only; - struct_.struct_.copy = print_settings_copy; - struct_.struct_.set_orientation = print_settings_set_orientation; - struct_.struct_.is_landscape = print_settings_is_landscape; - struct_.struct_.set_printer_printable_area = +CefPrintSettingsCppToC::CefPrintSettingsCppToC() { + GetStruct()->is_valid = print_settings_is_valid; + GetStruct()->is_read_only = print_settings_is_read_only; + GetStruct()->copy = print_settings_copy; + GetStruct()->set_orientation = print_settings_set_orientation; + GetStruct()->is_landscape = print_settings_is_landscape; + GetStruct()->set_printer_printable_area = print_settings_set_printer_printable_area; - struct_.struct_.set_device_name = print_settings_set_device_name; - struct_.struct_.get_device_name = print_settings_get_device_name; - struct_.struct_.set_dpi = print_settings_set_dpi; - struct_.struct_.get_dpi = print_settings_get_dpi; - struct_.struct_.set_page_ranges = print_settings_set_page_ranges; - struct_.struct_.get_page_ranges_count = print_settings_get_page_ranges_count; - struct_.struct_.get_page_ranges = print_settings_get_page_ranges; - struct_.struct_.set_selection_only = print_settings_set_selection_only; - struct_.struct_.is_selection_only = print_settings_is_selection_only; - struct_.struct_.set_collate = print_settings_set_collate; - struct_.struct_.will_collate = print_settings_will_collate; - struct_.struct_.set_color_model = print_settings_set_color_model; - struct_.struct_.get_color_model = print_settings_get_color_model; - struct_.struct_.set_copies = print_settings_set_copies; - struct_.struct_.get_copies = print_settings_get_copies; - struct_.struct_.set_duplex_mode = print_settings_set_duplex_mode; - struct_.struct_.get_duplex_mode = print_settings_get_duplex_mode; + GetStruct()->set_device_name = print_settings_set_device_name; + GetStruct()->get_device_name = print_settings_get_device_name; + GetStruct()->set_dpi = print_settings_set_dpi; + GetStruct()->get_dpi = print_settings_get_dpi; + GetStruct()->set_page_ranges = print_settings_set_page_ranges; + GetStruct()->get_page_ranges_count = print_settings_get_page_ranges_count; + GetStruct()->get_page_ranges = print_settings_get_page_ranges; + GetStruct()->set_selection_only = print_settings_set_selection_only; + GetStruct()->is_selection_only = print_settings_is_selection_only; + GetStruct()->set_collate = print_settings_set_collate; + GetStruct()->will_collate = print_settings_will_collate; + GetStruct()->set_color_model = print_settings_set_color_model; + GetStruct()->get_color_model = print_settings_get_color_model; + GetStruct()->set_copies = print_settings_set_copies; + GetStruct()->get_copies = print_settings_get_copies; + GetStruct()->set_duplex_mode = print_settings_set_duplex_mode; + GetStruct()->get_duplex_mode = print_settings_get_duplex_mode; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_print_settings_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -445,3 +454,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_PRINT_SETTINGS; diff --git a/libcef_dll/cpptoc/print_settings_cpptoc.h b/libcef_dll/cpptoc/print_settings_cpptoc.h index c17b2ca29..f8193bf67 100644 --- a/libcef_dll/cpptoc/print_settings_cpptoc.h +++ b/libcef_dll/cpptoc/print_settings_cpptoc.h @@ -28,9 +28,8 @@ class CefPrintSettingsCppToC : public CefCppToC { public: - explicit CefPrintSettingsCppToC(CefPrintSettings* cls); + CefPrintSettingsCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_SETTINGS_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/process_message_cpptoc.cc b/libcef_dll/cpptoc/process_message_cpptoc.cc index bac0a8cfb..7e7aa25f1 100644 --- a/libcef_dll/cpptoc/process_message_cpptoc.cc +++ b/libcef_dll/cpptoc/process_message_cpptoc.cc @@ -34,6 +34,8 @@ CEF_EXPORT cef_process_message_t* cef_process_message_create( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK process_message_is_valid(struct _cef_process_message_t* self) { @@ -112,17 +114,24 @@ struct _cef_list_value_t* CEF_CALLBACK process_message_get_argument_list( return CefListValueCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefProcessMessageCppToC::CefProcessMessageCppToC(CefProcessMessage* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = process_message_is_valid; - struct_.struct_.is_read_only = process_message_is_read_only; - struct_.struct_.copy = process_message_copy; - struct_.struct_.get_name = process_message_get_name; - struct_.struct_.get_argument_list = process_message_get_argument_list; +CefProcessMessageCppToC::CefProcessMessageCppToC() { + GetStruct()->is_valid = process_message_is_valid; + GetStruct()->is_read_only = process_message_is_read_only; + GetStruct()->copy = process_message_copy; + GetStruct()->get_name = process_message_get_name; + GetStruct()->get_argument_list = process_message_get_argument_list; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_process_message_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -130,3 +139,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_PROCESS_MESSAGE; diff --git a/libcef_dll/cpptoc/process_message_cpptoc.h b/libcef_dll/cpptoc/process_message_cpptoc.h index 03ec4b374..464bc95d6 100644 --- a/libcef_dll/cpptoc/process_message_cpptoc.h +++ b/libcef_dll/cpptoc/process_message_cpptoc.h @@ -28,9 +28,8 @@ class CefProcessMessageCppToC : public CefCppToC { public: - explicit CefProcessMessageCppToC(CefProcessMessage* cls); + CefProcessMessageCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_PROCESS_MESSAGE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.cc b/libcef_dll/cpptoc/read_handler_cpptoc.cc index df23e9665..d6751e823 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/read_handler_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, @@ -96,16 +98,24 @@ int CEF_CALLBACK read_handler_may_block(struct _cef_read_handler_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls) - : CefCppToC(cls) { - struct_.struct_.read = read_handler_read; - struct_.struct_.seek = read_handler_seek; - struct_.struct_.tell = read_handler_tell; - struct_.struct_.eof = read_handler_eof; - struct_.struct_.may_block = read_handler_may_block; +CefReadHandlerCppToC::CefReadHandlerCppToC() { + GetStruct()->read = read_handler_read; + GetStruct()->seek = read_handler_seek; + GetStruct()->tell = read_handler_tell; + GetStruct()->eof = read_handler_eof; + GetStruct()->may_block = read_handler_may_block; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_read_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -113,3 +123,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_READ_HANDLER; diff --git a/libcef_dll/cpptoc/read_handler_cpptoc.h b/libcef_dll/cpptoc/read_handler_cpptoc.h index f948301c9..0e94862ed 100644 --- a/libcef_dll/cpptoc/read_handler_cpptoc.h +++ b/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefReadHandlerCppToC : public CefCppToC { public: - explicit CefReadHandlerCppToC(CefReadHandler* cls); + CefReadHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.cc b/libcef_dll/cpptoc/render_handler_cpptoc.cc index 3f8472199..4700ce947 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/drag_data_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK render_handler_get_root_screen_rect( @@ -347,28 +349,37 @@ void CEF_CALLBACK render_handler_on_scroll_offset_changed( y); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls) - : CefCppToC( - cls) { - struct_.struct_.get_root_screen_rect = render_handler_get_root_screen_rect; - struct_.struct_.get_view_rect = render_handler_get_view_rect; - struct_.struct_.get_screen_point = render_handler_get_screen_point; - struct_.struct_.get_screen_info = render_handler_get_screen_info; - struct_.struct_.on_popup_show = render_handler_on_popup_show; - struct_.struct_.on_popup_size = render_handler_on_popup_size; - struct_.struct_.on_paint = render_handler_on_paint; - struct_.struct_.on_cursor_change = render_handler_on_cursor_change; - struct_.struct_.start_dragging = render_handler_start_dragging; - struct_.struct_.update_drag_cursor = render_handler_update_drag_cursor; - struct_.struct_.on_scroll_offset_changed = +CefRenderHandlerCppToC::CefRenderHandlerCppToC() { + GetStruct()->get_root_screen_rect = render_handler_get_root_screen_rect; + GetStruct()->get_view_rect = render_handler_get_view_rect; + GetStruct()->get_screen_point = render_handler_get_screen_point; + GetStruct()->get_screen_info = render_handler_get_screen_info; + GetStruct()->on_popup_show = render_handler_on_popup_show; + GetStruct()->on_popup_size = render_handler_on_popup_size; + GetStruct()->on_paint = render_handler_on_paint; + GetStruct()->on_cursor_change = render_handler_on_cursor_change; + GetStruct()->start_dragging = render_handler_start_dragging; + GetStruct()->update_drag_cursor = render_handler_update_drag_cursor; + GetStruct()->on_scroll_offset_changed = render_handler_on_scroll_offset_changed; } +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_render_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_RENDER_HANDLER; diff --git a/libcef_dll/cpptoc/render_handler_cpptoc.h b/libcef_dll/cpptoc/render_handler_cpptoc.h index 768b6200a..e90bdb00c 100644 --- a/libcef_dll/cpptoc/render_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefRenderHandlerCppToC : public CefCppToC { public: - explicit CefRenderHandlerCppToC(CefRenderHandler* cls); + CefRenderHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc index fdcd81f75..c2fda6e5e 100644 --- a/libcef_dll/cpptoc/render_process_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.cc @@ -23,6 +23,8 @@ #include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK render_process_handler_on_render_thread_created( @@ -284,38 +286,44 @@ int CEF_CALLBACK render_process_handler_on_process_message_received( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC( - CefRenderProcessHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_render_thread_created = +CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() { + GetStruct()->on_render_thread_created = render_process_handler_on_render_thread_created; - struct_.struct_.on_web_kit_initialized = + GetStruct()->on_web_kit_initialized = render_process_handler_on_web_kit_initialized; - struct_.struct_.on_browser_created = - render_process_handler_on_browser_created; - struct_.struct_.on_browser_destroyed = + GetStruct()->on_browser_created = render_process_handler_on_browser_created; + GetStruct()->on_browser_destroyed = render_process_handler_on_browser_destroyed; - struct_.struct_.get_load_handler = render_process_handler_get_load_handler; - struct_.struct_.on_before_navigation = + GetStruct()->get_load_handler = render_process_handler_get_load_handler; + GetStruct()->on_before_navigation = render_process_handler_on_before_navigation; - struct_.struct_.on_context_created = - render_process_handler_on_context_created; - struct_.struct_.on_context_released = - render_process_handler_on_context_released; - struct_.struct_.on_uncaught_exception = + GetStruct()->on_context_created = render_process_handler_on_context_created; + GetStruct()->on_context_released = render_process_handler_on_context_released; + GetStruct()->on_uncaught_exception = render_process_handler_on_uncaught_exception; - struct_.struct_.on_focused_node_changed = + GetStruct()->on_focused_node_changed = render_process_handler_on_focused_node_changed; - struct_.struct_.on_process_message_received = + GetStruct()->on_process_message_received = render_process_handler_on_process_message_received; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_render_process_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_RENDER_PROCESS_HANDLER; diff --git a/libcef_dll/cpptoc/render_process_handler_cpptoc.h b/libcef_dll/cpptoc/render_process_handler_cpptoc.h index d7402383c..d81e41767 100644 --- a/libcef_dll/cpptoc/render_process_handler_cpptoc.h +++ b/libcef_dll/cpptoc/render_process_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefRenderProcessHandlerCppToC : public CefCppToC { public: - explicit CefRenderProcessHandlerCppToC(CefRenderProcessHandler* cls); + CefRenderProcessHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.cc b/libcef_dll/cpptoc/request_callback_cpptoc.cc index 18828c684..48f931d97 100644 --- a/libcef_dll/cpptoc/request_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/request_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/request_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK request_callback_cont(struct _cef_request_callback_t* self, @@ -40,14 +42,21 @@ void CEF_CALLBACK request_callback_cancel( CefRequestCallbackCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRequestCallbackCppToC::CefRequestCallbackCppToC(CefRequestCallback* cls) - : CefCppToC(cls) { - struct_.struct_.cont = request_callback_cont; - struct_.struct_.cancel = request_callback_cancel; +CefRequestCallbackCppToC::CefRequestCallbackCppToC() { + GetStruct()->cont = request_callback_cont; + GetStruct()->cancel = request_callback_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_request_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -55,3 +64,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_REQUEST_CALLBACK; diff --git a/libcef_dll/cpptoc/request_callback_cpptoc.h b/libcef_dll/cpptoc/request_callback_cpptoc.h index 2303d011b..37fd6d12f 100644 --- a/libcef_dll/cpptoc/request_callback_cpptoc.h +++ b/libcef_dll/cpptoc/request_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefRequestCallbackCppToC : public CefCppToC { public: - explicit CefRequestCallbackCppToC(CefRequestCallback* cls); + CefRequestCallbackCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/request_context_cpptoc.cc b/libcef_dll/cpptoc/request_context_cpptoc.cc index 5b5a79601..22c17b4ff 100644 --- a/libcef_dll/cpptoc/request_context_cpptoc.cc +++ b/libcef_dll/cpptoc/request_context_cpptoc.cc @@ -75,6 +75,8 @@ CEF_EXPORT cef_request_context_t* create_context_shared( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK request_context_is_same(struct _cef_request_context_t* self, @@ -224,27 +226,36 @@ int CEF_CALLBACK request_context_clear_scheme_handler_factories( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRequestContextCppToC::CefRequestContextCppToC(CefRequestContext* cls) - : CefCppToC(cls) { - struct_.struct_.is_same = request_context_is_same; - struct_.struct_.is_sharing_with = request_context_is_sharing_with; - struct_.struct_.is_global = request_context_is_global; - struct_.struct_.get_handler = request_context_get_handler; - struct_.struct_.get_cache_path = request_context_get_cache_path; - struct_.struct_.get_default_cookie_manager = +CefRequestContextCppToC::CefRequestContextCppToC() { + GetStruct()->is_same = request_context_is_same; + GetStruct()->is_sharing_with = request_context_is_sharing_with; + GetStruct()->is_global = request_context_is_global; + GetStruct()->get_handler = request_context_get_handler; + GetStruct()->get_cache_path = request_context_get_cache_path; + GetStruct()->get_default_cookie_manager = request_context_get_default_cookie_manager; - struct_.struct_.register_scheme_handler_factory = + GetStruct()->register_scheme_handler_factory = request_context_register_scheme_handler_factory; - struct_.struct_.clear_scheme_handler_factories = + GetStruct()->clear_scheme_handler_factories = request_context_clear_scheme_handler_factories; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_request_context_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_REQUEST_CONTEXT; diff --git a/libcef_dll/cpptoc/request_context_cpptoc.h b/libcef_dll/cpptoc/request_context_cpptoc.h index fb610a028..7b440c7a6 100644 --- a/libcef_dll/cpptoc/request_context_cpptoc.h +++ b/libcef_dll/cpptoc/request_context_cpptoc.h @@ -30,9 +30,8 @@ class CefRequestContextCppToC : public CefCppToC { public: - explicit CefRequestContextCppToC(CefRequestContext* cls); + CefRequestContextCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc index 001db907f..12234b2f4 100644 --- a/libcef_dll/cpptoc/request_context_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_cookie_manager_t* CEF_CALLBACK request_context_handler_get_cookie_manager( @@ -32,15 +34,20 @@ cef_cookie_manager_t* CEF_CALLBACK request_context_handler_get_cookie_manager( return CefCookieManagerCToCpp::Unwrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC( - CefRequestContextHandler* cls) - : CefCppToC(cls) { - struct_.struct_.get_cookie_manager = - request_context_handler_get_cookie_manager; +CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() { + GetStruct()->get_cookie_manager = request_context_handler_get_cookie_manager; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_request_context_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -48,3 +55,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_REQUEST_CONTEXT_HANDLER; diff --git a/libcef_dll/cpptoc/request_context_handler_cpptoc.h b/libcef_dll/cpptoc/request_context_handler_cpptoc.h index 958f030e2..53560f5ae 100644 --- a/libcef_dll/cpptoc/request_context_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_context_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefRequestContextHandlerCppToC : public CefCppToC { public: - explicit CefRequestContextHandlerCppToC(CefRequestContextHandler* cls); + CefRequestContextHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/request_cpptoc.cc b/libcef_dll/cpptoc/request_cpptoc.cc index ecab5fb7b..f99811400 100644 --- a/libcef_dll/cpptoc/request_cpptoc.cc +++ b/libcef_dll/cpptoc/request_cpptoc.cc @@ -28,6 +28,8 @@ CEF_EXPORT cef_request_t* cef_request_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK request_is_read_only(struct _cef_request_t* self) { @@ -323,30 +325,37 @@ uint64 CEF_CALLBACK request_get_identifier(struct _cef_request_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRequestCppToC::CefRequestCppToC(CefRequest* cls) - : CefCppToC(cls) { - struct_.struct_.is_read_only = request_is_read_only; - struct_.struct_.get_url = request_get_url; - struct_.struct_.set_url = request_set_url; - struct_.struct_.get_method = request_get_method; - struct_.struct_.set_method = request_set_method; - struct_.struct_.get_post_data = request_get_post_data; - struct_.struct_.set_post_data = request_set_post_data; - struct_.struct_.get_header_map = request_get_header_map; - struct_.struct_.set_header_map = request_set_header_map; - struct_.struct_.set = request_set; - struct_.struct_.get_flags = request_get_flags; - struct_.struct_.set_flags = request_set_flags; - struct_.struct_.get_first_party_for_cookies = +CefRequestCppToC::CefRequestCppToC() { + GetStruct()->is_read_only = request_is_read_only; + GetStruct()->get_url = request_get_url; + GetStruct()->set_url = request_set_url; + GetStruct()->get_method = request_get_method; + GetStruct()->set_method = request_set_method; + GetStruct()->get_post_data = request_get_post_data; + GetStruct()->set_post_data = request_set_post_data; + GetStruct()->get_header_map = request_get_header_map; + GetStruct()->set_header_map = request_set_header_map; + GetStruct()->set = request_set; + GetStruct()->get_flags = request_get_flags; + GetStruct()->set_flags = request_set_flags; + GetStruct()->get_first_party_for_cookies = request_get_first_party_for_cookies; - struct_.struct_.set_first_party_for_cookies = + GetStruct()->set_first_party_for_cookies = request_set_first_party_for_cookies; - struct_.struct_.get_resource_type = request_get_resource_type; - struct_.struct_.get_transition_type = request_get_transition_type; - struct_.struct_.get_identifier = request_get_identifier; + GetStruct()->get_resource_type = request_get_resource_type; + GetStruct()->get_transition_type = request_get_transition_type; + GetStruct()->get_identifier = request_get_identifier; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_request_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -354,3 +363,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_REQUEST; diff --git a/libcef_dll/cpptoc/request_cpptoc.h b/libcef_dll/cpptoc/request_cpptoc.h index aa3faa5c3..d8f234449 100644 --- a/libcef_dll/cpptoc/request_cpptoc.h +++ b/libcef_dll/cpptoc/request_cpptoc.h @@ -27,9 +27,8 @@ class CefRequestCppToC : public CefCppToC { public: - explicit CefRequestCppToC(CefRequest* cls); + CefRequestCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.cc b/libcef_dll/cpptoc/request_handler_cpptoc.cc index c68fad5e3..07f39890d 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -22,6 +22,8 @@ #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK request_handler_on_before_browse( @@ -476,32 +478,41 @@ void CEF_CALLBACK request_handler_on_render_process_terminated( status); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls) - : CefCppToC(cls) { - struct_.struct_.on_before_browse = request_handler_on_before_browse; - struct_.struct_.on_open_urlfrom_tab = request_handler_on_open_urlfrom_tab; - struct_.struct_.on_before_resource_load = +CefRequestHandlerCppToC::CefRequestHandlerCppToC() { + GetStruct()->on_before_browse = request_handler_on_before_browse; + GetStruct()->on_open_urlfrom_tab = request_handler_on_open_urlfrom_tab; + GetStruct()->on_before_resource_load = request_handler_on_before_resource_load; - struct_.struct_.get_resource_handler = request_handler_get_resource_handler; - struct_.struct_.on_resource_redirect = request_handler_on_resource_redirect; - struct_.struct_.on_resource_response = request_handler_on_resource_response; - struct_.struct_.get_auth_credentials = request_handler_get_auth_credentials; - struct_.struct_.on_quota_request = request_handler_on_quota_request; - struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution; - struct_.struct_.on_certificate_error = request_handler_on_certificate_error; - struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load; - struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed; - struct_.struct_.on_render_view_ready = request_handler_on_render_view_ready; - struct_.struct_.on_render_process_terminated = + GetStruct()->get_resource_handler = request_handler_get_resource_handler; + GetStruct()->on_resource_redirect = request_handler_on_resource_redirect; + GetStruct()->on_resource_response = request_handler_on_resource_response; + GetStruct()->get_auth_credentials = request_handler_get_auth_credentials; + GetStruct()->on_quota_request = request_handler_on_quota_request; + GetStruct()->on_protocol_execution = request_handler_on_protocol_execution; + GetStruct()->on_certificate_error = request_handler_on_certificate_error; + GetStruct()->on_before_plugin_load = request_handler_on_before_plugin_load; + GetStruct()->on_plugin_crashed = request_handler_on_plugin_crashed; + GetStruct()->on_render_view_ready = request_handler_on_render_view_ready; + GetStruct()->on_render_process_terminated = request_handler_on_render_process_terminated; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_request_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_REQUEST_HANDLER; diff --git a/libcef_dll/cpptoc/request_handler_cpptoc.h b/libcef_dll/cpptoc/request_handler_cpptoc.h index 828145e54..4c93625af 100644 --- a/libcef_dll/cpptoc/request_handler_cpptoc.h +++ b/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefRequestHandlerCppToC : public CefCppToC { public: - explicit CefRequestHandlerCppToC(CefRequestHandler* cls); + CefRequestHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc index 1d30888ec..946c36e3c 100644 --- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK resource_bundle_handler_get_localized_string( @@ -79,16 +81,22 @@ int CEF_CALLBACK resource_bundle_handler_get_data_resource( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC( - CefResourceBundleHandler* cls) - : CefCppToC(cls) { - struct_.struct_.get_localized_string = +CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC() { + GetStruct()->get_localized_string = resource_bundle_handler_get_localized_string; - struct_.struct_.get_data_resource = resource_bundle_handler_get_data_resource; + GetStruct()->get_data_resource = resource_bundle_handler_get_data_resource; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_resource_bundle_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -96,3 +104,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_RESOURCE_BUNDLE_HANDLER; diff --git a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h index 2aca1f1ef..4fbd87883 100644 --- a/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h +++ b/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefResourceBundleHandlerCppToC : public CefCppToC { public: - explicit CefResourceBundleHandlerCppToC(CefResourceBundleHandler* cls); + CefResourceBundleHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.cc b/libcef_dll/cpptoc/resource_handler_cpptoc.cc index 35a822b69..592ce0c07 100644 --- a/libcef_dll/cpptoc/resource_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/resource_handler_cpptoc.cc @@ -16,6 +16,8 @@ #include "libcef_dll/ctocpp/response_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK resource_handler_process_request( @@ -182,18 +184,25 @@ void CEF_CALLBACK resource_handler_cancel( CefResourceHandlerCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefResourceHandlerCppToC::CefResourceHandlerCppToC(CefResourceHandler* cls) - : CefCppToC(cls) { - struct_.struct_.process_request = resource_handler_process_request; - struct_.struct_.get_response_headers = resource_handler_get_response_headers; - struct_.struct_.read_response = resource_handler_read_response; - struct_.struct_.can_get_cookie = resource_handler_can_get_cookie; - struct_.struct_.can_set_cookie = resource_handler_can_set_cookie; - struct_.struct_.cancel = resource_handler_cancel; +CefResourceHandlerCppToC::CefResourceHandlerCppToC() { + GetStruct()->process_request = resource_handler_process_request; + GetStruct()->get_response_headers = resource_handler_get_response_headers; + GetStruct()->read_response = resource_handler_read_response; + GetStruct()->can_get_cookie = resource_handler_can_get_cookie; + GetStruct()->can_set_cookie = resource_handler_can_set_cookie; + GetStruct()->cancel = resource_handler_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_resource_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -201,3 +210,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_RESOURCE_HANDLER; diff --git a/libcef_dll/cpptoc/resource_handler_cpptoc.h b/libcef_dll/cpptoc/resource_handler_cpptoc.h index 4549a4cf4..55b91ef4d 100644 --- a/libcef_dll/cpptoc/resource_handler_cpptoc.h +++ b/libcef_dll/cpptoc/resource_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefResourceHandlerCppToC : public CefCppToC { public: - explicit CefResourceHandlerCppToC(CefResourceHandler* cls); + CefResourceHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/response_cpptoc.cc b/libcef_dll/cpptoc/response_cpptoc.cc index 12c6c92cb..c4f858b82 100644 --- a/libcef_dll/cpptoc/response_cpptoc.cc +++ b/libcef_dll/cpptoc/response_cpptoc.cc @@ -27,6 +27,8 @@ CEF_EXPORT cef_response_t* cef_response_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK response_is_read_only(struct _cef_response_t* self) { @@ -200,21 +202,28 @@ void CEF_CALLBACK response_set_header_map(struct _cef_response_t* self, headerMapMultimap); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefResponseCppToC::CefResponseCppToC(CefResponse* cls) - : CefCppToC(cls) { - struct_.struct_.is_read_only = response_is_read_only; - struct_.struct_.get_status = response_get_status; - struct_.struct_.set_status = response_set_status; - struct_.struct_.get_status_text = response_get_status_text; - struct_.struct_.set_status_text = response_set_status_text; - struct_.struct_.get_mime_type = response_get_mime_type; - struct_.struct_.set_mime_type = response_set_mime_type; - struct_.struct_.get_header = response_get_header; - struct_.struct_.get_header_map = response_get_header_map; - struct_.struct_.set_header_map = response_set_header_map; +CefResponseCppToC::CefResponseCppToC() { + GetStruct()->is_read_only = response_is_read_only; + GetStruct()->get_status = response_get_status; + GetStruct()->set_status = response_set_status; + GetStruct()->get_status_text = response_get_status_text; + GetStruct()->set_status_text = response_set_status_text; + GetStruct()->get_mime_type = response_get_mime_type; + GetStruct()->set_mime_type = response_set_mime_type; + GetStruct()->get_header = response_get_header; + GetStruct()->get_header_map = response_get_header_map; + GetStruct()->set_header_map = response_set_header_map; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_response_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -222,3 +231,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_RESPONSE; diff --git a/libcef_dll/cpptoc/response_cpptoc.h b/libcef_dll/cpptoc/response_cpptoc.h index 235194e9e..3522c71b5 100644 --- a/libcef_dll/cpptoc/response_cpptoc.h +++ b/libcef_dll/cpptoc/response_cpptoc.h @@ -27,9 +27,8 @@ class CefResponseCppToC : public CefCppToC { public: - explicit CefResponseCppToC(CefResponse* cls); + CefResponseCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RESPONSE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc index d668d3a87..b8fa1b9b9 100644 --- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK run_file_dialog_callback_on_file_dialog_dismissed( @@ -40,19 +42,28 @@ void CEF_CALLBACK run_file_dialog_callback_on_file_dialog_dismissed( file_pathsList); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC( - CefRunFileDialogCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_file_dialog_dismissed = +CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC() { + GetStruct()->on_file_dialog_dismissed = run_file_dialog_callback_on_file_dialog_dismissed; } +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_run_file_dialog_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_RUN_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h index c590940b1..9ae46ee5d 100644 --- a/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h +++ b/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h @@ -30,9 +30,8 @@ class CefRunFileDialogCallbackCppToC : public CefCppToC { public: - explicit CefRunFileDialogCallbackCppToC(CefRunFileDialogCallback* cls); + CefRunFileDialogCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc index a05fe790b..e9f125ae1 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -17,6 +17,8 @@ #include "libcef_dll/ctocpp/request_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( @@ -50,14 +52,20 @@ cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( return CefResourceHandlerCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC( - CefSchemeHandlerFactory* cls) - : CefCppToC(cls) { - struct_.struct_.create = scheme_handler_factory_create; +CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC() { + GetStruct()->create = scheme_handler_factory_create; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_scheme_handler_factory_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -65,3 +73,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_SCHEME_HANDLER_FACTORY; diff --git a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h index 6c34c1e13..5508c7578 100644 --- a/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -28,9 +28,8 @@ class CefSchemeHandlerFactoryCppToC : public CefCppToC { public: - explicit CefSchemeHandlerFactoryCppToC(CefSchemeHandlerFactory* cls); + CefSchemeHandlerFactoryCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc b/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc index 5b2cc2fc5..455d006d3 100644 --- a/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc +++ b/libcef_dll/cpptoc/scheme_registrar_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/scheme_registrar_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK scheme_registrar_add_custom_scheme( @@ -39,13 +41,20 @@ int CEF_CALLBACK scheme_registrar_add_custom_scheme( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefSchemeRegistrarCppToC::CefSchemeRegistrarCppToC(CefSchemeRegistrar* cls) - : CefCppToC(cls) { - struct_.struct_.add_custom_scheme = scheme_registrar_add_custom_scheme; +CefSchemeRegistrarCppToC::CefSchemeRegistrarCppToC() { + GetStruct()->add_custom_scheme = scheme_registrar_add_custom_scheme; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_scheme_registrar_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -53,3 +62,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_SCHEME_REGISTRAR; diff --git a/libcef_dll/cpptoc/scheme_registrar_cpptoc.h b/libcef_dll/cpptoc/scheme_registrar_cpptoc.h index 2c2cfa981..b78984f56 100644 --- a/libcef_dll/cpptoc/scheme_registrar_cpptoc.h +++ b/libcef_dll/cpptoc/scheme_registrar_cpptoc.h @@ -28,9 +28,8 @@ class CefSchemeRegistrarCppToC : public CefCppToC { public: - explicit CefSchemeRegistrarCppToC(CefSchemeRegistrar* cls); + CefSchemeRegistrarCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_REGISTRAR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc index 13ce1f554..f84229267 100644 --- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/set_cookie_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK set_cookie_callback_on_complete( @@ -28,14 +30,20 @@ void CEF_CALLBACK set_cookie_callback_on_complete( success?true:false); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefSetCookieCallbackCppToC::CefSetCookieCallbackCppToC( - CefSetCookieCallback* cls) - : CefCppToC(cls) { - struct_.struct_.on_complete = set_cookie_callback_on_complete; +CefSetCookieCallbackCppToC::CefSetCookieCallbackCppToC() { + GetStruct()->on_complete = set_cookie_callback_on_complete; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_set_cookie_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -43,3 +51,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_SET_COOKIE_CALLBACK; diff --git a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h index e5613b456..c1baf1bd8 100644 --- a/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h +++ b/libcef_dll/cpptoc/set_cookie_callback_cpptoc.h @@ -28,9 +28,8 @@ class CefSetCookieCallbackCppToC : public CefCppToC { public: - explicit CefSetCookieCallbackCppToC(CefSetCookieCallback* cls); + CefSetCookieCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_SET_COOKIE_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/sslcert_principal_cpptoc.cc b/libcef_dll/cpptoc/sslcert_principal_cpptoc.cc index 339af9cb7..2d9ebdd4c 100644 --- a/libcef_dll/cpptoc/sslcert_principal_cpptoc.cc +++ b/libcef_dll/cpptoc/sslcert_principal_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/transfer_util.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK sslcert_principal_get_display_name( @@ -192,25 +194,31 @@ void CEF_CALLBACK sslcert_principal_get_domain_components( transfer_string_list_contents(componentsList, components); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefSSLCertPrincipalCppToC::CefSSLCertPrincipalCppToC(CefSSLCertPrincipal* cls) - : CefCppToC(cls) { - struct_.struct_.get_display_name = sslcert_principal_get_display_name; - struct_.struct_.get_common_name = sslcert_principal_get_common_name; - struct_.struct_.get_locality_name = sslcert_principal_get_locality_name; - struct_.struct_.get_state_or_province_name = +CefSSLCertPrincipalCppToC::CefSSLCertPrincipalCppToC() { + GetStruct()->get_display_name = sslcert_principal_get_display_name; + GetStruct()->get_common_name = sslcert_principal_get_common_name; + GetStruct()->get_locality_name = sslcert_principal_get_locality_name; + GetStruct()->get_state_or_province_name = sslcert_principal_get_state_or_province_name; - struct_.struct_.get_country_name = sslcert_principal_get_country_name; - struct_.struct_.get_street_addresses = sslcert_principal_get_street_addresses; - struct_.struct_.get_organization_names = + GetStruct()->get_country_name = sslcert_principal_get_country_name; + GetStruct()->get_street_addresses = sslcert_principal_get_street_addresses; + GetStruct()->get_organization_names = sslcert_principal_get_organization_names; - struct_.struct_.get_organization_unit_names = + GetStruct()->get_organization_unit_names = sslcert_principal_get_organization_unit_names; - struct_.struct_.get_domain_components = - sslcert_principal_get_domain_components; + GetStruct()->get_domain_components = sslcert_principal_get_domain_components; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_sslcert_principal_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -218,3 +226,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_SSLCERT_PRINCIPAL; diff --git a/libcef_dll/cpptoc/sslcert_principal_cpptoc.h b/libcef_dll/cpptoc/sslcert_principal_cpptoc.h index d52060032..759b8a2a6 100644 --- a/libcef_dll/cpptoc/sslcert_principal_cpptoc.h +++ b/libcef_dll/cpptoc/sslcert_principal_cpptoc.h @@ -28,9 +28,8 @@ class CefSSLCertPrincipalCppToC : public CefCppToC { public: - explicit CefSSLCertPrincipalCppToC(CefSSLCertPrincipal* cls); + CefSSLCertPrincipalCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_SSLCERT_PRINCIPAL_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.cc b/libcef_dll/cpptoc/sslinfo_cpptoc.cc index e7c6a283c..d808e6389 100644 --- a/libcef_dll/cpptoc/sslinfo_cpptoc.cc +++ b/libcef_dll/cpptoc/sslinfo_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/cpptoc/sslinfo_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_sslcert_principal_t* CEF_CALLBACK sslinfo_get_subject( @@ -125,18 +127,25 @@ struct _cef_binary_value_t* CEF_CALLBACK sslinfo_get_pemencoded( return CefBinaryValueCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefSSLInfoCppToC::CefSSLInfoCppToC(CefSSLInfo* cls) - : CefCppToC(cls) { - struct_.struct_.get_subject = sslinfo_get_subject; - struct_.struct_.get_issuer = sslinfo_get_issuer; - struct_.struct_.get_serial_number = sslinfo_get_serial_number; - struct_.struct_.get_valid_start = sslinfo_get_valid_start; - struct_.struct_.get_valid_expiry = sslinfo_get_valid_expiry; - struct_.struct_.get_derencoded = sslinfo_get_derencoded; - struct_.struct_.get_pemencoded = sslinfo_get_pemencoded; +CefSSLInfoCppToC::CefSSLInfoCppToC() { + GetStruct()->get_subject = sslinfo_get_subject; + GetStruct()->get_issuer = sslinfo_get_issuer; + GetStruct()->get_serial_number = sslinfo_get_serial_number; + GetStruct()->get_valid_start = sslinfo_get_valid_start; + GetStruct()->get_valid_expiry = sslinfo_get_valid_expiry; + GetStruct()->get_derencoded = sslinfo_get_derencoded; + GetStruct()->get_pemencoded = sslinfo_get_pemencoded; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_sslinfo_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -144,3 +153,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_SSLINFO; diff --git a/libcef_dll/cpptoc/sslinfo_cpptoc.h b/libcef_dll/cpptoc/sslinfo_cpptoc.h index dc37a52ca..a1d90b7c3 100644 --- a/libcef_dll/cpptoc/sslinfo_cpptoc.h +++ b/libcef_dll/cpptoc/sslinfo_cpptoc.h @@ -27,9 +27,8 @@ class CefSSLInfoCppToC : public CefCppToC { public: - explicit CefSSLInfoCppToC(CefSSLInfo* cls); + CefSSLInfoCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_SSLINFO_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.cc b/libcef_dll/cpptoc/stream_reader_cpptoc.cc index 75d826105..60e7944e0 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.cc @@ -69,6 +69,8 @@ CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_reader_read(struct _cef_stream_reader_t* self, @@ -152,17 +154,24 @@ int CEF_CALLBACK stream_reader_may_block(struct _cef_stream_reader_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefStreamReaderCppToC::CefStreamReaderCppToC(CefStreamReader* cls) - : CefCppToC( - cls) { - struct_.struct_.read = stream_reader_read; - struct_.struct_.seek = stream_reader_seek; - struct_.struct_.tell = stream_reader_tell; - struct_.struct_.eof = stream_reader_eof; - struct_.struct_.may_block = stream_reader_may_block; +CefStreamReaderCppToC::CefStreamReaderCppToC() { + GetStruct()->read = stream_reader_read; + GetStruct()->seek = stream_reader_seek; + GetStruct()->tell = stream_reader_tell; + GetStruct()->eof = stream_reader_eof; + GetStruct()->may_block = stream_reader_may_block; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_stream_reader_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -170,3 +179,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_STREAM_READER; diff --git a/libcef_dll/cpptoc/stream_reader_cpptoc.h b/libcef_dll/cpptoc/stream_reader_cpptoc.h index f74b731a4..2eee1dbcb 100644 --- a/libcef_dll/cpptoc/stream_reader_cpptoc.h +++ b/libcef_dll/cpptoc/stream_reader_cpptoc.h @@ -28,9 +28,8 @@ class CefStreamReaderCppToC : public CefCppToC { public: - explicit CefStreamReaderCppToC(CefStreamReader* cls); + CefStreamReaderCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_STREAM_READER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.cc b/libcef_dll/cpptoc/stream_writer_cpptoc.cc index b49931dde..ac6f4177b 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.cc +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.cc @@ -51,6 +51,8 @@ CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK stream_writer_write(struct _cef_stream_writer_t* self, @@ -134,17 +136,24 @@ int CEF_CALLBACK stream_writer_may_block(struct _cef_stream_writer_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefStreamWriterCppToC::CefStreamWriterCppToC(CefStreamWriter* cls) - : CefCppToC( - cls) { - struct_.struct_.write = stream_writer_write; - struct_.struct_.seek = stream_writer_seek; - struct_.struct_.tell = stream_writer_tell; - struct_.struct_.flush = stream_writer_flush; - struct_.struct_.may_block = stream_writer_may_block; +CefStreamWriterCppToC::CefStreamWriterCppToC() { + GetStruct()->write = stream_writer_write; + GetStruct()->seek = stream_writer_seek; + GetStruct()->tell = stream_writer_tell; + GetStruct()->flush = stream_writer_flush; + GetStruct()->may_block = stream_writer_may_block; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_stream_writer_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -152,3 +161,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_STREAM_WRITER; diff --git a/libcef_dll/cpptoc/stream_writer_cpptoc.h b/libcef_dll/cpptoc/stream_writer_cpptoc.h index 85652da85..d3c9ca0f6 100644 --- a/libcef_dll/cpptoc/stream_writer_cpptoc.h +++ b/libcef_dll/cpptoc/stream_writer_cpptoc.h @@ -28,9 +28,8 @@ class CefStreamWriterCppToC : public CefCppToC { public: - explicit CefStreamWriterCppToC(CefStreamWriter* cls); + CefStreamWriterCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_STREAM_WRITER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.cc b/libcef_dll/cpptoc/string_visitor_cpptoc.cc index 98d4673de..a33605587 100644 --- a/libcef_dll/cpptoc/string_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/string_visitor_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/string_visitor_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK string_visitor_visit(struct _cef_string_visitor_t* self, @@ -29,13 +31,20 @@ void CEF_CALLBACK string_visitor_visit(struct _cef_string_visitor_t* self, CefString(string)); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefStringVisitorCppToC::CefStringVisitorCppToC(CefStringVisitor* cls) - : CefCppToC( - cls) { - struct_.struct_.visit = string_visitor_visit; +CefStringVisitorCppToC::CefStringVisitorCppToC() { + GetStruct()->visit = string_visitor_visit; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_string_visitor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -43,3 +52,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_STRING_VISITOR; diff --git a/libcef_dll/cpptoc/string_visitor_cpptoc.h b/libcef_dll/cpptoc/string_visitor_cpptoc.h index 8aa23fde7..9e078c014 100644 --- a/libcef_dll/cpptoc/string_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/string_visitor_cpptoc.h @@ -28,9 +28,8 @@ class CefStringVisitorCppToC : public CefCppToC { public: - explicit CefStringVisitorCppToC(CefStringVisitor* cls); + CefStringVisitorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/task_cpptoc.cc b/libcef_dll/cpptoc/task_cpptoc.cc index a9b5cd258..aed1fbef5 100644 --- a/libcef_dll/cpptoc/task_cpptoc.cc +++ b/libcef_dll/cpptoc/task_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/task_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK task_execute(struct _cef_task_t* self) { @@ -26,12 +28,19 @@ void CEF_CALLBACK task_execute(struct _cef_task_t* self) { CefTaskCppToC::Get(self)->Execute(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefTaskCppToC::CefTaskCppToC(CefTask* cls) - : CefCppToC(cls) { - struct_.struct_.execute = task_execute; +CefTaskCppToC::CefTaskCppToC() { + GetStruct()->execute = task_execute; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_task_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -39,3 +48,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_TASK; diff --git a/libcef_dll/cpptoc/task_cpptoc.h b/libcef_dll/cpptoc/task_cpptoc.h index 42a6b62d0..65f0d9f9d 100644 --- a/libcef_dll/cpptoc/task_cpptoc.h +++ b/libcef_dll/cpptoc/task_cpptoc.h @@ -27,9 +27,8 @@ class CefTaskCppToC : public CefCppToC { public: - explicit CefTaskCppToC(CefTask* cls); + CefTaskCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.cc b/libcef_dll/cpptoc/task_runner_cpptoc.cc index e83d48baa..3540f5a60 100644 --- a/libcef_dll/cpptoc/task_runner_cpptoc.cc +++ b/libcef_dll/cpptoc/task_runner_cpptoc.cc @@ -39,6 +39,8 @@ CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK task_runner_is_same(struct _cef_task_runner_t* self, @@ -133,17 +135,25 @@ int CEF_CALLBACK task_runner_post_delayed_task(struct _cef_task_runner_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefTaskRunnerCppToC::CefTaskRunnerCppToC(CefTaskRunner* cls) - : CefCppToC(cls) { - struct_.struct_.is_same = task_runner_is_same; - struct_.struct_.belongs_to_current_thread = +CefTaskRunnerCppToC::CefTaskRunnerCppToC() { + GetStruct()->is_same = task_runner_is_same; + GetStruct()->belongs_to_current_thread = task_runner_belongs_to_current_thread; - struct_.struct_.belongs_to_thread = task_runner_belongs_to_thread; - struct_.struct_.post_task = task_runner_post_task; - struct_.struct_.post_delayed_task = task_runner_post_delayed_task; + GetStruct()->belongs_to_thread = task_runner_belongs_to_thread; + GetStruct()->post_task = task_runner_post_task; + GetStruct()->post_delayed_task = task_runner_post_delayed_task; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_task_runner_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -151,3 +161,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_TASK_RUNNER; diff --git a/libcef_dll/cpptoc/task_runner_cpptoc.h b/libcef_dll/cpptoc/task_runner_cpptoc.h index 579bc0da3..67efccb1a 100644 --- a/libcef_dll/cpptoc/task_runner_cpptoc.h +++ b/libcef_dll/cpptoc/task_runner_cpptoc.h @@ -27,9 +27,8 @@ class CefTaskRunnerCppToC : public CefCppToC { public: - explicit CefTaskRunnerCppToC(CefTaskRunner* cls); + CefTaskRunnerCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_TASK_RUNNER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc new file mode 100644 index 000000000..9f95eecdb --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.cc @@ -0,0 +1,1096 @@ +// 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 +#include "libcef_dll/cpptoc/test/translator_test_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_object_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h" +#include "libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// GLOBAL FUNCTIONS - Body may be edited by hand. + +CEF_EXPORT cef_translator_test_t* cef_translator_test_create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + CefRefPtr _retval = CefTranslatorTest::Create(); + + // Return type: refptr_same + return CefTranslatorTestCppToC::Wrap(_retval); +} + + +namespace { + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK translator_test_get_void( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefTranslatorTestCppToC::Get(self)->GetVoid(); +} + +int CEF_CALLBACK translator_test_get_bool(struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetBool(); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_int(struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefTranslatorTestCppToC::Get(self)->GetInt(); + + // Return type: simple + return _retval; +} + +double CEF_CALLBACK translator_test_get_double( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + double _retval = CefTranslatorTestCppToC::Get(self)->GetDouble(); + + // Return type: simple + return _retval; +} + +long CEF_CALLBACK translator_test_get_long( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + long _retval = CefTranslatorTestCppToC::Get(self)->GetLong(); + + // Return type: simple + return _retval; +} + +size_t CEF_CALLBACK translator_test_get_sizet( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + size_t _retval = CefTranslatorTestCppToC::Get(self)->GetSizet(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK translator_test_set_void(struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetVoid(); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_bool(struct _cef_translator_test_t* self, + int val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetBool( + val?true:false); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_int(struct _cef_translator_test_t* self, + int val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetInt( + val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_double(struct _cef_translator_test_t* self, + double val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetDouble( + val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_long(struct _cef_translator_test_t* self, + long val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetLong( + val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_sizet(struct _cef_translator_test_t* self, + size_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetSizet( + val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_int_list( + struct _cef_translator_test_t* self, size_t valCount, int const* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: simple_vec_byref_const + DCHECK(valCount == 0 || val); + if (valCount > 0 && !val) + return 0; + + // Translate param: val; type: simple_vec_byref_const + std::vector valList; + if (valCount > 0) { + for (size_t i = 0; i < valCount; ++i) { + valList.push_back(val[i]); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetIntList( + valList); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_int_list_by_ref( + struct _cef_translator_test_t* self, size_t* valCount, int* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: simple_vec_byref + DCHECK(valCount && (*valCount == 0 || val)); + if (!valCount || (*valCount > 0 && !val)) + return 0; + + // Translate param: val; type: simple_vec_byref + std::vector valList; + if (valCount && *valCount > 0 && val) { + for (size_t i = 0; i < *valCount; ++i) { + valList.push_back(val[i]); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetIntListByRef( + valList); + + // Restore param: val; type: simple_vec_byref + if (valCount && val) { + *valCount = std::min(valList.size(), *valCount); + if (*valCount > 0) { + for (size_t i = 0; i < *valCount; ++i) { + val[i] = valList[i]; + } + } + } + + // Return type: bool + return _retval; +} + +size_t CEF_CALLBACK translator_test_get_int_list_size( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + size_t _retval = CefTranslatorTestCppToC::Get(self)->GetIntListSize(); + + // Return type: simple + return _retval; +} + +cef_string_userfree_t CEF_CALLBACK translator_test_get_string( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefString _retval = CefTranslatorTestCppToC::Get(self)->GetString(); + + // Return type: string + return _retval.DetachToUserFree(); +} + +int CEF_CALLBACK translator_test_set_string(struct _cef_translator_test_t* self, + const cef_string_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_byref_const + DCHECK(val); + if (!val) + return 0; + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetString( + CefString(val)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK translator_test_get_string_by_ref( + struct _cef_translator_test_t* self, cef_string_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: val; type: string_byref + DCHECK(val); + if (!val) + return; + + // Translate param: val; type: string_byref + CefString valStr(val); + + // Execute + CefTranslatorTestCppToC::Get(self)->GetStringByRef( + valStr); +} + +int CEF_CALLBACK translator_test_set_string_list( + struct _cef_translator_test_t* self, cef_string_list_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_vec_byref_const + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_vec_byref_const + std::vector valList; + transfer_string_list_contents(val, valList); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringList( + valList); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_string_list_by_ref( + struct _cef_translator_test_t* self, cef_string_list_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_vec_byref + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_vec_byref + std::vector valList; + transfer_string_list_contents(val, valList); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringListByRef( + valList); + + // Restore param: val; type: string_vec_byref + cef_string_list_clear(val); + transfer_string_list_contents(valList, val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_string_map( + struct _cef_translator_test_t* self, cef_string_map_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_map_single_byref_const + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_map_single_byref_const + std::map valMap; + transfer_string_map_contents(val, valMap); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringMap( + valMap); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_string_map_by_ref( + struct _cef_translator_test_t* self, cef_string_map_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_map_single_byref + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_map_single_byref + std::map valMap; + transfer_string_map_contents(val, valMap); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringMapByRef( + valMap); + + // Restore param: val; type: string_map_single_byref + cef_string_map_clear(val); + transfer_string_map_contents(valMap, val); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_set_string_multimap( + struct _cef_translator_test_t* self, cef_string_multimap_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_map_multi_byref_const + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_map_multi_byref_const + std::multimap valMultimap; + transfer_string_multimap_contents(val, valMultimap); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetStringMultimap( + valMultimap); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_string_multimap_by_ref( + struct _cef_translator_test_t* self, cef_string_multimap_t val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: string_map_multi_byref + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: string_map_multi_byref + std::multimap valMultimap; + transfer_string_multimap_contents(val, valMultimap); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetStringMultimapByRef( + valMultimap); + + // Restore param: val; type: string_map_multi_byref + cef_string_multimap_clear(val); + transfer_string_multimap_contents(valMultimap, val); + + // Return type: bool + return _retval; +} + +cef_point_t CEF_CALLBACK translator_test_get_point( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return CefPoint(); + + // Execute + cef_point_t _retval = CefTranslatorTestCppToC::Get(self)->GetPoint(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK translator_test_set_point(struct _cef_translator_test_t* self, + const cef_point_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: simple_byref_const + DCHECK(val); + if (!val) + return 0; + + // Translate param: val; type: simple_byref_const + CefPoint valVal = val?*val:CefPoint(); + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetPoint( + valVal); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK translator_test_get_point_by_ref( + struct _cef_translator_test_t* self, cef_point_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: val; type: simple_byref + DCHECK(val); + if (!val) + return; + + // Translate param: val; type: simple_byref + CefPoint valVal = val?*val:CefPoint(); + + // Execute + CefTranslatorTestCppToC::Get(self)->GetPointByRef( + valVal); + + // Restore param: val; type: simple_byref + if (val) + *val = valVal; +} + +int CEF_CALLBACK translator_test_set_point_list( + struct _cef_translator_test_t* self, size_t valCount, + cef_point_t const* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: simple_vec_byref_const + DCHECK(valCount == 0 || val); + if (valCount > 0 && !val) + return 0; + + // Translate param: val; type: simple_vec_byref_const + std::vector valList; + if (valCount > 0) { + for (size_t i = 0; i < valCount; ++i) { + valList.push_back(val[i]); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetPointList( + valList); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_point_list_by_ref( + struct _cef_translator_test_t* self, size_t* valCount, cef_point_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: simple_vec_byref + DCHECK(valCount && (*valCount == 0 || val)); + if (!valCount || (*valCount > 0 && !val)) + return 0; + + // Translate param: val; type: simple_vec_byref + std::vector valList; + if (valCount && *valCount > 0 && val) { + for (size_t i = 0; i < *valCount; ++i) { + valList.push_back(val[i]); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetPointListByRef( + valList); + + // Restore param: val; type: simple_vec_byref + if (valCount && val) { + *valCount = std::min(valList.size(), *valCount); + if (*valCount > 0) { + for (size_t i = 0; i < *valCount; ++i) { + val[i] = valList[i]; + } + } + } + + // Return type: bool + return _retval; +} + +size_t CEF_CALLBACK translator_test_get_point_list_size( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + size_t _retval = CefTranslatorTestCppToC::Get(self)->GetPointListSize(); + + // Return type: simple + return _retval; +} + +struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_get_object( + struct _cef_translator_test_t* self, int val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefTranslatorTestCppToC::Get( + self)->GetObject( + val); + + // Return type: refptr_same + return CefTranslatorTestObjectCppToC::Wrap(_retval); +} + +int CEF_CALLBACK translator_test_set_object(struct _cef_translator_test_t* self, + struct _cef_translator_test_object_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_same + DCHECK(val); + if (!val) + return 0; + + // Execute + int _retval = CefTranslatorTestCppToC::Get(self)->SetObject( + CefTranslatorTestObjectCppToC::Unwrap(val)); + + // Return type: simple + return _retval; +} + +struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_object_and_return( + struct _cef_translator_test_t* self, + struct _cef_translator_test_object_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: val; type: refptr_same + DCHECK(val); + if (!val) + return NULL; + + // Execute + CefRefPtr _retval = CefTranslatorTestCppToC::Get( + self)->SetObjectAndReturn( + CefTranslatorTestObjectCppToC::Unwrap(val)); + + // Return type: refptr_same + return CefTranslatorTestObjectCppToC::Wrap(_retval); +} + +int CEF_CALLBACK translator_test_set_child_object( + struct _cef_translator_test_t* self, + struct _cef_translator_test_object_child_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_same + DCHECK(val); + if (!val) + return 0; + + // Execute + int _retval = CefTranslatorTestCppToC::Get(self)->SetChildObject( + CefTranslatorTestObjectChildCppToC::Unwrap(val)); + + // Return type: simple + return _retval; +} + +struct _cef_translator_test_object_t* CEF_CALLBACK translator_test_set_child_object_and_return_parent( + struct _cef_translator_test_t* self, + struct _cef_translator_test_object_child_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: val; type: refptr_same + DCHECK(val); + if (!val) + return NULL; + + // Execute + CefRefPtr _retval = CefTranslatorTestCppToC::Get( + self)->SetChildObjectAndReturnParent( + CefTranslatorTestObjectChildCppToC::Unwrap(val)); + + // Return type: refptr_same + return CefTranslatorTestObjectCppToC::Wrap(_retval); +} + +int CEF_CALLBACK translator_test_set_object_list( + struct _cef_translator_test_t* self, size_t valCount, + struct _cef_translator_test_object_t* const* val, int val1, int val2) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_vec_same_byref_const + DCHECK(valCount == 0 || val); + if (valCount > 0 && !val) + return 0; + + // Translate param: val; type: refptr_vec_same_byref_const + std::vector > valList; + if (valCount > 0) { + for (size_t i = 0; i < valCount; ++i) { + valList.push_back(CefTranslatorTestObjectCppToC::Unwrap(val[i])); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetObjectList( + valList, + val1, + val2); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_object_list_by_ref( + struct _cef_translator_test_t* self, size_t* valCount, + struct _cef_translator_test_object_t** val, int val1, int val2) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_vec_same_byref + DCHECK(valCount && (*valCount == 0 || val)); + if (!valCount || (*valCount > 0 && !val)) + return 0; + + // Translate param: val; type: refptr_vec_same_byref + std::vector > valList; + if (valCount && *valCount > 0 && val) { + for (size_t i = 0; i < *valCount; ++i) { + valList.push_back(CefTranslatorTestObjectCppToC::Unwrap(val[i])); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetObjectListByRef( + valList, + val1, + val2); + + // Restore param: val; type: refptr_vec_same_byref + if (valCount && val) { + *valCount = std::min(valList.size(), *valCount); + if (*valCount > 0) { + for (size_t i = 0; i < *valCount; ++i) { + val[i] = CefTranslatorTestObjectCppToC::Wrap(valList[i]); + } + } + } + + // Return type: bool + return _retval; +} + +size_t CEF_CALLBACK translator_test_get_object_list_size( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + size_t _retval = CefTranslatorTestCppToC::Get(self)->GetObjectListSize(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK translator_test_set_handler( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_diff + DCHECK(val); + if (!val) + return 0; + + // Execute + int _retval = CefTranslatorTestCppToC::Get(self)->SetHandler( + CefTranslatorTestHandlerCToCpp::Wrap(val)); + + // Return type: simple + return _retval; +} + +struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_handler_and_return( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: val; type: refptr_diff + DCHECK(val); + if (!val) + return NULL; + + // Execute + CefRefPtr _retval = CefTranslatorTestCppToC::Get( + self)->SetHandlerAndReturn( + CefTranslatorTestHandlerCToCpp::Wrap(val)); + + // Return type: refptr_diff + return CefTranslatorTestHandlerCToCpp::Unwrap(_retval); +} + +int CEF_CALLBACK translator_test_set_child_handler( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_child_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_diff + DCHECK(val); + if (!val) + return 0; + + // Execute + int _retval = CefTranslatorTestCppToC::Get(self)->SetChildHandler( + CefTranslatorTestHandlerChildCToCpp::Wrap(val)); + + // Return type: simple + return _retval; +} + +struct _cef_translator_test_handler_t* CEF_CALLBACK translator_test_set_child_handler_and_return_parent( + struct _cef_translator_test_t* self, + struct _cef_translator_test_handler_child_t* val) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: val; type: refptr_diff + DCHECK(val); + if (!val) + return NULL; + + // Execute + CefRefPtr _retval = CefTranslatorTestCppToC::Get( + self)->SetChildHandlerAndReturnParent( + CefTranslatorTestHandlerChildCToCpp::Wrap(val)); + + // Return type: refptr_diff + return CefTranslatorTestHandlerCToCpp::Unwrap(_retval); +} + +int CEF_CALLBACK translator_test_set_handler_list( + struct _cef_translator_test_t* self, size_t valCount, + struct _cef_translator_test_handler_t* const* val, int val1, int val2) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_vec_diff_byref_const + DCHECK(valCount == 0 || val); + if (valCount > 0 && !val) + return 0; + + // Translate param: val; type: refptr_vec_diff_byref_const + std::vector > valList; + if (valCount > 0) { + for (size_t i = 0; i < valCount; ++i) { + valList.push_back(CefTranslatorTestHandlerCToCpp::Wrap(val[i])); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->SetHandlerList( + valList, + val1, + val2); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK translator_test_get_handler_list_by_ref( + struct _cef_translator_test_t* self, size_t* valCount, + struct _cef_translator_test_handler_t** val, + struct _cef_translator_test_handler_t* val1, + struct _cef_translator_test_handler_t* val2) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: val; type: refptr_vec_diff_byref + DCHECK(valCount && (*valCount == 0 || val)); + if (!valCount || (*valCount > 0 && !val)) + return 0; + // Verify param: val1; type: refptr_diff + DCHECK(val1); + if (!val1) + return 0; + // Verify param: val2; type: refptr_diff + DCHECK(val2); + if (!val2) + return 0; + + // Translate param: val; type: refptr_vec_diff_byref + std::vector > valList; + if (valCount && *valCount > 0 && val) { + for (size_t i = 0; i < *valCount; ++i) { + valList.push_back(CefTranslatorTestHandlerCToCpp::Wrap(val[i])); + } + } + + // Execute + bool _retval = CefTranslatorTestCppToC::Get(self)->GetHandlerListByRef( + valList, + CefTranslatorTestHandlerCToCpp::Wrap(val1), + CefTranslatorTestHandlerCToCpp::Wrap(val2)); + + // Restore param: val; type: refptr_vec_diff_byref + if (valCount && val) { + *valCount = std::min(valList.size(), *valCount); + if (*valCount > 0) { + for (size_t i = 0; i < *valCount; ++i) { + val[i] = CefTranslatorTestHandlerCToCpp::Unwrap(valList[i]); + } + } + } + + // Return type: bool + return _retval; +} + +size_t CEF_CALLBACK translator_test_get_handler_list_size( + struct _cef_translator_test_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + size_t _retval = CefTranslatorTestCppToC::Get(self)->GetHandlerListSize(); + + // Return type: simple + return _retval; +} + +} // namespace + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestCppToC::CefTranslatorTestCppToC() { + GetStruct()->get_void = translator_test_get_void; + GetStruct()->get_bool = translator_test_get_bool; + GetStruct()->get_int = translator_test_get_int; + GetStruct()->get_double = translator_test_get_double; + GetStruct()->get_long = translator_test_get_long; + GetStruct()->get_sizet = translator_test_get_sizet; + GetStruct()->set_void = translator_test_set_void; + GetStruct()->set_bool = translator_test_set_bool; + GetStruct()->set_int = translator_test_set_int; + GetStruct()->set_double = translator_test_set_double; + GetStruct()->set_long = translator_test_set_long; + GetStruct()->set_sizet = translator_test_set_sizet; + GetStruct()->set_int_list = translator_test_set_int_list; + GetStruct()->get_int_list_by_ref = translator_test_get_int_list_by_ref; + GetStruct()->get_int_list_size = translator_test_get_int_list_size; + GetStruct()->get_string = translator_test_get_string; + GetStruct()->set_string = translator_test_set_string; + GetStruct()->get_string_by_ref = translator_test_get_string_by_ref; + GetStruct()->set_string_list = translator_test_set_string_list; + GetStruct()->get_string_list_by_ref = translator_test_get_string_list_by_ref; + GetStruct()->set_string_map = translator_test_set_string_map; + GetStruct()->get_string_map_by_ref = translator_test_get_string_map_by_ref; + GetStruct()->set_string_multimap = translator_test_set_string_multimap; + GetStruct()->get_string_multimap_by_ref = + translator_test_get_string_multimap_by_ref; + GetStruct()->get_point = translator_test_get_point; + GetStruct()->set_point = translator_test_set_point; + GetStruct()->get_point_by_ref = translator_test_get_point_by_ref; + GetStruct()->set_point_list = translator_test_set_point_list; + GetStruct()->get_point_list_by_ref = translator_test_get_point_list_by_ref; + GetStruct()->get_point_list_size = translator_test_get_point_list_size; + GetStruct()->get_object = translator_test_get_object; + GetStruct()->set_object = translator_test_set_object; + GetStruct()->set_object_and_return = translator_test_set_object_and_return; + GetStruct()->set_child_object = translator_test_set_child_object; + GetStruct()->set_child_object_and_return_parent = + translator_test_set_child_object_and_return_parent; + GetStruct()->set_object_list = translator_test_set_object_list; + GetStruct()->get_object_list_by_ref = translator_test_get_object_list_by_ref; + GetStruct()->get_object_list_size = translator_test_get_object_list_size; + GetStruct()->set_handler = translator_test_set_handler; + GetStruct()->set_handler_and_return = translator_test_set_handler_and_return; + GetStruct()->set_child_handler = translator_test_set_child_handler; + GetStruct()->set_child_handler_and_return_parent = + translator_test_set_child_handler_and_return_parent; + GetStruct()->set_handler_list = translator_test_set_handler_list; + GetStruct()->get_handler_list_by_ref = + translator_test_get_handler_list_by_ref; + GetStruct()->get_handler_list_size = translator_test_get_handler_list_size; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_translator_test_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = WT_TRANSLATOR_TEST; diff --git a/libcef_dll/cpptoc/test/translator_test_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_cpptoc.h new file mode 100644 index 000000000..04fbb52b9 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_cpptoc.h @@ -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 { + public: + CefTranslatorTestCppToC(); +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc new file mode 100644 index 000000000..553ffd0f9 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.cc @@ -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(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 CefCppToC::UnwrapDerived(CefWrapperType type, + cef_translator_test_handler_child_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = + WT_TRANSLATOR_TEST_HANDLER_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h new file mode 100644 index 000000000..edca7b863 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h @@ -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 { + public: + CefTranslatorTestHandlerChildCppToC(); +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc new file mode 100644 index 000000000..90b310bec --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.cc @@ -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 CefCppToC::UnwrapDerived( + CefWrapperType type, cef_translator_test_handler_t* s) { + if (type == WT_TRANSLATOR_TEST_HANDLER_CHILD) { + return CefTranslatorTestHandlerChildCppToC::Unwrap( + reinterpret_cast(s)); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = + WT_TRANSLATOR_TEST_HANDLER; diff --git a/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h new file mode 100644 index 000000000..b5c6fc133 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h @@ -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 { + public: + CefTranslatorTestHandlerCppToC(); +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_HANDLER_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc new file mode 100644 index 000000000..8059e3344 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.cc @@ -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 _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( + 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( + 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( + 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( + 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 CefCppToC::UnwrapDerived( + CefWrapperType type, cef_translator_test_object_child_child_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h new file mode 100644 index 000000000..d6dfeb82d --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_child_child_cpptoc.h @@ -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 { + public: + CefTranslatorTestObjectChildChildCppToC(); +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc new file mode 100644 index 000000000..4da5a50c6 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.cc @@ -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 _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(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(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 CefCppToC::UnwrapDerived(CefWrapperType type, + cef_translator_test_object_child_t* s) { + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) { + return CefTranslatorTestObjectChildChildCppToC::Unwrap( + reinterpret_cast(s)); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT_CHILD; diff --git a/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h new file mode 100644 index 000000000..f013cf29e --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_child_cpptoc.h @@ -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 { + public: + CefTranslatorTestObjectChildCppToC(); +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc b/libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc new file mode 100644 index 000000000..e9b61533e --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_cpptoc.cc @@ -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 _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 CefCppToC::UnwrapDerived( + CefWrapperType type, cef_translator_test_object_t* s) { + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD) { + return CefTranslatorTestObjectChildCppToC::Unwrap( + reinterpret_cast(s)); + } + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) { + return CefTranslatorTestObjectChildChildCppToC::Unwrap( + reinterpret_cast(s)); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCppToC::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT; diff --git a/libcef_dll/cpptoc/test/translator_test_object_cpptoc.h b/libcef_dll/cpptoc/test/translator_test_object_cpptoc.h new file mode 100644 index 000000000..e1fa735f7 --- /dev/null +++ b/libcef_dll/cpptoc/test/translator_test_object_cpptoc.h @@ -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 { + public: + CefTranslatorTestObjectCppToC(); +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TEST_TRANSLATOR_TEST_OBJECT_CPPTOC_H_ diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc index 52d9581a0..68440114d 100644 --- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc +++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc @@ -15,6 +15,8 @@ #include "libcef_dll/ctocpp/urlrequest_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK urlrequest_client_on_request_complete( @@ -134,17 +136,24 @@ int CEF_CALLBACK urlrequest_client_get_auth_credentials( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefURLRequestClientCppToC::CefURLRequestClientCppToC(CefURLRequestClient* cls) - : CefCppToC(cls) { - struct_.struct_.on_request_complete = urlrequest_client_on_request_complete; - struct_.struct_.on_upload_progress = urlrequest_client_on_upload_progress; - struct_.struct_.on_download_progress = urlrequest_client_on_download_progress; - struct_.struct_.on_download_data = urlrequest_client_on_download_data; - struct_.struct_.get_auth_credentials = urlrequest_client_get_auth_credentials; +CefURLRequestClientCppToC::CefURLRequestClientCppToC() { + GetStruct()->on_request_complete = urlrequest_client_on_request_complete; + GetStruct()->on_upload_progress = urlrequest_client_on_upload_progress; + GetStruct()->on_download_progress = urlrequest_client_on_download_progress; + GetStruct()->on_download_data = urlrequest_client_on_download_data; + GetStruct()->get_auth_credentials = urlrequest_client_get_auth_credentials; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_urlrequest_client_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -152,3 +161,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_URLREQUEST_CLIENT; diff --git a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h index 4799e21aa..d560ac76b 100644 --- a/libcef_dll/cpptoc/urlrequest_client_cpptoc.h +++ b/libcef_dll/cpptoc/urlrequest_client_cpptoc.h @@ -28,9 +28,8 @@ class CefURLRequestClientCppToC : public CefCppToC { public: - explicit CefURLRequestClientCppToC(CefURLRequestClient* cls); + CefURLRequestClientCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.cc b/libcef_dll/cpptoc/urlrequest_cpptoc.cc index a0736aa84..07513c1fb 100644 --- a/libcef_dll/cpptoc/urlrequest_cpptoc.cc +++ b/libcef_dll/cpptoc/urlrequest_cpptoc.cc @@ -45,6 +45,8 @@ CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create(cef_request_t* request, } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_request_t* CEF_CALLBACK urlrequest_get_request( @@ -136,17 +138,25 @@ void CEF_CALLBACK urlrequest_cancel(struct _cef_urlrequest_t* self) { CefURLRequestCppToC::Get(self)->Cancel(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefURLRequestCppToC::CefURLRequestCppToC(CefURLRequest* cls) - : CefCppToC(cls) { - struct_.struct_.get_request = urlrequest_get_request; - struct_.struct_.get_client = urlrequest_get_client; - struct_.struct_.get_request_status = urlrequest_get_request_status; - struct_.struct_.get_request_error = urlrequest_get_request_error; - struct_.struct_.get_response = urlrequest_get_response; - struct_.struct_.cancel = urlrequest_cancel; +CefURLRequestCppToC::CefURLRequestCppToC() { + GetStruct()->get_request = urlrequest_get_request; + GetStruct()->get_client = urlrequest_get_client; + GetStruct()->get_request_status = urlrequest_get_request_status; + GetStruct()->get_request_error = urlrequest_get_request_error; + GetStruct()->get_response = urlrequest_get_response; + GetStruct()->cancel = urlrequest_cancel; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_urlrequest_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -154,3 +164,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_URLREQUEST; diff --git a/libcef_dll/cpptoc/urlrequest_cpptoc.h b/libcef_dll/cpptoc/urlrequest_cpptoc.h index 1c16742e3..4fbee6c05 100644 --- a/libcef_dll/cpptoc/urlrequest_cpptoc.h +++ b/libcef_dll/cpptoc/urlrequest_cpptoc.h @@ -27,9 +27,8 @@ class CefURLRequestCppToC : public CefCppToC { public: - explicit CefURLRequestCppToC(CefURLRequest* cls); + CefURLRequestCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/libcef_dll/cpptoc/v8accessor_cpptoc.cc index 64ea845ea..a93bf7e12 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.cc +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/v8value_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, @@ -110,13 +112,21 @@ int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls) - : CefCppToC(cls) { - struct_.struct_.get = v8accessor_get; - struct_.struct_.set = v8accessor_set; +CefV8AccessorCppToC::CefV8AccessorCppToC() { + GetStruct()->get = v8accessor_get; + GetStruct()->set = v8accessor_set; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_v8accessor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -124,3 +134,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8ACCESSOR; diff --git a/libcef_dll/cpptoc/v8accessor_cpptoc.h b/libcef_dll/cpptoc/v8accessor_cpptoc.h index 82e534a6e..fe8abd06b 100644 --- a/libcef_dll/cpptoc/v8accessor_cpptoc.h +++ b/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -27,9 +27,8 @@ class CefV8AccessorCppToC : public CefCppToC { public: - explicit CefV8AccessorCppToC(CefV8Accessor* cls); + CefV8AccessorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8context_cpptoc.cc b/libcef_dll/cpptoc/v8context_cpptoc.cc index 0cc19fabe..6bbe2a180 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.cc +++ b/libcef_dll/cpptoc/v8context_cpptoc.cc @@ -51,6 +51,8 @@ CEF_EXPORT int cef_v8context_in_context() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_task_runner_t* CEF_CALLBACK v8context_get_task_runner( @@ -238,20 +240,27 @@ int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8ContextCppToC::CefV8ContextCppToC(CefV8Context* cls) - : CefCppToC(cls) { - struct_.struct_.get_task_runner = v8context_get_task_runner; - struct_.struct_.is_valid = v8context_is_valid; - struct_.struct_.get_browser = v8context_get_browser; - struct_.struct_.get_frame = v8context_get_frame; - struct_.struct_.get_global = v8context_get_global; - struct_.struct_.enter = v8context_enter; - struct_.struct_.exit = v8context_exit; - struct_.struct_.is_same = v8context_is_same; - struct_.struct_.eval = v8context_eval; +CefV8ContextCppToC::CefV8ContextCppToC() { + GetStruct()->get_task_runner = v8context_get_task_runner; + GetStruct()->is_valid = v8context_is_valid; + GetStruct()->get_browser = v8context_get_browser; + GetStruct()->get_frame = v8context_get_frame; + GetStruct()->get_global = v8context_get_global; + GetStruct()->enter = v8context_enter; + GetStruct()->exit = v8context_exit; + GetStruct()->is_same = v8context_is_same; + GetStruct()->eval = v8context_eval; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8context_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -259,3 +268,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8CONTEXT; diff --git a/libcef_dll/cpptoc/v8context_cpptoc.h b/libcef_dll/cpptoc/v8context_cpptoc.h index 1348cc4f3..1edb57c2f 100644 --- a/libcef_dll/cpptoc/v8context_cpptoc.h +++ b/libcef_dll/cpptoc/v8context_cpptoc.h @@ -27,9 +27,8 @@ class CefV8ContextCppToC : public CefCppToC { public: - explicit CefV8ContextCppToC(CefV8Context* cls); + CefV8ContextCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8CONTEXT_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.cc b/libcef_dll/cpptoc/v8exception_cpptoc.cc index 25ecc431b..83136432d 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.cc +++ b/libcef_dll/cpptoc/v8exception_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/v8exception_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK v8exception_get_message( @@ -131,20 +133,27 @@ int CEF_CALLBACK v8exception_get_end_column(struct _cef_v8exception_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8ExceptionCppToC::CefV8ExceptionCppToC(CefV8Exception* cls) - : CefCppToC(cls) { - struct_.struct_.get_message = v8exception_get_message; - struct_.struct_.get_source_line = v8exception_get_source_line; - struct_.struct_.get_script_resource_name = - v8exception_get_script_resource_name; - struct_.struct_.get_line_number = v8exception_get_line_number; - struct_.struct_.get_start_position = v8exception_get_start_position; - struct_.struct_.get_end_position = v8exception_get_end_position; - struct_.struct_.get_start_column = v8exception_get_start_column; - struct_.struct_.get_end_column = v8exception_get_end_column; +CefV8ExceptionCppToC::CefV8ExceptionCppToC() { + GetStruct()->get_message = v8exception_get_message; + GetStruct()->get_source_line = v8exception_get_source_line; + GetStruct()->get_script_resource_name = v8exception_get_script_resource_name; + GetStruct()->get_line_number = v8exception_get_line_number; + GetStruct()->get_start_position = v8exception_get_start_position; + GetStruct()->get_end_position = v8exception_get_end_position; + GetStruct()->get_start_column = v8exception_get_start_column; + GetStruct()->get_end_column = v8exception_get_end_column; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_v8exception_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -152,3 +161,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8EXCEPTION; diff --git a/libcef_dll/cpptoc/v8exception_cpptoc.h b/libcef_dll/cpptoc/v8exception_cpptoc.h index b24ff42c1..80eba56d5 100644 --- a/libcef_dll/cpptoc/v8exception_cpptoc.h +++ b/libcef_dll/cpptoc/v8exception_cpptoc.h @@ -28,9 +28,8 @@ class CefV8ExceptionCppToC : public CefCppToC { public: - explicit CefV8ExceptionCppToC(CefV8Exception* cls); + CefV8ExceptionCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8EXCEPTION_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.cc b/libcef_dll/cpptoc/v8handler_cpptoc.cc index 59c74cc5c..5b937f128 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.cc +++ b/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/v8value_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, @@ -84,12 +86,19 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls) - : CefCppToC(cls) { - struct_.struct_.execute = v8handler_execute; +CefV8HandlerCppToC::CefV8HandlerCppToC() { + GetStruct()->execute = v8handler_execute; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -97,3 +106,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8HANDLER; diff --git a/libcef_dll/cpptoc/v8handler_cpptoc.h b/libcef_dll/cpptoc/v8handler_cpptoc.h index 1c113e3b5..1a18e64b6 100644 --- a/libcef_dll/cpptoc/v8handler_cpptoc.h +++ b/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -27,9 +27,8 @@ class CefV8HandlerCppToC : public CefCppToC { public: - explicit CefV8HandlerCppToC(CefV8Handler* cls); + CefV8HandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc index e30aaef65..0c400c9e8 100644 --- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc +++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8stack_frame_is_valid(struct _cef_v8stack_frame_t* self) { @@ -133,21 +135,28 @@ int CEF_CALLBACK v8stack_frame_is_constructor( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8StackFrameCppToC::CefV8StackFrameCppToC(CefV8StackFrame* cls) - : CefCppToC( - cls) { - struct_.struct_.is_valid = v8stack_frame_is_valid; - struct_.struct_.get_script_name = v8stack_frame_get_script_name; - struct_.struct_.get_script_name_or_source_url = +CefV8StackFrameCppToC::CefV8StackFrameCppToC() { + GetStruct()->is_valid = v8stack_frame_is_valid; + GetStruct()->get_script_name = v8stack_frame_get_script_name; + GetStruct()->get_script_name_or_source_url = v8stack_frame_get_script_name_or_source_url; - struct_.struct_.get_function_name = v8stack_frame_get_function_name; - struct_.struct_.get_line_number = v8stack_frame_get_line_number; - struct_.struct_.get_column = v8stack_frame_get_column; - struct_.struct_.is_eval = v8stack_frame_is_eval; - struct_.struct_.is_constructor = v8stack_frame_is_constructor; + GetStruct()->get_function_name = v8stack_frame_get_function_name; + GetStruct()->get_line_number = v8stack_frame_get_line_number; + GetStruct()->get_column = v8stack_frame_get_column; + GetStruct()->is_eval = v8stack_frame_is_eval; + GetStruct()->is_constructor = v8stack_frame_is_constructor; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_v8stack_frame_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -155,3 +164,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8STACK_FRAME; diff --git a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h index 32b15e5f0..2bcc979b2 100644 --- a/libcef_dll/cpptoc/v8stack_frame_cpptoc.h +++ b/libcef_dll/cpptoc/v8stack_frame_cpptoc.h @@ -28,9 +28,8 @@ class CefV8StackFrameCppToC : public CefCppToC { public: - explicit CefV8StackFrameCppToC(CefV8StackFrame* cls); + CefV8StackFrameCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8STACK_FRAME_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc index 5b05b365b..82ba752d4 100644 --- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc +++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.cc @@ -28,6 +28,8 @@ CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit) { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8stack_trace_is_valid(struct _cef_v8stack_trace_t* self) { @@ -76,15 +78,22 @@ struct _cef_v8stack_frame_t* CEF_CALLBACK v8stack_trace_get_frame( return CefV8StackFrameCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8StackTraceCppToC::CefV8StackTraceCppToC(CefV8StackTrace* cls) - : CefCppToC( - cls) { - struct_.struct_.is_valid = v8stack_trace_is_valid; - struct_.struct_.get_frame_count = v8stack_trace_get_frame_count; - struct_.struct_.get_frame = v8stack_trace_get_frame; +CefV8StackTraceCppToC::CefV8StackTraceCppToC() { + GetStruct()->is_valid = v8stack_trace_is_valid; + GetStruct()->get_frame_count = v8stack_trace_get_frame_count; + GetStruct()->get_frame = v8stack_trace_get_frame; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_v8stack_trace_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -92,3 +101,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8STACK_TRACE; diff --git a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h index c9f81f403..1f9e75d89 100644 --- a/libcef_dll/cpptoc/v8stack_trace_cpptoc.h +++ b/libcef_dll/cpptoc/v8stack_trace_cpptoc.h @@ -28,9 +28,8 @@ class CefV8StackTraceCppToC : public CefCppToC { public: - explicit CefV8StackTraceCppToC(CefV8StackTrace* cls); + CefV8StackTraceCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8STACK_TRACE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/v8value_cpptoc.cc b/libcef_dll/cpptoc/v8value_cpptoc.cc index 2b4b9646d..3f3358d61 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.cc +++ b/libcef_dll/cpptoc/v8value_cpptoc.cc @@ -165,6 +165,8 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK v8value_is_valid(struct _cef_v8value_t* self) { @@ -912,62 +914,71 @@ struct _cef_v8value_t* CEF_CALLBACK v8value_execute_function_with_context( return CefV8ValueCppToC::Wrap(_retval); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = v8value_is_valid; - struct_.struct_.is_undefined = v8value_is_undefined; - struct_.struct_.is_null = v8value_is_null; - struct_.struct_.is_bool = v8value_is_bool; - struct_.struct_.is_int = v8value_is_int; - struct_.struct_.is_uint = v8value_is_uint; - struct_.struct_.is_double = v8value_is_double; - struct_.struct_.is_date = v8value_is_date; - struct_.struct_.is_string = v8value_is_string; - struct_.struct_.is_object = v8value_is_object; - struct_.struct_.is_array = v8value_is_array; - struct_.struct_.is_function = v8value_is_function; - struct_.struct_.is_same = v8value_is_same; - struct_.struct_.get_bool_value = v8value_get_bool_value; - struct_.struct_.get_int_value = v8value_get_int_value; - struct_.struct_.get_uint_value = v8value_get_uint_value; - struct_.struct_.get_double_value = v8value_get_double_value; - struct_.struct_.get_date_value = v8value_get_date_value; - struct_.struct_.get_string_value = v8value_get_string_value; - struct_.struct_.is_user_created = v8value_is_user_created; - struct_.struct_.has_exception = v8value_has_exception; - struct_.struct_.get_exception = v8value_get_exception; - struct_.struct_.clear_exception = v8value_clear_exception; - struct_.struct_.will_rethrow_exceptions = v8value_will_rethrow_exceptions; - struct_.struct_.set_rethrow_exceptions = v8value_set_rethrow_exceptions; - struct_.struct_.has_value_bykey = v8value_has_value_bykey; - struct_.struct_.has_value_byindex = v8value_has_value_byindex; - struct_.struct_.delete_value_bykey = v8value_delete_value_bykey; - struct_.struct_.delete_value_byindex = v8value_delete_value_byindex; - struct_.struct_.get_value_bykey = v8value_get_value_bykey; - struct_.struct_.get_value_byindex = v8value_get_value_byindex; - struct_.struct_.set_value_bykey = v8value_set_value_bykey; - struct_.struct_.set_value_byindex = v8value_set_value_byindex; - struct_.struct_.set_value_byaccessor = v8value_set_value_byaccessor; - struct_.struct_.get_keys = v8value_get_keys; - struct_.struct_.set_user_data = v8value_set_user_data; - struct_.struct_.get_user_data = v8value_get_user_data; - struct_.struct_.get_externally_allocated_memory = +CefV8ValueCppToC::CefV8ValueCppToC() { + GetStruct()->is_valid = v8value_is_valid; + GetStruct()->is_undefined = v8value_is_undefined; + GetStruct()->is_null = v8value_is_null; + GetStruct()->is_bool = v8value_is_bool; + GetStruct()->is_int = v8value_is_int; + GetStruct()->is_uint = v8value_is_uint; + GetStruct()->is_double = v8value_is_double; + GetStruct()->is_date = v8value_is_date; + GetStruct()->is_string = v8value_is_string; + GetStruct()->is_object = v8value_is_object; + GetStruct()->is_array = v8value_is_array; + GetStruct()->is_function = v8value_is_function; + GetStruct()->is_same = v8value_is_same; + GetStruct()->get_bool_value = v8value_get_bool_value; + GetStruct()->get_int_value = v8value_get_int_value; + GetStruct()->get_uint_value = v8value_get_uint_value; + GetStruct()->get_double_value = v8value_get_double_value; + GetStruct()->get_date_value = v8value_get_date_value; + GetStruct()->get_string_value = v8value_get_string_value; + GetStruct()->is_user_created = v8value_is_user_created; + GetStruct()->has_exception = v8value_has_exception; + GetStruct()->get_exception = v8value_get_exception; + GetStruct()->clear_exception = v8value_clear_exception; + GetStruct()->will_rethrow_exceptions = v8value_will_rethrow_exceptions; + GetStruct()->set_rethrow_exceptions = v8value_set_rethrow_exceptions; + GetStruct()->has_value_bykey = v8value_has_value_bykey; + GetStruct()->has_value_byindex = v8value_has_value_byindex; + GetStruct()->delete_value_bykey = v8value_delete_value_bykey; + GetStruct()->delete_value_byindex = v8value_delete_value_byindex; + GetStruct()->get_value_bykey = v8value_get_value_bykey; + GetStruct()->get_value_byindex = v8value_get_value_byindex; + GetStruct()->set_value_bykey = v8value_set_value_bykey; + GetStruct()->set_value_byindex = v8value_set_value_byindex; + GetStruct()->set_value_byaccessor = v8value_set_value_byaccessor; + GetStruct()->get_keys = v8value_get_keys; + GetStruct()->set_user_data = v8value_set_user_data; + GetStruct()->get_user_data = v8value_get_user_data; + GetStruct()->get_externally_allocated_memory = v8value_get_externally_allocated_memory; - struct_.struct_.adjust_externally_allocated_memory = + GetStruct()->adjust_externally_allocated_memory = v8value_adjust_externally_allocated_memory; - struct_.struct_.get_array_length = v8value_get_array_length; - struct_.struct_.get_function_name = v8value_get_function_name; - struct_.struct_.get_function_handler = v8value_get_function_handler; - struct_.struct_.execute_function = v8value_execute_function; - struct_.struct_.execute_function_with_context = + GetStruct()->get_array_length = v8value_get_array_length; + GetStruct()->get_function_name = v8value_get_function_name; + GetStruct()->get_function_handler = v8value_get_function_handler; + GetStruct()->execute_function = v8value_execute_function; + GetStruct()->execute_function_with_context = v8value_execute_function_with_context; } +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_v8value_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_V8VALUE; diff --git a/libcef_dll/cpptoc/v8value_cpptoc.h b/libcef_dll/cpptoc/v8value_cpptoc.h index 02135e3c7..707df2900 100644 --- a/libcef_dll/cpptoc/v8value_cpptoc.h +++ b/libcef_dll/cpptoc/v8value_cpptoc.h @@ -27,9 +27,8 @@ class CefV8ValueCppToC : public CefCppToC { public: - explicit CefV8ValueCppToC(CefV8Value* cls); + CefV8ValueCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/value_cpptoc.cc b/libcef_dll/cpptoc/value_cpptoc.cc index a955bdc14..d460a4bfe 100644 --- a/libcef_dll/cpptoc/value_cpptoc.cc +++ b/libcef_dll/cpptoc/value_cpptoc.cc @@ -29,6 +29,8 @@ CEF_EXPORT cef_value_t* cef_value_create() { } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK value_is_valid(struct _cef_value_t* self) { @@ -379,33 +381,40 @@ int CEF_CALLBACK value_set_list(struct _cef_value_t* self, return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefValueCppToC::CefValueCppToC(CefValue* cls) - : CefCppToC(cls) { - struct_.struct_.is_valid = value_is_valid; - struct_.struct_.is_owned = value_is_owned; - struct_.struct_.is_read_only = value_is_read_only; - struct_.struct_.is_same = value_is_same; - struct_.struct_.is_equal = value_is_equal; - struct_.struct_.copy = value_copy; - struct_.struct_.get_type = value_get_type; - struct_.struct_.get_bool = value_get_bool; - struct_.struct_.get_int = value_get_int; - struct_.struct_.get_double = value_get_double; - struct_.struct_.get_string = value_get_string; - struct_.struct_.get_binary = value_get_binary; - struct_.struct_.get_dictionary = value_get_dictionary; - struct_.struct_.get_list = value_get_list; - struct_.struct_.set_null = value_set_null; - struct_.struct_.set_bool = value_set_bool; - struct_.struct_.set_int = value_set_int; - struct_.struct_.set_double = value_set_double; - struct_.struct_.set_string = value_set_string; - struct_.struct_.set_binary = value_set_binary; - struct_.struct_.set_dictionary = value_set_dictionary; - struct_.struct_.set_list = value_set_list; +CefValueCppToC::CefValueCppToC() { + GetStruct()->is_valid = value_is_valid; + GetStruct()->is_owned = value_is_owned; + GetStruct()->is_read_only = value_is_read_only; + GetStruct()->is_same = value_is_same; + GetStruct()->is_equal = value_is_equal; + GetStruct()->copy = value_copy; + GetStruct()->get_type = value_get_type; + GetStruct()->get_bool = value_get_bool; + GetStruct()->get_int = value_get_int; + GetStruct()->get_double = value_get_double; + GetStruct()->get_string = value_get_string; + GetStruct()->get_binary = value_get_binary; + GetStruct()->get_dictionary = value_get_dictionary; + GetStruct()->get_list = value_get_list; + GetStruct()->set_null = value_set_null; + GetStruct()->set_bool = value_set_bool; + GetStruct()->set_int = value_set_int; + GetStruct()->set_double = value_set_double; + GetStruct()->set_string = value_set_string; + GetStruct()->set_binary = value_set_binary; + GetStruct()->set_dictionary = value_set_dictionary; + GetStruct()->set_list = value_set_list; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, cef_value_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -413,3 +422,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_VALUE; diff --git a/libcef_dll/cpptoc/value_cpptoc.h b/libcef_dll/cpptoc/value_cpptoc.h index 57b792c98..0e4ef3bac 100644 --- a/libcef_dll/cpptoc/value_cpptoc.h +++ b/libcef_dll/cpptoc/value_cpptoc.h @@ -27,9 +27,8 @@ class CefValueCppToC : public CefCppToC { public: - explicit CefValueCppToC(CefValue* cls); + CefValueCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_VALUE_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc index ba4fd2b9b..951fd84dd 100644 --- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/web_plugin_info_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_name( @@ -75,16 +77,23 @@ cef_string_userfree_t CEF_CALLBACK web_plugin_info_get_description( return _retval.DetachToUserFree(); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefWebPluginInfoCppToC::CefWebPluginInfoCppToC(CefWebPluginInfo* cls) - : CefCppToC(cls) { - struct_.struct_.get_name = web_plugin_info_get_name; - struct_.struct_.get_path = web_plugin_info_get_path; - struct_.struct_.get_version = web_plugin_info_get_version; - struct_.struct_.get_description = web_plugin_info_get_description; +CefWebPluginInfoCppToC::CefWebPluginInfoCppToC() { + GetStruct()->get_name = web_plugin_info_get_name; + GetStruct()->get_path = web_plugin_info_get_path; + GetStruct()->get_version = web_plugin_info_get_version; + GetStruct()->get_description = web_plugin_info_get_description; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_web_plugin_info_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -92,3 +101,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_WEB_PLUGIN_INFO; diff --git a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h index ddc14cdc2..72a04fbb5 100644 --- a/libcef_dll/cpptoc/web_plugin_info_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_info_cpptoc.h @@ -28,9 +28,8 @@ class CefWebPluginInfoCppToC : public CefCppToC { public: - explicit CefWebPluginInfoCppToC(CefWebPluginInfo* cls); + CefWebPluginInfoCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc index d4874cd35..d1e2c908a 100644 --- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc @@ -14,6 +14,8 @@ #include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK web_plugin_info_visitor_visit( @@ -39,14 +41,20 @@ int CEF_CALLBACK web_plugin_info_visitor_visit( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefWebPluginInfoVisitorCppToC::CefWebPluginInfoVisitorCppToC( - CefWebPluginInfoVisitor* cls) - : CefCppToC(cls) { - struct_.struct_.visit = web_plugin_info_visitor_visit; +CefWebPluginInfoVisitorCppToC::CefWebPluginInfoVisitorCppToC() { + GetStruct()->visit = web_plugin_info_visitor_visit; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived( + CefWrapperType type, cef_web_plugin_info_visitor_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -54,3 +62,6 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_WEB_PLUGIN_INFO_VISITOR; diff --git a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h index 8e4156171..a488e4e3c 100644 --- a/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h @@ -28,9 +28,8 @@ class CefWebPluginInfoVisitorCppToC : public CefCppToC { public: - explicit CefWebPluginInfoVisitorCppToC(CefWebPluginInfoVisitor* cls); + CefWebPluginInfoVisitorCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc index 2e42864dd..bb08ba849 100644 --- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc +++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. void CEF_CALLBACK web_plugin_unstable_callback_is_unstable( @@ -34,15 +36,21 @@ void CEF_CALLBACK web_plugin_unstable_callback_is_unstable( unstable?true:false); } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefWebPluginUnstableCallbackCppToC::CefWebPluginUnstableCallbackCppToC( - CefWebPluginUnstableCallback* cls) - : CefCppToC( - cls) { - struct_.struct_.is_unstable = web_plugin_unstable_callback_is_unstable; +CefWebPluginUnstableCallbackCppToC::CefWebPluginUnstableCallbackCppToC() { + GetStruct()->is_unstable = web_plugin_unstable_callback_is_unstable; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_web_plugin_unstable_callback_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -51,3 +59,7 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = + WT_WEB_PLUGIN_UNSTABLE_CALLBACK; diff --git a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h index 583c4d5e1..9d38cd0f3 100644 --- a/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h +++ b/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h @@ -28,10 +28,8 @@ class CefWebPluginUnstableCallbackCppToC : public CefCppToC { public: - explicit CefWebPluginUnstableCallbackCppToC( - CefWebPluginUnstableCallback* cls); + CefWebPluginUnstableCallbackCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.cc b/libcef_dll/cpptoc/write_handler_cpptoc.cc index dcf12daf6..6bbf35d77 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.cc +++ b/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -13,6 +13,8 @@ #include "libcef_dll/cpptoc/write_handler_cpptoc.h" +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, @@ -96,17 +98,24 @@ int CEF_CALLBACK write_handler_may_block(struct _cef_write_handler_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls) - : CefCppToC( - cls) { - struct_.struct_.write = write_handler_write; - struct_.struct_.seek = write_handler_seek; - struct_.struct_.tell = write_handler_tell; - struct_.struct_.flush = write_handler_flush; - struct_.struct_.may_block = write_handler_may_block; +CefWriteHandlerCppToC::CefWriteHandlerCppToC() { + GetStruct()->write = write_handler_write; + GetStruct()->seek = write_handler_seek; + GetStruct()->tell = write_handler_tell; + GetStruct()->flush = write_handler_flush; + GetStruct()->may_block = write_handler_may_block; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_write_handler_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -114,3 +123,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_WRITE_HANDLER; diff --git a/libcef_dll/cpptoc/write_handler_cpptoc.h b/libcef_dll/cpptoc/write_handler_cpptoc.h index a945c4b63..ec7039551 100644 --- a/libcef_dll/cpptoc/write_handler_cpptoc.h +++ b/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -28,9 +28,8 @@ class CefWriteHandlerCppToC : public CefCppToC { public: - explicit CefWriteHandlerCppToC(CefWriteHandler* cls); + CefWriteHandlerCppToC(); }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.cc b/libcef_dll/cpptoc/xml_reader_cpptoc.cc index a23830d0c..4b4ed4189 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.cc @@ -40,6 +40,8 @@ CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create(cef_stream_reader_t* stream, } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK xml_reader_move_to_next_node(struct _cef_xml_reader_t* self) { @@ -511,44 +513,48 @@ int CEF_CALLBACK xml_reader_move_to_carrying_element( return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls) - : CefCppToC(cls) { - struct_.struct_.move_to_next_node = xml_reader_move_to_next_node; - struct_.struct_.close = xml_reader_close; - struct_.struct_.has_error = xml_reader_has_error; - struct_.struct_.get_error = xml_reader_get_error; - struct_.struct_.get_type = xml_reader_get_type; - struct_.struct_.get_depth = xml_reader_get_depth; - struct_.struct_.get_local_name = xml_reader_get_local_name; - struct_.struct_.get_prefix = xml_reader_get_prefix; - struct_.struct_.get_qualified_name = xml_reader_get_qualified_name; - struct_.struct_.get_namespace_uri = xml_reader_get_namespace_uri; - struct_.struct_.get_base_uri = xml_reader_get_base_uri; - struct_.struct_.get_xml_lang = xml_reader_get_xml_lang; - struct_.struct_.is_empty_element = xml_reader_is_empty_element; - struct_.struct_.has_value = xml_reader_has_value; - struct_.struct_.get_value = xml_reader_get_value; - struct_.struct_.has_attributes = xml_reader_has_attributes; - struct_.struct_.get_attribute_count = xml_reader_get_attribute_count; - struct_.struct_.get_attribute_byindex = xml_reader_get_attribute_byindex; - struct_.struct_.get_attribute_byqname = xml_reader_get_attribute_byqname; - struct_.struct_.get_attribute_bylname = xml_reader_get_attribute_bylname; - struct_.struct_.get_inner_xml = xml_reader_get_inner_xml; - struct_.struct_.get_outer_xml = xml_reader_get_outer_xml; - struct_.struct_.get_line_number = xml_reader_get_line_number; - struct_.struct_.move_to_attribute_byindex = - xml_reader_move_to_attribute_byindex; - struct_.struct_.move_to_attribute_byqname = - xml_reader_move_to_attribute_byqname; - struct_.struct_.move_to_attribute_bylname = - xml_reader_move_to_attribute_bylname; - struct_.struct_.move_to_first_attribute = xml_reader_move_to_first_attribute; - struct_.struct_.move_to_next_attribute = xml_reader_move_to_next_attribute; - struct_.struct_.move_to_carrying_element = - xml_reader_move_to_carrying_element; +CefXmlReaderCppToC::CefXmlReaderCppToC() { + GetStruct()->move_to_next_node = xml_reader_move_to_next_node; + GetStruct()->close = xml_reader_close; + GetStruct()->has_error = xml_reader_has_error; + GetStruct()->get_error = xml_reader_get_error; + GetStruct()->get_type = xml_reader_get_type; + GetStruct()->get_depth = xml_reader_get_depth; + GetStruct()->get_local_name = xml_reader_get_local_name; + GetStruct()->get_prefix = xml_reader_get_prefix; + GetStruct()->get_qualified_name = xml_reader_get_qualified_name; + GetStruct()->get_namespace_uri = xml_reader_get_namespace_uri; + GetStruct()->get_base_uri = xml_reader_get_base_uri; + GetStruct()->get_xml_lang = xml_reader_get_xml_lang; + GetStruct()->is_empty_element = xml_reader_is_empty_element; + GetStruct()->has_value = xml_reader_has_value; + GetStruct()->get_value = xml_reader_get_value; + GetStruct()->has_attributes = xml_reader_has_attributes; + GetStruct()->get_attribute_count = xml_reader_get_attribute_count; + GetStruct()->get_attribute_byindex = xml_reader_get_attribute_byindex; + GetStruct()->get_attribute_byqname = xml_reader_get_attribute_byqname; + GetStruct()->get_attribute_bylname = xml_reader_get_attribute_bylname; + GetStruct()->get_inner_xml = xml_reader_get_inner_xml; + GetStruct()->get_outer_xml = xml_reader_get_outer_xml; + GetStruct()->get_line_number = xml_reader_get_line_number; + GetStruct()->move_to_attribute_byindex = xml_reader_move_to_attribute_byindex; + GetStruct()->move_to_attribute_byqname = xml_reader_move_to_attribute_byqname; + GetStruct()->move_to_attribute_bylname = xml_reader_move_to_attribute_bylname; + GetStruct()->move_to_first_attribute = xml_reader_move_to_first_attribute; + GetStruct()->move_to_next_attribute = xml_reader_move_to_next_attribute; + GetStruct()->move_to_carrying_element = xml_reader_move_to_carrying_element; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_xml_reader_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -556,3 +562,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_XML_READER; diff --git a/libcef_dll/cpptoc/xml_reader_cpptoc.h b/libcef_dll/cpptoc/xml_reader_cpptoc.h index 29a79239d..08c56b9bf 100644 --- a/libcef_dll/cpptoc/xml_reader_cpptoc.h +++ b/libcef_dll/cpptoc/xml_reader_cpptoc.h @@ -27,9 +27,8 @@ class CefXmlReaderCppToC : public CefCppToC { public: - explicit CefXmlReaderCppToC(CefXmlReader* cls); + CefXmlReaderCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_XML_READER_CPPTOC_H_ - diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.cc b/libcef_dll/cpptoc/zip_reader_cpptoc.cc index 0fd9b17c1..e579ce30a 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.cc +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.cc @@ -34,6 +34,8 @@ CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( } +namespace { + // MEMBER FUNCTIONS - Body may be edited by hand. int CEF_CALLBACK zip_reader_move_to_first_file(struct _cef_zip_reader_t* self) { @@ -223,23 +225,31 @@ int CEF_CALLBACK zip_reader_eof(struct _cef_zip_reader_t* self) { return _retval; } +} // namespace + // CONSTRUCTOR - Do not edit by hand. -CefZipReaderCppToC::CefZipReaderCppToC(CefZipReader* cls) - : CefCppToC(cls) { - struct_.struct_.move_to_first_file = zip_reader_move_to_first_file; - struct_.struct_.move_to_next_file = zip_reader_move_to_next_file; - struct_.struct_.move_to_file = zip_reader_move_to_file; - struct_.struct_.close = zip_reader_close; - struct_.struct_.get_file_name = zip_reader_get_file_name; - struct_.struct_.get_file_size = zip_reader_get_file_size; - struct_.struct_.get_file_last_modified = zip_reader_get_file_last_modified; - struct_.struct_.open_file = zip_reader_open_file; - struct_.struct_.close_file = zip_reader_close_file; - struct_.struct_.read_file = zip_reader_read_file; - struct_.struct_.tell = zip_reader_tell; - struct_.struct_.eof = zip_reader_eof; +CefZipReaderCppToC::CefZipReaderCppToC() { + GetStruct()->move_to_first_file = zip_reader_move_to_first_file; + GetStruct()->move_to_next_file = zip_reader_move_to_next_file; + GetStruct()->move_to_file = zip_reader_move_to_file; + GetStruct()->close = zip_reader_close; + GetStruct()->get_file_name = zip_reader_get_file_name; + GetStruct()->get_file_size = zip_reader_get_file_size; + GetStruct()->get_file_last_modified = zip_reader_get_file_last_modified; + GetStruct()->open_file = zip_reader_open_file; + GetStruct()->close_file = zip_reader_close_file; + GetStruct()->read_file = zip_reader_read_file; + GetStruct()->tell = zip_reader_tell; + GetStruct()->eof = zip_reader_eof; +} + +template<> CefRefPtr CefCppToC::UnwrapDerived(CefWrapperType type, + cef_zip_reader_t* s) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; } #ifndef NDEBUG @@ -247,3 +257,5 @@ template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; #endif +template<> CefWrapperType CefCppToC::kWrapperType = WT_ZIP_READER; diff --git a/libcef_dll/cpptoc/zip_reader_cpptoc.h b/libcef_dll/cpptoc/zip_reader_cpptoc.h index 0b78ab1b7..fe93815f7 100644 --- a/libcef_dll/cpptoc/zip_reader_cpptoc.h +++ b/libcef_dll/cpptoc/zip_reader_cpptoc.h @@ -27,9 +27,8 @@ class CefZipReaderCppToC : public CefCppToC { public: - explicit CefZipReaderCppToC(CefZipReader* cls); + CefZipReaderCppToC(); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_ZIP_READER_CPPTOC_H_ - diff --git a/libcef_dll/ctocpp/app_ctocpp.cc b/libcef_dll/ctocpp/app_ctocpp.cc index cf1c779e6..55c8da21e 100644 --- a/libcef_dll/ctocpp/app_ctocpp.cc +++ b/libcef_dll/ctocpp/app_ctocpp.cc @@ -22,7 +22,8 @@ void CefAppCToCpp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr command_line) { - if (CEF_MEMBER_MISSING(struct_, on_before_command_line_processing)) + cef_app_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_command_line_processing)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -34,14 +35,15 @@ void CefAppCToCpp::OnBeforeCommandLineProcessing(const CefString& process_type, // Unverified params: process_type // Execute - struct_->on_before_command_line_processing(struct_, + _struct->on_before_command_line_processing(_struct, process_type.GetStruct(), CefCommandLineCppToC::Wrap(command_line)); } void CefAppCToCpp::OnRegisterCustomSchemes( CefRefPtr registrar) { - if (CEF_MEMBER_MISSING(struct_, on_register_custom_schemes)) + cef_app_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_register_custom_schemes)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -52,55 +54,71 @@ void CefAppCToCpp::OnRegisterCustomSchemes( return; // Execute - struct_->on_register_custom_schemes(struct_, + _struct->on_register_custom_schemes(_struct, CefSchemeRegistrarCppToC::Wrap(registrar)); } CefRefPtr CefAppCToCpp::GetResourceBundleHandler() { - if (CEF_MEMBER_MISSING(struct_, get_resource_bundle_handler)) + cef_app_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_resource_bundle_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_resource_bundle_handler_t* _retval = struct_->get_resource_bundle_handler( - struct_); + cef_resource_bundle_handler_t* _retval = _struct->get_resource_bundle_handler( + _struct); // Return type: refptr_same return CefResourceBundleHandlerCToCpp::Wrap(_retval); } CefRefPtr CefAppCToCpp::GetBrowserProcessHandler() { - if (CEF_MEMBER_MISSING(struct_, get_browser_process_handler)) + cef_app_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_browser_process_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_process_handler_t* _retval = struct_->get_browser_process_handler( - struct_); + cef_browser_process_handler_t* _retval = _struct->get_browser_process_handler( + _struct); // Return type: refptr_same return CefBrowserProcessHandlerCToCpp::Wrap(_retval); } CefRefPtr CefAppCToCpp::GetRenderProcessHandler() { - if (CEF_MEMBER_MISSING(struct_, get_render_process_handler)) + cef_app_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_render_process_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_render_process_handler_t* _retval = struct_->get_render_process_handler( - struct_); + cef_render_process_handler_t* _retval = _struct->get_render_process_handler( + _struct); // Return type: refptr_same return CefRenderProcessHandlerCToCpp::Wrap(_retval); } +// CONSTRUCTOR - Do not edit by hand. + +CefAppCToCpp::CefAppCToCpp() { +} + +template<> cef_app_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefApp* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_APP; diff --git a/libcef_dll/ctocpp/app_ctocpp.h b/libcef_dll/ctocpp/app_ctocpp.h index 7c870d060..418d8e859 100644 --- a/libcef_dll/ctocpp/app_ctocpp.h +++ b/libcef_dll/ctocpp/app_ctocpp.h @@ -27,10 +27,9 @@ class CefAppCToCpp : public CefCToCpp { public: - explicit CefAppCToCpp(cef_app_t* str) - : CefCToCpp(str) {} + CefAppCToCpp(); - // CefApp methods + // CefApp methods. void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr command_line) override; void OnRegisterCustomSchemes( @@ -42,4 +41,3 @@ class CefAppCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_APP_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.cc b/libcef_dll/ctocpp/auth_callback_ctocpp.cc index ce5a8307d..86709d6e5 100644 --- a/libcef_dll/ctocpp/auth_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/auth_callback_ctocpp.cc @@ -17,7 +17,8 @@ void CefAuthCallbackCToCpp::Continue(const CefString& username, const CefString& password) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_auth_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -32,24 +33,39 @@ void CefAuthCallbackCToCpp::Continue(const CefString& username, return; // Execute - struct_->cont(struct_, + _struct->cont(_struct, username.GetStruct(), password.GetStruct()); } void CefAuthCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_auth_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefAuthCallbackCToCpp::CefAuthCallbackCToCpp() { +} + +template<> cef_auth_callback_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefAuthCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_AUTH_CALLBACK; diff --git a/libcef_dll/ctocpp/auth_callback_ctocpp.h b/libcef_dll/ctocpp/auth_callback_ctocpp.h index e4b8b4e7f..7bc749ea2 100644 --- a/libcef_dll/ctocpp/auth_callback_ctocpp.h +++ b/libcef_dll/ctocpp/auth_callback_ctocpp.h @@ -28,16 +28,12 @@ class CefAuthCallbackCToCpp : public CefCToCpp { public: - explicit CefAuthCallbackCToCpp(cef_auth_callback_t* str) - : CefCToCpp( - str) {} + CefAuthCallbackCToCpp(); - // CefAuthCallback methods - virtual void Continue(const CefString& username, - const CefString& password) OVERRIDE; - virtual void Cancel() OVERRIDE; + // CefAuthCallback methods. + void Continue(const CefString& username, const CefString& password) OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/base_ctocpp.cc b/libcef_dll/ctocpp/base_ctocpp.cc new file mode 100644 index 000000000..f4c54f370 --- /dev/null +++ b/libcef_dll/ctocpp/base_ctocpp.cc @@ -0,0 +1,22 @@ +// 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. + +#include "libcef_dll/ctocpp/base_ctocpp.h" + +CefBaseCToCpp::CefBaseCToCpp() { +} + +template<> cef_base_t* CefCToCpp:: + UnwrapDerived(CefWrapperType type, CefBase* c) { + NOTREACHED(); + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp:: + kWrapperType = WT_BASE; diff --git a/libcef_dll/ctocpp/base_ctocpp.h b/libcef_dll/ctocpp/base_ctocpp.h index f085183b1..e5e4b4b7a 100644 --- a/libcef_dll/ctocpp/base_ctocpp.h +++ b/libcef_dll/ctocpp/base_ctocpp.h @@ -6,96 +6,20 @@ #define CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ #pragma once -#include "include/base/cef_logging.h" -#include "include/base/cef_macros.h" #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" +#ifndef BUILDING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed DLL-side only") +#else // BUILDING_CEF_SHARED -// CefCToCpp implementation for CefBase. -class CefBaseCToCpp : public CefBase { +// Wrap a C structure with a C++ class. +class CefBaseCToCpp + : public CefCToCpp { public: - // Use this method to create a wrapper class instance for a structure - // received from the other side. - static CefRefPtr Wrap(cef_base_t* s) { - if (!s) - return NULL; - - // Wrap their structure with the CefCToCpp object. - CefBaseCToCpp* wrapper = new CefBaseCToCpp(s); - // Put the wrapper object in a smart pointer. - CefRefPtr wrapperPtr(wrapper); - // Release the reference that was added to the CefCppToC wrapper object on - // the other side before their structure was passed to us. - wrapper->UnderlyingRelease(); - // Return the smart pointer. - return wrapperPtr; - } - - // Use this method to retrieve the underlying structure from a wrapper class - // instance for return back to the other side. - static cef_base_t* Unwrap(CefRefPtr c) { - if (!c.get()) - return NULL; - - // Cast the object to our wrapper class type. - CefBaseCToCpp* wrapper = static_cast(c.get()); - // Add a reference to the CefCppToC wrapper object on the other side that - // will be released once the structure is received. - wrapper->UnderlyingAddRef(); - // Return their original structure. - return wrapper->GetStruct(); - } - - explicit CefBaseCToCpp(cef_base_t* str) - : struct_(str) { - DCHECK(str); - } - virtual ~CefBaseCToCpp() {} - - // If returning the structure across the DLL boundary you should call - // UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of - // the DLL boundary, call Release() on the CefCppToC object. - cef_base_t* GetStruct() { return struct_; } - - // CefBase methods increment/decrement reference counts on both this object - // and the underlying wrapped structure. - void AddRef() const { - UnderlyingAddRef(); - ref_count_.AddRef(); - } - bool Release() const { - UnderlyingRelease(); - if (ref_count_.Release()) { - delete this; - return true; - } - return false; - } - bool HasOneRef() const { return ref_count_.HasOneRef(); } - - // Increment/decrement reference counts on only the underlying class. - void UnderlyingAddRef() const { - if (struct_->add_ref) - struct_->add_ref(struct_); - } - bool UnderlyingRelease() const { - if (!struct_->release) - return false; - return struct_->release(struct_) ? true : false; - } - bool UnderlyingHasOneRef() const { - if (!struct_->has_one_ref) - return false; - return struct_->has_one_ref(struct_) ? true : false; - } - - private: - CefRefCount ref_count_; - cef_base_t* struct_; - - DISALLOW_COPY_AND_ASSIGN(CefBaseCToCpp); + CefBaseCToCpp(); }; - +#endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc index 602df784d..55818d4da 100644 --- a/libcef_dll/ctocpp/before_download_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.cc @@ -17,7 +17,8 @@ void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path, bool show_dialog) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_before_download_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -25,15 +26,30 @@ void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path, // Unverified params: download_path // Execute - struct_->cont(struct_, + _struct->cont(_struct, download_path.GetStruct(), show_dialog); } +// CONSTRUCTOR - Do not edit by hand. + +CefBeforeDownloadCallbackCToCpp::CefBeforeDownloadCallbackCToCpp() { +} + +template<> cef_before_download_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefBeforeDownloadCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_BEFORE_DOWNLOAD_CALLBACK; diff --git a/libcef_dll/ctocpp/before_download_callback_ctocpp.h b/libcef_dll/ctocpp/before_download_callback_ctocpp.h index 25042ba8e..da9e64440 100644 --- a/libcef_dll/ctocpp/before_download_callback_ctocpp.h +++ b/libcef_dll/ctocpp/before_download_callback_ctocpp.h @@ -28,15 +28,11 @@ class CefBeforeDownloadCallbackCToCpp : public CefCToCpp { public: - explicit CefBeforeDownloadCallbackCToCpp(cef_before_download_callback_t* str) - : CefCToCpp(str) {} + CefBeforeDownloadCallbackCToCpp(); - // CefBeforeDownloadCallback methods - virtual void Continue(const CefString& download_path, - bool show_dialog) OVERRIDE; + // CefBeforeDownloadCallback methods. + void Continue(const CefString& download_path, bool show_dialog) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.cc b/libcef_dll/ctocpp/binary_value_ctocpp.cc index e9f71e350..414fc5661 100644 --- a/libcef_dll/ctocpp/binary_value_ctocpp.cc +++ b/libcef_dll/ctocpp/binary_value_ctocpp.cc @@ -37,33 +37,36 @@ CefRefPtr CefBinaryValue::Create(const void* data, // VIRTUAL METHODS - Body may be edited by hand. bool CefBinaryValueCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefBinaryValueCToCpp::IsOwned() { - if (CEF_MEMBER_MISSING(struct_, is_owned)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_owned)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_owned(struct_); + int _retval = _struct->is_owned(_struct); // Return type: bool return _retval?true:false; } bool CefBinaryValueCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -74,7 +77,7 @@ bool CefBinaryValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefBinaryValueCToCpp::Unwrap(that)); // Return type: bool @@ -82,7 +85,8 @@ bool CefBinaryValueCToCpp::IsSame(CefRefPtr that) { } bool CefBinaryValueCToCpp::IsEqual(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_equal)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_equal)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -93,7 +97,7 @@ bool CefBinaryValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_equal(struct_, + int _retval = _struct->is_equal(_struct, CefBinaryValueCToCpp::Unwrap(that)); // Return type: bool @@ -101,26 +105,28 @@ bool CefBinaryValueCToCpp::IsEqual(CefRefPtr that) { } CefRefPtr CefBinaryValueCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = struct_->copy(struct_); + cef_binary_value_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } size_t CefBinaryValueCToCpp::GetSize() { - if (CEF_MEMBER_MISSING(struct_, get_size)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_size(struct_); + size_t _retval = _struct->get_size(_struct); // Return type: simple return _retval; @@ -128,7 +134,8 @@ size_t CefBinaryValueCToCpp::GetSize() { size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, size_t data_offset) { - if (CEF_MEMBER_MISSING(struct_, get_data)) + cef_binary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_data)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -139,7 +146,7 @@ size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, return 0; // Execute - size_t _retval = struct_->get_data(struct_, + size_t _retval = _struct->get_data(_struct, buffer, buffer_size, data_offset); @@ -149,8 +156,22 @@ size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, } +// CONSTRUCTOR - Do not edit by hand. + +CefBinaryValueCToCpp::CefBinaryValueCToCpp() { +} + +template<> cef_binary_value_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefBinaryValue* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_BINARY_VALUE; diff --git a/libcef_dll/ctocpp/binary_value_ctocpp.h b/libcef_dll/ctocpp/binary_value_ctocpp.h index 01e805701..8520c9267 100644 --- a/libcef_dll/ctocpp/binary_value_ctocpp.h +++ b/libcef_dll/ctocpp/binary_value_ctocpp.h @@ -28,21 +28,17 @@ class CefBinaryValueCToCpp : public CefCToCpp { public: - explicit CefBinaryValueCToCpp(cef_binary_value_t* str) - : CefCToCpp( - str) {} + CefBinaryValueCToCpp(); - // CefBinaryValue methods - virtual bool IsValid() OVERRIDE; - virtual bool IsOwned() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool IsEqual(CefRefPtr that) OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual size_t GetSize() OVERRIDE; - virtual size_t GetData(void* buffer, size_t buffer_size, - size_t data_offset) OVERRIDE; + // CefBinaryValue methods. + bool IsValid() OVERRIDE; + bool IsOwned() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool IsEqual(CefRefPtr that) OVERRIDE; + CefRefPtr Copy() OVERRIDE; + size_t GetSize() OVERRIDE; + size_t GetData(void* buffer, size_t buffer_size, size_t data_offset) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index c97e3e75f..95e268052 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -21,122 +21,133 @@ // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefBrowserCToCpp::GetHost() { - if (CEF_MEMBER_MISSING(struct_, get_host)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_host)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_host_t* _retval = struct_->get_host(struct_); + cef_browser_host_t* _retval = _struct->get_host(_struct); // Return type: refptr_same return CefBrowserHostCToCpp::Wrap(_retval); } bool CefBrowserCToCpp::CanGoBack() { - if (CEF_MEMBER_MISSING(struct_, can_go_back)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, can_go_back)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->can_go_back(struct_); + int _retval = _struct->can_go_back(_struct); // Return type: bool return _retval?true:false; } void CefBrowserCToCpp::GoBack() { - if (CEF_MEMBER_MISSING(struct_, go_back)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, go_back)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->go_back(struct_); + _struct->go_back(_struct); } bool CefBrowserCToCpp::CanGoForward() { - if (CEF_MEMBER_MISSING(struct_, can_go_forward)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, can_go_forward)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->can_go_forward(struct_); + int _retval = _struct->can_go_forward(_struct); // Return type: bool return _retval?true:false; } void CefBrowserCToCpp::GoForward() { - if (CEF_MEMBER_MISSING(struct_, go_forward)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, go_forward)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->go_forward(struct_); + _struct->go_forward(_struct); } bool CefBrowserCToCpp::IsLoading() { - if (CEF_MEMBER_MISSING(struct_, is_loading)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_loading)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_loading(struct_); + int _retval = _struct->is_loading(_struct); // Return type: bool return _retval?true:false; } void CefBrowserCToCpp::Reload() { - if (CEF_MEMBER_MISSING(struct_, reload)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, reload)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->reload(struct_); + _struct->reload(_struct); } void CefBrowserCToCpp::ReloadIgnoreCache() { - if (CEF_MEMBER_MISSING(struct_, reload_ignore_cache)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, reload_ignore_cache)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->reload_ignore_cache(struct_); + _struct->reload_ignore_cache(_struct); } void CefBrowserCToCpp::StopLoad() { - if (CEF_MEMBER_MISSING(struct_, stop_load)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, stop_load)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->stop_load(struct_); + _struct->stop_load(_struct); } int CefBrowserCToCpp::GetIdentifier() { - if (CEF_MEMBER_MISSING(struct_, get_identifier)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_identifier)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_identifier(struct_); + int _retval = _struct->get_identifier(_struct); // Return type: simple return _retval; } bool CefBrowserCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -147,7 +158,7 @@ bool CefBrowserCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefBrowserCToCpp::Unwrap(that)); // Return type: bool @@ -155,65 +166,70 @@ bool CefBrowserCToCpp::IsSame(CefRefPtr that) { } bool CefBrowserCToCpp::IsPopup() { - if (CEF_MEMBER_MISSING(struct_, is_popup)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_popup)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_popup(struct_); + int _retval = _struct->is_popup(_struct); // Return type: bool return _retval?true:false; } bool CefBrowserCToCpp::HasDocument() { - if (CEF_MEMBER_MISSING(struct_, has_document)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_document)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_document(struct_); + int _retval = _struct->has_document(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefBrowserCToCpp::GetMainFrame() { - if (CEF_MEMBER_MISSING(struct_, get_main_frame)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_main_frame)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = struct_->get_main_frame(struct_); + cef_frame_t* _retval = _struct->get_main_frame(_struct); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); } CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { - if (CEF_MEMBER_MISSING(struct_, get_focused_frame)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_focused_frame)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = struct_->get_focused_frame(struct_); + cef_frame_t* _retval = _struct->get_focused_frame(_struct); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); } CefRefPtr CefBrowserCToCpp::GetFrame(int64 identifier) { - if (CEF_MEMBER_MISSING(struct_, get_frame_byident)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_byident)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = struct_->get_frame_byident(struct_, + cef_frame_t* _retval = _struct->get_frame_byident(_struct, identifier); // Return type: refptr_same @@ -221,7 +237,8 @@ CefRefPtr CefBrowserCToCpp::GetFrame(int64 identifier) { } CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, get_frame)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -229,7 +246,7 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { // Unverified params: name // Execute - cef_frame_t* _retval = struct_->get_frame(struct_, + cef_frame_t* _retval = _struct->get_frame(_struct, name.GetStruct()); // Return type: refptr_same @@ -237,20 +254,22 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { } size_t CefBrowserCToCpp::GetFrameCount() { - if (CEF_MEMBER_MISSING(struct_, get_frame_count)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_frame_count(struct_); + size_t _retval = _struct->get_frame_count(_struct); // Return type: simple return _retval; } void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { - if (CEF_MEMBER_MISSING(struct_, get_frame_identifiers)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_identifiers)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -273,7 +292,7 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { } // Execute - struct_->get_frame_identifiers(struct_, + _struct->get_frame_identifiers(_struct, &identifiersCount, identifiersList); @@ -288,7 +307,8 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { } void CefBrowserCToCpp::GetFrameNames(std::vector& names) { - if (CEF_MEMBER_MISSING(struct_, get_frame_names)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_names)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -300,7 +320,7 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) { transfer_string_list_contents(names, namesList); // Execute - struct_->get_frame_names(struct_, + _struct->get_frame_names(_struct, namesList); // Restore param:names; type: string_vec_byref @@ -313,7 +333,8 @@ void CefBrowserCToCpp::GetFrameNames(std::vector& names) { bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, CefRefPtr message) { - if (CEF_MEMBER_MISSING(struct_, send_process_message)) + cef_browser_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_process_message)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -324,7 +345,7 @@ bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, return false; // Execute - int _retval = struct_->send_process_message(struct_, + int _retval = _struct->send_process_message(_struct, target_process, CefProcessMessageCToCpp::Unwrap(message)); @@ -333,8 +354,21 @@ bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, } +// CONSTRUCTOR - Do not edit by hand. + +CefBrowserCToCpp::CefBrowserCToCpp() { +} + +template<> cef_browser_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefBrowser* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_BROWSER; diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index c18bfd602..3e8f805b2 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -30,34 +30,32 @@ class CefBrowserCToCpp : public CefCToCpp { public: - explicit CefBrowserCToCpp(cef_browser_t* str) - : CefCToCpp(str) {} + CefBrowserCToCpp(); - // CefBrowser methods - virtual CefRefPtr GetHost() OVERRIDE; - virtual bool CanGoBack() OVERRIDE; - virtual void GoBack() OVERRIDE; - virtual bool CanGoForward() OVERRIDE; - virtual void GoForward() OVERRIDE; - virtual bool IsLoading() OVERRIDE; - virtual void Reload() OVERRIDE; - virtual void ReloadIgnoreCache() OVERRIDE; - virtual void StopLoad() OVERRIDE; - virtual int GetIdentifier() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool IsPopup() OVERRIDE; - virtual bool HasDocument() OVERRIDE; - virtual CefRefPtr GetMainFrame() OVERRIDE; - virtual CefRefPtr GetFocusedFrame() OVERRIDE; - virtual CefRefPtr GetFrame(int64 identifier) OVERRIDE; - virtual CefRefPtr GetFrame(const CefString& name) OVERRIDE; - virtual size_t GetFrameCount() OVERRIDE; - virtual void GetFrameIdentifiers(std::vector& identifiers) OVERRIDE; - virtual void GetFrameNames(std::vector& names) OVERRIDE; - virtual bool SendProcessMessage(CefProcessId target_process, + // CefBrowser methods. + CefRefPtr GetHost() OVERRIDE; + bool CanGoBack() OVERRIDE; + void GoBack() OVERRIDE; + bool CanGoForward() OVERRIDE; + void GoForward() OVERRIDE; + bool IsLoading() OVERRIDE; + void Reload() OVERRIDE; + void ReloadIgnoreCache() OVERRIDE; + void StopLoad() OVERRIDE; + int GetIdentifier() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool IsPopup() OVERRIDE; + bool HasDocument() OVERRIDE; + CefRefPtr GetMainFrame() OVERRIDE; + CefRefPtr GetFocusedFrame() OVERRIDE; + CefRefPtr GetFrame(int64 identifier) OVERRIDE; + CefRefPtr GetFrame(const CefString& name) OVERRIDE; + size_t GetFrameCount() OVERRIDE; + void GetFrameIdentifiers(std::vector& identifiers) OVERRIDE; + void GetFrameNames(std::vector& names) OVERRIDE; + bool SendProcessMessage(CefProcessId target_process, CefRefPtr message) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.cc b/libcef_dll/ctocpp/browser_host_ctocpp.cc index 1d6b220e3..3b9800e2b 100644 --- a/libcef_dll/ctocpp/browser_host_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_host_ctocpp.cc @@ -66,124 +66,134 @@ CefRefPtr CefBrowserHost::CreateBrowserSync( // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefBrowserHostCToCpp::GetBrowser() { - if (CEF_MEMBER_MISSING(struct_, get_browser)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_browser)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_t* _retval = struct_->get_browser(struct_); + cef_browser_t* _retval = _struct->get_browser(_struct); // Return type: refptr_same return CefBrowserCToCpp::Wrap(_retval); } void CefBrowserHostCToCpp::CloseBrowser(bool force_close) { - if (CEF_MEMBER_MISSING(struct_, close_browser)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, close_browser)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->close_browser(struct_, + _struct->close_browser(_struct, force_close); } void CefBrowserHostCToCpp::SetFocus(bool focus) { - if (CEF_MEMBER_MISSING(struct_, set_focus)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_focus)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_focus(struct_, + _struct->set_focus(_struct, focus); } void CefBrowserHostCToCpp::SetWindowVisibility(bool visible) { - if (CEF_MEMBER_MISSING(struct_, set_window_visibility)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_window_visibility)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_window_visibility(struct_, + _struct->set_window_visibility(_struct, visible); } CefWindowHandle CefBrowserHostCToCpp::GetWindowHandle() { - if (CEF_MEMBER_MISSING(struct_, get_window_handle)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_window_handle)) return kNullWindowHandle; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_window_handle_t _retval = struct_->get_window_handle(struct_); + cef_window_handle_t _retval = _struct->get_window_handle(_struct); // Return type: simple return _retval; } CefWindowHandle CefBrowserHostCToCpp::GetOpenerWindowHandle() { - if (CEF_MEMBER_MISSING(struct_, get_opener_window_handle)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_opener_window_handle)) return kNullWindowHandle; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_window_handle_t _retval = struct_->get_opener_window_handle(struct_); + cef_window_handle_t _retval = _struct->get_opener_window_handle(_struct); // Return type: simple return _retval; } CefRefPtr CefBrowserHostCToCpp::GetClient() { - if (CEF_MEMBER_MISSING(struct_, get_client)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_client)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_client_t* _retval = struct_->get_client(struct_); + cef_client_t* _retval = _struct->get_client(_struct); // Return type: refptr_diff return CefClientCppToC::Unwrap(_retval); } CefRefPtr CefBrowserHostCToCpp::GetRequestContext() { - if (CEF_MEMBER_MISSING(struct_, get_request_context)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_request_context)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_request_context_t* _retval = struct_->get_request_context(struct_); + cef_request_context_t* _retval = _struct->get_request_context(_struct); // Return type: refptr_same return CefRequestContextCToCpp::Wrap(_retval); } double CefBrowserHostCToCpp::GetZoomLevel() { - if (CEF_MEMBER_MISSING(struct_, get_zoom_level)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_zoom_level)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - double _retval = struct_->get_zoom_level(struct_); + double _retval = _struct->get_zoom_level(_struct); // Return type: simple return _retval; } void CefBrowserHostCToCpp::SetZoomLevel(double zoomLevel) { - if (CEF_MEMBER_MISSING(struct_, set_zoom_level)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_zoom_level)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_zoom_level(struct_, + _struct->set_zoom_level(_struct, zoomLevel); } @@ -191,7 +201,8 @@ void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, run_file_dialog)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, run_file_dialog)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -213,7 +224,7 @@ void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, transfer_string_list_contents(accept_filters, accept_filtersList); // Execute - struct_->run_file_dialog(struct_, + _struct->run_file_dialog(_struct, mode, title.GetStruct(), default_file_path.GetStruct(), @@ -227,7 +238,8 @@ void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, } void CefBrowserHostCToCpp::StartDownload(const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, start_download)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, start_download)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -238,23 +250,25 @@ void CefBrowserHostCToCpp::StartDownload(const CefString& url) { return; // Execute - struct_->start_download(struct_, + _struct->start_download(_struct, url.GetStruct()); } void CefBrowserHostCToCpp::Print() { - if (CEF_MEMBER_MISSING(struct_, print)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, print)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->print(struct_); + _struct->print(_struct); } void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext) { - if (CEF_MEMBER_MISSING(struct_, find)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, find)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -265,7 +279,7 @@ void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, return; // Execute - struct_->find(struct_, + _struct->find(_struct, identifier, searchText.GetStruct(), forward, @@ -274,20 +288,22 @@ void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, } void CefBrowserHostCToCpp::StopFinding(bool clearSelection) { - if (CEF_MEMBER_MISSING(struct_, stop_finding)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, stop_finding)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->stop_finding(struct_, + _struct->stop_finding(_struct, clearSelection); } void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, CefRefPtr client, const CefBrowserSettings& settings, const CefPoint& inspect_element_at) { - if (CEF_MEMBER_MISSING(struct_, show_dev_tools)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, show_dev_tools)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -299,7 +315,7 @@ void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, // Unverified params: inspect_element_at // Execute - struct_->show_dev_tools(struct_, + _struct->show_dev_tools(_struct, &windowInfo, CefClientCppToC::Wrap(client), &settings, @@ -307,18 +323,20 @@ void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, } void CefBrowserHostCToCpp::CloseDevTools() { - if (CEF_MEMBER_MISSING(struct_, close_dev_tools)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, close_dev_tools)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->close_dev_tools(struct_); + _struct->close_dev_tools(_struct); } void CefBrowserHostCToCpp::GetNavigationEntries( CefRefPtr visitor, bool current_only) { - if (CEF_MEMBER_MISSING(struct_, get_navigation_entries)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_navigation_entries)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -329,37 +347,40 @@ void CefBrowserHostCToCpp::GetNavigationEntries( return; // Execute - struct_->get_navigation_entries(struct_, + _struct->get_navigation_entries(_struct, CefNavigationEntryVisitorCppToC::Wrap(visitor), current_only); } void CefBrowserHostCToCpp::SetMouseCursorChangeDisabled(bool disabled) { - if (CEF_MEMBER_MISSING(struct_, set_mouse_cursor_change_disabled)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_mouse_cursor_change_disabled)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_mouse_cursor_change_disabled(struct_, + _struct->set_mouse_cursor_change_disabled(_struct, disabled); } bool CefBrowserHostCToCpp::IsMouseCursorChangeDisabled() { - if (CEF_MEMBER_MISSING(struct_, is_mouse_cursor_change_disabled)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_mouse_cursor_change_disabled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_mouse_cursor_change_disabled(struct_); + int _retval = _struct->is_mouse_cursor_change_disabled(_struct); // Return type: bool return _retval?true:false; } void CefBrowserHostCToCpp::ReplaceMisspelling(const CefString& word) { - if (CEF_MEMBER_MISSING(struct_, replace_misspelling)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, replace_misspelling)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -370,12 +391,13 @@ void CefBrowserHostCToCpp::ReplaceMisspelling(const CefString& word) { return; // Execute - struct_->replace_misspelling(struct_, + _struct->replace_misspelling(_struct, word.GetStruct()); } void CefBrowserHostCToCpp::AddWordToDictionary(const CefString& word) { - if (CEF_MEMBER_MISSING(struct_, add_word_to_dictionary)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_word_to_dictionary)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -386,85 +408,92 @@ void CefBrowserHostCToCpp::AddWordToDictionary(const CefString& word) { return; // Execute - struct_->add_word_to_dictionary(struct_, + _struct->add_word_to_dictionary(_struct, word.GetStruct()); } bool CefBrowserHostCToCpp::IsWindowRenderingDisabled() { - if (CEF_MEMBER_MISSING(struct_, is_window_rendering_disabled)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_window_rendering_disabled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_window_rendering_disabled(struct_); + int _retval = _struct->is_window_rendering_disabled(_struct); // Return type: bool return _retval?true:false; } void CefBrowserHostCToCpp::WasResized() { - if (CEF_MEMBER_MISSING(struct_, was_resized)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, was_resized)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->was_resized(struct_); + _struct->was_resized(_struct); } void CefBrowserHostCToCpp::WasHidden(bool hidden) { - if (CEF_MEMBER_MISSING(struct_, was_hidden)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, was_hidden)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->was_hidden(struct_, + _struct->was_hidden(_struct, hidden); } void CefBrowserHostCToCpp::NotifyScreenInfoChanged() { - if (CEF_MEMBER_MISSING(struct_, notify_screen_info_changed)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, notify_screen_info_changed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->notify_screen_info_changed(struct_); + _struct->notify_screen_info_changed(_struct); } void CefBrowserHostCToCpp::Invalidate(PaintElementType type) { - if (CEF_MEMBER_MISSING(struct_, invalidate)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, invalidate)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->invalidate(struct_, + _struct->invalidate(_struct, type); } void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) { - if (CEF_MEMBER_MISSING(struct_, send_key_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_key_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_key_event(struct_, + _struct->send_key_event(_struct, &event); } void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event, MouseButtonType type, bool mouseUp, int clickCount) { - if (CEF_MEMBER_MISSING(struct_, send_mouse_click_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_mouse_click_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_mouse_click_event(struct_, + _struct->send_mouse_click_event(_struct, &event, type, mouseUp, @@ -473,70 +502,76 @@ void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event, void CefBrowserHostCToCpp::SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) { - if (CEF_MEMBER_MISSING(struct_, send_mouse_move_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_mouse_move_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_mouse_move_event(struct_, + _struct->send_mouse_move_event(_struct, &event, mouseLeave); } void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event, int deltaX, int deltaY) { - if (CEF_MEMBER_MISSING(struct_, send_mouse_wheel_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_mouse_wheel_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_mouse_wheel_event(struct_, + _struct->send_mouse_wheel_event(_struct, &event, deltaX, deltaY); } void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) { - if (CEF_MEMBER_MISSING(struct_, send_focus_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_focus_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_focus_event(struct_, + _struct->send_focus_event(_struct, setFocus); } void CefBrowserHostCToCpp::SendCaptureLostEvent() { - if (CEF_MEMBER_MISSING(struct_, send_capture_lost_event)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, send_capture_lost_event)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->send_capture_lost_event(struct_); + _struct->send_capture_lost_event(_struct); } void CefBrowserHostCToCpp::NotifyMoveOrResizeStarted() { - if (CEF_MEMBER_MISSING(struct_, notify_move_or_resize_started)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, notify_move_or_resize_started)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->notify_move_or_resize_started(struct_); + _struct->notify_move_or_resize_started(_struct); } CefTextInputContext CefBrowserHostCToCpp::GetNSTextInputContext() { - if (CEF_MEMBER_MISSING(struct_, get_nstext_input_context)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_nstext_input_context)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_text_input_context_t _retval = struct_->get_nstext_input_context(struct_); + cef_text_input_context_t _retval = _struct->get_nstext_input_context(_struct); // Return type: simple return _retval; @@ -544,31 +579,34 @@ CefTextInputContext CefBrowserHostCToCpp::GetNSTextInputContext() { void CefBrowserHostCToCpp::HandleKeyEventBeforeTextInputClient( CefEventHandle keyEvent) { - if (CEF_MEMBER_MISSING(struct_, handle_key_event_before_text_input_client)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, handle_key_event_before_text_input_client)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->handle_key_event_before_text_input_client(struct_, + _struct->handle_key_event_before_text_input_client(_struct, keyEvent); } void CefBrowserHostCToCpp::HandleKeyEventAfterTextInputClient( CefEventHandle keyEvent) { - if (CEF_MEMBER_MISSING(struct_, handle_key_event_after_text_input_client)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, handle_key_event_after_text_input_client)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->handle_key_event_after_text_input_client(struct_, + _struct->handle_key_event_after_text_input_client(_struct, keyEvent); } void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, const CefMouseEvent& event, DragOperationsMask allowed_ops) { - if (CEF_MEMBER_MISSING(struct_, drag_target_drag_enter)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_target_drag_enter)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -579,7 +617,7 @@ void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, return; // Execute - struct_->drag_target_drag_enter(struct_, + _struct->drag_target_drag_enter(_struct, CefDragDataCToCpp::Unwrap(drag_data), &event, allowed_ops); @@ -587,65 +625,84 @@ void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, void CefBrowserHostCToCpp::DragTargetDragOver(const CefMouseEvent& event, DragOperationsMask allowed_ops) { - if (CEF_MEMBER_MISSING(struct_, drag_target_drag_over)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_target_drag_over)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->drag_target_drag_over(struct_, + _struct->drag_target_drag_over(_struct, &event, allowed_ops); } void CefBrowserHostCToCpp::DragTargetDragLeave() { - if (CEF_MEMBER_MISSING(struct_, drag_target_drag_leave)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_target_drag_leave)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->drag_target_drag_leave(struct_); + _struct->drag_target_drag_leave(_struct); } void CefBrowserHostCToCpp::DragTargetDrop(const CefMouseEvent& event) { - if (CEF_MEMBER_MISSING(struct_, drag_target_drop)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_target_drop)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->drag_target_drop(struct_, + _struct->drag_target_drop(_struct, &event); } void CefBrowserHostCToCpp::DragSourceEndedAt(int x, int y, DragOperationsMask op) { - if (CEF_MEMBER_MISSING(struct_, drag_source_ended_at)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_source_ended_at)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->drag_source_ended_at(struct_, + _struct->drag_source_ended_at(_struct, x, y, op); } void CefBrowserHostCToCpp::DragSourceSystemDragEnded() { - if (CEF_MEMBER_MISSING(struct_, drag_source_system_drag_ended)) + cef_browser_host_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, drag_source_system_drag_ended)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->drag_source_system_drag_ended(struct_); + _struct->drag_source_system_drag_ended(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefBrowserHostCToCpp::CefBrowserHostCToCpp() { +} + +template<> cef_browser_host_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefBrowserHost* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_BROWSER_HOST; diff --git a/libcef_dll/ctocpp/browser_host_ctocpp.h b/libcef_dll/ctocpp/browser_host_ctocpp.h index 9c5290ee3..42b01608b 100644 --- a/libcef_dll/ctocpp/browser_host_ctocpp.h +++ b/libcef_dll/ctocpp/browser_host_ctocpp.h @@ -31,71 +31,64 @@ class CefBrowserHostCToCpp : public CefCToCpp { public: - explicit CefBrowserHostCToCpp(cef_browser_host_t* str) - : CefCToCpp( - str) {} + CefBrowserHostCToCpp(); - // CefBrowserHost methods - virtual CefRefPtr GetBrowser() OVERRIDE; - virtual void CloseBrowser(bool force_close) OVERRIDE; - virtual void SetFocus(bool focus) OVERRIDE; - virtual void SetWindowVisibility(bool visible) OVERRIDE; - virtual CefWindowHandle GetWindowHandle() OVERRIDE; - virtual CefWindowHandle GetOpenerWindowHandle() OVERRIDE; - virtual CefRefPtr GetClient() OVERRIDE; - virtual CefRefPtr GetRequestContext() OVERRIDE; - virtual double GetZoomLevel() OVERRIDE; - virtual void SetZoomLevel(double zoomLevel) OVERRIDE; - virtual void RunFileDialog(FileDialogMode mode, const CefString& title, + // CefBrowserHost methods. + CefRefPtr GetBrowser() OVERRIDE; + void CloseBrowser(bool force_close) OVERRIDE; + void SetFocus(bool focus) OVERRIDE; + void SetWindowVisibility(bool visible) OVERRIDE; + CefWindowHandle GetWindowHandle() OVERRIDE; + CefWindowHandle GetOpenerWindowHandle() OVERRIDE; + CefRefPtr GetClient() OVERRIDE; + CefRefPtr GetRequestContext() OVERRIDE; + double GetZoomLevel() OVERRIDE; + void SetZoomLevel(double zoomLevel) OVERRIDE; + void RunFileDialog(FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, CefRefPtr callback) OVERRIDE; - virtual void StartDownload(const CefString& url) OVERRIDE; - virtual void Print() OVERRIDE; - virtual void Find(int identifier, const CefString& searchText, bool forward, + void StartDownload(const CefString& url) OVERRIDE; + void Print() OVERRIDE; + void Find(int identifier, const CefString& searchText, bool forward, bool matchCase, bool findNext) OVERRIDE; - virtual void StopFinding(bool clearSelection) OVERRIDE; - virtual void ShowDevTools(const CefWindowInfo& windowInfo, + void StopFinding(bool clearSelection) OVERRIDE; + void ShowDevTools(const CefWindowInfo& windowInfo, CefRefPtr client, const CefBrowserSettings& settings, const CefPoint& inspect_element_at) OVERRIDE; - virtual void CloseDevTools() OVERRIDE; - virtual void GetNavigationEntries( - CefRefPtr visitor, + void CloseDevTools() OVERRIDE; + void GetNavigationEntries(CefRefPtr visitor, bool current_only) OVERRIDE; - virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE; - virtual bool IsMouseCursorChangeDisabled() OVERRIDE; - virtual void ReplaceMisspelling(const CefString& word) OVERRIDE; - virtual void AddWordToDictionary(const CefString& word) OVERRIDE; - virtual bool IsWindowRenderingDisabled() OVERRIDE; - virtual void WasResized() OVERRIDE; - virtual void WasHidden(bool hidden) OVERRIDE; - virtual void NotifyScreenInfoChanged() OVERRIDE; - virtual void Invalidate(PaintElementType type) OVERRIDE; - virtual void SendKeyEvent(const CefKeyEvent& event) OVERRIDE; - virtual void SendMouseClickEvent(const CefMouseEvent& event, - MouseButtonType type, bool mouseUp, int clickCount) OVERRIDE; - virtual void SendMouseMoveEvent(const CefMouseEvent& event, - bool mouseLeave) OVERRIDE; - virtual void SendMouseWheelEvent(const CefMouseEvent& event, int deltaX, + void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE; + bool IsMouseCursorChangeDisabled() OVERRIDE; + void ReplaceMisspelling(const CefString& word) OVERRIDE; + void AddWordToDictionary(const CefString& word) OVERRIDE; + bool IsWindowRenderingDisabled() OVERRIDE; + void WasResized() OVERRIDE; + void WasHidden(bool hidden) OVERRIDE; + void NotifyScreenInfoChanged() OVERRIDE; + void Invalidate(PaintElementType type) OVERRIDE; + void SendKeyEvent(const CefKeyEvent& event) OVERRIDE; + void SendMouseClickEvent(const CefMouseEvent& event, MouseButtonType type, + bool mouseUp, int clickCount) OVERRIDE; + void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) OVERRIDE; + void SendMouseWheelEvent(const CefMouseEvent& event, int deltaX, int deltaY) OVERRIDE; - virtual void SendFocusEvent(bool setFocus) OVERRIDE; - virtual void SendCaptureLostEvent() OVERRIDE; - virtual void NotifyMoveOrResizeStarted() OVERRIDE; - virtual CefTextInputContext GetNSTextInputContext() OVERRIDE; - virtual void HandleKeyEventBeforeTextInputClient( - CefEventHandle keyEvent) OVERRIDE; - virtual void HandleKeyEventAfterTextInputClient( - CefEventHandle keyEvent) OVERRIDE; - virtual void DragTargetDragEnter(CefRefPtr drag_data, + void SendFocusEvent(bool setFocus) OVERRIDE; + void SendCaptureLostEvent() OVERRIDE; + void NotifyMoveOrResizeStarted() OVERRIDE; + CefTextInputContext GetNSTextInputContext() OVERRIDE; + void HandleKeyEventBeforeTextInputClient(CefEventHandle keyEvent) OVERRIDE; + void HandleKeyEventAfterTextInputClient(CefEventHandle keyEvent) OVERRIDE; + void DragTargetDragEnter(CefRefPtr drag_data, const CefMouseEvent& event, DragOperationsMask allowed_ops) OVERRIDE; - virtual void DragTargetDragOver(const CefMouseEvent& event, + void DragTargetDragOver(const CefMouseEvent& event, DragOperationsMask allowed_ops) OVERRIDE; - virtual void DragTargetDragLeave() OVERRIDE; - virtual void DragTargetDrop(const CefMouseEvent& event) OVERRIDE; - virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) OVERRIDE; - virtual void DragSourceSystemDragEnded() OVERRIDE; + void DragTargetDragLeave() OVERRIDE; + void DragTargetDrop(const CefMouseEvent& event) OVERRIDE; + void DragSourceEndedAt(int x, int y, DragOperationsMask op) OVERRIDE; + void DragSourceSystemDragEnded() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc index c2c0d7b40..f0b5edc29 100644 --- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.cc @@ -19,18 +19,20 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefBrowserProcessHandlerCToCpp::OnContextInitialized() { - if (CEF_MEMBER_MISSING(struct_, on_context_initialized)) + cef_browser_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_context_initialized)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_context_initialized(struct_); + _struct->on_context_initialized(_struct); } void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch( CefRefPtr command_line) { - if (CEF_MEMBER_MISSING(struct_, on_before_child_process_launch)) + cef_browser_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_child_process_launch)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -41,13 +43,14 @@ void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch( return; // Execute - struct_->on_before_child_process_launch(struct_, + _struct->on_before_child_process_launch(_struct, CefCommandLineCppToC::Wrap(command_line)); } void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated( CefRefPtr extra_info) { - if (CEF_MEMBER_MISSING(struct_, on_render_process_thread_created)) + cef_browser_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_render_process_thread_created)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -58,26 +61,42 @@ void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated( return; // Execute - struct_->on_render_process_thread_created(struct_, + _struct->on_render_process_thread_created(_struct, CefListValueCppToC::Wrap(extra_info)); } CefRefPtr CefBrowserProcessHandlerCToCpp::GetPrintHandler() { - if (CEF_MEMBER_MISSING(struct_, get_print_handler)) + cef_browser_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_print_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_print_handler_t* _retval = struct_->get_print_handler(struct_); + cef_print_handler_t* _retval = _struct->get_print_handler(_struct); // Return type: refptr_same return CefPrintHandlerCToCpp::Wrap(_retval); } +// CONSTRUCTOR - Do not edit by hand. + +CefBrowserProcessHandlerCToCpp::CefBrowserProcessHandlerCToCpp() { +} + +template<> cef_browser_process_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefBrowserProcessHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_BROWSER_PROCESS_HANDLER; diff --git a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h index 0f0acd8f1..649f43f3b 100644 --- a/libcef_dll/ctocpp/browser_process_handler_ctocpp.h +++ b/libcef_dll/ctocpp/browser_process_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefBrowserProcessHandlerCToCpp : public CefCToCpp { public: - explicit CefBrowserProcessHandlerCToCpp(cef_browser_process_handler_t* str) - : CefCToCpp(str) {} + CefBrowserProcessHandlerCToCpp(); - // CefBrowserProcessHandler methods + // CefBrowserProcessHandler methods. void OnContextInitialized() override; void OnBeforeChildProcessLaunch( CefRefPtr command_line) override; @@ -43,4 +41,3 @@ class CefBrowserProcessHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/callback_ctocpp.cc b/libcef_dll/ctocpp/callback_ctocpp.cc index dfa507301..7a73e1d65 100644 --- a/libcef_dll/ctocpp/callback_ctocpp.cc +++ b/libcef_dll/ctocpp/callback_ctocpp.cc @@ -16,28 +16,43 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefCallbackCToCpp::Continue() { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cont(struct_); + _struct->cont(_struct); } void CefCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefCallbackCToCpp::CefCallbackCToCpp() { +} + +template<> cef_callback_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_CALLBACK; diff --git a/libcef_dll/ctocpp/callback_ctocpp.h b/libcef_dll/ctocpp/callback_ctocpp.h index ed90e6c38..d2dc91642 100644 --- a/libcef_dll/ctocpp/callback_ctocpp.h +++ b/libcef_dll/ctocpp/callback_ctocpp.h @@ -27,14 +27,12 @@ class CefCallbackCToCpp : public CefCToCpp { public: - explicit CefCallbackCToCpp(cef_callback_t* str) - : CefCToCpp(str) {} + CefCallbackCToCpp(); - // CefCallback methods - virtual void Continue() OVERRIDE; - virtual void Cancel() OVERRIDE; + // CefCallback methods. + void Continue() OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/client_ctocpp.cc b/libcef_dll/ctocpp/client_ctocpp.cc index 9a20b35c6..4265368a1 100644 --- a/libcef_dll/ctocpp/client_ctocpp.cc +++ b/libcef_dll/ctocpp/client_ctocpp.cc @@ -32,184 +32,198 @@ // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefClientCToCpp::GetContextMenuHandler() { - if (CEF_MEMBER_MISSING(struct_, get_context_menu_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_context_menu_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_handler_t* _retval = struct_->get_context_menu_handler( - struct_); + cef_context_menu_handler_t* _retval = _struct->get_context_menu_handler( + _struct); // Return type: refptr_same return CefContextMenuHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetDialogHandler() { - if (CEF_MEMBER_MISSING(struct_, get_dialog_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dialog_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dialog_handler_t* _retval = struct_->get_dialog_handler(struct_); + cef_dialog_handler_t* _retval = _struct->get_dialog_handler(_struct); // Return type: refptr_same return CefDialogHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetDisplayHandler() { - if (CEF_MEMBER_MISSING(struct_, get_display_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_display_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_display_handler_t* _retval = struct_->get_display_handler(struct_); + cef_display_handler_t* _retval = _struct->get_display_handler(_struct); // Return type: refptr_same return CefDisplayHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetDownloadHandler() { - if (CEF_MEMBER_MISSING(struct_, get_download_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_download_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_download_handler_t* _retval = struct_->get_download_handler(struct_); + cef_download_handler_t* _retval = _struct->get_download_handler(_struct); // Return type: refptr_same return CefDownloadHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetDragHandler() { - if (CEF_MEMBER_MISSING(struct_, get_drag_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_drag_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_drag_handler_t* _retval = struct_->get_drag_handler(struct_); + cef_drag_handler_t* _retval = _struct->get_drag_handler(_struct); // Return type: refptr_same return CefDragHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetFindHandler() { - if (CEF_MEMBER_MISSING(struct_, get_find_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_find_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_find_handler_t* _retval = struct_->get_find_handler(struct_); + cef_find_handler_t* _retval = _struct->get_find_handler(_struct); // Return type: refptr_same return CefFindHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetFocusHandler() { - if (CEF_MEMBER_MISSING(struct_, get_focus_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_focus_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_focus_handler_t* _retval = struct_->get_focus_handler(struct_); + cef_focus_handler_t* _retval = _struct->get_focus_handler(_struct); // Return type: refptr_same return CefFocusHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetGeolocationHandler() { - if (CEF_MEMBER_MISSING(struct_, get_geolocation_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_geolocation_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_geolocation_handler_t* _retval = struct_->get_geolocation_handler( - struct_); + cef_geolocation_handler_t* _retval = _struct->get_geolocation_handler( + _struct); // Return type: refptr_same return CefGeolocationHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetJSDialogHandler() { - if (CEF_MEMBER_MISSING(struct_, get_jsdialog_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_jsdialog_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_jsdialog_handler_t* _retval = struct_->get_jsdialog_handler(struct_); + cef_jsdialog_handler_t* _retval = _struct->get_jsdialog_handler(_struct); // Return type: refptr_same return CefJSDialogHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetKeyboardHandler() { - if (CEF_MEMBER_MISSING(struct_, get_keyboard_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_keyboard_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_keyboard_handler_t* _retval = struct_->get_keyboard_handler(struct_); + cef_keyboard_handler_t* _retval = _struct->get_keyboard_handler(_struct); // Return type: refptr_same return CefKeyboardHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetLifeSpanHandler() { - if (CEF_MEMBER_MISSING(struct_, get_life_span_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_life_span_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_life_span_handler_t* _retval = struct_->get_life_span_handler(struct_); + cef_life_span_handler_t* _retval = _struct->get_life_span_handler(_struct); // Return type: refptr_same return CefLifeSpanHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetLoadHandler() { - if (CEF_MEMBER_MISSING(struct_, get_load_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_load_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_load_handler_t* _retval = struct_->get_load_handler(struct_); + cef_load_handler_t* _retval = _struct->get_load_handler(_struct); // Return type: refptr_same return CefLoadHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetRenderHandler() { - if (CEF_MEMBER_MISSING(struct_, get_render_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_render_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_render_handler_t* _retval = struct_->get_render_handler(struct_); + cef_render_handler_t* _retval = _struct->get_render_handler(_struct); // Return type: refptr_same return CefRenderHandlerCToCpp::Wrap(_retval); } CefRefPtr CefClientCToCpp::GetRequestHandler() { - if (CEF_MEMBER_MISSING(struct_, get_request_handler)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_request_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_request_handler_t* _retval = struct_->get_request_handler(struct_); + cef_request_handler_t* _retval = _struct->get_request_handler(_struct); // Return type: refptr_same return CefRequestHandlerCToCpp::Wrap(_retval); @@ -217,7 +231,8 @@ CefRefPtr CefClientCToCpp::GetRequestHandler() { bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) { - if (CEF_MEMBER_MISSING(struct_, on_process_message_received)) + cef_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_process_message_received)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -232,7 +247,7 @@ bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_process_message_received(struct_, + int _retval = _struct->on_process_message_received(_struct, CefBrowserCppToC::Wrap(browser), source_process, CefProcessMessageCppToC::Wrap(message)); @@ -242,8 +257,21 @@ bool CefClientCToCpp::OnProcessMessageReceived(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefClientCToCpp::CefClientCToCpp() { +} + +template<> cef_client_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefClient* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_CLIENT; diff --git a/libcef_dll/ctocpp/client_ctocpp.h b/libcef_dll/ctocpp/client_ctocpp.h index b5dacbe0d..0ae4de18e 100644 --- a/libcef_dll/ctocpp/client_ctocpp.h +++ b/libcef_dll/ctocpp/client_ctocpp.h @@ -27,10 +27,9 @@ class CefClientCToCpp : public CefCToCpp { public: - explicit CefClientCToCpp(cef_client_t* str) - : CefCToCpp(str) {} + CefClientCToCpp(); - // CefClient methods + // CefClient methods. CefRefPtr GetContextMenuHandler() override; CefRefPtr GetDialogHandler() override; CefRefPtr GetDisplayHandler() override; @@ -52,4 +51,3 @@ class CefClientCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_CLIENT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/command_line_ctocpp.cc b/libcef_dll/ctocpp/command_line_ctocpp.cc index 2f7d28b77..c7059d085 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.cc +++ b/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -55,46 +55,50 @@ CefRefPtr CefCommandLine::GetGlobalCommandLine() { // VIRTUAL METHODS - Body may be edited by hand. bool CefCommandLineCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefCommandLineCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefCommandLineCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_command_line_t* _retval = struct_->copy(struct_); + cef_command_line_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefCommandLineCToCpp::Wrap(_retval); } void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) { - if (CEF_MEMBER_MISSING(struct_, init_from_argv)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, init_from_argv)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -105,13 +109,14 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) { return; // Execute - struct_->init_from_argv(struct_, + _struct->init_from_argv(_struct, argc, argv); } void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { - if (CEF_MEMBER_MISSING(struct_, init_from_string)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, init_from_string)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -122,22 +127,24 @@ void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { return; // Execute - struct_->init_from_string(struct_, + _struct->init_from_string(_struct, command_line.GetStruct()); } void CefCommandLineCToCpp::Reset() { - if (CEF_MEMBER_MISSING(struct_, reset)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, reset)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->reset(struct_); + _struct->reset(_struct); } void CefCommandLineCToCpp::GetArgv(std::vector& argv) { - if (CEF_MEMBER_MISSING(struct_, get_argv)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_argv)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -149,7 +156,7 @@ void CefCommandLineCToCpp::GetArgv(std::vector& argv) { transfer_string_list_contents(argv, argvList); // Execute - struct_->get_argv(struct_, + _struct->get_argv(_struct, argvList); // Restore param:argv; type: string_vec_byref @@ -161,13 +168,14 @@ void CefCommandLineCToCpp::GetArgv(std::vector& argv) { } CefString CefCommandLineCToCpp::GetCommandLineString() { - if (CEF_MEMBER_MISSING(struct_, get_command_line_string)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_command_line_string)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_command_line_string(struct_); + cef_string_userfree_t _retval = _struct->get_command_line_string(_struct); // Return type: string CefString _retvalStr; @@ -176,13 +184,14 @@ CefString CefCommandLineCToCpp::GetCommandLineString() { } CefString CefCommandLineCToCpp::GetProgram() { - if (CEF_MEMBER_MISSING(struct_, get_program)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_program)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_program(struct_); + cef_string_userfree_t _retval = _struct->get_program(_struct); // Return type: string CefString _retvalStr; @@ -191,7 +200,8 @@ CefString CefCommandLineCToCpp::GetProgram() { } void CefCommandLineCToCpp::SetProgram(const CefString& program) { - if (CEF_MEMBER_MISSING(struct_, set_program)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_program)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -202,25 +212,27 @@ void CefCommandLineCToCpp::SetProgram(const CefString& program) { return; // Execute - struct_->set_program(struct_, + _struct->set_program(_struct, program.GetStruct()); } bool CefCommandLineCToCpp::HasSwitches() { - if (CEF_MEMBER_MISSING(struct_, has_switches)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_switches)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_switches(struct_); + int _retval = _struct->has_switches(_struct); // Return type: bool return _retval?true:false; } bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, has_switch)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_switch)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -231,7 +243,7 @@ bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { return false; // Execute - int _retval = struct_->has_switch(struct_, + int _retval = _struct->has_switch(_struct, name.GetStruct()); // Return type: bool @@ -239,7 +251,8 @@ bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { } CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, get_switch_value)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_switch_value)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -250,7 +263,7 @@ CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_switch_value(struct_, + cef_string_userfree_t _retval = _struct->get_switch_value(_struct, name.GetStruct()); // Return type: string @@ -260,7 +273,8 @@ CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { } void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { - if (CEF_MEMBER_MISSING(struct_, get_switches)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_switches)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -272,7 +286,7 @@ void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { transfer_string_map_contents(switches, switchesMap); // Execute - struct_->get_switches(struct_, + _struct->get_switches(_struct, switchesMap); // Restore param:switches; type: string_map_single_byref @@ -284,7 +298,8 @@ void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { } void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, append_switch)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, append_switch)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -295,13 +310,14 @@ void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { return; // Execute - struct_->append_switch(struct_, + _struct->append_switch(_struct, name.GetStruct()); } void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, append_switch_with_value)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, append_switch_with_value)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -316,26 +332,28 @@ void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, return; // Execute - struct_->append_switch_with_value(struct_, + _struct->append_switch_with_value(_struct, name.GetStruct(), value.GetStruct()); } bool CefCommandLineCToCpp::HasArguments() { - if (CEF_MEMBER_MISSING(struct_, has_arguments)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_arguments)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_arguments(struct_); + int _retval = _struct->has_arguments(_struct); // Return type: bool return _retval?true:false; } void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { - if (CEF_MEMBER_MISSING(struct_, get_arguments)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_arguments)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -347,7 +365,7 @@ void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { transfer_string_list_contents(arguments, argumentsList); // Execute - struct_->get_arguments(struct_, + _struct->get_arguments(_struct, argumentsList); // Restore param:arguments; type: string_vec_byref @@ -359,7 +377,8 @@ void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { } void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { - if (CEF_MEMBER_MISSING(struct_, append_argument)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, append_argument)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -370,12 +389,13 @@ void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { return; // Execute - struct_->append_argument(struct_, + _struct->append_argument(_struct, argument.GetStruct()); } void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) { - if (CEF_MEMBER_MISSING(struct_, prepend_wrapper)) + cef_command_line_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, prepend_wrapper)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -386,13 +406,27 @@ void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) { return; // Execute - struct_->prepend_wrapper(struct_, + _struct->prepend_wrapper(_struct, wrapper.GetStruct()); } +// CONSTRUCTOR - Do not edit by hand. + +CefCommandLineCToCpp::CefCommandLineCToCpp() { +} + +template<> cef_command_line_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefCommandLine* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_COMMAND_LINE; diff --git a/libcef_dll/ctocpp/command_line_ctocpp.h b/libcef_dll/ctocpp/command_line_ctocpp.h index 97add3654..913c71b78 100644 --- a/libcef_dll/ctocpp/command_line_ctocpp.h +++ b/libcef_dll/ctocpp/command_line_ctocpp.h @@ -29,34 +29,31 @@ class CefCommandLineCToCpp : public CefCToCpp { public: - explicit CefCommandLineCToCpp(cef_command_line_t* str) - : CefCToCpp( - str) {} + CefCommandLineCToCpp(); - // CefCommandLine methods - virtual bool IsValid() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE; - virtual void InitFromString(const CefString& command_line) OVERRIDE; - virtual void Reset() OVERRIDE; - virtual void GetArgv(std::vector& argv) OVERRIDE; - virtual CefString GetCommandLineString() OVERRIDE; - virtual CefString GetProgram() OVERRIDE; - virtual void SetProgram(const CefString& program) OVERRIDE; - virtual bool HasSwitches() OVERRIDE; - virtual bool HasSwitch(const CefString& name) OVERRIDE; - virtual CefString GetSwitchValue(const CefString& name) OVERRIDE; - virtual void GetSwitches(SwitchMap& switches) OVERRIDE; - virtual void AppendSwitch(const CefString& name) OVERRIDE; - virtual void AppendSwitchWithValue(const CefString& name, + // CefCommandLine methods. + bool IsValid() OVERRIDE; + bool IsReadOnly() OVERRIDE; + CefRefPtr Copy() OVERRIDE; + void InitFromArgv(int argc, const char* const* argv) OVERRIDE; + void InitFromString(const CefString& command_line) OVERRIDE; + void Reset() OVERRIDE; + void GetArgv(std::vector& argv) OVERRIDE; + CefString GetCommandLineString() OVERRIDE; + CefString GetProgram() OVERRIDE; + void SetProgram(const CefString& program) OVERRIDE; + bool HasSwitches() OVERRIDE; + bool HasSwitch(const CefString& name) OVERRIDE; + CefString GetSwitchValue(const CefString& name) OVERRIDE; + void GetSwitches(SwitchMap& switches) OVERRIDE; + void AppendSwitch(const CefString& name) OVERRIDE; + void AppendSwitchWithValue(const CefString& name, const CefString& value) OVERRIDE; - virtual bool HasArguments() OVERRIDE; - virtual void GetArguments(ArgumentList& arguments) OVERRIDE; - virtual void AppendArgument(const CefString& argument) OVERRIDE; - virtual void PrependWrapper(const CefString& wrapper) OVERRIDE; + bool HasArguments() OVERRIDE; + void GetArguments(ArgumentList& arguments) OVERRIDE; + void AppendArgument(const CefString& argument) OVERRIDE; + void PrependWrapper(const CefString& wrapper) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.cc b/libcef_dll/ctocpp/completion_callback_ctocpp.cc index 2ea3f31bc..77cbd252f 100644 --- a/libcef_dll/ctocpp/completion_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/completion_callback_ctocpp.cc @@ -16,18 +16,34 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefCompletionCallbackCToCpp::OnComplete() { - if (CEF_MEMBER_MISSING(struct_, on_complete)) + cef_completion_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_complete)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_complete(struct_); + _struct->on_complete(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefCompletionCallbackCToCpp::CefCompletionCallbackCToCpp() { +} + +template<> cef_completion_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefCompletionCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_COMPLETION_CALLBACK; diff --git a/libcef_dll/ctocpp/completion_callback_ctocpp.h b/libcef_dll/ctocpp/completion_callback_ctocpp.h index 147811f26..d0e27b98f 100644 --- a/libcef_dll/ctocpp/completion_callback_ctocpp.h +++ b/libcef_dll/ctocpp/completion_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefCompletionCallbackCToCpp : public CefCToCpp { public: - explicit CefCompletionCallbackCToCpp(cef_completion_callback_t* str) - : CefCToCpp(str) {} + CefCompletionCallbackCToCpp(); - // CefCompletionCallback methods + // CefCompletionCallback methods. void OnComplete() override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_COMPLETION_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc index e02406558..b6c52e1ae 100644 --- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.cc @@ -22,7 +22,8 @@ void CefContextMenuHandlerCToCpp::OnBeforeContextMenu( CefRefPtr browser, CefRefPtr frame, CefRefPtr params, CefRefPtr model) { - if (CEF_MEMBER_MISSING(struct_, on_before_context_menu)) + cef_context_menu_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_context_menu)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,7 +46,7 @@ void CefContextMenuHandlerCToCpp::OnBeforeContextMenu( return; // Execute - struct_->on_before_context_menu(struct_, + _struct->on_before_context_menu(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefContextMenuParamsCppToC::Wrap(params), @@ -56,7 +57,8 @@ bool CefContextMenuHandlerCToCpp::OnContextMenuCommand( CefRefPtr browser, CefRefPtr frame, CefRefPtr params, int command_id, EventFlags event_flags) { - if (CEF_MEMBER_MISSING(struct_, on_context_menu_command)) + cef_context_menu_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_context_menu_command)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -75,7 +77,7 @@ bool CefContextMenuHandlerCToCpp::OnContextMenuCommand( return false; // Execute - int _retval = struct_->on_context_menu_command(struct_, + int _retval = _struct->on_context_menu_command(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefContextMenuParamsCppToC::Wrap(params), @@ -88,7 +90,8 @@ bool CefContextMenuHandlerCToCpp::OnContextMenuCommand( void CefContextMenuHandlerCToCpp::OnContextMenuDismissed( CefRefPtr browser, CefRefPtr frame) { - if (CEF_MEMBER_MISSING(struct_, on_context_menu_dismissed)) + cef_context_menu_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_context_menu_dismissed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -103,14 +106,29 @@ void CefContextMenuHandlerCToCpp::OnContextMenuDismissed( return; // Execute - struct_->on_context_menu_dismissed(struct_, + _struct->on_context_menu_dismissed(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame)); } +// CONSTRUCTOR - Do not edit by hand. + +CefContextMenuHandlerCToCpp::CefContextMenuHandlerCToCpp() { +} + +template<> cef_context_menu_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefContextMenuHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_CONTEXT_MENU_HANDLER; diff --git a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h index f9ca11d3d..a231de9fa 100644 --- a/libcef_dll/ctocpp/context_menu_handler_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefContextMenuHandlerCToCpp : public CefCToCpp { public: - explicit CefContextMenuHandlerCToCpp(cef_context_menu_handler_t* str) - : CefCToCpp(str) {} + CefContextMenuHandlerCToCpp(); - // CefContextMenuHandler methods + // CefContextMenuHandler methods. void OnBeforeContextMenu(CefRefPtr browser, CefRefPtr frame, CefRefPtr params, CefRefPtr model) override; @@ -45,4 +43,3 @@ class CefContextMenuHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc index 4b3ab0da1..f1119cb2d 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc @@ -17,52 +17,56 @@ // VIRTUAL METHODS - Body may be edited by hand. int CefContextMenuParamsCToCpp::GetXCoord() { - if (CEF_MEMBER_MISSING(struct_, get_xcoord)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_xcoord)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_xcoord(struct_); + int _retval = _struct->get_xcoord(_struct); // Return type: simple return _retval; } int CefContextMenuParamsCToCpp::GetYCoord() { - if (CEF_MEMBER_MISSING(struct_, get_ycoord)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_ycoord)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_ycoord(struct_); + int _retval = _struct->get_ycoord(_struct); // Return type: simple return _retval; } CefContextMenuParams::TypeFlags CefContextMenuParamsCToCpp::GetTypeFlags() { - if (CEF_MEMBER_MISSING(struct_, get_type_flags)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type_flags)) return CM_TYPEFLAG_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_type_flags_t _retval = struct_->get_type_flags(struct_); + cef_context_menu_type_flags_t _retval = _struct->get_type_flags(_struct); // Return type: simple return _retval; } CefString CefContextMenuParamsCToCpp::GetLinkUrl() { - if (CEF_MEMBER_MISSING(struct_, get_link_url)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_link_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_link_url(struct_); + cef_string_userfree_t _retval = _struct->get_link_url(_struct); // Return type: string CefString _retvalStr; @@ -71,13 +75,14 @@ CefString CefContextMenuParamsCToCpp::GetLinkUrl() { } CefString CefContextMenuParamsCToCpp::GetUnfilteredLinkUrl() { - if (CEF_MEMBER_MISSING(struct_, get_unfiltered_link_url)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_unfiltered_link_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_unfiltered_link_url(struct_); + cef_string_userfree_t _retval = _struct->get_unfiltered_link_url(_struct); // Return type: string CefString _retvalStr; @@ -86,13 +91,14 @@ CefString CefContextMenuParamsCToCpp::GetUnfilteredLinkUrl() { } CefString CefContextMenuParamsCToCpp::GetSourceUrl() { - if (CEF_MEMBER_MISSING(struct_, get_source_url)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_source_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_source_url(struct_); + cef_string_userfree_t _retval = _struct->get_source_url(_struct); // Return type: string CefString _retvalStr; @@ -101,26 +107,28 @@ CefString CefContextMenuParamsCToCpp::GetSourceUrl() { } bool CefContextMenuParamsCToCpp::HasImageContents() { - if (CEF_MEMBER_MISSING(struct_, has_image_contents)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_image_contents)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_image_contents(struct_); + int _retval = _struct->has_image_contents(_struct); // Return type: bool return _retval?true:false; } CefString CefContextMenuParamsCToCpp::GetPageUrl() { - if (CEF_MEMBER_MISSING(struct_, get_page_url)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_page_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_page_url(struct_); + cef_string_userfree_t _retval = _struct->get_page_url(_struct); // Return type: string CefString _retvalStr; @@ -129,13 +137,14 @@ CefString CefContextMenuParamsCToCpp::GetPageUrl() { } CefString CefContextMenuParamsCToCpp::GetFrameUrl() { - if (CEF_MEMBER_MISSING(struct_, get_frame_url)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_frame_url(struct_); + cef_string_userfree_t _retval = _struct->get_frame_url(_struct); // Return type: string CefString _retvalStr; @@ -144,13 +153,14 @@ CefString CefContextMenuParamsCToCpp::GetFrameUrl() { } CefString CefContextMenuParamsCToCpp::GetFrameCharset() { - if (CEF_MEMBER_MISSING(struct_, get_frame_charset)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_charset)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_frame_charset(struct_); + cef_string_userfree_t _retval = _struct->get_frame_charset(_struct); // Return type: string CefString _retvalStr; @@ -159,13 +169,14 @@ CefString CefContextMenuParamsCToCpp::GetFrameCharset() { } CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { - if (CEF_MEMBER_MISSING(struct_, get_media_type)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_media_type)) return CM_MEDIATYPE_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_media_type_t _retval = struct_->get_media_type(struct_); + cef_context_menu_media_type_t _retval = _struct->get_media_type(_struct); // Return type: simple return _retval; @@ -173,27 +184,29 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { CefContextMenuParams::MediaStateFlags CefContextMenuParamsCToCpp::GetMediaStateFlags( ) { - if (CEF_MEMBER_MISSING(struct_, get_media_state_flags)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_media_state_flags)) return CM_MEDIAFLAG_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_media_state_flags_t _retval = struct_->get_media_state_flags( - struct_); + cef_context_menu_media_state_flags_t _retval = _struct->get_media_state_flags( + _struct); // Return type: simple return _retval; } CefString CefContextMenuParamsCToCpp::GetSelectionText() { - if (CEF_MEMBER_MISSING(struct_, get_selection_text)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_selection_text)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_selection_text(struct_); + cef_string_userfree_t _retval = _struct->get_selection_text(_struct); // Return type: string CefString _retvalStr; @@ -202,13 +215,14 @@ CefString CefContextMenuParamsCToCpp::GetSelectionText() { } CefString CefContextMenuParamsCToCpp::GetMisspelledWord() { - if (CEF_MEMBER_MISSING(struct_, get_misspelled_word)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_misspelled_word)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_misspelled_word(struct_); + cef_string_userfree_t _retval = _struct->get_misspelled_word(_struct); // Return type: string CefString _retvalStr; @@ -218,7 +232,8 @@ CefString CefContextMenuParamsCToCpp::GetMisspelledWord() { bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( std::vector& suggestions) { - if (CEF_MEMBER_MISSING(struct_, get_dictionary_suggestions)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dictionary_suggestions)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -230,7 +245,7 @@ bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( transfer_string_list_contents(suggestions, suggestionsList); // Execute - int _retval = struct_->get_dictionary_suggestions(struct_, + int _retval = _struct->get_dictionary_suggestions(_struct, suggestionsList); // Restore param:suggestions; type: string_vec_byref @@ -245,26 +260,28 @@ bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( } bool CefContextMenuParamsCToCpp::IsEditable() { - if (CEF_MEMBER_MISSING(struct_, is_editable)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_editable)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_editable(struct_); + int _retval = _struct->is_editable(_struct); // Return type: bool return _retval?true:false; } bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { - if (CEF_MEMBER_MISSING(struct_, is_spell_check_enabled)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_spell_check_enabled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_spell_check_enabled(struct_); + int _retval = _struct->is_spell_check_enabled(_struct); // Return type: bool return _retval?true:false; @@ -272,22 +289,38 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { CefContextMenuParams::EditStateFlags CefContextMenuParamsCToCpp::GetEditStateFlags( ) { - if (CEF_MEMBER_MISSING(struct_, get_edit_state_flags)) + cef_context_menu_params_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_edit_state_flags)) return CM_EDITFLAG_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_context_menu_edit_state_flags_t _retval = struct_->get_edit_state_flags( - struct_); + cef_context_menu_edit_state_flags_t _retval = _struct->get_edit_state_flags( + _struct); // Return type: simple return _retval; } +// CONSTRUCTOR - Do not edit by hand. + +CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() { +} + +template<> cef_context_menu_params_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefContextMenuParams* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_CONTEXT_MENU_PARAMS; diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/libcef_dll/ctocpp/context_menu_params_ctocpp.h index 8af9deab9..e9fdc8a65 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.h @@ -29,32 +29,28 @@ class CefContextMenuParamsCToCpp : public CefCToCpp { public: - explicit CefContextMenuParamsCToCpp(cef_context_menu_params_t* str) - : CefCToCpp(str) {} + CefContextMenuParamsCToCpp(); - // CefContextMenuParams methods - virtual int GetXCoord() OVERRIDE; - virtual int GetYCoord() OVERRIDE; - virtual TypeFlags GetTypeFlags() OVERRIDE; - virtual CefString GetLinkUrl() OVERRIDE; - virtual CefString GetUnfilteredLinkUrl() OVERRIDE; - virtual CefString GetSourceUrl() OVERRIDE; - virtual bool HasImageContents() OVERRIDE; - virtual CefString GetPageUrl() OVERRIDE; - virtual CefString GetFrameUrl() OVERRIDE; - virtual CefString GetFrameCharset() OVERRIDE; - virtual MediaType GetMediaType() OVERRIDE; - virtual MediaStateFlags GetMediaStateFlags() OVERRIDE; - virtual CefString GetSelectionText() OVERRIDE; - virtual CefString GetMisspelledWord() OVERRIDE; - virtual bool GetDictionarySuggestions( - std::vector& suggestions) OVERRIDE; - virtual bool IsEditable() OVERRIDE; - virtual bool IsSpellCheckEnabled() OVERRIDE; - virtual EditStateFlags GetEditStateFlags() OVERRIDE; + // CefContextMenuParams methods. + int GetXCoord() OVERRIDE; + int GetYCoord() OVERRIDE; + TypeFlags GetTypeFlags() OVERRIDE; + CefString GetLinkUrl() OVERRIDE; + CefString GetUnfilteredLinkUrl() OVERRIDE; + CefString GetSourceUrl() OVERRIDE; + bool HasImageContents() OVERRIDE; + CefString GetPageUrl() OVERRIDE; + CefString GetFrameUrl() OVERRIDE; + CefString GetFrameCharset() OVERRIDE; + MediaType GetMediaType() OVERRIDE; + MediaStateFlags GetMediaStateFlags() OVERRIDE; + CefString GetSelectionText() OVERRIDE; + CefString GetMisspelledWord() OVERRIDE; + bool GetDictionarySuggestions(std::vector& suggestions) OVERRIDE; + bool IsEditable() OVERRIDE; + bool IsSpellCheckEnabled() OVERRIDE; + EditStateFlags GetEditStateFlags() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc index b6be7f5b1..9533bf3e8 100644 --- a/libcef_dll/ctocpp/cookie_manager_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.cc @@ -57,7 +57,8 @@ CefRefPtr CefCookieManager::CreateManager( void CefCookieManagerCToCpp::SetSupportedSchemes( const std::vector& schemes, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, set_supported_schemes)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_supported_schemes)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -71,7 +72,7 @@ void CefCookieManagerCToCpp::SetSupportedSchemes( transfer_string_list_contents(schemes, schemesList); // Execute - struct_->set_supported_schemes(struct_, + _struct->set_supported_schemes(_struct, schemesList, CefCompletionCallbackCppToC::Wrap(callback)); @@ -82,7 +83,8 @@ void CefCookieManagerCToCpp::SetSupportedSchemes( bool CefCookieManagerCToCpp::VisitAllCookies( CefRefPtr visitor) { - if (CEF_MEMBER_MISSING(struct_, visit_all_cookies)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit_all_cookies)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -93,7 +95,7 @@ bool CefCookieManagerCToCpp::VisitAllCookies( return false; // Execute - int _retval = struct_->visit_all_cookies(struct_, + int _retval = _struct->visit_all_cookies(_struct, CefCookieVisitorCppToC::Wrap(visitor)); // Return type: bool @@ -102,7 +104,8 @@ bool CefCookieManagerCToCpp::VisitAllCookies( bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, bool includeHttpOnly, CefRefPtr visitor) { - if (CEF_MEMBER_MISSING(struct_, visit_url_cookies)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit_url_cookies)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -117,7 +120,7 @@ bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, return false; // Execute - int _retval = struct_->visit_url_cookies(struct_, + int _retval = _struct->visit_url_cookies(_struct, url.GetStruct(), includeHttpOnly, CefCookieVisitorCppToC::Wrap(visitor)); @@ -128,7 +131,8 @@ bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, bool CefCookieManagerCToCpp::SetCookie(const CefString& url, const CefCookie& cookie, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, set_cookie)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_cookie)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -140,7 +144,7 @@ bool CefCookieManagerCToCpp::SetCookie(const CefString& url, // Unverified params: callback // Execute - int _retval = struct_->set_cookie(struct_, + int _retval = _struct->set_cookie(_struct, url.GetStruct(), &cookie, CefSetCookieCallbackCppToC::Wrap(callback)); @@ -152,7 +156,8 @@ bool CefCookieManagerCToCpp::SetCookie(const CefString& url, bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, const CefString& cookie_name, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, delete_cookies)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, delete_cookies)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -160,7 +165,7 @@ bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, // Unverified params: url, cookie_name, callback // Execute - int _retval = struct_->delete_cookies(struct_, + int _retval = _struct->delete_cookies(_struct, url.GetStruct(), cookie_name.GetStruct(), CefDeleteCookiesCallbackCppToC::Wrap(callback)); @@ -171,7 +176,8 @@ bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, bool persist_session_cookies, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, set_storage_path)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_storage_path)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -179,7 +185,7 @@ bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, // Unverified params: path, callback // Execute - int _retval = struct_->set_storage_path(struct_, + int _retval = _struct->set_storage_path(_struct, path.GetStruct(), persist_session_cookies, CefCompletionCallbackCppToC::Wrap(callback)); @@ -190,7 +196,8 @@ bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, bool CefCookieManagerCToCpp::FlushStore( CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, flush_store)) + cef_cookie_manager_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, flush_store)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -198,7 +205,7 @@ bool CefCookieManagerCToCpp::FlushStore( // Unverified params: callback // Execute - int _retval = struct_->flush_store(struct_, + int _retval = _struct->flush_store(_struct, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: bool @@ -206,8 +213,22 @@ bool CefCookieManagerCToCpp::FlushStore( } +// CONSTRUCTOR - Do not edit by hand. + +CefCookieManagerCToCpp::CefCookieManagerCToCpp() { +} + +template<> cef_cookie_manager_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefCookieManager* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_COOKIE_MANAGER; diff --git a/libcef_dll/ctocpp/cookie_manager_ctocpp.h b/libcef_dll/ctocpp/cookie_manager_ctocpp.h index b7f9f5e53..a03db4b7d 100644 --- a/libcef_dll/ctocpp/cookie_manager_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_manager_ctocpp.h @@ -29,26 +29,22 @@ class CefCookieManagerCToCpp : public CefCToCpp { public: - explicit CefCookieManagerCToCpp(cef_cookie_manager_t* str) - : CefCToCpp(str) {} + CefCookieManagerCToCpp(); - // CefCookieManager methods - virtual void SetSupportedSchemes(const std::vector& schemes, + // CefCookieManager methods. + void SetSupportedSchemes(const std::vector& schemes, CefRefPtr callback) OVERRIDE; - virtual bool VisitAllCookies(CefRefPtr visitor) OVERRIDE; - virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, + bool VisitAllCookies(CefRefPtr visitor) OVERRIDE; + bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, CefRefPtr visitor) OVERRIDE; - virtual bool SetCookie(const CefString& url, const CefCookie& cookie, + bool SetCookie(const CefString& url, const CefCookie& cookie, CefRefPtr callback) OVERRIDE; - virtual bool DeleteCookies(const CefString& url, const CefString& cookie_name, + bool DeleteCookies(const CefString& url, const CefString& cookie_name, CefRefPtr callback) OVERRIDE; - virtual bool SetStoragePath(const CefString& path, - bool persist_session_cookies, + bool SetStoragePath(const CefString& path, bool persist_session_cookies, CefRefPtr callback) OVERRIDE; - virtual bool FlushStore(CefRefPtr callback) OVERRIDE; + bool FlushStore(CefRefPtr callback) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc index c2cefbae6..71aaaefb3 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.cc @@ -17,7 +17,8 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, int total, bool& deleteCookie) { - if (CEF_MEMBER_MISSING(struct_, visit)) + cef_cookie_visitor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -26,7 +27,7 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, int deleteCookieInt = deleteCookie; // Execute - int _retval = struct_->visit(struct_, + int _retval = _struct->visit(_struct, &cookie, count, total, @@ -40,8 +41,22 @@ bool CefCookieVisitorCToCpp::Visit(const CefCookie& cookie, int count, } +// CONSTRUCTOR - Do not edit by hand. + +CefCookieVisitorCToCpp::CefCookieVisitorCToCpp() { +} + +template<> cef_cookie_visitor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefCookieVisitor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_COOKIE_VISITOR; diff --git a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h index d8a12968c..0f169ccd3 100644 --- a/libcef_dll/ctocpp/cookie_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/cookie_visitor_ctocpp.h @@ -28,15 +28,12 @@ class CefCookieVisitorCToCpp : public CefCToCpp { public: - explicit CefCookieVisitorCToCpp(cef_cookie_visitor_t* str) - : CefCToCpp(str) {} + CefCookieVisitorCToCpp(); - // CefCookieVisitor methods + // CefCookieVisitor methods. bool Visit(const CefCookie& cookie, int count, int total, bool& deleteCookie) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_COOKIE_VISITOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/ctocpp.h b/libcef_dll/ctocpp/ctocpp.h index 063fe1cfd..f28f438d2 100644 --- a/libcef_dll/ctocpp/ctocpp.h +++ b/libcef_dll/ctocpp/ctocpp.h @@ -10,63 +10,31 @@ #include "include/base/cef_macros.h" #include "include/cef_base.h" #include "include/capi/cef_base_capi.h" +#include "libcef_dll/wrapper_types.h" -// Wrap a C structure with a C++ class. This is used when the implementation +// Wrap a C structure with a C++ class. This is used when the implementation // exists on the other side of the DLL boundary but will have methods called on // this side of the DLL boundary. template class CefCToCpp : public BaseName { public: - // Use this method to create a wrapper class instance for a structure - // received from the other side. - static CefRefPtr Wrap(StructName* s) { - if (!s) - return NULL; + // Create a new wrapper instance for a structure reference received from the + // other side. + static CefRefPtr Wrap(StructName* s); - // Wrap their structure with the CefCToCpp object. - ClassName* wrapper = new ClassName(s); - // Put the wrapper object in a smart pointer. - CefRefPtr wrapperPtr(wrapper); - // Release the reference that was added to the CefCppToC wrapper object on - // the other side before their structure was passed to us. - wrapper->UnderlyingRelease(); - // Return the smart pointer. - return wrapperPtr; - } - - // Use this method to retrieve the underlying structure from a wrapper class - // instance for return back to the other side. - static StructName* Unwrap(CefRefPtr c) { - if (!c.get()) - return NULL; - - // Cast the object to our wrapper class type. - ClassName* wrapper = static_cast(c.get()); - // Add a reference to the CefCppToC wrapper object on the other side that - // will be released once the structure is received. - wrapper->UnderlyingAddRef(); - // Return their original structure. - return wrapper->GetStruct(); - } - - explicit CefCToCpp(StructName* str) - : struct_(str) { - DCHECK(str); - -#ifndef NDEBUG - base::AtomicRefCountInc(&DebugObjCt); -#endif - } - virtual ~CefCToCpp() { -#ifndef NDEBUG - base::AtomicRefCountDec(&DebugObjCt); -#endif - } + // Retrieve the underlying structure reference from a wrapper instance for + // return back to the other side. + static StructName* Unwrap(CefRefPtr c); // If returning the structure across the DLL boundary you should call // UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of - // the DLL boundary, call Release() on the CefCppToC object. - StructName* GetStruct() { return struct_; } + // the DLL boundary, call Release() on the CefCppToC object. + StructName* GetStruct() const { + WrapperStruct* wrapperStruct = GetWrapperStruct(this); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + return wrapperStruct->struct_; + } // CefBase methods increment/decrement reference counts on both this object // and the underlying wrapped structure. @@ -74,31 +42,8 @@ class CefCToCpp : public BaseName { UnderlyingAddRef(); ref_count_.AddRef(); } - bool Release() const { - UnderlyingRelease(); - if (ref_count_.Release()) { - delete this; - return true; - } - return false; - } - bool HasOneRef() const { return ref_count_.HasOneRef(); } - - // Increment/decrement reference counts on only the underlying class. - void UnderlyingAddRef() const { - if (struct_->base.add_ref) - struct_->base.add_ref(&struct_->base); - } - bool UnderlyingRelease() const { - if (!struct_->base.release) - return false; - return struct_->base.release(&struct_->base) ? true : false; - } - bool UnderlyingHasOneRef() const { - if (!struct_->base.has_one_ref) - return false; - return struct_->base.has_one_ref(&struct_->base) ? true : false; - } + bool Release() const; + bool HasOneRef() const { return UnderlyingHasOneRef(); } #ifndef NDEBUG // Simple tracking of allocated objects. @@ -106,12 +51,125 @@ class CefCToCpp : public BaseName { #endif protected: - StructName* struct_; + CefCToCpp() { +#ifndef NDEBUG + base::AtomicRefCountInc(&DebugObjCt); +#endif + } + + virtual ~CefCToCpp() { +#ifndef NDEBUG + base::AtomicRefCountDec(&DebugObjCt); +#endif + } private: + // Used to associate this wrapper object and the structure reference received + // from the other side. + struct WrapperStruct; + + static WrapperStruct* GetWrapperStruct(const BaseName* obj); + + // Unwrap as the derived type. + static StructName* UnwrapDerived(CefWrapperType type, BaseName* c); + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { + cef_base_t* base = reinterpret_cast(GetStruct()); + if (base->add_ref) + base->add_ref(base); + } + + bool UnderlyingRelease() const { + cef_base_t* base = reinterpret_cast(GetStruct()); + if (!base->release) + return false; + return base->release(base) ? true : false; + } + + bool UnderlyingHasOneRef() const { + cef_base_t* base = reinterpret_cast(GetStruct()); + if (!base->has_one_ref) + return false; + return base->has_one_ref(base) ? true : false; + } + CefRefCount ref_count_; + static CefWrapperType kWrapperType; + DISALLOW_COPY_AND_ASSIGN(CefCToCpp); }; +template +struct CefCToCpp::WrapperStruct { + CefWrapperType type_; + StructName* struct_; + ClassName wrapper_; +}; + +template +CefRefPtr + CefCToCpp::Wrap(StructName* s) { + if (!s) + return NULL; + + // Wrap their structure with the CefCToCpp object. + WrapperStruct* wrapperStruct = new WrapperStruct; + wrapperStruct->type_ = kWrapperType; + wrapperStruct->struct_ = s; + + // Put the wrapper object in a smart pointer. + CefRefPtr wrapperPtr(&wrapperStruct->wrapper_); + // Release the reference that was added to the CefCppToC wrapper object on + // the other side before their structure was passed to us. + wrapperStruct->wrapper_.UnderlyingRelease(); + // Return the smart pointer. + return wrapperPtr; +} + +template +StructName* + CefCToCpp::Unwrap(CefRefPtr c) { + if (!c.get()) + return NULL; + + WrapperStruct* wrapperStruct = GetWrapperStruct(c.get()); + + // If the type does not match this object then we need to unwrap as the + // derived type. + if (wrapperStruct->type_ != kWrapperType) + return UnwrapDerived(wrapperStruct->type_, c.get()); + + // Add a reference to the CefCppToC wrapper object on the other side that + // will be released once the structure is received. + wrapperStruct->wrapper_.UnderlyingAddRef(); + // Return their original structure. + return wrapperStruct->struct_; +} + +template +bool CefCToCpp::Release() const { + UnderlyingRelease(); + if (ref_count_.Release()) { + WrapperStruct* wrapperStruct = GetWrapperStruct(this); + // Verify that the wrapper offset was calculated correctly. + DCHECK_EQ(kWrapperType, wrapperStruct->type_); + delete wrapperStruct; + return true; + } + return false; +} + +template +typename CefCToCpp::WrapperStruct* + CefCToCpp::GetWrapperStruct( + const BaseName* obj) { + // Offset using the WrapperStruct size instead of individual member sizes to + // avoid problems due to platform/compiler differences in structure padding. + return reinterpret_cast( + reinterpret_cast(const_cast(obj)) - + (sizeof(WrapperStruct) - sizeof(ClassName))); +} + #endif // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc index fd56dcd6a..e26c51a04 100644 --- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.cc @@ -16,19 +16,35 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefDeleteCookiesCallbackCToCpp::OnComplete(int num_deleted) { - if (CEF_MEMBER_MISSING(struct_, on_complete)) + cef_delete_cookies_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_complete)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_complete(struct_, + _struct->on_complete(_struct, num_deleted); } +// CONSTRUCTOR - Do not edit by hand. + +CefDeleteCookiesCallbackCToCpp::CefDeleteCookiesCallbackCToCpp() { +} + +template<> cef_delete_cookies_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefDeleteCookiesCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_DELETE_COOKIES_CALLBACK; diff --git a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h index a83b7d617..cb6003f56 100644 --- a/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h +++ b/libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefDeleteCookiesCallbackCToCpp : public CefCToCpp { public: - explicit CefDeleteCookiesCallbackCToCpp(cef_delete_cookies_callback_t* str) - : CefCToCpp(str) {} + CefDeleteCookiesCallbackCToCpp(); - // CefDeleteCookiesCallback methods + // CefDeleteCookiesCallback methods. void OnComplete(int num_deleted) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DELETE_COOKIES_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc index d2a522dcd..3e0b3fcca 100644 --- a/libcef_dll/ctocpp/dialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.cc @@ -23,7 +23,8 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_file_dialog)) + cef_dialog_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_file_dialog)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -49,7 +50,7 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, transfer_string_list_contents(accept_filters, accept_filtersList); // Execute - int _retval = struct_->on_file_dialog(struct_, + int _retval = _struct->on_file_dialog(_struct, CefBrowserCppToC::Wrap(browser), mode, title.GetStruct(), @@ -67,8 +68,22 @@ bool CefDialogHandlerCToCpp::OnFileDialog(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefDialogHandlerCToCpp::CefDialogHandlerCToCpp() { +} + +template<> cef_dialog_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefDialogHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DIALOG_HANDLER; diff --git a/libcef_dll/ctocpp/dialog_handler_ctocpp.h b/libcef_dll/ctocpp/dialog_handler_ctocpp.h index 665add1e6..f514070b4 100644 --- a/libcef_dll/ctocpp/dialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/dialog_handler_ctocpp.h @@ -29,11 +29,9 @@ class CefDialogHandlerCToCpp : public CefCToCpp { public: - explicit CefDialogHandlerCToCpp(cef_dialog_handler_t* str) - : CefCToCpp(str) {} + CefDialogHandlerCToCpp(); - // CefDialogHandler methods + // CefDialogHandler methods. bool OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title, const CefString& default_file_path, const std::vector& accept_filters, int selected_accept_filter, @@ -42,4 +40,3 @@ class CefDialogHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DIALOG_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc index 0dc707c6d..e51d99b22 100644 --- a/libcef_dll/ctocpp/dictionary_value_ctocpp.cc +++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.cc @@ -33,46 +33,50 @@ CefRefPtr CefDictionaryValue::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefDictionaryValueCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefDictionaryValueCToCpp::IsOwned() { - if (CEF_MEMBER_MISSING(struct_, is_owned)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_owned)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_owned(struct_); + int _retval = _struct->is_owned(_struct); // Return type: bool return _retval?true:false; } bool CefDictionaryValueCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } bool CefDictionaryValueCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -83,7 +87,7 @@ bool CefDictionaryValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefDictionaryValueCToCpp::Unwrap(that)); // Return type: bool @@ -91,7 +95,8 @@ bool CefDictionaryValueCToCpp::IsSame(CefRefPtr that) { } bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_equal)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_equal)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -102,7 +107,7 @@ bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_equal(struct_, + int _retval = _struct->is_equal(_struct, CefDictionaryValueCToCpp::Unwrap(that)); // Return type: bool @@ -111,13 +116,14 @@ bool CefDictionaryValueCToCpp::IsEqual(CefRefPtr that) { CefRefPtr CefDictionaryValueCToCpp::Copy( bool exclude_empty_children) { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dictionary_value_t* _retval = struct_->copy(struct_, + cef_dictionary_value_t* _retval = _struct->copy(_struct, exclude_empty_children); // Return type: refptr_same @@ -125,33 +131,36 @@ CefRefPtr CefDictionaryValueCToCpp::Copy( } size_t CefDictionaryValueCToCpp::GetSize() { - if (CEF_MEMBER_MISSING(struct_, get_size)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_size(struct_); + size_t _retval = _struct->get_size(_struct); // Return type: simple return _retval; } bool CefDictionaryValueCToCpp::Clear() { - if (CEF_MEMBER_MISSING(struct_, clear)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clear)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->clear(struct_); + int _retval = _struct->clear(_struct); // Return type: bool return _retval?true:false; } bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, has_key)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_key)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -162,7 +171,7 @@ bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { return false; // Execute - int _retval = struct_->has_key(struct_, + int _retval = _struct->has_key(_struct, key.GetStruct()); // Return type: bool @@ -170,7 +179,8 @@ bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { } bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { - if (CEF_MEMBER_MISSING(struct_, get_keys)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_keys)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -182,7 +192,7 @@ bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { transfer_string_list_contents(keys, keysList); // Execute - int _retval = struct_->get_keys(struct_, + int _retval = _struct->get_keys(_struct, keysList); // Restore param:keys; type: string_vec_byref @@ -197,7 +207,8 @@ bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { } bool CefDictionaryValueCToCpp::Remove(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, remove)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -208,7 +219,7 @@ bool CefDictionaryValueCToCpp::Remove(const CefString& key) { return false; // Execute - int _retval = struct_->remove(struct_, + int _retval = _struct->remove(_struct, key.GetStruct()); // Return type: bool @@ -216,7 +227,8 @@ bool CefDictionaryValueCToCpp::Remove(const CefString& key) { } CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return VTYPE_INVALID; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -227,7 +239,7 @@ CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { return VTYPE_INVALID; // Execute - cef_value_type_t _retval = struct_->get_type(struct_, + cef_value_type_t _retval = _struct->get_type(_struct, key.GetStruct()); // Return type: simple @@ -235,7 +247,8 @@ CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { } CefRefPtr CefDictionaryValueCToCpp::GetValue(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_value)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -246,7 +259,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetValue(const CefString& key) { return NULL; // Execute - cef_value_t* _retval = struct_->get_value(struct_, + cef_value_t* _retval = _struct->get_value(_struct, key.GetStruct()); // Return type: refptr_same @@ -254,7 +267,8 @@ CefRefPtr CefDictionaryValueCToCpp::GetValue(const CefString& key) { } bool CefDictionaryValueCToCpp::GetBool(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_bool)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -265,7 +279,7 @@ bool CefDictionaryValueCToCpp::GetBool(const CefString& key) { return false; // Execute - int _retval = struct_->get_bool(struct_, + int _retval = _struct->get_bool(_struct, key.GetStruct()); // Return type: bool @@ -273,7 +287,8 @@ bool CefDictionaryValueCToCpp::GetBool(const CefString& key) { } int CefDictionaryValueCToCpp::GetInt(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_int)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -284,7 +299,7 @@ int CefDictionaryValueCToCpp::GetInt(const CefString& key) { return 0; // Execute - int _retval = struct_->get_int(struct_, + int _retval = _struct->get_int(_struct, key.GetStruct()); // Return type: simple @@ -292,7 +307,8 @@ int CefDictionaryValueCToCpp::GetInt(const CefString& key) { } double CefDictionaryValueCToCpp::GetDouble(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_double)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_double)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -303,7 +319,7 @@ double CefDictionaryValueCToCpp::GetDouble(const CefString& key) { return 0; // Execute - double _retval = struct_->get_double(struct_, + double _retval = _struct->get_double(_struct, key.GetStruct()); // Return type: simple @@ -311,7 +327,8 @@ double CefDictionaryValueCToCpp::GetDouble(const CefString& key) { } CefString CefDictionaryValueCToCpp::GetString(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_string)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -322,7 +339,7 @@ CefString CefDictionaryValueCToCpp::GetString(const CefString& key) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_string(struct_, + cef_string_userfree_t _retval = _struct->get_string(_struct, key.GetStruct()); // Return type: string @@ -333,7 +350,8 @@ CefString CefDictionaryValueCToCpp::GetString(const CefString& key) { CefRefPtr CefDictionaryValueCToCpp::GetBinary( const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_binary)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_binary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -344,7 +362,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetBinary( return NULL; // Execute - cef_binary_value_t* _retval = struct_->get_binary(struct_, + cef_binary_value_t* _retval = _struct->get_binary(_struct, key.GetStruct()); // Return type: refptr_same @@ -353,7 +371,8 @@ CefRefPtr CefDictionaryValueCToCpp::GetBinary( CefRefPtr CefDictionaryValueCToCpp::GetDictionary( const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_dictionary)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dictionary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -364,7 +383,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetDictionary( return NULL; // Execute - cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_, + cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct, key.GetStruct()); // Return type: refptr_same @@ -373,7 +392,8 @@ CefRefPtr CefDictionaryValueCToCpp::GetDictionary( CefRefPtr CefDictionaryValueCToCpp::GetList( const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_list)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_list)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -384,7 +404,7 @@ CefRefPtr CefDictionaryValueCToCpp::GetList( return NULL; // Execute - cef_list_value_t* _retval = struct_->get_list(struct_, + cef_list_value_t* _retval = _struct->get_list(_struct, key.GetStruct()); // Return type: refptr_same @@ -393,7 +413,8 @@ CefRefPtr CefDictionaryValueCToCpp::GetList( bool CefDictionaryValueCToCpp::SetValue(const CefString& key, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_value)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -408,7 +429,7 @@ bool CefDictionaryValueCToCpp::SetValue(const CefString& key, return false; // Execute - int _retval = struct_->set_value(struct_, + int _retval = _struct->set_value(_struct, key.GetStruct(), CefValueCToCpp::Unwrap(value)); @@ -417,7 +438,8 @@ bool CefDictionaryValueCToCpp::SetValue(const CefString& key, } bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, set_null)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_null)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -428,7 +450,7 @@ bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { return false; // Execute - int _retval = struct_->set_null(struct_, + int _retval = _struct->set_null(_struct, key.GetStruct()); // Return type: bool @@ -436,7 +458,8 @@ bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { } bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { - if (CEF_MEMBER_MISSING(struct_, set_bool)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -447,7 +470,7 @@ bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { return false; // Execute - int _retval = struct_->set_bool(struct_, + int _retval = _struct->set_bool(_struct, key.GetStruct(), value); @@ -456,7 +479,8 @@ bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { } bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { - if (CEF_MEMBER_MISSING(struct_, set_int)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_int)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -467,7 +491,7 @@ bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { return false; // Execute - int _retval = struct_->set_int(struct_, + int _retval = _struct->set_int(_struct, key.GetStruct(), value); @@ -476,7 +500,8 @@ bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { } bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { - if (CEF_MEMBER_MISSING(struct_, set_double)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_double)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -487,7 +512,7 @@ bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { return false; // Execute - int _retval = struct_->set_double(struct_, + int _retval = _struct->set_double(_struct, key.GetStruct(), value); @@ -497,7 +522,8 @@ bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { bool CefDictionaryValueCToCpp::SetString(const CefString& key, const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, set_string)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -509,7 +535,7 @@ bool CefDictionaryValueCToCpp::SetString(const CefString& key, // Unverified params: value // Execute - int _retval = struct_->set_string(struct_, + int _retval = _struct->set_string(_struct, key.GetStruct(), value.GetStruct()); @@ -519,7 +545,8 @@ bool CefDictionaryValueCToCpp::SetString(const CefString& key, bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_binary)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_binary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -534,7 +561,7 @@ bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, return false; // Execute - int _retval = struct_->set_binary(struct_, + int _retval = _struct->set_binary(_struct, key.GetStruct(), CefBinaryValueCToCpp::Unwrap(value)); @@ -544,7 +571,8 @@ bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_dictionary)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_dictionary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -559,7 +587,7 @@ bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, return false; // Execute - int _retval = struct_->set_dictionary(struct_, + int _retval = _struct->set_dictionary(_struct, key.GetStruct(), CefDictionaryValueCToCpp::Unwrap(value)); @@ -569,7 +597,8 @@ bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, bool CefDictionaryValueCToCpp::SetList(const CefString& key, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_list)) + cef_dictionary_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -584,7 +613,7 @@ bool CefDictionaryValueCToCpp::SetList(const CefString& key, return false; // Execute - int _retval = struct_->set_list(struct_, + int _retval = _struct->set_list(_struct, key.GetStruct(), CefListValueCToCpp::Unwrap(value)); @@ -593,8 +622,23 @@ bool CefDictionaryValueCToCpp::SetList(const CefString& key, } +// CONSTRUCTOR - Do not edit by hand. + +CefDictionaryValueCToCpp::CefDictionaryValueCToCpp() { +} + +template<> cef_dictionary_value_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefDictionaryValue* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_DICTIONARY_VALUE; diff --git a/libcef_dll/ctocpp/dictionary_value_ctocpp.h b/libcef_dll/ctocpp/dictionary_value_ctocpp.h index f98400b7f..527451b6e 100644 --- a/libcef_dll/ctocpp/dictionary_value_ctocpp.h +++ b/libcef_dll/ctocpp/dictionary_value_ctocpp.h @@ -28,48 +28,41 @@ class CefDictionaryValueCToCpp : public CefCToCpp { public: - explicit CefDictionaryValueCToCpp(cef_dictionary_value_t* str) - : CefCToCpp(str) {} + CefDictionaryValueCToCpp(); - // CefDictionaryValue methods - virtual bool IsValid() OVERRIDE; - virtual bool IsOwned() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool IsEqual(CefRefPtr that) OVERRIDE; - virtual CefRefPtr Copy( - bool exclude_empty_children) OVERRIDE; - virtual size_t GetSize() OVERRIDE; - virtual bool Clear() OVERRIDE; - virtual bool HasKey(const CefString& key) OVERRIDE; - virtual bool GetKeys(KeyList& keys) OVERRIDE; - virtual bool Remove(const CefString& key) OVERRIDE; - virtual CefValueType GetType(const CefString& key) OVERRIDE; - virtual CefRefPtr GetValue(const CefString& key) OVERRIDE; - virtual bool GetBool(const CefString& key) OVERRIDE; - virtual int GetInt(const CefString& key) OVERRIDE; - virtual double GetDouble(const CefString& key) OVERRIDE; - virtual CefString GetString(const CefString& key) OVERRIDE; - virtual CefRefPtr GetBinary(const CefString& key) OVERRIDE; - virtual CefRefPtr GetDictionary( - const CefString& key) OVERRIDE; - virtual CefRefPtr GetList(const CefString& key) OVERRIDE; - virtual bool SetValue(const CefString& key, - CefRefPtr value) OVERRIDE; - virtual bool SetNull(const CefString& key) OVERRIDE; - virtual bool SetBool(const CefString& key, bool value) OVERRIDE; - virtual bool SetInt(const CefString& key, int value) OVERRIDE; - virtual bool SetDouble(const CefString& key, double value) OVERRIDE; - virtual bool SetString(const CefString& key, const CefString& value) OVERRIDE; - virtual bool SetBinary(const CefString& key, + // CefDictionaryValue methods. + bool IsValid() OVERRIDE; + bool IsOwned() OVERRIDE; + bool IsReadOnly() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool IsEqual(CefRefPtr that) OVERRIDE; + CefRefPtr Copy(bool exclude_empty_children) OVERRIDE; + size_t GetSize() OVERRIDE; + bool Clear() OVERRIDE; + bool HasKey(const CefString& key) OVERRIDE; + bool GetKeys(KeyList& keys) OVERRIDE; + bool Remove(const CefString& key) OVERRIDE; + CefValueType GetType(const CefString& key) OVERRIDE; + CefRefPtr GetValue(const CefString& key) OVERRIDE; + bool GetBool(const CefString& key) OVERRIDE; + int GetInt(const CefString& key) OVERRIDE; + double GetDouble(const CefString& key) OVERRIDE; + CefString GetString(const CefString& key) OVERRIDE; + CefRefPtr GetBinary(const CefString& key) OVERRIDE; + CefRefPtr GetDictionary(const CefString& key) OVERRIDE; + CefRefPtr GetList(const CefString& key) OVERRIDE; + bool SetValue(const CefString& key, CefRefPtr value) OVERRIDE; + bool SetNull(const CefString& key) OVERRIDE; + bool SetBool(const CefString& key, bool value) OVERRIDE; + bool SetInt(const CefString& key, int value) OVERRIDE; + bool SetDouble(const CefString& key, double value) OVERRIDE; + bool SetString(const CefString& key, const CefString& value) OVERRIDE; + bool SetBinary(const CefString& key, CefRefPtr value) OVERRIDE; - virtual bool SetDictionary(const CefString& key, + bool SetDictionary(const CefString& key, CefRefPtr value) OVERRIDE; - virtual bool SetList(const CefString& key, - CefRefPtr value) OVERRIDE; + bool SetList(const CefString& key, CefRefPtr value) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.cc b/libcef_dll/ctocpp/display_handler_ctocpp.cc index 51797aea2..bb27f2e55 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/display_handler_ctocpp.cc @@ -20,7 +20,8 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, on_address_change)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_address_change)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -39,7 +40,7 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, return; // Execute - struct_->on_address_change(struct_, + _struct->on_address_change(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), url.GetStruct()); @@ -47,7 +48,8 @@ void CefDisplayHandlerCToCpp::OnAddressChange(CefRefPtr browser, void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, const CefString& title) { - if (CEF_MEMBER_MISSING(struct_, on_title_change)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_title_change)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -59,14 +61,15 @@ void CefDisplayHandlerCToCpp::OnTitleChange(CefRefPtr browser, // Unverified params: title // Execute - struct_->on_title_change(struct_, + _struct->on_title_change(_struct, CefBrowserCppToC::Wrap(browser), title.GetStruct()); } void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, const std::vector& icon_urls) { - if (CEF_MEMBER_MISSING(struct_, on_favicon_urlchange)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_favicon_urlchange)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -84,7 +87,7 @@ void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, transfer_string_list_contents(icon_urls, icon_urlsList); // Execute - struct_->on_favicon_urlchange(struct_, + _struct->on_favicon_urlchange(_struct, CefBrowserCppToC::Wrap(browser), icon_urlsList); @@ -95,7 +98,8 @@ void CefDisplayHandlerCToCpp::OnFaviconURLChange(CefRefPtr browser, bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, CefString& text) { - if (CEF_MEMBER_MISSING(struct_, on_tooltip)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_tooltip)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -107,7 +111,7 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, // Unverified params: text // Execute - int _retval = struct_->on_tooltip(struct_, + int _retval = _struct->on_tooltip(_struct, CefBrowserCppToC::Wrap(browser), text.GetWritableStruct()); @@ -117,7 +121,8 @@ bool CefDisplayHandlerCToCpp::OnTooltip(CefRefPtr browser, void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, on_status_message)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_status_message)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -129,14 +134,15 @@ void CefDisplayHandlerCToCpp::OnStatusMessage(CefRefPtr browser, // Unverified params: value // Execute - struct_->on_status_message(struct_, + _struct->on_status_message(_struct, CefBrowserCppToC::Wrap(browser), value.GetStruct()); } bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, const CefString& message, const CefString& source, int line) { - if (CEF_MEMBER_MISSING(struct_, on_console_message)) + cef_display_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_console_message)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -148,7 +154,7 @@ bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, // Unverified params: message, source // Execute - int _retval = struct_->on_console_message(struct_, + int _retval = _struct->on_console_message(_struct, CefBrowserCppToC::Wrap(browser), message.GetStruct(), source.GetStruct(), @@ -159,8 +165,22 @@ bool CefDisplayHandlerCToCpp::OnConsoleMessage(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefDisplayHandlerCToCpp::CefDisplayHandlerCToCpp() { +} + +template<> cef_display_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefDisplayHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DISPLAY_HANDLER; diff --git a/libcef_dll/ctocpp/display_handler_ctocpp.h b/libcef_dll/ctocpp/display_handler_ctocpp.h index f44651f58..3b0c9a5e1 100644 --- a/libcef_dll/ctocpp/display_handler_ctocpp.h +++ b/libcef_dll/ctocpp/display_handler_ctocpp.h @@ -29,11 +29,9 @@ class CefDisplayHandlerCToCpp : public CefCToCpp { public: - explicit CefDisplayHandlerCToCpp(cef_display_handler_t* str) - : CefCToCpp(str) {} + CefDisplayHandlerCToCpp(); - // CefDisplayHandler methods + // CefDisplayHandler methods. void OnAddressChange(CefRefPtr browser, CefRefPtr frame, const CefString& url) override; void OnTitleChange(CefRefPtr browser, @@ -49,4 +47,3 @@ class CefDisplayHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DISPLAY_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.cc b/libcef_dll/ctocpp/domdocument_ctocpp.cc index e4965701c..59c697758 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.cc +++ b/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -17,65 +17,70 @@ // VIRTUAL METHODS - Body may be edited by hand. CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return DOM_DOCUMENT_TYPE_UNKNOWN; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dom_document_type_t _retval = struct_->get_type(struct_); + cef_dom_document_type_t _retval = _struct->get_type(_struct); // Return type: simple return _retval; } CefRefPtr CefDOMDocumentCToCpp::GetDocument() { - if (CEF_MEMBER_MISSING(struct_, get_document)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_document)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_document(struct_); + cef_domnode_t* _retval = _struct->get_document(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefRefPtr CefDOMDocumentCToCpp::GetBody() { - if (CEF_MEMBER_MISSING(struct_, get_body)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_body)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_body(struct_); + cef_domnode_t* _retval = _struct->get_body(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefRefPtr CefDOMDocumentCToCpp::GetHead() { - if (CEF_MEMBER_MISSING(struct_, get_head)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_head)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_head(struct_); + cef_domnode_t* _retval = _struct->get_head(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefString CefDOMDocumentCToCpp::GetTitle() { - if (CEF_MEMBER_MISSING(struct_, get_title)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_title)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_title(struct_); + cef_string_userfree_t _retval = _struct->get_title(_struct); // Return type: string CefString _retvalStr; @@ -85,7 +90,8 @@ CefString CefDOMDocumentCToCpp::GetTitle() { CefRefPtr CefDOMDocumentCToCpp::GetElementById( const CefString& id) { - if (CEF_MEMBER_MISSING(struct_, get_element_by_id)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_by_id)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -96,7 +102,7 @@ CefRefPtr CefDOMDocumentCToCpp::GetElementById( return NULL; // Execute - cef_domnode_t* _retval = struct_->get_element_by_id(struct_, + cef_domnode_t* _retval = _struct->get_element_by_id(_struct, id.GetStruct()); // Return type: refptr_same @@ -104,65 +110,70 @@ CefRefPtr CefDOMDocumentCToCpp::GetElementById( } CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() { - if (CEF_MEMBER_MISSING(struct_, get_focused_node)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_focused_node)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_focused_node(struct_); + cef_domnode_t* _retval = _struct->get_focused_node(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } bool CefDOMDocumentCToCpp::HasSelection() { - if (CEF_MEMBER_MISSING(struct_, has_selection)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_selection)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_selection(struct_); + int _retval = _struct->has_selection(_struct); // Return type: bool return _retval?true:false; } int CefDOMDocumentCToCpp::GetSelectionStartOffset() { - if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_selection_start_offset)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_selection_start_offset(struct_); + int _retval = _struct->get_selection_start_offset(_struct); // Return type: simple return _retval; } int CefDOMDocumentCToCpp::GetSelectionEndOffset() { - if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_selection_end_offset)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_selection_end_offset(struct_); + int _retval = _struct->get_selection_end_offset(_struct); // Return type: simple return _retval; } CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { - if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_selection_as_markup)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_selection_as_markup(struct_); + cef_string_userfree_t _retval = _struct->get_selection_as_markup(_struct); // Return type: string CefString _retvalStr; @@ -171,13 +182,14 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { } CefString CefDOMDocumentCToCpp::GetSelectionAsText() { - if (CEF_MEMBER_MISSING(struct_, get_selection_as_text)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_selection_as_text)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_selection_as_text(struct_); + cef_string_userfree_t _retval = _struct->get_selection_as_text(_struct); // Return type: string CefString _retvalStr; @@ -186,13 +198,14 @@ CefString CefDOMDocumentCToCpp::GetSelectionAsText() { } CefString CefDOMDocumentCToCpp::GetBaseURL() { - if (CEF_MEMBER_MISSING(struct_, get_base_url)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_base_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_base_url(struct_); + cef_string_userfree_t _retval = _struct->get_base_url(_struct); // Return type: string CefString _retvalStr; @@ -201,7 +214,8 @@ CefString CefDOMDocumentCToCpp::GetBaseURL() { } CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { - if (CEF_MEMBER_MISSING(struct_, get_complete_url)) + cef_domdocument_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_complete_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -212,7 +226,7 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_complete_url(struct_, + cef_string_userfree_t _retval = _struct->get_complete_url(_struct, partialURL.GetStruct()); // Return type: string @@ -222,8 +236,22 @@ CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { } +// CONSTRUCTOR - Do not edit by hand. + +CefDOMDocumentCToCpp::CefDOMDocumentCToCpp() { +} + +template<> cef_domdocument_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefDOMDocument* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOMDOCUMENT; diff --git a/libcef_dll/ctocpp/domdocument_ctocpp.h b/libcef_dll/ctocpp/domdocument_ctocpp.h index 32bb1a6c8..beda6ad9e 100644 --- a/libcef_dll/ctocpp/domdocument_ctocpp.h +++ b/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -28,27 +28,24 @@ class CefDOMDocumentCToCpp : public CefCToCpp { public: - explicit CefDOMDocumentCToCpp(cef_domdocument_t* str) - : CefCToCpp( - str) {} + CefDOMDocumentCToCpp(); - // CefDOMDocument methods - virtual Type GetType() OVERRIDE; - virtual CefRefPtr GetDocument() OVERRIDE; - virtual CefRefPtr GetBody() OVERRIDE; - virtual CefRefPtr GetHead() OVERRIDE; - virtual CefString GetTitle() OVERRIDE; - virtual CefRefPtr GetElementById(const CefString& id) OVERRIDE; - virtual CefRefPtr GetFocusedNode() OVERRIDE; - virtual bool HasSelection() OVERRIDE; - virtual int GetSelectionStartOffset() OVERRIDE; - virtual int GetSelectionEndOffset() OVERRIDE; - virtual CefString GetSelectionAsMarkup() OVERRIDE; - virtual CefString GetSelectionAsText() OVERRIDE; - virtual CefString GetBaseURL() OVERRIDE; - virtual CefString GetCompleteURL(const CefString& partialURL) OVERRIDE; + // CefDOMDocument methods. + Type GetType() OVERRIDE; + CefRefPtr GetDocument() OVERRIDE; + CefRefPtr GetBody() OVERRIDE; + CefRefPtr GetHead() OVERRIDE; + CefString GetTitle() OVERRIDE; + CefRefPtr GetElementById(const CefString& id) OVERRIDE; + CefRefPtr GetFocusedNode() OVERRIDE; + bool HasSelection() OVERRIDE; + int GetSelectionStartOffset() OVERRIDE; + int GetSelectionEndOffset() OVERRIDE; + CefString GetSelectionAsMarkup() OVERRIDE; + CefString GetSelectionAsText() OVERRIDE; + CefString GetBaseURL() OVERRIDE; + CefString GetCompleteURL(const CefString& partialURL) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/domnode_ctocpp.cc b/libcef_dll/ctocpp/domnode_ctocpp.cc index 05306b72d..5c7e938bd 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.cc +++ b/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -18,79 +18,85 @@ // VIRTUAL METHODS - Body may be edited by hand. CefDOMNode::Type CefDOMNodeCToCpp::GetType() { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return DOM_NODE_TYPE_UNSUPPORTED; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dom_node_type_t _retval = struct_->get_type(struct_); + cef_dom_node_type_t _retval = _struct->get_type(_struct); // Return type: simple return _retval; } bool CefDOMNodeCToCpp::IsText() { - if (CEF_MEMBER_MISSING(struct_, is_text)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_text)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_text(struct_); + int _retval = _struct->is_text(_struct); // Return type: bool return _retval?true:false; } bool CefDOMNodeCToCpp::IsElement() { - if (CEF_MEMBER_MISSING(struct_, is_element)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_element(struct_); + int _retval = _struct->is_element(_struct); // Return type: bool return _retval?true:false; } bool CefDOMNodeCToCpp::IsEditable() { - if (CEF_MEMBER_MISSING(struct_, is_editable)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_editable)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_editable(struct_); + int _retval = _struct->is_editable(_struct); // Return type: bool return _retval?true:false; } bool CefDOMNodeCToCpp::IsFormControlElement() { - if (CEF_MEMBER_MISSING(struct_, is_form_control_element)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_form_control_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_form_control_element(struct_); + int _retval = _struct->is_form_control_element(_struct); // Return type: bool return _retval?true:false; } CefString CefDOMNodeCToCpp::GetFormControlElementType() { - if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_form_control_element_type)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_form_control_element_type( - struct_); + cef_string_userfree_t _retval = _struct->get_form_control_element_type( + _struct); // Return type: string CefString _retvalStr; @@ -99,7 +105,8 @@ CefString CefDOMNodeCToCpp::GetFormControlElementType() { } bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -110,7 +117,7 @@ bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefDOMNodeCToCpp::Unwrap(that)); // Return type: bool @@ -118,13 +125,14 @@ bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { } CefString CefDOMNodeCToCpp::GetName() { - if (CEF_MEMBER_MISSING(struct_, get_name)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_name(struct_); + cef_string_userfree_t _retval = _struct->get_name(_struct); // Return type: string CefString _retvalStr; @@ -133,13 +141,14 @@ CefString CefDOMNodeCToCpp::GetName() { } CefString CefDOMNodeCToCpp::GetValue() { - if (CEF_MEMBER_MISSING(struct_, get_value)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_value(struct_); + cef_string_userfree_t _retval = _struct->get_value(_struct); // Return type: string CefString _retvalStr; @@ -148,7 +157,8 @@ CefString CefDOMNodeCToCpp::GetValue() { } bool CefDOMNodeCToCpp::SetValue(const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, set_value)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -159,7 +169,7 @@ bool CefDOMNodeCToCpp::SetValue(const CefString& value) { return false; // Execute - int _retval = struct_->set_value(struct_, + int _retval = _struct->set_value(_struct, value.GetStruct()); // Return type: bool @@ -167,13 +177,14 @@ bool CefDOMNodeCToCpp::SetValue(const CefString& value) { } CefString CefDOMNodeCToCpp::GetAsMarkup() { - if (CEF_MEMBER_MISSING(struct_, get_as_markup)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_as_markup)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_as_markup(struct_); + cef_string_userfree_t _retval = _struct->get_as_markup(_struct); // Return type: string CefString _retvalStr; @@ -182,104 +193,112 @@ CefString CefDOMNodeCToCpp::GetAsMarkup() { } CefRefPtr CefDOMNodeCToCpp::GetDocument() { - if (CEF_MEMBER_MISSING(struct_, get_document)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_document)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domdocument_t* _retval = struct_->get_document(struct_); + cef_domdocument_t* _retval = _struct->get_document(_struct); // Return type: refptr_same return CefDOMDocumentCToCpp::Wrap(_retval); } CefRefPtr CefDOMNodeCToCpp::GetParent() { - if (CEF_MEMBER_MISSING(struct_, get_parent)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_parent)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_parent(struct_); + cef_domnode_t* _retval = _struct->get_parent(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() { - if (CEF_MEMBER_MISSING(struct_, get_previous_sibling)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_previous_sibling)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_previous_sibling(struct_); + cef_domnode_t* _retval = _struct->get_previous_sibling(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefRefPtr CefDOMNodeCToCpp::GetNextSibling() { - if (CEF_MEMBER_MISSING(struct_, get_next_sibling)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_next_sibling)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_next_sibling(struct_); + cef_domnode_t* _retval = _struct->get_next_sibling(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } bool CefDOMNodeCToCpp::HasChildren() { - if (CEF_MEMBER_MISSING(struct_, has_children)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_children)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_children(struct_); + int _retval = _struct->has_children(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { - if (CEF_MEMBER_MISSING(struct_, get_first_child)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_first_child)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_first_child(struct_); + cef_domnode_t* _retval = _struct->get_first_child(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefRefPtr CefDOMNodeCToCpp::GetLastChild() { - if (CEF_MEMBER_MISSING(struct_, get_last_child)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_last_child)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_domnode_t* _retval = struct_->get_last_child(struct_); + cef_domnode_t* _retval = _struct->get_last_child(_struct); // Return type: refptr_same return CefDOMNodeCToCpp::Wrap(_retval); } CefString CefDOMNodeCToCpp::GetElementTagName() { - if (CEF_MEMBER_MISSING(struct_, get_element_tag_name)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_tag_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_element_tag_name(struct_); + cef_string_userfree_t _retval = _struct->get_element_tag_name(_struct); // Return type: string CefString _retvalStr; @@ -288,20 +307,22 @@ CefString CefDOMNodeCToCpp::GetElementTagName() { } bool CefDOMNodeCToCpp::HasElementAttributes() { - if (CEF_MEMBER_MISSING(struct_, has_element_attributes)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_element_attributes)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_element_attributes(struct_); + int _retval = _struct->has_element_attributes(_struct); // Return type: bool return _retval?true:false; } bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { - if (CEF_MEMBER_MISSING(struct_, has_element_attribute)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_element_attribute)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -312,7 +333,7 @@ bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { return false; // Execute - int _retval = struct_->has_element_attribute(struct_, + int _retval = _struct->has_element_attribute(_struct, attrName.GetStruct()); // Return type: bool @@ -320,7 +341,8 @@ bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { } CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { - if (CEF_MEMBER_MISSING(struct_, get_element_attribute)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_attribute)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -331,7 +353,7 @@ CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_element_attribute(struct_, + cef_string_userfree_t _retval = _struct->get_element_attribute(_struct, attrName.GetStruct()); // Return type: string @@ -341,7 +363,8 @@ CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { } void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { - if (CEF_MEMBER_MISSING(struct_, get_element_attributes)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_attributes)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -353,7 +376,7 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { transfer_string_map_contents(attrMap, attrMapMap); // Execute - struct_->get_element_attributes(struct_, + _struct->get_element_attributes(_struct, attrMapMap); // Restore param:attrMap; type: string_map_single_byref @@ -366,7 +389,8 @@ void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, set_element_attribute)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_element_attribute)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -381,7 +405,7 @@ bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, return false; // Execute - int _retval = struct_->set_element_attribute(struct_, + int _retval = _struct->set_element_attribute(_struct, attrName.GetStruct(), value.GetStruct()); @@ -390,13 +414,14 @@ bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, } CefString CefDOMNodeCToCpp::GetElementInnerText() { - if (CEF_MEMBER_MISSING(struct_, get_element_inner_text)) + cef_domnode_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_inner_text)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_element_inner_text(struct_); + cef_string_userfree_t _retval = _struct->get_element_inner_text(_struct); // Return type: string CefString _retvalStr; @@ -405,8 +430,21 @@ CefString CefDOMNodeCToCpp::GetElementInnerText() { } +// CONSTRUCTOR - Do not edit by hand. + +CefDOMNodeCToCpp::CefDOMNodeCToCpp() { +} + +template<> cef_domnode_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefDOMNode* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOMNODE; diff --git a/libcef_dll/ctocpp/domnode_ctocpp.h b/libcef_dll/ctocpp/domnode_ctocpp.h index 24b42e67a..18e5f5360 100644 --- a/libcef_dll/ctocpp/domnode_ctocpp.h +++ b/libcef_dll/ctocpp/domnode_ctocpp.h @@ -27,38 +27,36 @@ class CefDOMNodeCToCpp : public CefCToCpp { public: - explicit CefDOMNodeCToCpp(cef_domnode_t* str) - : CefCToCpp(str) {} + CefDOMNodeCToCpp(); - // CefDOMNode methods - virtual Type GetType() OVERRIDE; - virtual bool IsText() OVERRIDE; - virtual bool IsElement() OVERRIDE; - virtual bool IsEditable() OVERRIDE; - virtual bool IsFormControlElement() OVERRIDE; - virtual CefString GetFormControlElementType() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual CefString GetName() OVERRIDE; - virtual CefString GetValue() OVERRIDE; - virtual bool SetValue(const CefString& value) OVERRIDE; - virtual CefString GetAsMarkup() OVERRIDE; - virtual CefRefPtr GetDocument() OVERRIDE; - virtual CefRefPtr GetParent() OVERRIDE; - virtual CefRefPtr GetPreviousSibling() OVERRIDE; - virtual CefRefPtr GetNextSibling() OVERRIDE; - virtual bool HasChildren() OVERRIDE; - virtual CefRefPtr GetFirstChild() OVERRIDE; - virtual CefRefPtr GetLastChild() OVERRIDE; - virtual CefString GetElementTagName() OVERRIDE; - virtual bool HasElementAttributes() OVERRIDE; - virtual bool HasElementAttribute(const CefString& attrName) OVERRIDE; - virtual CefString GetElementAttribute(const CefString& attrName) OVERRIDE; - virtual void GetElementAttributes(AttributeMap& attrMap) OVERRIDE; - virtual bool SetElementAttribute(const CefString& attrName, + // CefDOMNode methods. + Type GetType() OVERRIDE; + bool IsText() OVERRIDE; + bool IsElement() OVERRIDE; + bool IsEditable() OVERRIDE; + bool IsFormControlElement() OVERRIDE; + CefString GetFormControlElementType() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + CefString GetName() OVERRIDE; + CefString GetValue() OVERRIDE; + bool SetValue(const CefString& value) OVERRIDE; + CefString GetAsMarkup() OVERRIDE; + CefRefPtr GetDocument() OVERRIDE; + CefRefPtr GetParent() OVERRIDE; + CefRefPtr GetPreviousSibling() OVERRIDE; + CefRefPtr GetNextSibling() OVERRIDE; + bool HasChildren() OVERRIDE; + CefRefPtr GetFirstChild() OVERRIDE; + CefRefPtr GetLastChild() OVERRIDE; + CefString GetElementTagName() OVERRIDE; + bool HasElementAttributes() OVERRIDE; + bool HasElementAttribute(const CefString& attrName) OVERRIDE; + CefString GetElementAttribute(const CefString& attrName) OVERRIDE; + void GetElementAttributes(AttributeMap& attrMap) OVERRIDE; + bool SetElementAttribute(const CefString& attrName, const CefString& value) OVERRIDE; - virtual CefString GetElementInnerText() OVERRIDE; + CefString GetElementInnerText() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.cc b/libcef_dll/ctocpp/domvisitor_ctocpp.cc index 51db2b04f..8620034b1 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.cc +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.cc @@ -17,7 +17,8 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { - if (CEF_MEMBER_MISSING(struct_, visit)) + cef_domvisitor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -28,13 +29,26 @@ void CefDOMVisitorCToCpp::Visit(CefRefPtr document) { return; // Execute - struct_->visit(struct_, + _struct->visit(_struct, CefDOMDocumentCppToC::Wrap(document)); } +// CONSTRUCTOR - Do not edit by hand. + +CefDOMVisitorCToCpp::CefDOMVisitorCToCpp() { +} + +template<> cef_domvisitor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefDOMVisitor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOMVISITOR; diff --git a/libcef_dll/ctocpp/domvisitor_ctocpp.h b/libcef_dll/ctocpp/domvisitor_ctocpp.h index eb5b8062d..95e951857 100644 --- a/libcef_dll/ctocpp/domvisitor_ctocpp.h +++ b/libcef_dll/ctocpp/domvisitor_ctocpp.h @@ -27,13 +27,11 @@ class CefDOMVisitorCToCpp : public CefCToCpp { public: - explicit CefDOMVisitorCToCpp(cef_domvisitor_t* str) - : CefCToCpp(str) {} + CefDOMVisitorCToCpp(); - // CefDOMVisitor methods + // CefDOMVisitor methods. void Visit(CefRefPtr document) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.cc b/libcef_dll/ctocpp/download_handler_ctocpp.cc index e1c1475c8..597dd0a6c 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/download_handler_ctocpp.cc @@ -22,7 +22,8 @@ void CefDownloadHandlerCToCpp::OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, const CefString& suggested_name, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_before_download)) + cef_download_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_download)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -45,7 +46,7 @@ void CefDownloadHandlerCToCpp::OnBeforeDownload(CefRefPtr browser, return; // Execute - struct_->on_before_download(struct_, + _struct->on_before_download(_struct, CefBrowserCppToC::Wrap(browser), CefDownloadItemCppToC::Wrap(download_item), suggested_name.GetStruct(), @@ -55,7 +56,8 @@ void CefDownloadHandlerCToCpp::OnBeforeDownload(CefRefPtr browser, void CefDownloadHandlerCToCpp::OnDownloadUpdated(CefRefPtr browser, CefRefPtr download_item, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_download_updated)) + cef_download_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_download_updated)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -74,15 +76,30 @@ void CefDownloadHandlerCToCpp::OnDownloadUpdated(CefRefPtr browser, return; // Execute - struct_->on_download_updated(struct_, + _struct->on_download_updated(_struct, CefBrowserCppToC::Wrap(browser), CefDownloadItemCppToC::Wrap(download_item), CefDownloadItemCallbackCppToC::Wrap(callback)); } +// CONSTRUCTOR - Do not edit by hand. + +CefDownloadHandlerCToCpp::CefDownloadHandlerCToCpp() { +} + +template<> cef_download_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefDownloadHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_DOWNLOAD_HANDLER; diff --git a/libcef_dll/ctocpp/download_handler_ctocpp.h b/libcef_dll/ctocpp/download_handler_ctocpp.h index 9796d36b9..d9803b0c1 100644 --- a/libcef_dll/ctocpp/download_handler_ctocpp.h +++ b/libcef_dll/ctocpp/download_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefDownloadHandlerCToCpp : public CefCToCpp { public: - explicit CefDownloadHandlerCToCpp(cef_download_handler_t* str) - : CefCToCpp(str) {} + CefDownloadHandlerCToCpp(); - // CefDownloadHandler methods + // CefDownloadHandler methods. void OnBeforeDownload(CefRefPtr browser, CefRefPtr download_item, const CefString& suggested_name, @@ -44,4 +42,3 @@ class CefDownloadHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc index e219bbee1..a4a50634f 100644 --- a/libcef_dll/ctocpp/download_item_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.cc @@ -16,38 +16,56 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefDownloadItemCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_download_item_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } void CefDownloadItemCallbackCToCpp::Pause() { - if (CEF_MEMBER_MISSING(struct_, pause)) + cef_download_item_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, pause)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->pause(struct_); + _struct->pause(_struct); } void CefDownloadItemCallbackCToCpp::Resume() { - if (CEF_MEMBER_MISSING(struct_, resume)) + cef_download_item_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, resume)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->resume(struct_); + _struct->resume(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefDownloadItemCallbackCToCpp::CefDownloadItemCallbackCToCpp() { +} + +template<> cef_download_item_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefDownloadItemCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_DOWNLOAD_ITEM_CALLBACK; diff --git a/libcef_dll/ctocpp/download_item_callback_ctocpp.h b/libcef_dll/ctocpp/download_item_callback_ctocpp.h index c59ded45d..597c77f58 100644 --- a/libcef_dll/ctocpp/download_item_callback_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_callback_ctocpp.h @@ -28,16 +28,13 @@ class CefDownloadItemCallbackCToCpp : public CefCToCpp { public: - explicit CefDownloadItemCallbackCToCpp(cef_download_item_callback_t* str) - : CefCToCpp(str) {} + CefDownloadItemCallbackCToCpp(); - // CefDownloadItemCallback methods - virtual void Cancel() OVERRIDE; - virtual void Pause() OVERRIDE; - virtual void Resume() OVERRIDE; + // CefDownloadItemCallback methods. + void Cancel() OVERRIDE; + void Pause() OVERRIDE; + void Resume() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/download_item_ctocpp.cc b/libcef_dll/ctocpp/download_item_ctocpp.cc index 908739a89..c3283c7e1 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.cc +++ b/libcef_dll/ctocpp/download_item_ctocpp.cc @@ -16,143 +16,154 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefDownloadItemCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefDownloadItemCToCpp::IsInProgress() { - if (CEF_MEMBER_MISSING(struct_, is_in_progress)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_in_progress)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_in_progress(struct_); + int _retval = _struct->is_in_progress(_struct); // Return type: bool return _retval?true:false; } bool CefDownloadItemCToCpp::IsComplete() { - if (CEF_MEMBER_MISSING(struct_, is_complete)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_complete)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_complete(struct_); + int _retval = _struct->is_complete(_struct); // Return type: bool return _retval?true:false; } bool CefDownloadItemCToCpp::IsCanceled() { - if (CEF_MEMBER_MISSING(struct_, is_canceled)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_canceled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_canceled(struct_); + int _retval = _struct->is_canceled(_struct); // Return type: bool return _retval?true:false; } int64 CefDownloadItemCToCpp::GetCurrentSpeed() { - if (CEF_MEMBER_MISSING(struct_, get_current_speed)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_current_speed)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->get_current_speed(struct_); + int64 _retval = _struct->get_current_speed(_struct); // Return type: simple return _retval; } int CefDownloadItemCToCpp::GetPercentComplete() { - if (CEF_MEMBER_MISSING(struct_, get_percent_complete)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_percent_complete)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_percent_complete(struct_); + int _retval = _struct->get_percent_complete(_struct); // Return type: simple return _retval; } int64 CefDownloadItemCToCpp::GetTotalBytes() { - if (CEF_MEMBER_MISSING(struct_, get_total_bytes)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_total_bytes)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->get_total_bytes(struct_); + int64 _retval = _struct->get_total_bytes(_struct); // Return type: simple return _retval; } int64 CefDownloadItemCToCpp::GetReceivedBytes() { - if (CEF_MEMBER_MISSING(struct_, get_received_bytes)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_received_bytes)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->get_received_bytes(struct_); + int64 _retval = _struct->get_received_bytes(_struct); // Return type: simple return _retval; } CefTime CefDownloadItemCToCpp::GetStartTime() { - if (CEF_MEMBER_MISSING(struct_, get_start_time)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_start_time)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_start_time(struct_); + cef_time_t _retval = _struct->get_start_time(_struct); // Return type: simple return _retval; } CefTime CefDownloadItemCToCpp::GetEndTime() { - if (CEF_MEMBER_MISSING(struct_, get_end_time)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_end_time)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_end_time(struct_); + cef_time_t _retval = _struct->get_end_time(_struct); // Return type: simple return _retval; } CefString CefDownloadItemCToCpp::GetFullPath() { - if (CEF_MEMBER_MISSING(struct_, get_full_path)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_full_path)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_full_path(struct_); + cef_string_userfree_t _retval = _struct->get_full_path(_struct); // Return type: string CefString _retvalStr; @@ -161,26 +172,28 @@ CefString CefDownloadItemCToCpp::GetFullPath() { } uint32 CefDownloadItemCToCpp::GetId() { - if (CEF_MEMBER_MISSING(struct_, get_id)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_id)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - uint32 _retval = struct_->get_id(struct_); + uint32 _retval = _struct->get_id(_struct); // Return type: simple return _retval; } CefString CefDownloadItemCToCpp::GetURL() { - if (CEF_MEMBER_MISSING(struct_, get_url)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_url(struct_); + cef_string_userfree_t _retval = _struct->get_url(_struct); // Return type: string CefString _retvalStr; @@ -189,13 +202,14 @@ CefString CefDownloadItemCToCpp::GetURL() { } CefString CefDownloadItemCToCpp::GetOriginalUrl() { - if (CEF_MEMBER_MISSING(struct_, get_original_url)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_original_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_original_url(struct_); + cef_string_userfree_t _retval = _struct->get_original_url(_struct); // Return type: string CefString _retvalStr; @@ -204,13 +218,14 @@ CefString CefDownloadItemCToCpp::GetOriginalUrl() { } CefString CefDownloadItemCToCpp::GetSuggestedFileName() { - if (CEF_MEMBER_MISSING(struct_, get_suggested_file_name)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_suggested_file_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_suggested_file_name(struct_); + cef_string_userfree_t _retval = _struct->get_suggested_file_name(_struct); // Return type: string CefString _retvalStr; @@ -219,13 +234,14 @@ CefString CefDownloadItemCToCpp::GetSuggestedFileName() { } CefString CefDownloadItemCToCpp::GetContentDisposition() { - if (CEF_MEMBER_MISSING(struct_, get_content_disposition)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_content_disposition)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_content_disposition(struct_); + cef_string_userfree_t _retval = _struct->get_content_disposition(_struct); // Return type: string CefString _retvalStr; @@ -234,13 +250,14 @@ CefString CefDownloadItemCToCpp::GetContentDisposition() { } CefString CefDownloadItemCToCpp::GetMimeType() { - if (CEF_MEMBER_MISSING(struct_, get_mime_type)) + cef_download_item_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_mime_type)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_mime_type(struct_); + cef_string_userfree_t _retval = _struct->get_mime_type(_struct); // Return type: string CefString _retvalStr; @@ -249,8 +266,22 @@ CefString CefDownloadItemCToCpp::GetMimeType() { } +// CONSTRUCTOR - Do not edit by hand. + +CefDownloadItemCToCpp::CefDownloadItemCToCpp() { +} + +template<> cef_download_item_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefDownloadItem* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DOWNLOAD_ITEM; diff --git a/libcef_dll/ctocpp/download_item_ctocpp.h b/libcef_dll/ctocpp/download_item_ctocpp.h index af0cb5f05..26b3a5342 100644 --- a/libcef_dll/ctocpp/download_item_ctocpp.h +++ b/libcef_dll/ctocpp/download_item_ctocpp.h @@ -28,30 +28,27 @@ class CefDownloadItemCToCpp : public CefCToCpp { public: - explicit CefDownloadItemCToCpp(cef_download_item_t* str) - : CefCToCpp( - str) {} + CefDownloadItemCToCpp(); - // CefDownloadItem methods - virtual bool IsValid() OVERRIDE; - virtual bool IsInProgress() OVERRIDE; - virtual bool IsComplete() OVERRIDE; - virtual bool IsCanceled() OVERRIDE; - virtual int64 GetCurrentSpeed() OVERRIDE; - virtual int GetPercentComplete() OVERRIDE; - virtual int64 GetTotalBytes() OVERRIDE; - virtual int64 GetReceivedBytes() OVERRIDE; - virtual CefTime GetStartTime() OVERRIDE; - virtual CefTime GetEndTime() OVERRIDE; - virtual CefString GetFullPath() OVERRIDE; - virtual uint32 GetId() OVERRIDE; - virtual CefString GetURL() OVERRIDE; - virtual CefString GetOriginalUrl() OVERRIDE; - virtual CefString GetSuggestedFileName() OVERRIDE; - virtual CefString GetContentDisposition() OVERRIDE; - virtual CefString GetMimeType() OVERRIDE; + // CefDownloadItem methods. + bool IsValid() OVERRIDE; + bool IsInProgress() OVERRIDE; + bool IsComplete() OVERRIDE; + bool IsCanceled() OVERRIDE; + int64 GetCurrentSpeed() OVERRIDE; + int GetPercentComplete() OVERRIDE; + int64 GetTotalBytes() OVERRIDE; + int64 GetReceivedBytes() OVERRIDE; + CefTime GetStartTime() OVERRIDE; + CefTime GetEndTime() OVERRIDE; + CefString GetFullPath() OVERRIDE; + uint32 GetId() OVERRIDE; + CefString GetURL() OVERRIDE; + CefString GetOriginalUrl() OVERRIDE; + CefString GetSuggestedFileName() OVERRIDE; + CefString GetContentDisposition() OVERRIDE; + CefString GetMimeType() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.cc b/libcef_dll/ctocpp/drag_data_ctocpp.cc index a9c84563f..e36f896b6 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -31,78 +31,84 @@ CefRefPtr CefDragData::Create() { // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefDragDataCToCpp::Clone() { - if (CEF_MEMBER_MISSING(struct_, clone)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clone)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_drag_data_t* _retval = struct_->clone(struct_); + cef_drag_data_t* _retval = _struct->clone(_struct); // Return type: refptr_same return CefDragDataCToCpp::Wrap(_retval); } bool CefDragDataCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } bool CefDragDataCToCpp::IsLink() { - if (CEF_MEMBER_MISSING(struct_, is_link)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_link)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_link(struct_); + int _retval = _struct->is_link(_struct); // Return type: bool return _retval?true:false; } bool CefDragDataCToCpp::IsFragment() { - if (CEF_MEMBER_MISSING(struct_, is_fragment)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_fragment)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_fragment(struct_); + int _retval = _struct->is_fragment(_struct); // Return type: bool return _retval?true:false; } bool CefDragDataCToCpp::IsFile() { - if (CEF_MEMBER_MISSING(struct_, is_file)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_file(struct_); + int _retval = _struct->is_file(_struct); // Return type: bool return _retval?true:false; } CefString CefDragDataCToCpp::GetLinkURL() { - if (CEF_MEMBER_MISSING(struct_, get_link_url)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_link_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_link_url(struct_); + cef_string_userfree_t _retval = _struct->get_link_url(_struct); // Return type: string CefString _retvalStr; @@ -111,13 +117,14 @@ CefString CefDragDataCToCpp::GetLinkURL() { } CefString CefDragDataCToCpp::GetLinkTitle() { - if (CEF_MEMBER_MISSING(struct_, get_link_title)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_link_title)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_link_title(struct_); + cef_string_userfree_t _retval = _struct->get_link_title(_struct); // Return type: string CefString _retvalStr; @@ -126,13 +133,14 @@ CefString CefDragDataCToCpp::GetLinkTitle() { } CefString CefDragDataCToCpp::GetLinkMetadata() { - if (CEF_MEMBER_MISSING(struct_, get_link_metadata)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_link_metadata)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_link_metadata(struct_); + cef_string_userfree_t _retval = _struct->get_link_metadata(_struct); // Return type: string CefString _retvalStr; @@ -141,13 +149,14 @@ CefString CefDragDataCToCpp::GetLinkMetadata() { } CefString CefDragDataCToCpp::GetFragmentText() { - if (CEF_MEMBER_MISSING(struct_, get_fragment_text)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_fragment_text)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_fragment_text(struct_); + cef_string_userfree_t _retval = _struct->get_fragment_text(_struct); // Return type: string CefString _retvalStr; @@ -156,13 +165,14 @@ CefString CefDragDataCToCpp::GetFragmentText() { } CefString CefDragDataCToCpp::GetFragmentHtml() { - if (CEF_MEMBER_MISSING(struct_, get_fragment_html)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_fragment_html)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_fragment_html(struct_); + cef_string_userfree_t _retval = _struct->get_fragment_html(_struct); // Return type: string CefString _retvalStr; @@ -171,13 +181,14 @@ CefString CefDragDataCToCpp::GetFragmentHtml() { } CefString CefDragDataCToCpp::GetFragmentBaseURL() { - if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_fragment_base_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_fragment_base_url(struct_); + cef_string_userfree_t _retval = _struct->get_fragment_base_url(_struct); // Return type: string CefString _retvalStr; @@ -186,13 +197,14 @@ CefString CefDragDataCToCpp::GetFragmentBaseURL() { } CefString CefDragDataCToCpp::GetFileName() { - if (CEF_MEMBER_MISSING(struct_, get_file_name)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_file_name(struct_); + cef_string_userfree_t _retval = _struct->get_file_name(_struct); // Return type: string CefString _retvalStr; @@ -201,7 +213,8 @@ CefString CefDragDataCToCpp::GetFileName() { } size_t CefDragDataCToCpp::GetFileContents(CefRefPtr writer) { - if (CEF_MEMBER_MISSING(struct_, get_file_contents)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_contents)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -209,7 +222,7 @@ size_t CefDragDataCToCpp::GetFileContents(CefRefPtr writer) { // Unverified params: writer // Execute - size_t _retval = struct_->get_file_contents(struct_, + size_t _retval = _struct->get_file_contents(_struct, CefStreamWriterCToCpp::Unwrap(writer)); // Return type: simple @@ -217,7 +230,8 @@ size_t CefDragDataCToCpp::GetFileContents(CefRefPtr writer) { } bool CefDragDataCToCpp::GetFileNames(std::vector& names) { - if (CEF_MEMBER_MISSING(struct_, get_file_names)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_names)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -229,7 +243,7 @@ bool CefDragDataCToCpp::GetFileNames(std::vector& names) { transfer_string_list_contents(names, namesList); // Execute - int _retval = struct_->get_file_names(struct_, + int _retval = _struct->get_file_names(_struct, namesList); // Restore param:names; type: string_vec_byref @@ -244,7 +258,8 @@ bool CefDragDataCToCpp::GetFileNames(std::vector& names) { } void CefDragDataCToCpp::SetLinkURL(const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, set_link_url)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_link_url)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -252,12 +267,13 @@ void CefDragDataCToCpp::SetLinkURL(const CefString& url) { // Unverified params: url // Execute - struct_->set_link_url(struct_, + _struct->set_link_url(_struct, url.GetStruct()); } void CefDragDataCToCpp::SetLinkTitle(const CefString& title) { - if (CEF_MEMBER_MISSING(struct_, set_link_title)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_link_title)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -265,12 +281,13 @@ void CefDragDataCToCpp::SetLinkTitle(const CefString& title) { // Unverified params: title // Execute - struct_->set_link_title(struct_, + _struct->set_link_title(_struct, title.GetStruct()); } void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) { - if (CEF_MEMBER_MISSING(struct_, set_link_metadata)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_link_metadata)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -278,12 +295,13 @@ void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) { // Unverified params: data // Execute - struct_->set_link_metadata(struct_, + _struct->set_link_metadata(_struct, data.GetStruct()); } void CefDragDataCToCpp::SetFragmentText(const CefString& text) { - if (CEF_MEMBER_MISSING(struct_, set_fragment_text)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_fragment_text)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -291,12 +309,13 @@ void CefDragDataCToCpp::SetFragmentText(const CefString& text) { // Unverified params: text // Execute - struct_->set_fragment_text(struct_, + _struct->set_fragment_text(_struct, text.GetStruct()); } void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) { - if (CEF_MEMBER_MISSING(struct_, set_fragment_html)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_fragment_html)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -304,12 +323,13 @@ void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) { // Unverified params: html // Execute - struct_->set_fragment_html(struct_, + _struct->set_fragment_html(_struct, html.GetStruct()); } void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) { - if (CEF_MEMBER_MISSING(struct_, set_fragment_base_url)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_fragment_base_url)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -317,23 +337,25 @@ void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) { // Unverified params: base_url // Execute - struct_->set_fragment_base_url(struct_, + _struct->set_fragment_base_url(_struct, base_url.GetStruct()); } void CefDragDataCToCpp::ResetFileContents() { - if (CEF_MEMBER_MISSING(struct_, reset_file_contents)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, reset_file_contents)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->reset_file_contents(struct_); + _struct->reset_file_contents(_struct); } void CefDragDataCToCpp::AddFile(const CefString& path, const CefString& display_name) { - if (CEF_MEMBER_MISSING(struct_, add_file)) + cef_drag_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_file)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -345,14 +367,27 @@ void CefDragDataCToCpp::AddFile(const CefString& path, // Unverified params: display_name // Execute - struct_->add_file(struct_, + _struct->add_file(_struct, path.GetStruct(), display_name.GetStruct()); } +// CONSTRUCTOR - Do not edit by hand. + +CefDragDataCToCpp::CefDragDataCToCpp() { +} + +template<> cef_drag_data_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefDragData* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DRAG_DATA; diff --git a/libcef_dll/ctocpp/drag_data_ctocpp.h b/libcef_dll/ctocpp/drag_data_ctocpp.h index e7c3038f6..b837d28e7 100644 --- a/libcef_dll/ctocpp/drag_data_ctocpp.h +++ b/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -28,35 +28,32 @@ class CefDragDataCToCpp : public CefCToCpp { public: - explicit CefDragDataCToCpp(cef_drag_data_t* str) - : CefCToCpp(str) {} + CefDragDataCToCpp(); - // CefDragData methods - virtual CefRefPtr Clone() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual bool IsLink() OVERRIDE; - virtual bool IsFragment() OVERRIDE; - virtual bool IsFile() OVERRIDE; - virtual CefString GetLinkURL() OVERRIDE; - virtual CefString GetLinkTitle() OVERRIDE; - virtual CefString GetLinkMetadata() OVERRIDE; - virtual CefString GetFragmentText() OVERRIDE; - virtual CefString GetFragmentHtml() OVERRIDE; - virtual CefString GetFragmentBaseURL() OVERRIDE; - virtual CefString GetFileName() OVERRIDE; - virtual size_t GetFileContents(CefRefPtr writer) OVERRIDE; - virtual bool GetFileNames(std::vector& names) OVERRIDE; - virtual void SetLinkURL(const CefString& url) OVERRIDE; - virtual void SetLinkTitle(const CefString& title) OVERRIDE; - virtual void SetLinkMetadata(const CefString& data) OVERRIDE; - virtual void SetFragmentText(const CefString& text) OVERRIDE; - virtual void SetFragmentHtml(const CefString& html) OVERRIDE; - virtual void SetFragmentBaseURL(const CefString& base_url) OVERRIDE; - virtual void ResetFileContents() OVERRIDE; - virtual void AddFile(const CefString& path, - const CefString& display_name) OVERRIDE; + // CefDragData methods. + CefRefPtr Clone() OVERRIDE; + bool IsReadOnly() OVERRIDE; + bool IsLink() OVERRIDE; + bool IsFragment() OVERRIDE; + bool IsFile() OVERRIDE; + CefString GetLinkURL() OVERRIDE; + CefString GetLinkTitle() OVERRIDE; + CefString GetLinkMetadata() OVERRIDE; + CefString GetFragmentText() OVERRIDE; + CefString GetFragmentHtml() OVERRIDE; + CefString GetFragmentBaseURL() OVERRIDE; + CefString GetFileName() OVERRIDE; + size_t GetFileContents(CefRefPtr writer) OVERRIDE; + bool GetFileNames(std::vector& names) OVERRIDE; + void SetLinkURL(const CefString& url) OVERRIDE; + void SetLinkTitle(const CefString& title) OVERRIDE; + void SetLinkMetadata(const CefString& data) OVERRIDE; + void SetFragmentText(const CefString& text) OVERRIDE; + void SetFragmentHtml(const CefString& html) OVERRIDE; + void SetFragmentBaseURL(const CefString& base_url) OVERRIDE; + void ResetFileContents() OVERRIDE; + void AddFile(const CefString& path, const CefString& display_name) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.cc b/libcef_dll/ctocpp/drag_handler_ctocpp.cc index 52e781900..d85b01463 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.cc @@ -19,7 +19,8 @@ bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) { - if (CEF_MEMBER_MISSING(struct_, on_drag_enter)) + cef_drag_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_drag_enter)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -34,7 +35,7 @@ bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_drag_enter(struct_, + int _retval = _struct->on_drag_enter(_struct, CefBrowserCppToC::Wrap(browser), CefDragDataCppToC::Wrap(dragData), mask); @@ -44,8 +45,22 @@ bool CefDragHandlerCToCpp::OnDragEnter(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefDragHandlerCToCpp::CefDragHandlerCToCpp() { +} + +template<> cef_drag_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefDragHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_DRAG_HANDLER; diff --git a/libcef_dll/ctocpp/drag_handler_ctocpp.h b/libcef_dll/ctocpp/drag_handler_ctocpp.h index b342ab895..5d7bf48f1 100644 --- a/libcef_dll/ctocpp/drag_handler_ctocpp.h +++ b/libcef_dll/ctocpp/drag_handler_ctocpp.h @@ -28,15 +28,12 @@ class CefDragHandlerCToCpp : public CefCToCpp { public: - explicit CefDragHandlerCToCpp(cef_drag_handler_t* str) - : CefCToCpp( - str) {} + CefDragHandlerCToCpp(); - // CefDragHandler methods + // CefDragHandler methods. bool OnDragEnter(CefRefPtr browser, CefRefPtr dragData, DragOperationsMask mask) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc index 9f88e054b..b5a10c3f7 100644 --- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.cc @@ -17,7 +17,8 @@ void CefEndTracingCallbackCToCpp::OnEndTracingComplete( const CefString& tracing_file) { - if (CEF_MEMBER_MISSING(struct_, on_end_tracing_complete)) + cef_end_tracing_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_end_tracing_complete)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -28,13 +29,28 @@ void CefEndTracingCallbackCToCpp::OnEndTracingComplete( return; // Execute - struct_->on_end_tracing_complete(struct_, + _struct->on_end_tracing_complete(_struct, tracing_file.GetStruct()); } +// CONSTRUCTOR - Do not edit by hand. + +CefEndTracingCallbackCToCpp::CefEndTracingCallbackCToCpp() { +} + +template<> cef_end_tracing_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefEndTracingCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_END_TRACING_CALLBACK; diff --git a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h index dedba2766..ff02d352b 100644 --- a/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h +++ b/libcef_dll/ctocpp/end_tracing_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefEndTracingCallbackCToCpp : public CefCToCpp { public: - explicit CefEndTracingCallbackCToCpp(cef_end_tracing_callback_t* str) - : CefCToCpp(str) {} + CefEndTracingCallbackCToCpp(); - // CefEndTracingCallback methods + // CefEndTracingCallback methods. void OnEndTracingComplete(const CefString& tracing_file) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_END_TRACING_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc index df8324c5d..0ca054590 100644 --- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc @@ -18,7 +18,8 @@ void CefFileDialogCallbackCToCpp::Continue(int selected_accept_filter, const std::vector& file_paths) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_file_dialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -36,7 +37,7 @@ void CefFileDialogCallbackCToCpp::Continue(int selected_accept_filter, transfer_string_list_contents(file_paths, file_pathsList); // Execute - struct_->cont(struct_, + _struct->cont(_struct, selected_accept_filter, file_pathsList); @@ -46,18 +47,34 @@ void CefFileDialogCallbackCToCpp::Continue(int selected_accept_filter, } void CefFileDialogCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_file_dialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefFileDialogCallbackCToCpp::CefFileDialogCallbackCToCpp() { +} + +template<> cef_file_dialog_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefFileDialogCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h index 92a329e41..779cf9da2 100644 --- a/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h @@ -29,16 +29,13 @@ class CefFileDialogCallbackCToCpp : public CefCToCpp { public: - explicit CefFileDialogCallbackCToCpp(cef_file_dialog_callback_t* str) - : CefCToCpp(str) {} + CefFileDialogCallbackCToCpp(); - // CefFileDialogCallback methods - virtual void Continue(int selected_accept_filter, + // CefFileDialogCallback methods. + void Continue(int selected_accept_filter, const std::vector& file_paths) OVERRIDE; - virtual void Cancel() OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.cc b/libcef_dll/ctocpp/find_handler_ctocpp.cc index 55c6641de..19bdea128 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/find_handler_ctocpp.cc @@ -19,7 +19,8 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) { - if (CEF_MEMBER_MISSING(struct_, on_find_result)) + cef_find_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_find_result)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -30,7 +31,7 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, return; // Execute - struct_->on_find_result(struct_, + _struct->on_find_result(_struct, CefBrowserCppToC::Wrap(browser), identifier, count, @@ -40,8 +41,22 @@ void CefFindHandlerCToCpp::OnFindResult(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefFindHandlerCToCpp::CefFindHandlerCToCpp() { +} + +template<> cef_find_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefFindHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_FIND_HANDLER; diff --git a/libcef_dll/ctocpp/find_handler_ctocpp.h b/libcef_dll/ctocpp/find_handler_ctocpp.h index 401473625..7475732e9 100644 --- a/libcef_dll/ctocpp/find_handler_ctocpp.h +++ b/libcef_dll/ctocpp/find_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefFindHandlerCToCpp : public CefCToCpp { public: - explicit CefFindHandlerCToCpp(cef_find_handler_t* str) - : CefCToCpp( - str) {} + CefFindHandlerCToCpp(); - // CefFindHandler methods + // CefFindHandler methods. void OnFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) override; @@ -40,4 +38,3 @@ class CefFindHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.cc b/libcef_dll/ctocpp/focus_handler_ctocpp.cc index ee1c9eed5..cd1e680fb 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.cc @@ -18,7 +18,8 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, bool next) { - if (CEF_MEMBER_MISSING(struct_, on_take_focus)) + cef_focus_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_take_focus)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -29,14 +30,15 @@ void CefFocusHandlerCToCpp::OnTakeFocus(CefRefPtr browser, return; // Execute - struct_->on_take_focus(struct_, + _struct->on_take_focus(_struct, CefBrowserCppToC::Wrap(browser), next); } bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, FocusSource source) { - if (CEF_MEMBER_MISSING(struct_, on_set_focus)) + cef_focus_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_set_focus)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -47,7 +49,7 @@ bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_set_focus(struct_, + int _retval = _struct->on_set_focus(_struct, CefBrowserCppToC::Wrap(browser), source); @@ -56,7 +58,8 @@ bool CefFocusHandlerCToCpp::OnSetFocus(CefRefPtr browser, } void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_got_focus)) + cef_focus_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_got_focus)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -67,13 +70,27 @@ void CefFocusHandlerCToCpp::OnGotFocus(CefRefPtr browser) { return; // Execute - struct_->on_got_focus(struct_, + _struct->on_got_focus(_struct, CefBrowserCppToC::Wrap(browser)); } +// CONSTRUCTOR - Do not edit by hand. + +CefFocusHandlerCToCpp::CefFocusHandlerCToCpp() { +} + +template<> cef_focus_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefFocusHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_FOCUS_HANDLER; diff --git a/libcef_dll/ctocpp/focus_handler_ctocpp.h b/libcef_dll/ctocpp/focus_handler_ctocpp.h index 594e2a682..8ba6c4a05 100644 --- a/libcef_dll/ctocpp/focus_handler_ctocpp.h +++ b/libcef_dll/ctocpp/focus_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefFocusHandlerCToCpp : public CefCToCpp { public: - explicit CefFocusHandlerCToCpp(cef_focus_handler_t* str) - : CefCToCpp( - str) {} + CefFocusHandlerCToCpp(); - // CefFocusHandler methods + // CefFocusHandler methods. void OnTakeFocus(CefRefPtr browser, bool next) override; bool OnSetFocus(CefRefPtr browser, FocusSource source) override; void OnGotFocus(CefRefPtr browser) override; @@ -40,4 +38,3 @@ class CefFocusHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_FOCUS_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index 63c2c0c63..037f67c11 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -21,100 +21,110 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefFrameCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } void CefFrameCToCpp::Undo() { - if (CEF_MEMBER_MISSING(struct_, undo)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, undo)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->undo(struct_); + _struct->undo(_struct); } void CefFrameCToCpp::Redo() { - if (CEF_MEMBER_MISSING(struct_, redo)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, redo)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->redo(struct_); + _struct->redo(_struct); } void CefFrameCToCpp::Cut() { - if (CEF_MEMBER_MISSING(struct_, cut)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cut)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cut(struct_); + _struct->cut(_struct); } void CefFrameCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->copy(struct_); + _struct->copy(_struct); } void CefFrameCToCpp::Paste() { - if (CEF_MEMBER_MISSING(struct_, paste)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, paste)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->paste(struct_); + _struct->paste(_struct); } void CefFrameCToCpp::Delete() { - if (CEF_MEMBER_MISSING(struct_, del)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, del)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->del(struct_); + _struct->del(_struct); } void CefFrameCToCpp::SelectAll() { - if (CEF_MEMBER_MISSING(struct_, select_all)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, select_all)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->select_all(struct_); + _struct->select_all(_struct); } void CefFrameCToCpp::ViewSource() { - if (CEF_MEMBER_MISSING(struct_, view_source)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, view_source)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->view_source(struct_); + _struct->view_source(_struct); } void CefFrameCToCpp::GetSource(CefRefPtr visitor) { - if (CEF_MEMBER_MISSING(struct_, get_source)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_source)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -125,12 +135,13 @@ void CefFrameCToCpp::GetSource(CefRefPtr visitor) { return; // Execute - struct_->get_source(struct_, + _struct->get_source(_struct, CefStringVisitorCppToC::Wrap(visitor)); } void CefFrameCToCpp::GetText(CefRefPtr visitor) { - if (CEF_MEMBER_MISSING(struct_, get_text)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_text)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -141,12 +152,13 @@ void CefFrameCToCpp::GetText(CefRefPtr visitor) { return; // Execute - struct_->get_text(struct_, + _struct->get_text(_struct, CefStringVisitorCppToC::Wrap(visitor)); } void CefFrameCToCpp::LoadRequest(CefRefPtr request) { - if (CEF_MEMBER_MISSING(struct_, load_request)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, load_request)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -157,12 +169,13 @@ void CefFrameCToCpp::LoadRequest(CefRefPtr request) { return; // Execute - struct_->load_request(struct_, + _struct->load_request(_struct, CefRequestCToCpp::Unwrap(request)); } void CefFrameCToCpp::LoadURL(const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, load_url)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, load_url)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -173,13 +186,14 @@ void CefFrameCToCpp::LoadURL(const CefString& url) { return; // Execute - struct_->load_url(struct_, + _struct->load_url(_struct, url.GetStruct()); } void CefFrameCToCpp::LoadString(const CefString& string_val, const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, load_string)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, load_string)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -194,14 +208,15 @@ void CefFrameCToCpp::LoadString(const CefString& string_val, return; // Execute - struct_->load_string(struct_, + _struct->load_string(_struct, string_val.GetStruct(), url.GetStruct()); } void CefFrameCToCpp::ExecuteJavaScript(const CefString& code, const CefString& script_url, int start_line) { - if (CEF_MEMBER_MISSING(struct_, execute_java_script)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, execute_java_script)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -213,46 +228,49 @@ void CefFrameCToCpp::ExecuteJavaScript(const CefString& code, // Unverified params: script_url // Execute - struct_->execute_java_script(struct_, + _struct->execute_java_script(_struct, code.GetStruct(), script_url.GetStruct(), start_line); } bool CefFrameCToCpp::IsMain() { - if (CEF_MEMBER_MISSING(struct_, is_main)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_main)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_main(struct_); + int _retval = _struct->is_main(_struct); // Return type: bool return _retval?true:false; } bool CefFrameCToCpp::IsFocused() { - if (CEF_MEMBER_MISSING(struct_, is_focused)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_focused)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_focused(struct_); + int _retval = _struct->is_focused(_struct); // Return type: bool return _retval?true:false; } CefString CefFrameCToCpp::GetName() { - if (CEF_MEMBER_MISSING(struct_, get_name)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_name(struct_); + cef_string_userfree_t _retval = _struct->get_name(_struct); // Return type: string CefString _retvalStr; @@ -261,39 +279,42 @@ CefString CefFrameCToCpp::GetName() { } int64 CefFrameCToCpp::GetIdentifier() { - if (CEF_MEMBER_MISSING(struct_, get_identifier)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_identifier)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->get_identifier(struct_); + int64 _retval = _struct->get_identifier(_struct); // Return type: simple return _retval; } CefRefPtr CefFrameCToCpp::GetParent() { - if (CEF_MEMBER_MISSING(struct_, get_parent)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_parent)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = struct_->get_parent(struct_); + cef_frame_t* _retval = _struct->get_parent(_struct); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); } CefString CefFrameCToCpp::GetURL() { - if (CEF_MEMBER_MISSING(struct_, get_url)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_url(struct_); + cef_string_userfree_t _retval = _struct->get_url(_struct); // Return type: string CefString _retvalStr; @@ -302,33 +323,36 @@ CefString CefFrameCToCpp::GetURL() { } CefRefPtr CefFrameCToCpp::GetBrowser() { - if (CEF_MEMBER_MISSING(struct_, get_browser)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_browser)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_t* _retval = struct_->get_browser(struct_); + cef_browser_t* _retval = _struct->get_browser(_struct); // Return type: refptr_same return CefBrowserCToCpp::Wrap(_retval); } CefRefPtr CefFrameCToCpp::GetV8Context() { - if (CEF_MEMBER_MISSING(struct_, get_v8context)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_v8context)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8context_t* _retval = struct_->get_v8context(struct_); + cef_v8context_t* _retval = _struct->get_v8context(_struct); // Return type: refptr_same return CefV8ContextCToCpp::Wrap(_retval); } void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { - if (CEF_MEMBER_MISSING(struct_, visit_dom)) + cef_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit_dom)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -339,13 +363,26 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { return; // Execute - struct_->visit_dom(struct_, + _struct->visit_dom(_struct, CefDOMVisitorCppToC::Wrap(visitor)); } +// CONSTRUCTOR - Do not edit by hand. + +CefFrameCToCpp::CefFrameCToCpp() { +} + +template<> cef_frame_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefFrame* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_FRAME; diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index c2c2720d1..3f6192c7a 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -31,38 +31,35 @@ class CefFrameCToCpp : public CefCToCpp { public: - explicit CefFrameCToCpp(cef_frame_t* str) - : CefCToCpp(str) {} + CefFrameCToCpp(); - // CefFrame methods - virtual bool IsValid() OVERRIDE; - virtual void Undo() OVERRIDE; - virtual void Redo() OVERRIDE; - virtual void Cut() OVERRIDE; - virtual void Copy() OVERRIDE; - virtual void Paste() OVERRIDE; - virtual void Delete() OVERRIDE; - virtual void SelectAll() OVERRIDE; - virtual void ViewSource() OVERRIDE; - virtual void GetSource(CefRefPtr visitor) OVERRIDE; - virtual void GetText(CefRefPtr visitor) OVERRIDE; - virtual void LoadRequest(CefRefPtr request) OVERRIDE; - virtual void LoadURL(const CefString& url) OVERRIDE; - virtual void LoadString(const CefString& string_val, - const CefString& url) OVERRIDE; - virtual void ExecuteJavaScript(const CefString& code, - const CefString& script_url, int start_line) OVERRIDE; - virtual bool IsMain() OVERRIDE; - virtual bool IsFocused() OVERRIDE; - virtual CefString GetName() OVERRIDE; - virtual int64 GetIdentifier() OVERRIDE; - virtual CefRefPtr GetParent() OVERRIDE; - virtual CefString GetURL() OVERRIDE; - virtual CefRefPtr GetBrowser() OVERRIDE; - virtual CefRefPtr GetV8Context() OVERRIDE; - virtual void VisitDOM(CefRefPtr visitor) OVERRIDE; + // CefFrame methods. + bool IsValid() OVERRIDE; + void Undo() OVERRIDE; + void Redo() OVERRIDE; + void Cut() OVERRIDE; + void Copy() OVERRIDE; + void Paste() OVERRIDE; + void Delete() OVERRIDE; + void SelectAll() OVERRIDE; + void ViewSource() OVERRIDE; + void GetSource(CefRefPtr visitor) OVERRIDE; + void GetText(CefRefPtr visitor) OVERRIDE; + void LoadRequest(CefRefPtr request) OVERRIDE; + void LoadURL(const CefString& url) OVERRIDE; + void LoadString(const CefString& string_val, const CefString& url) OVERRIDE; + void ExecuteJavaScript(const CefString& code, const CefString& script_url, + int start_line) OVERRIDE; + bool IsMain() OVERRIDE; + bool IsFocused() OVERRIDE; + CefString GetName() OVERRIDE; + int64 GetIdentifier() OVERRIDE; + CefRefPtr GetParent() OVERRIDE; + CefString GetURL() OVERRIDE; + CefRefPtr GetBrowser() OVERRIDE; + CefRefPtr GetV8Context() OVERRIDE; + void VisitDOM(CefRefPtr visitor) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc index f8ef28371..f676dc3a6 100644 --- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc @@ -16,19 +16,35 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefGeolocationCallbackCToCpp::Continue(bool allow) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_geolocation_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cont(struct_, + _struct->cont(_struct, allow); } +// CONSTRUCTOR - Do not edit by hand. + +CefGeolocationCallbackCToCpp::CefGeolocationCallbackCToCpp() { +} + +template<> cef_geolocation_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefGeolocationCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h index f71fc49e3..2e649d262 100644 --- a/libcef_dll/ctocpp/geolocation_callback_ctocpp.h +++ b/libcef_dll/ctocpp/geolocation_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefGeolocationCallbackCToCpp : public CefCToCpp { public: - explicit CefGeolocationCallbackCToCpp(cef_geolocation_callback_t* str) - : CefCToCpp(str) {} + CefGeolocationCallbackCToCpp(); - // CefGeolocationCallback methods - virtual void Continue(bool allow) OVERRIDE; + // CefGeolocationCallback methods. + void Continue(bool allow) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc index 47835d7dd..e336c5ed3 100644 --- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.cc @@ -20,7 +20,8 @@ bool CefGeolocationHandlerCToCpp::OnRequestGeolocationPermission( CefRefPtr browser, const CefString& requesting_url, int request_id, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_request_geolocation_permission)) + cef_geolocation_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_request_geolocation_permission)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -39,7 +40,7 @@ bool CefGeolocationHandlerCToCpp::OnRequestGeolocationPermission( return false; // Execute - int _retval = struct_->on_request_geolocation_permission(struct_, + int _retval = _struct->on_request_geolocation_permission(_struct, CefBrowserCppToC::Wrap(browser), requesting_url.GetStruct(), request_id, @@ -52,7 +53,8 @@ bool CefGeolocationHandlerCToCpp::OnRequestGeolocationPermission( void CefGeolocationHandlerCToCpp::OnCancelGeolocationPermission( CefRefPtr browser, const CefString& requesting_url, int request_id) { - if (CEF_MEMBER_MISSING(struct_, on_cancel_geolocation_permission)) + cef_geolocation_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_cancel_geolocation_permission)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -67,15 +69,30 @@ void CefGeolocationHandlerCToCpp::OnCancelGeolocationPermission( return; // Execute - struct_->on_cancel_geolocation_permission(struct_, + _struct->on_cancel_geolocation_permission(_struct, CefBrowserCppToC::Wrap(browser), requesting_url.GetStruct(), request_id); } +// CONSTRUCTOR - Do not edit by hand. + +CefGeolocationHandlerCToCpp::CefGeolocationHandlerCToCpp() { +} + +template<> cef_geolocation_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefGeolocationHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_GEOLOCATION_HANDLER; diff --git a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h index 7e1224e6e..22495e10d 100644 --- a/libcef_dll/ctocpp/geolocation_handler_ctocpp.h +++ b/libcef_dll/ctocpp/geolocation_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefGeolocationHandlerCToCpp : public CefCToCpp { public: - explicit CefGeolocationHandlerCToCpp(cef_geolocation_handler_t* str) - : CefCToCpp(str) {} + CefGeolocationHandlerCToCpp(); - // CefGeolocationHandler methods + // CefGeolocationHandler methods. bool OnRequestGeolocationPermission(CefRefPtr browser, const CefString& requesting_url, int request_id, CefRefPtr callback) override; @@ -42,4 +40,3 @@ class CefGeolocationHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc index 066dcf64b..f6c7dfd0f 100644 --- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.cc @@ -17,20 +17,36 @@ void CefGetGeolocationCallbackCToCpp::OnLocationUpdate( const CefGeoposition& position) { - if (CEF_MEMBER_MISSING(struct_, on_location_update)) + cef_get_geolocation_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_location_update)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_location_update(struct_, + _struct->on_location_update(_struct, &position); } +// CONSTRUCTOR - Do not edit by hand. + +CefGetGeolocationCallbackCToCpp::CefGetGeolocationCallbackCToCpp() { +} + +template<> cef_get_geolocation_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefGetGeolocationCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_GET_GEOLOCATION_CALLBACK; diff --git a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h index 47319ac47..b4d3ca166 100644 --- a/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h +++ b/libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefGetGeolocationCallbackCToCpp : public CefCToCpp { public: - explicit CefGetGeolocationCallbackCToCpp(cef_get_geolocation_callback_t* str) - : CefCToCpp(str) {} + CefGetGeolocationCallbackCToCpp(); - // CefGetGeolocationCallback methods + // CefGetGeolocationCallback methods. void OnLocationUpdate(const CefGeoposition& position) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_GET_GEOLOCATION_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc index 60480dec9..b9aaa4a9d 100644 --- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc @@ -17,7 +17,8 @@ void CefJSDialogCallbackCToCpp::Continue(bool success, const CefString& user_input) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_jsdialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -25,14 +26,29 @@ void CefJSDialogCallbackCToCpp::Continue(bool success, // Unverified params: user_input // Execute - struct_->cont(struct_, + _struct->cont(_struct, success, user_input.GetStruct()); } +// CONSTRUCTOR - Do not edit by hand. + +CefJSDialogCallbackCToCpp::CefJSDialogCallbackCToCpp() { +} + +template<> cef_jsdialog_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefJSDialogCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_JSDIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h index 1461424da..e6016a1de 100644 --- a/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefJSDialogCallbackCToCpp : public CefCToCpp { public: - explicit CefJSDialogCallbackCToCpp(cef_jsdialog_callback_t* str) - : CefCToCpp(str) {} + CefJSDialogCallbackCToCpp(); - // CefJSDialogCallback methods - virtual void Continue(bool success, const CefString& user_input) OVERRIDE; + // CefJSDialogCallback methods. + void Continue(bool success, const CefString& user_input) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc index 182902ace..de0aa49a2 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.cc @@ -22,7 +22,8 @@ bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, CefRefPtr callback, bool& suppress_message) { - if (CEF_MEMBER_MISSING(struct_, on_jsdialog)) + cef_jsdialog_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_jsdialog)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -42,7 +43,7 @@ bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, int suppress_messageInt = suppress_message; // Execute - int _retval = struct_->on_jsdialog(struct_, + int _retval = _struct->on_jsdialog(_struct, CefBrowserCppToC::Wrap(browser), origin_url.GetStruct(), accept_lang.GetStruct(), @@ -62,7 +63,8 @@ bool CefJSDialogHandlerCToCpp::OnJSDialog(CefRefPtr browser, bool CefJSDialogHandlerCToCpp::OnBeforeUnloadDialog( CefRefPtr browser, const CefString& message_text, bool is_reload, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_before_unload_dialog)) + cef_jsdialog_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_unload_dialog)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -78,7 +80,7 @@ bool CefJSDialogHandlerCToCpp::OnBeforeUnloadDialog( // Unverified params: message_text // Execute - int _retval = struct_->on_before_unload_dialog(struct_, + int _retval = _struct->on_before_unload_dialog(_struct, CefBrowserCppToC::Wrap(browser), message_text.GetStruct(), is_reload, @@ -90,7 +92,8 @@ bool CefJSDialogHandlerCToCpp::OnBeforeUnloadDialog( void CefJSDialogHandlerCToCpp::OnResetDialogState( CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_reset_dialog_state)) + cef_jsdialog_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_reset_dialog_state)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -101,12 +104,13 @@ void CefJSDialogHandlerCToCpp::OnResetDialogState( return; // Execute - struct_->on_reset_dialog_state(struct_, + _struct->on_reset_dialog_state(_struct, CefBrowserCppToC::Wrap(browser)); } void CefJSDialogHandlerCToCpp::OnDialogClosed(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_dialog_closed)) + cef_jsdialog_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_dialog_closed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -117,13 +121,28 @@ void CefJSDialogHandlerCToCpp::OnDialogClosed(CefRefPtr browser) { return; // Execute - struct_->on_dialog_closed(struct_, + _struct->on_dialog_closed(_struct, CefBrowserCppToC::Wrap(browser)); } +// CONSTRUCTOR - Do not edit by hand. + +CefJSDialogHandlerCToCpp::CefJSDialogHandlerCToCpp() { +} + +template<> cef_jsdialog_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefJSDialogHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_JSDIALOG_HANDLER; diff --git a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h index 558ee0cbb..6f3945848 100644 --- a/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h +++ b/libcef_dll/ctocpp/jsdialog_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefJSDialogHandlerCToCpp : public CefCToCpp { public: - explicit CefJSDialogHandlerCToCpp(cef_jsdialog_handler_t* str) - : CefCToCpp(str) {} + CefJSDialogHandlerCToCpp(); - // CefJSDialogHandler methods + // CefJSDialogHandler methods. bool OnJSDialog(CefRefPtr browser, const CefString& origin_url, const CefString& accept_lang, JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, @@ -47,4 +45,3 @@ class CefJSDialogHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc index ed708453b..518e9a1b1 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.cc @@ -19,7 +19,8 @@ bool CefKeyboardHandlerCToCpp::OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut) { - if (CEF_MEMBER_MISSING(struct_, on_pre_key_event)) + cef_keyboard_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_pre_key_event)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -37,7 +38,7 @@ bool CefKeyboardHandlerCToCpp::OnPreKeyEvent(CefRefPtr browser, int is_keyboard_shortcutInt = is_keyboard_shortcut?*is_keyboard_shortcut:0; // Execute - int _retval = struct_->on_pre_key_event(struct_, + int _retval = _struct->on_pre_key_event(_struct, CefBrowserCppToC::Wrap(browser), &event, os_event, @@ -53,7 +54,8 @@ bool CefKeyboardHandlerCToCpp::OnPreKeyEvent(CefRefPtr browser, bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event) { - if (CEF_MEMBER_MISSING(struct_, on_key_event)) + cef_keyboard_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_key_event)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -64,7 +66,7 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_key_event(struct_, + int _retval = _struct->on_key_event(_struct, CefBrowserCppToC::Wrap(browser), &event, os_event); @@ -74,8 +76,23 @@ bool CefKeyboardHandlerCToCpp::OnKeyEvent(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefKeyboardHandlerCToCpp::CefKeyboardHandlerCToCpp() { +} + +template<> cef_keyboard_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefKeyboardHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_KEYBOARD_HANDLER; diff --git a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h index 88ad45d4f..7fc2e776a 100644 --- a/libcef_dll/ctocpp/keyboard_handler_ctocpp.h +++ b/libcef_dll/ctocpp/keyboard_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefKeyboardHandlerCToCpp : public CefCToCpp { public: - explicit CefKeyboardHandlerCToCpp(cef_keyboard_handler_t* str) - : CefCToCpp(str) {} + CefKeyboardHandlerCToCpp(); - // CefKeyboardHandler methods + // CefKeyboardHandler methods. bool OnPreKeyEvent(CefRefPtr browser, const CefKeyEvent& event, CefEventHandle os_event, bool* is_keyboard_shortcut) override; bool OnKeyEvent(CefRefPtr browser, const CefKeyEvent& event, @@ -41,4 +39,3 @@ class CefKeyboardHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_KEYBOARD_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc index c83350e1a..27347fbf0 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.cc @@ -25,7 +25,8 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access) { - if (CEF_MEMBER_MISSING(struct_, on_before_popup)) + cef_life_span_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_popup)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -53,7 +54,7 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, int no_javascript_accessInt = no_javascript_access?*no_javascript_access:0; // Execute - int _retval = struct_->on_before_popup(struct_, + int _retval = _struct->on_before_popup(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), target_url.GetStruct(), @@ -83,7 +84,8 @@ bool CefLifeSpanHandlerCToCpp::OnBeforePopup(CefRefPtr browser, } void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_after_created)) + cef_life_span_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_after_created)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -94,12 +96,13 @@ void CefLifeSpanHandlerCToCpp::OnAfterCreated(CefRefPtr browser) { return; // Execute - struct_->on_after_created(struct_, + _struct->on_after_created(_struct, CefBrowserCppToC::Wrap(browser)); } bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, run_modal)) + cef_life_span_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, run_modal)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -110,7 +113,7 @@ bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { return false; // Execute - int _retval = struct_->run_modal(struct_, + int _retval = _struct->run_modal(_struct, CefBrowserCppToC::Wrap(browser)); // Return type: bool @@ -118,7 +121,8 @@ bool CefLifeSpanHandlerCToCpp::RunModal(CefRefPtr browser) { } bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, do_close)) + cef_life_span_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, do_close)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -129,7 +133,7 @@ bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { return false; // Execute - int _retval = struct_->do_close(struct_, + int _retval = _struct->do_close(_struct, CefBrowserCppToC::Wrap(browser)); // Return type: bool @@ -137,7 +141,8 @@ bool CefLifeSpanHandlerCToCpp::DoClose(CefRefPtr browser) { } void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_before_close)) + cef_life_span_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_close)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -148,13 +153,28 @@ void CefLifeSpanHandlerCToCpp::OnBeforeClose(CefRefPtr browser) { return; // Execute - struct_->on_before_close(struct_, + _struct->on_before_close(_struct, CefBrowserCppToC::Wrap(browser)); } +// CONSTRUCTOR - Do not edit by hand. + +CefLifeSpanHandlerCToCpp::CefLifeSpanHandlerCToCpp() { +} + +template<> cef_life_span_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefLifeSpanHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_LIFE_SPAN_HANDLER; diff --git a/libcef_dll/ctocpp/life_span_handler_ctocpp.h b/libcef_dll/ctocpp/life_span_handler_ctocpp.h index 7e253e3b5..c1f225656 100644 --- a/libcef_dll/ctocpp/life_span_handler_ctocpp.h +++ b/libcef_dll/ctocpp/life_span_handler_ctocpp.h @@ -30,11 +30,9 @@ class CefLifeSpanHandlerCToCpp : public CefCToCpp { public: - explicit CefLifeSpanHandlerCToCpp(cef_life_span_handler_t* str) - : CefCToCpp(str) {} + CefLifeSpanHandlerCToCpp(); - // CefLifeSpanHandler methods + // CefLifeSpanHandler methods. bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, const CefString& target_url, const CefString& target_frame_name, WindowOpenDisposition target_disposition, bool user_gesture, @@ -49,4 +47,3 @@ class CefLifeSpanHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_LIFE_SPAN_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/list_value_ctocpp.cc b/libcef_dll/ctocpp/list_value_ctocpp.cc index ed6c42dfb..9ec3c8ab3 100644 --- a/libcef_dll/ctocpp/list_value_ctocpp.cc +++ b/libcef_dll/ctocpp/list_value_ctocpp.cc @@ -32,46 +32,50 @@ CefRefPtr CefListValue::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefListValueCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefListValueCToCpp::IsOwned() { - if (CEF_MEMBER_MISSING(struct_, is_owned)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_owned)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_owned(struct_); + int _retval = _struct->is_owned(_struct); // Return type: bool return _retval?true:false; } bool CefListValueCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } bool CefListValueCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -82,7 +86,7 @@ bool CefListValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefListValueCToCpp::Unwrap(that)); // Return type: bool @@ -90,7 +94,8 @@ bool CefListValueCToCpp::IsSame(CefRefPtr that) { } bool CefListValueCToCpp::IsEqual(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_equal)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_equal)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -101,7 +106,7 @@ bool CefListValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_equal(struct_, + int _retval = _struct->is_equal(_struct, CefListValueCToCpp::Unwrap(that)); // Return type: bool @@ -109,26 +114,28 @@ bool CefListValueCToCpp::IsEqual(CefRefPtr that) { } CefRefPtr CefListValueCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_list_value_t* _retval = struct_->copy(struct_); + cef_list_value_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefListValueCToCpp::Wrap(_retval); } bool CefListValueCToCpp::SetSize(size_t size) { - if (CEF_MEMBER_MISSING(struct_, set_size)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_size)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_size(struct_, + int _retval = _struct->set_size(_struct, size); // Return type: bool @@ -136,33 +143,36 @@ bool CefListValueCToCpp::SetSize(size_t size) { } size_t CefListValueCToCpp::GetSize() { - if (CEF_MEMBER_MISSING(struct_, get_size)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_size(struct_); + size_t _retval = _struct->get_size(_struct); // Return type: simple return _retval; } bool CefListValueCToCpp::Clear() { - if (CEF_MEMBER_MISSING(struct_, clear)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clear)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->clear(struct_); + int _retval = _struct->clear(_struct); // Return type: bool return _retval?true:false; } bool CefListValueCToCpp::Remove(int index) { - if (CEF_MEMBER_MISSING(struct_, remove)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -173,7 +183,7 @@ bool CefListValueCToCpp::Remove(int index) { return false; // Execute - int _retval = struct_->remove(struct_, + int _retval = _struct->remove(_struct, index); // Return type: bool @@ -181,7 +191,8 @@ bool CefListValueCToCpp::Remove(int index) { } CefValueType CefListValueCToCpp::GetType(int index) { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return VTYPE_INVALID; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -192,7 +203,7 @@ CefValueType CefListValueCToCpp::GetType(int index) { return VTYPE_INVALID; // Execute - cef_value_type_t _retval = struct_->get_type(struct_, + cef_value_type_t _retval = _struct->get_type(_struct, index); // Return type: simple @@ -200,7 +211,8 @@ CefValueType CefListValueCToCpp::GetType(int index) { } CefRefPtr CefListValueCToCpp::GetValue(int index) { - if (CEF_MEMBER_MISSING(struct_, get_value)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -211,7 +223,7 @@ CefRefPtr CefListValueCToCpp::GetValue(int index) { return NULL; // Execute - cef_value_t* _retval = struct_->get_value(struct_, + cef_value_t* _retval = _struct->get_value(_struct, index); // Return type: refptr_same @@ -219,7 +231,8 @@ CefRefPtr CefListValueCToCpp::GetValue(int index) { } bool CefListValueCToCpp::GetBool(int index) { - if (CEF_MEMBER_MISSING(struct_, get_bool)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -230,7 +243,7 @@ bool CefListValueCToCpp::GetBool(int index) { return false; // Execute - int _retval = struct_->get_bool(struct_, + int _retval = _struct->get_bool(_struct, index); // Return type: bool @@ -238,7 +251,8 @@ bool CefListValueCToCpp::GetBool(int index) { } int CefListValueCToCpp::GetInt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_int)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -249,7 +263,7 @@ int CefListValueCToCpp::GetInt(int index) { return 0; // Execute - int _retval = struct_->get_int(struct_, + int _retval = _struct->get_int(_struct, index); // Return type: simple @@ -257,7 +271,8 @@ int CefListValueCToCpp::GetInt(int index) { } double CefListValueCToCpp::GetDouble(int index) { - if (CEF_MEMBER_MISSING(struct_, get_double)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_double)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -268,7 +283,7 @@ double CefListValueCToCpp::GetDouble(int index) { return 0; // Execute - double _retval = struct_->get_double(struct_, + double _retval = _struct->get_double(_struct, index); // Return type: simple @@ -276,7 +291,8 @@ double CefListValueCToCpp::GetDouble(int index) { } CefString CefListValueCToCpp::GetString(int index) { - if (CEF_MEMBER_MISSING(struct_, get_string)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -287,7 +303,7 @@ CefString CefListValueCToCpp::GetString(int index) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_string(struct_, + cef_string_userfree_t _retval = _struct->get_string(_struct, index); // Return type: string @@ -297,7 +313,8 @@ CefString CefListValueCToCpp::GetString(int index) { } CefRefPtr CefListValueCToCpp::GetBinary(int index) { - if (CEF_MEMBER_MISSING(struct_, get_binary)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_binary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -308,7 +325,7 @@ CefRefPtr CefListValueCToCpp::GetBinary(int index) { return NULL; // Execute - cef_binary_value_t* _retval = struct_->get_binary(struct_, + cef_binary_value_t* _retval = _struct->get_binary(_struct, index); // Return type: refptr_same @@ -316,7 +333,8 @@ CefRefPtr CefListValueCToCpp::GetBinary(int index) { } CefRefPtr CefListValueCToCpp::GetDictionary(int index) { - if (CEF_MEMBER_MISSING(struct_, get_dictionary)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dictionary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -327,7 +345,7 @@ CefRefPtr CefListValueCToCpp::GetDictionary(int index) { return NULL; // Execute - cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_, + cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct, index); // Return type: refptr_same @@ -335,7 +353,8 @@ CefRefPtr CefListValueCToCpp::GetDictionary(int index) { } CefRefPtr CefListValueCToCpp::GetList(int index) { - if (CEF_MEMBER_MISSING(struct_, get_list)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_list)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -346,7 +365,7 @@ CefRefPtr CefListValueCToCpp::GetList(int index) { return NULL; // Execute - cef_list_value_t* _retval = struct_->get_list(struct_, + cef_list_value_t* _retval = _struct->get_list(_struct, index); // Return type: refptr_same @@ -354,7 +373,8 @@ CefRefPtr CefListValueCToCpp::GetList(int index) { } bool CefListValueCToCpp::SetValue(int index, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_value)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -369,7 +389,7 @@ bool CefListValueCToCpp::SetValue(int index, CefRefPtr value) { return false; // Execute - int _retval = struct_->set_value(struct_, + int _retval = _struct->set_value(_struct, index, CefValueCToCpp::Unwrap(value)); @@ -378,7 +398,8 @@ bool CefListValueCToCpp::SetValue(int index, CefRefPtr value) { } bool CefListValueCToCpp::SetNull(int index) { - if (CEF_MEMBER_MISSING(struct_, set_null)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_null)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -389,7 +410,7 @@ bool CefListValueCToCpp::SetNull(int index) { return false; // Execute - int _retval = struct_->set_null(struct_, + int _retval = _struct->set_null(_struct, index); // Return type: bool @@ -397,7 +418,8 @@ bool CefListValueCToCpp::SetNull(int index) { } bool CefListValueCToCpp::SetBool(int index, bool value) { - if (CEF_MEMBER_MISSING(struct_, set_bool)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -408,7 +430,7 @@ bool CefListValueCToCpp::SetBool(int index, bool value) { return false; // Execute - int _retval = struct_->set_bool(struct_, + int _retval = _struct->set_bool(_struct, index, value); @@ -417,7 +439,8 @@ bool CefListValueCToCpp::SetBool(int index, bool value) { } bool CefListValueCToCpp::SetInt(int index, int value) { - if (CEF_MEMBER_MISSING(struct_, set_int)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_int)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -428,7 +451,7 @@ bool CefListValueCToCpp::SetInt(int index, int value) { return false; // Execute - int _retval = struct_->set_int(struct_, + int _retval = _struct->set_int(_struct, index, value); @@ -437,7 +460,8 @@ bool CefListValueCToCpp::SetInt(int index, int value) { } bool CefListValueCToCpp::SetDouble(int index, double value) { - if (CEF_MEMBER_MISSING(struct_, set_double)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_double)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -448,7 +472,7 @@ bool CefListValueCToCpp::SetDouble(int index, double value) { return false; // Execute - int _retval = struct_->set_double(struct_, + int _retval = _struct->set_double(_struct, index, value); @@ -457,7 +481,8 @@ bool CefListValueCToCpp::SetDouble(int index, double value) { } bool CefListValueCToCpp::SetString(int index, const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, set_string)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -469,7 +494,7 @@ bool CefListValueCToCpp::SetString(int index, const CefString& value) { // Unverified params: value // Execute - int _retval = struct_->set_string(struct_, + int _retval = _struct->set_string(_struct, index, value.GetStruct()); @@ -478,7 +503,8 @@ bool CefListValueCToCpp::SetString(int index, const CefString& value) { } bool CefListValueCToCpp::SetBinary(int index, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_binary)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_binary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -493,7 +519,7 @@ bool CefListValueCToCpp::SetBinary(int index, CefRefPtr value) { return false; // Execute - int _retval = struct_->set_binary(struct_, + int _retval = _struct->set_binary(_struct, index, CefBinaryValueCToCpp::Unwrap(value)); @@ -503,7 +529,8 @@ bool CefListValueCToCpp::SetBinary(int index, CefRefPtr value) { bool CefListValueCToCpp::SetDictionary(int index, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_dictionary)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_dictionary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -518,7 +545,7 @@ bool CefListValueCToCpp::SetDictionary(int index, return false; // Execute - int _retval = struct_->set_dictionary(struct_, + int _retval = _struct->set_dictionary(_struct, index, CefDictionaryValueCToCpp::Unwrap(value)); @@ -527,7 +554,8 @@ bool CefListValueCToCpp::SetDictionary(int index, } bool CefListValueCToCpp::SetList(int index, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_list)) + cef_list_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -542,7 +570,7 @@ bool CefListValueCToCpp::SetList(int index, CefRefPtr value) { return false; // Execute - int _retval = struct_->set_list(struct_, + int _retval = _struct->set_list(_struct, index, CefListValueCToCpp::Unwrap(value)); @@ -551,8 +579,21 @@ bool CefListValueCToCpp::SetList(int index, CefRefPtr value) { } +// CONSTRUCTOR - Do not edit by hand. + +CefListValueCToCpp::CefListValueCToCpp() { +} + +template<> cef_list_value_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefListValue* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_LIST_VALUE; diff --git a/libcef_dll/ctocpp/list_value_ctocpp.h b/libcef_dll/ctocpp/list_value_ctocpp.h index c4124bb2e..84835551e 100644 --- a/libcef_dll/ctocpp/list_value_ctocpp.h +++ b/libcef_dll/ctocpp/list_value_ctocpp.h @@ -27,41 +27,38 @@ class CefListValueCToCpp : public CefCToCpp { public: - explicit CefListValueCToCpp(cef_list_value_t* str) - : CefCToCpp(str) {} + CefListValueCToCpp(); - // CefListValue methods - virtual bool IsValid() OVERRIDE; - virtual bool IsOwned() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool IsEqual(CefRefPtr that) OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual bool SetSize(size_t size) OVERRIDE; - virtual size_t GetSize() OVERRIDE; - virtual bool Clear() OVERRIDE; - virtual bool Remove(int index) OVERRIDE; - virtual CefValueType GetType(int index) OVERRIDE; - virtual CefRefPtr GetValue(int index) OVERRIDE; - virtual bool GetBool(int index) OVERRIDE; - virtual int GetInt(int index) OVERRIDE; - virtual double GetDouble(int index) OVERRIDE; - virtual CefString GetString(int index) OVERRIDE; - virtual CefRefPtr GetBinary(int index) OVERRIDE; - virtual CefRefPtr GetDictionary(int index) OVERRIDE; - virtual CefRefPtr GetList(int index) OVERRIDE; - virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; - virtual bool SetNull(int index) OVERRIDE; - virtual bool SetBool(int index, bool value) OVERRIDE; - virtual bool SetInt(int index, int value) OVERRIDE; - virtual bool SetDouble(int index, double value) OVERRIDE; - virtual bool SetString(int index, const CefString& value) OVERRIDE; - virtual bool SetBinary(int index, CefRefPtr value) OVERRIDE; - virtual bool SetDictionary(int index, - CefRefPtr value) OVERRIDE; - virtual bool SetList(int index, CefRefPtr value) OVERRIDE; + // CefListValue methods. + bool IsValid() OVERRIDE; + bool IsOwned() OVERRIDE; + bool IsReadOnly() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool IsEqual(CefRefPtr that) OVERRIDE; + CefRefPtr Copy() OVERRIDE; + bool SetSize(size_t size) OVERRIDE; + size_t GetSize() OVERRIDE; + bool Clear() OVERRIDE; + bool Remove(int index) OVERRIDE; + CefValueType GetType(int index) OVERRIDE; + CefRefPtr GetValue(int index) OVERRIDE; + bool GetBool(int index) OVERRIDE; + int GetInt(int index) OVERRIDE; + double GetDouble(int index) OVERRIDE; + CefString GetString(int index) OVERRIDE; + CefRefPtr GetBinary(int index) OVERRIDE; + CefRefPtr GetDictionary(int index) OVERRIDE; + CefRefPtr GetList(int index) OVERRIDE; + bool SetValue(int index, CefRefPtr value) OVERRIDE; + bool SetNull(int index) OVERRIDE; + bool SetBool(int index, bool value) OVERRIDE; + bool SetInt(int index, int value) OVERRIDE; + bool SetDouble(int index, double value) OVERRIDE; + bool SetString(int index, const CefString& value) OVERRIDE; + bool SetBinary(int index, CefRefPtr value) OVERRIDE; + bool SetDictionary(int index, CefRefPtr value) OVERRIDE; + bool SetList(int index, CefRefPtr value) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.cc b/libcef_dll/ctocpp/load_handler_ctocpp.cc index 4b35870fe..f651db8b6 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/load_handler_ctocpp.cc @@ -19,7 +19,8 @@ void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) { - if (CEF_MEMBER_MISSING(struct_, on_loading_state_change)) + cef_load_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_loading_state_change)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -30,7 +31,7 @@ void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr browser, return; // Execute - struct_->on_loading_state_change(struct_, + _struct->on_loading_state_change(_struct, CefBrowserCppToC::Wrap(browser), isLoading, canGoBack, @@ -39,7 +40,8 @@ void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr browser, void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, CefRefPtr frame) { - if (CEF_MEMBER_MISSING(struct_, on_load_start)) + cef_load_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_load_start)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -54,14 +56,15 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr browser, return; // Execute - struct_->on_load_start(struct_, + _struct->on_load_start(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame)); } void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) { - if (CEF_MEMBER_MISSING(struct_, on_load_end)) + cef_load_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_load_end)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -76,7 +79,7 @@ void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, return; // Execute - struct_->on_load_end(struct_, + _struct->on_load_end(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), httpStatusCode); @@ -85,7 +88,8 @@ void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr browser, void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, const CefString& failedUrl) { - if (CEF_MEMBER_MISSING(struct_, on_load_error)) + cef_load_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_load_error)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -105,7 +109,7 @@ void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, // Unverified params: errorText // Execute - struct_->on_load_error(struct_, + _struct->on_load_error(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), errorCode, @@ -114,8 +118,22 @@ void CefLoadHandlerCToCpp::OnLoadError(CefRefPtr browser, } +// CONSTRUCTOR - Do not edit by hand. + +CefLoadHandlerCToCpp::CefLoadHandlerCToCpp() { +} + +template<> cef_load_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefLoadHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_LOAD_HANDLER; diff --git a/libcef_dll/ctocpp/load_handler_ctocpp.h b/libcef_dll/ctocpp/load_handler_ctocpp.h index 48ed8d85b..badad0f80 100644 --- a/libcef_dll/ctocpp/load_handler_ctocpp.h +++ b/libcef_dll/ctocpp/load_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefLoadHandlerCToCpp : public CefCToCpp { public: - explicit CefLoadHandlerCToCpp(cef_load_handler_t* str) - : CefCToCpp( - str) {} + CefLoadHandlerCToCpp(); - // CefLoadHandler methods + // CefLoadHandler methods. void OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) override; void OnLoadStart(CefRefPtr browser, @@ -46,4 +44,3 @@ class CefLoadHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_LOAD_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.cc b/libcef_dll/ctocpp/menu_model_ctocpp.cc index a9bbcac39..4d98bea55 100644 --- a/libcef_dll/ctocpp/menu_model_ctocpp.cc +++ b/libcef_dll/ctocpp/menu_model_ctocpp.cc @@ -16,46 +16,50 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefMenuModelCToCpp::Clear() { - if (CEF_MEMBER_MISSING(struct_, clear)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clear)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->clear(struct_); + int _retval = _struct->clear(_struct); // Return type: bool return _retval?true:false; } int CefMenuModelCToCpp::GetCount() { - if (CEF_MEMBER_MISSING(struct_, get_count)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_count(struct_); + int _retval = _struct->get_count(_struct); // Return type: simple return _retval; } bool CefMenuModelCToCpp::AddSeparator() { - if (CEF_MEMBER_MISSING(struct_, add_separator)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_separator)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->add_separator(struct_); + int _retval = _struct->add_separator(_struct); // Return type: bool return _retval?true:false; } bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, add_item)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_item)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -66,7 +70,7 @@ bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { return false; // Execute - int _retval = struct_->add_item(struct_, + int _retval = _struct->add_item(_struct, command_id, label.GetStruct()); @@ -75,7 +79,8 @@ bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { } bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, add_check_item)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_check_item)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -86,7 +91,7 @@ bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { return false; // Execute - int _retval = struct_->add_check_item(struct_, + int _retval = _struct->add_check_item(_struct, command_id, label.GetStruct()); @@ -96,7 +101,8 @@ bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, int group_id) { - if (CEF_MEMBER_MISSING(struct_, add_radio_item)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_radio_item)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -107,7 +113,7 @@ bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, return false; // Execute - int _retval = struct_->add_radio_item(struct_, + int _retval = _struct->add_radio_item(_struct, command_id, label.GetStruct(), group_id); @@ -118,7 +124,8 @@ bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, add_sub_menu)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_sub_menu)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -129,7 +136,7 @@ CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, return NULL; // Execute - cef_menu_model_t* _retval = struct_->add_sub_menu(struct_, + cef_menu_model_t* _retval = _struct->add_sub_menu(_struct, command_id, label.GetStruct()); @@ -138,13 +145,14 @@ CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, } bool CefMenuModelCToCpp::InsertSeparatorAt(int index) { - if (CEF_MEMBER_MISSING(struct_, insert_separator_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, insert_separator_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->insert_separator_at(struct_, + int _retval = _struct->insert_separator_at(_struct, index); // Return type: bool @@ -153,7 +161,8 @@ bool CefMenuModelCToCpp::InsertSeparatorAt(int index) { bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, insert_item_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, insert_item_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -164,7 +173,7 @@ bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, return false; // Execute - int _retval = struct_->insert_item_at(struct_, + int _retval = _struct->insert_item_at(_struct, index, command_id, label.GetStruct()); @@ -175,7 +184,8 @@ bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, insert_check_item_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, insert_check_item_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -186,7 +196,7 @@ bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, return false; // Execute - int _retval = struct_->insert_check_item_at(struct_, + int _retval = _struct->insert_check_item_at(_struct, index, command_id, label.GetStruct()); @@ -197,7 +207,8 @@ bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, const CefString& label, int group_id) { - if (CEF_MEMBER_MISSING(struct_, insert_radio_item_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, insert_radio_item_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -208,7 +219,7 @@ bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, return false; // Execute - int _retval = struct_->insert_radio_item_at(struct_, + int _retval = _struct->insert_radio_item_at(_struct, index, command_id, label.GetStruct(), @@ -220,7 +231,8 @@ bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, insert_sub_menu_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, insert_sub_menu_at)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -231,7 +243,7 @@ CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, return NULL; // Execute - cef_menu_model_t* _retval = struct_->insert_sub_menu_at(struct_, + cef_menu_model_t* _retval = _struct->insert_sub_menu_at(_struct, index, command_id, label.GetStruct()); @@ -241,13 +253,14 @@ CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, } bool CefMenuModelCToCpp::Remove(int command_id) { - if (CEF_MEMBER_MISSING(struct_, remove)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->remove(struct_, + int _retval = _struct->remove(_struct, command_id); // Return type: bool @@ -255,13 +268,14 @@ bool CefMenuModelCToCpp::Remove(int command_id) { } bool CefMenuModelCToCpp::RemoveAt(int index) { - if (CEF_MEMBER_MISSING(struct_, remove_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->remove_at(struct_, + int _retval = _struct->remove_at(_struct, index); // Return type: bool @@ -269,13 +283,14 @@ bool CefMenuModelCToCpp::RemoveAt(int index) { } int CefMenuModelCToCpp::GetIndexOf(int command_id) { - if (CEF_MEMBER_MISSING(struct_, get_index_of)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_index_of)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_index_of(struct_, + int _retval = _struct->get_index_of(_struct, command_id); // Return type: simple @@ -283,13 +298,14 @@ int CefMenuModelCToCpp::GetIndexOf(int command_id) { } int CefMenuModelCToCpp::GetCommandIdAt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_command_id_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_command_id_at)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_command_id_at(struct_, + int _retval = _struct->get_command_id_at(_struct, index); // Return type: simple @@ -297,13 +313,14 @@ int CefMenuModelCToCpp::GetCommandIdAt(int index) { } bool CefMenuModelCToCpp::SetCommandIdAt(int index, int command_id) { - if (CEF_MEMBER_MISSING(struct_, set_command_id_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_command_id_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_command_id_at(struct_, + int _retval = _struct->set_command_id_at(_struct, index, command_id); @@ -312,13 +329,14 @@ bool CefMenuModelCToCpp::SetCommandIdAt(int index, int command_id) { } CefString CefMenuModelCToCpp::GetLabel(int command_id) { - if (CEF_MEMBER_MISSING(struct_, get_label)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_label)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_label(struct_, + cef_string_userfree_t _retval = _struct->get_label(_struct, command_id); // Return type: string @@ -328,13 +346,14 @@ CefString CefMenuModelCToCpp::GetLabel(int command_id) { } CefString CefMenuModelCToCpp::GetLabelAt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_label_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_label_at)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_label_at(struct_, + cef_string_userfree_t _retval = _struct->get_label_at(_struct, index); // Return type: string @@ -344,7 +363,8 @@ CefString CefMenuModelCToCpp::GetLabelAt(int index) { } bool CefMenuModelCToCpp::SetLabel(int command_id, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, set_label)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_label)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -355,7 +375,7 @@ bool CefMenuModelCToCpp::SetLabel(int command_id, const CefString& label) { return false; // Execute - int _retval = struct_->set_label(struct_, + int _retval = _struct->set_label(_struct, command_id, label.GetStruct()); @@ -364,7 +384,8 @@ bool CefMenuModelCToCpp::SetLabel(int command_id, const CefString& label) { } bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { - if (CEF_MEMBER_MISSING(struct_, set_label_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_label_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -375,7 +396,7 @@ bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { return false; // Execute - int _retval = struct_->set_label_at(struct_, + int _retval = _struct->set_label_at(_struct, index, label.GetStruct()); @@ -384,13 +405,14 @@ bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { } CefMenuModel::MenuItemType CefMenuModelCToCpp::GetType(int command_id) { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return MENUITEMTYPE_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_item_type_t _retval = struct_->get_type(struct_, + cef_menu_item_type_t _retval = _struct->get_type(_struct, command_id); // Return type: simple @@ -398,13 +420,14 @@ CefMenuModel::MenuItemType CefMenuModelCToCpp::GetType(int command_id) { } CefMenuModel::MenuItemType CefMenuModelCToCpp::GetTypeAt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_type_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type_at)) return MENUITEMTYPE_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_item_type_t _retval = struct_->get_type_at(struct_, + cef_menu_item_type_t _retval = _struct->get_type_at(_struct, index); // Return type: simple @@ -412,13 +435,14 @@ CefMenuModel::MenuItemType CefMenuModelCToCpp::GetTypeAt(int index) { } int CefMenuModelCToCpp::GetGroupId(int command_id) { - if (CEF_MEMBER_MISSING(struct_, get_group_id)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_group_id)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_group_id(struct_, + int _retval = _struct->get_group_id(_struct, command_id); // Return type: simple @@ -426,13 +450,14 @@ int CefMenuModelCToCpp::GetGroupId(int command_id) { } int CefMenuModelCToCpp::GetGroupIdAt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_group_id_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_group_id_at)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_group_id_at(struct_, + int _retval = _struct->get_group_id_at(_struct, index); // Return type: simple @@ -440,13 +465,14 @@ int CefMenuModelCToCpp::GetGroupIdAt(int index) { } bool CefMenuModelCToCpp::SetGroupId(int command_id, int group_id) { - if (CEF_MEMBER_MISSING(struct_, set_group_id)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_group_id)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_group_id(struct_, + int _retval = _struct->set_group_id(_struct, command_id, group_id); @@ -455,13 +481,14 @@ bool CefMenuModelCToCpp::SetGroupId(int command_id, int group_id) { } bool CefMenuModelCToCpp::SetGroupIdAt(int index, int group_id) { - if (CEF_MEMBER_MISSING(struct_, set_group_id_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_group_id_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_group_id_at(struct_, + int _retval = _struct->set_group_id_at(_struct, index, group_id); @@ -470,13 +497,14 @@ bool CefMenuModelCToCpp::SetGroupIdAt(int index, int group_id) { } CefRefPtr CefMenuModelCToCpp::GetSubMenu(int command_id) { - if (CEF_MEMBER_MISSING(struct_, get_sub_menu)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_sub_menu)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_model_t* _retval = struct_->get_sub_menu(struct_, + cef_menu_model_t* _retval = _struct->get_sub_menu(_struct, command_id); // Return type: refptr_same @@ -484,13 +512,14 @@ CefRefPtr CefMenuModelCToCpp::GetSubMenu(int command_id) { } CefRefPtr CefMenuModelCToCpp::GetSubMenuAt(int index) { - if (CEF_MEMBER_MISSING(struct_, get_sub_menu_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_sub_menu_at)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_menu_model_t* _retval = struct_->get_sub_menu_at(struct_, + cef_menu_model_t* _retval = _struct->get_sub_menu_at(_struct, index); // Return type: refptr_same @@ -498,13 +527,14 @@ CefRefPtr CefMenuModelCToCpp::GetSubMenuAt(int index) { } bool CefMenuModelCToCpp::IsVisible(int command_id) { - if (CEF_MEMBER_MISSING(struct_, is_visible)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_visible)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_visible(struct_, + int _retval = _struct->is_visible(_struct, command_id); // Return type: bool @@ -512,13 +542,14 @@ bool CefMenuModelCToCpp::IsVisible(int command_id) { } bool CefMenuModelCToCpp::IsVisibleAt(int index) { - if (CEF_MEMBER_MISSING(struct_, is_visible_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_visible_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_visible_at(struct_, + int _retval = _struct->is_visible_at(_struct, index); // Return type: bool @@ -526,13 +557,14 @@ bool CefMenuModelCToCpp::IsVisibleAt(int index) { } bool CefMenuModelCToCpp::SetVisible(int command_id, bool visible) { - if (CEF_MEMBER_MISSING(struct_, set_visible)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_visible)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_visible(struct_, + int _retval = _struct->set_visible(_struct, command_id, visible); @@ -541,13 +573,14 @@ bool CefMenuModelCToCpp::SetVisible(int command_id, bool visible) { } bool CefMenuModelCToCpp::SetVisibleAt(int index, bool visible) { - if (CEF_MEMBER_MISSING(struct_, set_visible_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_visible_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_visible_at(struct_, + int _retval = _struct->set_visible_at(_struct, index, visible); @@ -556,13 +589,14 @@ bool CefMenuModelCToCpp::SetVisibleAt(int index, bool visible) { } bool CefMenuModelCToCpp::IsEnabled(int command_id) { - if (CEF_MEMBER_MISSING(struct_, is_enabled)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_enabled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_enabled(struct_, + int _retval = _struct->is_enabled(_struct, command_id); // Return type: bool @@ -570,13 +604,14 @@ bool CefMenuModelCToCpp::IsEnabled(int command_id) { } bool CefMenuModelCToCpp::IsEnabledAt(int index) { - if (CEF_MEMBER_MISSING(struct_, is_enabled_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_enabled_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_enabled_at(struct_, + int _retval = _struct->is_enabled_at(_struct, index); // Return type: bool @@ -584,13 +619,14 @@ bool CefMenuModelCToCpp::IsEnabledAt(int index) { } bool CefMenuModelCToCpp::SetEnabled(int command_id, bool enabled) { - if (CEF_MEMBER_MISSING(struct_, set_enabled)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_enabled)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_enabled(struct_, + int _retval = _struct->set_enabled(_struct, command_id, enabled); @@ -599,13 +635,14 @@ bool CefMenuModelCToCpp::SetEnabled(int command_id, bool enabled) { } bool CefMenuModelCToCpp::SetEnabledAt(int index, bool enabled) { - if (CEF_MEMBER_MISSING(struct_, set_enabled_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_enabled_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_enabled_at(struct_, + int _retval = _struct->set_enabled_at(_struct, index, enabled); @@ -614,13 +651,14 @@ bool CefMenuModelCToCpp::SetEnabledAt(int index, bool enabled) { } bool CefMenuModelCToCpp::IsChecked(int command_id) { - if (CEF_MEMBER_MISSING(struct_, is_checked)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_checked)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_checked(struct_, + int _retval = _struct->is_checked(_struct, command_id); // Return type: bool @@ -628,13 +666,14 @@ bool CefMenuModelCToCpp::IsChecked(int command_id) { } bool CefMenuModelCToCpp::IsCheckedAt(int index) { - if (CEF_MEMBER_MISSING(struct_, is_checked_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_checked_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_checked_at(struct_, + int _retval = _struct->is_checked_at(_struct, index); // Return type: bool @@ -642,13 +681,14 @@ bool CefMenuModelCToCpp::IsCheckedAt(int index) { } bool CefMenuModelCToCpp::SetChecked(int command_id, bool checked) { - if (CEF_MEMBER_MISSING(struct_, set_checked)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_checked)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_checked(struct_, + int _retval = _struct->set_checked(_struct, command_id, checked); @@ -657,13 +697,14 @@ bool CefMenuModelCToCpp::SetChecked(int command_id, bool checked) { } bool CefMenuModelCToCpp::SetCheckedAt(int index, bool checked) { - if (CEF_MEMBER_MISSING(struct_, set_checked_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_checked_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_checked_at(struct_, + int _retval = _struct->set_checked_at(_struct, index, checked); @@ -672,13 +713,14 @@ bool CefMenuModelCToCpp::SetCheckedAt(int index, bool checked) { } bool CefMenuModelCToCpp::HasAccelerator(int command_id) { - if (CEF_MEMBER_MISSING(struct_, has_accelerator)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_accelerator)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_accelerator(struct_, + int _retval = _struct->has_accelerator(_struct, command_id); // Return type: bool @@ -686,13 +728,14 @@ bool CefMenuModelCToCpp::HasAccelerator(int command_id) { } bool CefMenuModelCToCpp::HasAcceleratorAt(int index) { - if (CEF_MEMBER_MISSING(struct_, has_accelerator_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_accelerator_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_accelerator_at(struct_, + int _retval = _struct->has_accelerator_at(_struct, index); // Return type: bool @@ -701,13 +744,14 @@ bool CefMenuModelCToCpp::HasAcceleratorAt(int index) { bool CefMenuModelCToCpp::SetAccelerator(int command_id, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { - if (CEF_MEMBER_MISSING(struct_, set_accelerator)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_accelerator)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_accelerator(struct_, + int _retval = _struct->set_accelerator(_struct, command_id, key_code, shift_pressed, @@ -720,13 +764,14 @@ bool CefMenuModelCToCpp::SetAccelerator(int command_id, int key_code, bool CefMenuModelCToCpp::SetAcceleratorAt(int index, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { - if (CEF_MEMBER_MISSING(struct_, set_accelerator_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_accelerator_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_accelerator_at(struct_, + int _retval = _struct->set_accelerator_at(_struct, index, key_code, shift_pressed, @@ -738,13 +783,14 @@ bool CefMenuModelCToCpp::SetAcceleratorAt(int index, int key_code, } bool CefMenuModelCToCpp::RemoveAccelerator(int command_id) { - if (CEF_MEMBER_MISSING(struct_, remove_accelerator)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove_accelerator)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->remove_accelerator(struct_, + int _retval = _struct->remove_accelerator(_struct, command_id); // Return type: bool @@ -752,13 +798,14 @@ bool CefMenuModelCToCpp::RemoveAccelerator(int command_id) { } bool CefMenuModelCToCpp::RemoveAcceleratorAt(int index) { - if (CEF_MEMBER_MISSING(struct_, remove_accelerator_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove_accelerator_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->remove_accelerator_at(struct_, + int _retval = _struct->remove_accelerator_at(_struct, index); // Return type: bool @@ -767,7 +814,8 @@ bool CefMenuModelCToCpp::RemoveAcceleratorAt(int index) { bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { - if (CEF_MEMBER_MISSING(struct_, get_accelerator)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_accelerator)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -780,7 +828,7 @@ bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, int alt_pressedInt = alt_pressed; // Execute - int _retval = struct_->get_accelerator(struct_, + int _retval = _struct->get_accelerator(_struct, command_id, &key_code, &shift_pressedInt, @@ -800,7 +848,8 @@ bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { - if (CEF_MEMBER_MISSING(struct_, get_accelerator_at)) + cef_menu_model_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_accelerator_at)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -813,7 +862,7 @@ bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, int alt_pressedInt = alt_pressed; // Execute - int _retval = struct_->get_accelerator_at(struct_, + int _retval = _struct->get_accelerator_at(_struct, index, &key_code, &shift_pressedInt, @@ -832,8 +881,21 @@ bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, } +// CONSTRUCTOR - Do not edit by hand. + +CefMenuModelCToCpp::CefMenuModelCToCpp() { +} + +template<> cef_menu_model_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefMenuModel* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_MENU_MODEL; diff --git a/libcef_dll/ctocpp/menu_model_ctocpp.h b/libcef_dll/ctocpp/menu_model_ctocpp.h index 8a298c51f..c4787f69a 100644 --- a/libcef_dll/ctocpp/menu_model_ctocpp.h +++ b/libcef_dll/ctocpp/menu_model_ctocpp.h @@ -27,71 +27,68 @@ class CefMenuModelCToCpp : public CefCToCpp { public: - explicit CefMenuModelCToCpp(cef_menu_model_t* str) - : CefCToCpp(str) {} + CefMenuModelCToCpp(); - // CefMenuModel methods - virtual bool Clear() OVERRIDE; - virtual int GetCount() OVERRIDE; - virtual bool AddSeparator() OVERRIDE; - virtual bool AddItem(int command_id, const CefString& label) OVERRIDE; - virtual bool AddCheckItem(int command_id, const CefString& label) OVERRIDE; - virtual bool AddRadioItem(int command_id, const CefString& label, + // CefMenuModel methods. + bool Clear() OVERRIDE; + int GetCount() OVERRIDE; + bool AddSeparator() OVERRIDE; + bool AddItem(int command_id, const CefString& label) OVERRIDE; + bool AddCheckItem(int command_id, const CefString& label) OVERRIDE; + bool AddRadioItem(int command_id, const CefString& label, int group_id) OVERRIDE; - virtual CefRefPtr AddSubMenu(int command_id, + CefRefPtr AddSubMenu(int command_id, const CefString& label) OVERRIDE; - virtual bool InsertSeparatorAt(int index) OVERRIDE; - virtual bool InsertItemAt(int index, int command_id, + bool InsertSeparatorAt(int index) OVERRIDE; + bool InsertItemAt(int index, int command_id, const CefString& label) OVERRIDE; + bool InsertCheckItemAt(int index, int command_id, const CefString& label) OVERRIDE; - virtual bool InsertCheckItemAt(int index, int command_id, + bool InsertRadioItemAt(int index, int command_id, const CefString& label, + int group_id) OVERRIDE; + CefRefPtr InsertSubMenuAt(int index, int command_id, const CefString& label) OVERRIDE; - virtual bool InsertRadioItemAt(int index, int command_id, - const CefString& label, int group_id) OVERRIDE; - virtual CefRefPtr InsertSubMenuAt(int index, int command_id, - const CefString& label) OVERRIDE; - virtual bool Remove(int command_id) OVERRIDE; - virtual bool RemoveAt(int index) OVERRIDE; - virtual int GetIndexOf(int command_id) OVERRIDE; - virtual int GetCommandIdAt(int index) OVERRIDE; - virtual bool SetCommandIdAt(int index, int command_id) OVERRIDE; - virtual CefString GetLabel(int command_id) OVERRIDE; - virtual CefString GetLabelAt(int index) OVERRIDE; - virtual bool SetLabel(int command_id, const CefString& label) OVERRIDE; - virtual bool SetLabelAt(int index, const CefString& label) OVERRIDE; - virtual MenuItemType GetType(int command_id) OVERRIDE; - virtual MenuItemType GetTypeAt(int index) OVERRIDE; - virtual int GetGroupId(int command_id) OVERRIDE; - virtual int GetGroupIdAt(int index) OVERRIDE; - virtual bool SetGroupId(int command_id, int group_id) OVERRIDE; - virtual bool SetGroupIdAt(int index, int group_id) OVERRIDE; - virtual CefRefPtr GetSubMenu(int command_id) OVERRIDE; - virtual CefRefPtr GetSubMenuAt(int index) OVERRIDE; - virtual bool IsVisible(int command_id) OVERRIDE; - virtual bool IsVisibleAt(int index) OVERRIDE; - virtual bool SetVisible(int command_id, bool visible) OVERRIDE; - virtual bool SetVisibleAt(int index, bool visible) OVERRIDE; - virtual bool IsEnabled(int command_id) OVERRIDE; - virtual bool IsEnabledAt(int index) OVERRIDE; - virtual bool SetEnabled(int command_id, bool enabled) OVERRIDE; - virtual bool SetEnabledAt(int index, bool enabled) OVERRIDE; - virtual bool IsChecked(int command_id) OVERRIDE; - virtual bool IsCheckedAt(int index) OVERRIDE; - virtual bool SetChecked(int command_id, bool checked) OVERRIDE; - virtual bool SetCheckedAt(int index, bool checked) OVERRIDE; - virtual bool HasAccelerator(int command_id) OVERRIDE; - virtual bool HasAcceleratorAt(int index) OVERRIDE; - virtual bool SetAccelerator(int command_id, int key_code, bool shift_pressed, + bool Remove(int command_id) OVERRIDE; + bool RemoveAt(int index) OVERRIDE; + int GetIndexOf(int command_id) OVERRIDE; + int GetCommandIdAt(int index) OVERRIDE; + bool SetCommandIdAt(int index, int command_id) OVERRIDE; + CefString GetLabel(int command_id) OVERRIDE; + CefString GetLabelAt(int index) OVERRIDE; + bool SetLabel(int command_id, const CefString& label) OVERRIDE; + bool SetLabelAt(int index, const CefString& label) OVERRIDE; + MenuItemType GetType(int command_id) OVERRIDE; + MenuItemType GetTypeAt(int index) OVERRIDE; + int GetGroupId(int command_id) OVERRIDE; + int GetGroupIdAt(int index) OVERRIDE; + bool SetGroupId(int command_id, int group_id) OVERRIDE; + bool SetGroupIdAt(int index, int group_id) OVERRIDE; + CefRefPtr GetSubMenu(int command_id) OVERRIDE; + CefRefPtr GetSubMenuAt(int index) OVERRIDE; + bool IsVisible(int command_id) OVERRIDE; + bool IsVisibleAt(int index) OVERRIDE; + bool SetVisible(int command_id, bool visible) OVERRIDE; + bool SetVisibleAt(int index, bool visible) OVERRIDE; + bool IsEnabled(int command_id) OVERRIDE; + bool IsEnabledAt(int index) OVERRIDE; + bool SetEnabled(int command_id, bool enabled) OVERRIDE; + bool SetEnabledAt(int index, bool enabled) OVERRIDE; + bool IsChecked(int command_id) OVERRIDE; + bool IsCheckedAt(int index) OVERRIDE; + bool SetChecked(int command_id, bool checked) OVERRIDE; + bool SetCheckedAt(int index, bool checked) OVERRIDE; + bool HasAccelerator(int command_id) OVERRIDE; + bool HasAcceleratorAt(int index) OVERRIDE; + bool SetAccelerator(int command_id, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed) OVERRIDE; - virtual bool SetAcceleratorAt(int index, int key_code, bool shift_pressed, + bool SetAcceleratorAt(int index, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed) OVERRIDE; - virtual bool RemoveAccelerator(int command_id) OVERRIDE; - virtual bool RemoveAcceleratorAt(int index) OVERRIDE; - virtual bool GetAccelerator(int command_id, int& key_code, - bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; - virtual bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, + bool RemoveAccelerator(int command_id) OVERRIDE; + bool RemoveAcceleratorAt(int index) OVERRIDE; + bool GetAccelerator(int command_id, int& key_code, bool& shift_pressed, + bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; + bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc index c5801e4e9..0c193058b 100644 --- a/libcef_dll/ctocpp/navigation_entry_ctocpp.cc +++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.cc @@ -16,26 +16,28 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefNavigationEntryCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } CefString CefNavigationEntryCToCpp::GetURL() { - if (CEF_MEMBER_MISSING(struct_, get_url)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_url(struct_); + cef_string_userfree_t _retval = _struct->get_url(_struct); // Return type: string CefString _retvalStr; @@ -44,13 +46,14 @@ CefString CefNavigationEntryCToCpp::GetURL() { } CefString CefNavigationEntryCToCpp::GetDisplayURL() { - if (CEF_MEMBER_MISSING(struct_, get_display_url)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_display_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_display_url(struct_); + cef_string_userfree_t _retval = _struct->get_display_url(_struct); // Return type: string CefString _retvalStr; @@ -59,13 +62,14 @@ CefString CefNavigationEntryCToCpp::GetDisplayURL() { } CefString CefNavigationEntryCToCpp::GetOriginalURL() { - if (CEF_MEMBER_MISSING(struct_, get_original_url)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_original_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_original_url(struct_); + cef_string_userfree_t _retval = _struct->get_original_url(_struct); // Return type: string CefString _retvalStr; @@ -74,13 +78,14 @@ CefString CefNavigationEntryCToCpp::GetOriginalURL() { } CefString CefNavigationEntryCToCpp::GetTitle() { - if (CEF_MEMBER_MISSING(struct_, get_title)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_title)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_title(struct_); + cef_string_userfree_t _retval = _struct->get_title(_struct); // Return type: string CefString _retvalStr; @@ -90,39 +95,42 @@ CefString CefNavigationEntryCToCpp::GetTitle() { CefNavigationEntry::TransitionType CefNavigationEntryCToCpp::GetTransitionType( ) { - if (CEF_MEMBER_MISSING(struct_, get_transition_type)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_transition_type)) return TT_EXPLICIT; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_transition_type_t _retval = struct_->get_transition_type(struct_); + cef_transition_type_t _retval = _struct->get_transition_type(_struct); // Return type: simple return _retval; } bool CefNavigationEntryCToCpp::HasPostData() { - if (CEF_MEMBER_MISSING(struct_, has_post_data)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_post_data)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_post_data(struct_); + int _retval = _struct->has_post_data(_struct); // Return type: bool return _retval?true:false; } CefString CefNavigationEntryCToCpp::GetFrameName() { - if (CEF_MEMBER_MISSING(struct_, get_frame_name)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_frame_name(struct_); + cef_string_userfree_t _retval = _struct->get_frame_name(_struct); // Return type: string CefString _retvalStr; @@ -131,34 +139,51 @@ CefString CefNavigationEntryCToCpp::GetFrameName() { } CefTime CefNavigationEntryCToCpp::GetCompletionTime() { - if (CEF_MEMBER_MISSING(struct_, get_completion_time)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_completion_time)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_completion_time(struct_); + cef_time_t _retval = _struct->get_completion_time(_struct); // Return type: simple return _retval; } int CefNavigationEntryCToCpp::GetHttpStatusCode() { - if (CEF_MEMBER_MISSING(struct_, get_http_status_code)) + cef_navigation_entry_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_http_status_code)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_http_status_code(struct_); + int _retval = _struct->get_http_status_code(_struct); // Return type: simple return _retval; } +// CONSTRUCTOR - Do not edit by hand. + +CefNavigationEntryCToCpp::CefNavigationEntryCToCpp() { +} + +template<> cef_navigation_entry_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefNavigationEntry* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_NAVIGATION_ENTRY; diff --git a/libcef_dll/ctocpp/navigation_entry_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_ctocpp.h index f1832c147..71acb6c8e 100644 --- a/libcef_dll/ctocpp/navigation_entry_ctocpp.h +++ b/libcef_dll/ctocpp/navigation_entry_ctocpp.h @@ -28,23 +28,20 @@ class CefNavigationEntryCToCpp : public CefCToCpp { public: - explicit CefNavigationEntryCToCpp(cef_navigation_entry_t* str) - : CefCToCpp(str) {} + CefNavigationEntryCToCpp(); - // CefNavigationEntry methods - virtual bool IsValid() OVERRIDE; - virtual CefString GetURL() OVERRIDE; - virtual CefString GetDisplayURL() OVERRIDE; - virtual CefString GetOriginalURL() OVERRIDE; - virtual CefString GetTitle() OVERRIDE; - virtual TransitionType GetTransitionType() OVERRIDE; - virtual bool HasPostData() OVERRIDE; - virtual CefString GetFrameName() OVERRIDE; - virtual CefTime GetCompletionTime() OVERRIDE; - virtual int GetHttpStatusCode() OVERRIDE; + // CefNavigationEntry methods. + bool IsValid() OVERRIDE; + CefString GetURL() OVERRIDE; + CefString GetDisplayURL() OVERRIDE; + CefString GetOriginalURL() OVERRIDE; + CefString GetTitle() OVERRIDE; + TransitionType GetTransitionType() OVERRIDE; + bool HasPostData() OVERRIDE; + CefString GetFrameName() OVERRIDE; + CefTime GetCompletionTime() OVERRIDE; + int GetHttpStatusCode() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc index ed226ea12..534f00c6f 100644 --- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.cc @@ -18,7 +18,8 @@ bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry, bool current, int index, int total) { - if (CEF_MEMBER_MISSING(struct_, visit)) + cef_navigation_entry_visitor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -29,7 +30,7 @@ bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry, return false; // Execute - int _retval = struct_->visit(struct_, + int _retval = _struct->visit(_struct, CefNavigationEntryCppToC::Wrap(entry), current, index, @@ -40,9 +41,24 @@ bool CefNavigationEntryVisitorCToCpp::Visit(CefRefPtr entry, } +// CONSTRUCTOR - Do not edit by hand. + +CefNavigationEntryVisitorCToCpp::CefNavigationEntryVisitorCToCpp() { +} + +template<> cef_navigation_entry_visitor_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefNavigationEntryVisitor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_NAVIGATION_ENTRY_VISITOR; diff --git a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h index 2b8858be2..d209c05ff 100644 --- a/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h @@ -30,15 +30,12 @@ class CefNavigationEntryVisitorCToCpp : public CefCToCpp { public: - explicit CefNavigationEntryVisitorCToCpp(cef_navigation_entry_visitor_t* str) - : CefCToCpp(str) {} + CefNavigationEntryVisitorCToCpp(); - // CefNavigationEntryVisitor methods + // CefNavigationEntryVisitor methods. bool Visit(CefRefPtr entry, bool current, int index, int total) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_VISITOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/post_data_ctocpp.cc b/libcef_dll/ctocpp/post_data_ctocpp.cc index 72cfb3433..a21f9a691 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -31,33 +31,36 @@ CefRefPtr CefPostData::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefPostDataCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } size_t CefPostDataCToCpp::GetElementCount() { - if (CEF_MEMBER_MISSING(struct_, get_element_count)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_element_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_element_count(struct_); + size_t _retval = _struct->get_element_count(_struct); // Return type: simple return _retval; } void CefPostDataCToCpp::GetElements(ElementVector& elements) { - if (CEF_MEMBER_MISSING(struct_, get_elements)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_elements)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -80,7 +83,7 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) { } // Execute - struct_->get_elements(struct_, + _struct->get_elements(_struct, &elementsCount, elementsList); @@ -95,7 +98,8 @@ void CefPostDataCToCpp::GetElements(ElementVector& elements) { } bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { - if (CEF_MEMBER_MISSING(struct_, remove_element)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -106,7 +110,7 @@ bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { return false; // Execute - int _retval = struct_->remove_element(struct_, + int _retval = _struct->remove_element(_struct, CefPostDataElementCToCpp::Unwrap(element)); // Return type: bool @@ -114,7 +118,8 @@ bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { } bool CefPostDataCToCpp::AddElement(CefRefPtr element) { - if (CEF_MEMBER_MISSING(struct_, add_element)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -125,7 +130,7 @@ bool CefPostDataCToCpp::AddElement(CefRefPtr element) { return false; // Execute - int _retval = struct_->add_element(struct_, + int _retval = _struct->add_element(_struct, CefPostDataElementCToCpp::Unwrap(element)); // Return type: bool @@ -133,18 +138,32 @@ bool CefPostDataCToCpp::AddElement(CefRefPtr element) { } void CefPostDataCToCpp::RemoveElements() { - if (CEF_MEMBER_MISSING(struct_, remove_elements)) + cef_post_data_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, remove_elements)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->remove_elements(struct_); + _struct->remove_elements(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefPostDataCToCpp::CefPostDataCToCpp() { +} + +template<> cef_post_data_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefPostData* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_POST_DATA; diff --git a/libcef_dll/ctocpp/post_data_ctocpp.h b/libcef_dll/ctocpp/post_data_ctocpp.h index 0074c16e5..b8452b03d 100644 --- a/libcef_dll/ctocpp/post_data_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_ctocpp.h @@ -27,18 +27,16 @@ class CefPostDataCToCpp : public CefCToCpp { public: - explicit CefPostDataCToCpp(cef_post_data_t* str) - : CefCToCpp(str) {} + CefPostDataCToCpp(); - // CefPostData methods - virtual bool IsReadOnly() OVERRIDE; - virtual size_t GetElementCount() OVERRIDE; - virtual void GetElements(ElementVector& elements) OVERRIDE; - virtual bool RemoveElement(CefRefPtr element) OVERRIDE; - virtual bool AddElement(CefRefPtr element) OVERRIDE; - virtual void RemoveElements() OVERRIDE; + // CefPostData methods. + bool IsReadOnly() OVERRIDE; + size_t GetElementCount() OVERRIDE; + void GetElements(ElementVector& elements) OVERRIDE; + bool RemoveElement(CefRefPtr element) OVERRIDE; + bool AddElement(CefRefPtr element) OVERRIDE; + void RemoveElements() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/libcef_dll/ctocpp/post_data_element_ctocpp.cc index da225b047..aa54832ac 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.cc +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -29,30 +29,33 @@ CefRefPtr CefPostDataElement::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefPostDataElementCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } void CefPostDataElementCToCpp::SetToEmpty() { - if (CEF_MEMBER_MISSING(struct_, set_to_empty)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_to_empty)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_to_empty(struct_); + _struct->set_to_empty(_struct); } void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { - if (CEF_MEMBER_MISSING(struct_, set_to_file)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_to_file)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -63,12 +66,13 @@ void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { return; // Execute - struct_->set_to_file(struct_, + _struct->set_to_file(_struct, fileName.GetStruct()); } void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { - if (CEF_MEMBER_MISSING(struct_, set_to_bytes)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_to_bytes)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -79,32 +83,34 @@ void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { return; // Execute - struct_->set_to_bytes(struct_, + _struct->set_to_bytes(_struct, size, bytes); } CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return PDE_TYPE_EMPTY; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_postdataelement_type_t _retval = struct_->get_type(struct_); + cef_postdataelement_type_t _retval = _struct->get_type(_struct); // Return type: simple return _retval; } CefString CefPostDataElementCToCpp::GetFile() { - if (CEF_MEMBER_MISSING(struct_, get_file)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_file(struct_); + cef_string_userfree_t _retval = _struct->get_file(_struct); // Return type: string CefString _retvalStr; @@ -113,20 +119,22 @@ CefString CefPostDataElementCToCpp::GetFile() { } size_t CefPostDataElementCToCpp::GetBytesCount() { - if (CEF_MEMBER_MISSING(struct_, get_bytes_count)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bytes_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_bytes_count(struct_); + size_t _retval = _struct->get_bytes_count(_struct); // Return type: simple return _retval; } size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { - if (CEF_MEMBER_MISSING(struct_, get_bytes)) + cef_post_data_element_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bytes)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -137,7 +145,7 @@ size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { return 0; // Execute - size_t _retval = struct_->get_bytes(struct_, + size_t _retval = _struct->get_bytes(_struct, size, bytes); @@ -146,8 +154,23 @@ size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { } +// CONSTRUCTOR - Do not edit by hand. + +CefPostDataElementCToCpp::CefPostDataElementCToCpp() { +} + +template<> cef_post_data_element_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefPostDataElement* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_POST_DATA_ELEMENT; diff --git a/libcef_dll/ctocpp/post_data_element_ctocpp.h b/libcef_dll/ctocpp/post_data_element_ctocpp.h index 6b309d3f1..159ff5080 100644 --- a/libcef_dll/ctocpp/post_data_element_ctocpp.h +++ b/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -28,21 +28,18 @@ class CefPostDataElementCToCpp : public CefCToCpp { public: - explicit CefPostDataElementCToCpp(cef_post_data_element_t* str) - : CefCToCpp(str) {} + CefPostDataElementCToCpp(); - // CefPostDataElement methods - virtual bool IsReadOnly() OVERRIDE; - virtual void SetToEmpty() OVERRIDE; - virtual void SetToFile(const CefString& fileName) OVERRIDE; - virtual void SetToBytes(size_t size, const void* bytes) OVERRIDE; - virtual Type GetType() OVERRIDE; - virtual CefString GetFile() OVERRIDE; - virtual size_t GetBytesCount() OVERRIDE; - virtual size_t GetBytes(size_t size, void* bytes) OVERRIDE; + // CefPostDataElement methods. + bool IsReadOnly() OVERRIDE; + void SetToEmpty() OVERRIDE; + void SetToFile(const CefString& fileName) OVERRIDE; + void SetToBytes(size_t size, const void* bytes) OVERRIDE; + Type GetType() OVERRIDE; + CefString GetFile() OVERRIDE; + size_t GetBytesCount() OVERRIDE; + size_t GetBytes(size_t size, void* bytes) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc index e5a0d07e3..7a33ff2f3 100644 --- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc @@ -18,7 +18,8 @@ void CefPrintDialogCallbackCToCpp::Continue( CefRefPtr settings) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_print_dialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -29,23 +30,39 @@ void CefPrintDialogCallbackCToCpp::Continue( return; // Execute - struct_->cont(struct_, + _struct->cont(_struct, CefPrintSettingsCToCpp::Unwrap(settings)); } void CefPrintDialogCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_print_dialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefPrintDialogCallbackCToCpp::CefPrintDialogCallbackCToCpp() { +} + +template<> cef_print_dialog_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefPrintDialogCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_PRINT_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h index cac349543..2e94c8fc2 100644 --- a/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h @@ -28,15 +28,12 @@ class CefPrintDialogCallbackCToCpp : public CefCToCpp { public: - explicit CefPrintDialogCallbackCToCpp(cef_print_dialog_callback_t* str) - : CefCToCpp(str) {} + CefPrintDialogCallbackCToCpp(); - // CefPrintDialogCallback methods - virtual void Continue(CefRefPtr settings) OVERRIDE; - virtual void Cancel() OVERRIDE; + // CefPrintDialogCallback methods. + void Continue(CefRefPtr settings) OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.cc b/libcef_dll/ctocpp/print_handler_ctocpp.cc index d7807936a..0032e596d 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/print_handler_ctocpp.cc @@ -20,7 +20,8 @@ void CefPrintHandlerCToCpp::OnPrintSettings( CefRefPtr settings, bool get_defaults) { - if (CEF_MEMBER_MISSING(struct_, on_print_settings)) + cef_print_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_print_settings)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -31,14 +32,15 @@ void CefPrintHandlerCToCpp::OnPrintSettings( return; // Execute - struct_->on_print_settings(struct_, + _struct->on_print_settings(_struct, CefPrintSettingsCppToC::Wrap(settings), get_defaults); } bool CefPrintHandlerCToCpp::OnPrintDialog(bool has_selection, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_print_dialog)) + cef_print_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_print_dialog)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -49,7 +51,7 @@ bool CefPrintHandlerCToCpp::OnPrintDialog(bool has_selection, return false; // Execute - int _retval = struct_->on_print_dialog(struct_, + int _retval = _struct->on_print_dialog(_struct, has_selection, CefPrintDialogCallbackCppToC::Wrap(callback)); @@ -59,7 +61,8 @@ bool CefPrintHandlerCToCpp::OnPrintDialog(bool has_selection, bool CefPrintHandlerCToCpp::OnPrintJob(const CefString& document_name, const CefString& pdf_file_path, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_print_job)) + cef_print_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_print_job)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -78,7 +81,7 @@ bool CefPrintHandlerCToCpp::OnPrintJob(const CefString& document_name, return false; // Execute - int _retval = struct_->on_print_job(struct_, + int _retval = _struct->on_print_job(_struct, document_name.GetStruct(), pdf_file_path.GetStruct(), CefPrintJobCallbackCppToC::Wrap(callback)); @@ -88,18 +91,33 @@ bool CefPrintHandlerCToCpp::OnPrintJob(const CefString& document_name, } void CefPrintHandlerCToCpp::OnPrintReset() { - if (CEF_MEMBER_MISSING(struct_, on_print_reset)) + cef_print_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_print_reset)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_print_reset(struct_); + _struct->on_print_reset(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefPrintHandlerCToCpp::CefPrintHandlerCToCpp() { +} + +template<> cef_print_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefPrintHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_PRINT_HANDLER; diff --git a/libcef_dll/ctocpp/print_handler_ctocpp.h b/libcef_dll/ctocpp/print_handler_ctocpp.h index 3d39b0ee7..da0d23b57 100644 --- a/libcef_dll/ctocpp/print_handler_ctocpp.h +++ b/libcef_dll/ctocpp/print_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefPrintHandlerCToCpp : public CefCToCpp { public: - explicit CefPrintHandlerCToCpp(cef_print_handler_t* str) - : CefCToCpp( - str) {} + CefPrintHandlerCToCpp(); - // CefPrintHandler methods + // CefPrintHandler methods. void OnPrintSettings(CefRefPtr settings, bool get_defaults) override; bool OnPrintDialog(bool has_selection, @@ -45,4 +43,3 @@ class CefPrintHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc index 4ea878411..e513d4765 100644 --- a/libcef_dll/ctocpp/print_job_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.cc @@ -16,18 +16,34 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefPrintJobCallbackCToCpp::Continue() { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_print_job_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cont(struct_); + _struct->cont(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefPrintJobCallbackCToCpp::CefPrintJobCallbackCToCpp() { +} + +template<> cef_print_job_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefPrintJobCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_PRINT_JOB_CALLBACK; diff --git a/libcef_dll/ctocpp/print_job_callback_ctocpp.h b/libcef_dll/ctocpp/print_job_callback_ctocpp.h index 951560824..f2b8c29c0 100644 --- a/libcef_dll/ctocpp/print_job_callback_ctocpp.h +++ b/libcef_dll/ctocpp/print_job_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefPrintJobCallbackCToCpp : public CefCToCpp { public: - explicit CefPrintJobCallbackCToCpp(cef_print_job_callback_t* str) - : CefCToCpp(str) {} + CefPrintJobCallbackCToCpp(); - // CefPrintJobCallback methods - virtual void Continue() OVERRIDE; + // CefPrintJobCallback methods. + void Continue() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.cc b/libcef_dll/ctocpp/print_settings_ctocpp.cc index 465a27d2b..2c083c94f 100644 --- a/libcef_dll/ctocpp/print_settings_ctocpp.cc +++ b/libcef_dll/ctocpp/print_settings_ctocpp.cc @@ -30,63 +30,68 @@ CefRefPtr CefPrintSettings::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefPrintSettingsCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefPrintSettingsCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefPrintSettingsCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_print_settings_t* _retval = struct_->copy(struct_); + cef_print_settings_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefPrintSettingsCToCpp::Wrap(_retval); } void CefPrintSettingsCToCpp::SetOrientation(bool landscape) { - if (CEF_MEMBER_MISSING(struct_, set_orientation)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_orientation)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_orientation(struct_, + _struct->set_orientation(_struct, landscape); } bool CefPrintSettingsCToCpp::IsLandscape() { - if (CEF_MEMBER_MISSING(struct_, is_landscape)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_landscape)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_landscape(struct_); + int _retval = _struct->is_landscape(_struct); // Return type: bool return _retval?true:false; @@ -95,20 +100,22 @@ bool CefPrintSettingsCToCpp::IsLandscape() { void CefPrintSettingsCToCpp::SetPrinterPrintableArea( const CefSize& physical_size_device_units, const CefRect& printable_area_device_units, bool landscape_needs_flip) { - if (CEF_MEMBER_MISSING(struct_, set_printer_printable_area)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_printer_printable_area)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_printer_printable_area(struct_, + _struct->set_printer_printable_area(_struct, &physical_size_device_units, &printable_area_device_units, landscape_needs_flip); } void CefPrintSettingsCToCpp::SetDeviceName(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, set_device_name)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_device_name)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -116,18 +123,19 @@ void CefPrintSettingsCToCpp::SetDeviceName(const CefString& name) { // Unverified params: name // Execute - struct_->set_device_name(struct_, + _struct->set_device_name(_struct, name.GetStruct()); } CefString CefPrintSettingsCToCpp::GetDeviceName() { - if (CEF_MEMBER_MISSING(struct_, get_device_name)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_device_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_device_name(struct_); + cef_string_userfree_t _retval = _struct->get_device_name(_struct); // Return type: string CefString _retvalStr; @@ -136,31 +144,34 @@ CefString CefPrintSettingsCToCpp::GetDeviceName() { } void CefPrintSettingsCToCpp::SetDPI(int dpi) { - if (CEF_MEMBER_MISSING(struct_, set_dpi)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_dpi)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_dpi(struct_, + _struct->set_dpi(_struct, dpi); } int CefPrintSettingsCToCpp::GetDPI() { - if (CEF_MEMBER_MISSING(struct_, get_dpi)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dpi)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_dpi(struct_); + int _retval = _struct->get_dpi(_struct); // Return type: simple return _retval; } void CefPrintSettingsCToCpp::SetPageRanges(const PageRangeList& ranges) { - if (CEF_MEMBER_MISSING(struct_, set_page_ranges)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_page_ranges)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -179,7 +190,7 @@ void CefPrintSettingsCToCpp::SetPageRanges(const PageRangeList& ranges) { } // Execute - struct_->set_page_ranges(struct_, + _struct->set_page_ranges(_struct, rangesCount, rangesList); @@ -189,20 +200,22 @@ void CefPrintSettingsCToCpp::SetPageRanges(const PageRangeList& ranges) { } size_t CefPrintSettingsCToCpp::GetPageRangesCount() { - if (CEF_MEMBER_MISSING(struct_, get_page_ranges_count)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_page_ranges_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_page_ranges_count(struct_); + size_t _retval = _struct->get_page_ranges_count(_struct); // Return type: simple return _retval; } void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { - if (CEF_MEMBER_MISSING(struct_, get_page_ranges)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_page_ranges)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -225,7 +238,7 @@ void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { } // Execute - struct_->get_page_ranges(struct_, + _struct->get_page_ranges(_struct, &rangesCount, rangesList); @@ -240,128 +253,152 @@ void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { } void CefPrintSettingsCToCpp::SetSelectionOnly(bool selection_only) { - if (CEF_MEMBER_MISSING(struct_, set_selection_only)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_selection_only)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_selection_only(struct_, + _struct->set_selection_only(_struct, selection_only); } bool CefPrintSettingsCToCpp::IsSelectionOnly() { - if (CEF_MEMBER_MISSING(struct_, is_selection_only)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_selection_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_selection_only(struct_); + int _retval = _struct->is_selection_only(_struct); // Return type: bool return _retval?true:false; } void CefPrintSettingsCToCpp::SetCollate(bool collate) { - if (CEF_MEMBER_MISSING(struct_, set_collate)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_collate)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_collate(struct_, + _struct->set_collate(_struct, collate); } bool CefPrintSettingsCToCpp::WillCollate() { - if (CEF_MEMBER_MISSING(struct_, will_collate)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, will_collate)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->will_collate(struct_); + int _retval = _struct->will_collate(_struct); // Return type: bool return _retval?true:false; } void CefPrintSettingsCToCpp::SetColorModel(ColorModel model) { - if (CEF_MEMBER_MISSING(struct_, set_color_model)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_color_model)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_color_model(struct_, + _struct->set_color_model(_struct, model); } CefPrintSettings::ColorModel CefPrintSettingsCToCpp::GetColorModel() { - if (CEF_MEMBER_MISSING(struct_, get_color_model)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_color_model)) return COLOR_MODEL_UNKNOWN; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_color_model_t _retval = struct_->get_color_model(struct_); + cef_color_model_t _retval = _struct->get_color_model(_struct); // Return type: simple return _retval; } void CefPrintSettingsCToCpp::SetCopies(int copies) { - if (CEF_MEMBER_MISSING(struct_, set_copies)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_copies)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_copies(struct_, + _struct->set_copies(_struct, copies); } int CefPrintSettingsCToCpp::GetCopies() { - if (CEF_MEMBER_MISSING(struct_, get_copies)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_copies)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_copies(struct_); + int _retval = _struct->get_copies(_struct); // Return type: simple return _retval; } void CefPrintSettingsCToCpp::SetDuplexMode(DuplexMode mode) { - if (CEF_MEMBER_MISSING(struct_, set_duplex_mode)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_duplex_mode)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_duplex_mode(struct_, + _struct->set_duplex_mode(_struct, mode); } CefPrintSettings::DuplexMode CefPrintSettingsCToCpp::GetDuplexMode() { - if (CEF_MEMBER_MISSING(struct_, get_duplex_mode)) + cef_print_settings_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_duplex_mode)) return DUPLEX_MODE_UNKNOWN; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_duplex_mode_t _retval = struct_->get_duplex_mode(struct_); + cef_duplex_mode_t _retval = _struct->get_duplex_mode(_struct); // Return type: simple return _retval; } +// CONSTRUCTOR - Do not edit by hand. + +CefPrintSettingsCToCpp::CefPrintSettingsCToCpp() { +} + +template<> cef_print_settings_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefPrintSettings* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_PRINT_SETTINGS; diff --git a/libcef_dll/ctocpp/print_settings_ctocpp.h b/libcef_dll/ctocpp/print_settings_ctocpp.h index 326a88432..3939ef0af 100644 --- a/libcef_dll/ctocpp/print_settings_ctocpp.h +++ b/libcef_dll/ctocpp/print_settings_ctocpp.h @@ -28,39 +28,35 @@ class CefPrintSettingsCToCpp : public CefCToCpp { public: - explicit CefPrintSettingsCToCpp(cef_print_settings_t* str) - : CefCToCpp(str) {} + CefPrintSettingsCToCpp(); - // CefPrintSettings methods - virtual bool IsValid() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual void SetOrientation(bool landscape) OVERRIDE; - virtual bool IsLandscape() OVERRIDE; - virtual void SetPrinterPrintableArea( - const CefSize& physical_size_device_units, + // CefPrintSettings methods. + bool IsValid() OVERRIDE; + bool IsReadOnly() OVERRIDE; + CefRefPtr Copy() OVERRIDE; + void SetOrientation(bool landscape) OVERRIDE; + bool IsLandscape() OVERRIDE; + void SetPrinterPrintableArea(const CefSize& physical_size_device_units, const CefRect& printable_area_device_units, bool landscape_needs_flip) OVERRIDE; - virtual void SetDeviceName(const CefString& name) OVERRIDE; - virtual CefString GetDeviceName() OVERRIDE; - virtual void SetDPI(int dpi) OVERRIDE; - virtual int GetDPI() OVERRIDE; - virtual void SetPageRanges(const PageRangeList& ranges) OVERRIDE; - virtual size_t GetPageRangesCount() OVERRIDE; - virtual void GetPageRanges(PageRangeList& ranges) OVERRIDE; - virtual void SetSelectionOnly(bool selection_only) OVERRIDE; - virtual bool IsSelectionOnly() OVERRIDE; - virtual void SetCollate(bool collate) OVERRIDE; - virtual bool WillCollate() OVERRIDE; - virtual void SetColorModel(ColorModel model) OVERRIDE; - virtual ColorModel GetColorModel() OVERRIDE; - virtual void SetCopies(int copies) OVERRIDE; - virtual int GetCopies() OVERRIDE; - virtual void SetDuplexMode(DuplexMode mode) OVERRIDE; - virtual DuplexMode GetDuplexMode() OVERRIDE; + void SetDeviceName(const CefString& name) OVERRIDE; + CefString GetDeviceName() OVERRIDE; + void SetDPI(int dpi) OVERRIDE; + int GetDPI() OVERRIDE; + void SetPageRanges(const PageRangeList& ranges) OVERRIDE; + size_t GetPageRangesCount() OVERRIDE; + void GetPageRanges(PageRangeList& ranges) OVERRIDE; + void SetSelectionOnly(bool selection_only) OVERRIDE; + bool IsSelectionOnly() OVERRIDE; + void SetCollate(bool collate) OVERRIDE; + bool WillCollate() OVERRIDE; + void SetColorModel(ColorModel model) OVERRIDE; + ColorModel GetColorModel() OVERRIDE; + void SetCopies(int copies) OVERRIDE; + int GetCopies() OVERRIDE; + void SetDuplexMode(DuplexMode mode) OVERRIDE; + DuplexMode GetDuplexMode() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/process_message_ctocpp.cc b/libcef_dll/ctocpp/process_message_ctocpp.cc index 62585fda3..abcd0bc47 100644 --- a/libcef_dll/ctocpp/process_message_ctocpp.cc +++ b/libcef_dll/ctocpp/process_message_ctocpp.cc @@ -36,52 +36,56 @@ CefRefPtr CefProcessMessage::Create(const CefString& name) { // VIRTUAL METHODS - Body may be edited by hand. bool CefProcessMessageCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_process_message_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefProcessMessageCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_process_message_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefProcessMessageCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_process_message_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_process_message_t* _retval = struct_->copy(struct_); + cef_process_message_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefProcessMessageCToCpp::Wrap(_retval); } CefString CefProcessMessageCToCpp::GetName() { - if (CEF_MEMBER_MISSING(struct_, get_name)) + cef_process_message_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_name(struct_); + cef_string_userfree_t _retval = _struct->get_name(_struct); // Return type: string CefString _retvalStr; @@ -90,21 +94,36 @@ CefString CefProcessMessageCToCpp::GetName() { } CefRefPtr CefProcessMessageCToCpp::GetArgumentList() { - if (CEF_MEMBER_MISSING(struct_, get_argument_list)) + cef_process_message_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_argument_list)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_list_value_t* _retval = struct_->get_argument_list(struct_); + cef_list_value_t* _retval = _struct->get_argument_list(_struct); // Return type: refptr_same return CefListValueCToCpp::Wrap(_retval); } +// CONSTRUCTOR - Do not edit by hand. + +CefProcessMessageCToCpp::CefProcessMessageCToCpp() { +} + +template<> cef_process_message_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefProcessMessage* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_PROCESS_MESSAGE; diff --git a/libcef_dll/ctocpp/process_message_ctocpp.h b/libcef_dll/ctocpp/process_message_ctocpp.h index b97e622dc..d90dd620f 100644 --- a/libcef_dll/ctocpp/process_message_ctocpp.h +++ b/libcef_dll/ctocpp/process_message_ctocpp.h @@ -28,18 +28,15 @@ class CefProcessMessageCToCpp : public CefCToCpp { public: - explicit CefProcessMessageCToCpp(cef_process_message_t* str) - : CefCToCpp(str) {} + CefProcessMessageCToCpp(); - // CefProcessMessage methods - virtual bool IsValid() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual CefString GetName() OVERRIDE; - virtual CefRefPtr GetArgumentList() OVERRIDE; + // CefProcessMessage methods. + bool IsValid() OVERRIDE; + bool IsReadOnly() OVERRIDE; + CefRefPtr Copy() OVERRIDE; + CefString GetName() OVERRIDE; + CefRefPtr GetArgumentList() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.cc b/libcef_dll/ctocpp/read_handler_ctocpp.cc index 7f5165782..e89756c24 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/read_handler_ctocpp.cc @@ -16,7 +16,8 @@ // VIRTUAL METHODS - Body may be edited by hand. size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { - if (CEF_MEMBER_MISSING(struct_, read)) + cef_read_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, read)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -27,7 +28,7 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = struct_->read(struct_, + size_t _retval = _struct->read(_struct, ptr, size, n); @@ -37,13 +38,14 @@ size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n) { } int CefReadHandlerCToCpp::Seek(int64 offset, int whence) { - if (CEF_MEMBER_MISSING(struct_, seek)) + cef_read_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, seek)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->seek(struct_, + int _retval = _struct->seek(_struct, offset, whence); @@ -52,47 +54,64 @@ int CefReadHandlerCToCpp::Seek(int64 offset, int whence) { } int64 CefReadHandlerCToCpp::Tell() { - if (CEF_MEMBER_MISSING(struct_, tell)) + cef_read_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->tell(struct_); + int64 _retval = _struct->tell(_struct); // Return type: simple return _retval; } int CefReadHandlerCToCpp::Eof() { - if (CEF_MEMBER_MISSING(struct_, eof)) + cef_read_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, eof)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->eof(struct_); + int _retval = _struct->eof(_struct); // Return type: simple return _retval; } bool CefReadHandlerCToCpp::MayBlock() { - if (CEF_MEMBER_MISSING(struct_, may_block)) + cef_read_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, may_block)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->may_block(struct_); + int _retval = _struct->may_block(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefReadHandlerCToCpp::CefReadHandlerCToCpp() { +} + +template<> cef_read_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefReadHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_READ_HANDLER; diff --git a/libcef_dll/ctocpp/read_handler_ctocpp.h b/libcef_dll/ctocpp/read_handler_ctocpp.h index 792e7c39e..67e480c8f 100644 --- a/libcef_dll/ctocpp/read_handler_ctocpp.h +++ b/libcef_dll/ctocpp/read_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefReadHandlerCToCpp : public CefCToCpp { public: - explicit CefReadHandlerCToCpp(cef_read_handler_t* str) - : CefCToCpp( - str) {} + CefReadHandlerCToCpp(); - // CefReadHandler methods + // CefReadHandler methods. size_t Read(void* ptr, size_t size, size_t n) override; int Seek(int64 offset, int whence) override; int64 Tell() override; @@ -42,4 +40,3 @@ class CefReadHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_READ_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.cc b/libcef_dll/ctocpp/render_handler_ctocpp.cc index 1d8febd36..4d948d153 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_handler_ctocpp.cc @@ -19,7 +19,8 @@ bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, CefRect& rect) { - if (CEF_MEMBER_MISSING(struct_, get_root_screen_rect)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_root_screen_rect)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -30,7 +31,7 @@ bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, return false; // Execute - int _retval = struct_->get_root_screen_rect(struct_, + int _retval = _struct->get_root_screen_rect(_struct, CefBrowserCppToC::Wrap(browser), &rect); @@ -40,7 +41,8 @@ bool CefRenderHandlerCToCpp::GetRootScreenRect(CefRefPtr browser, bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, CefRect& rect) { - if (CEF_MEMBER_MISSING(struct_, get_view_rect)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_view_rect)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -51,7 +53,7 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, return false; // Execute - int _retval = struct_->get_view_rect(struct_, + int _retval = _struct->get_view_rect(_struct, CefBrowserCppToC::Wrap(browser), &rect); @@ -61,7 +63,8 @@ bool CefRenderHandlerCToCpp::GetViewRect(CefRefPtr browser, bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, int viewX, int viewY, int& screenX, int& screenY) { - if (CEF_MEMBER_MISSING(struct_, get_screen_point)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_screen_point)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -72,7 +75,7 @@ bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, return false; // Execute - int _retval = struct_->get_screen_point(struct_, + int _retval = _struct->get_screen_point(_struct, CefBrowserCppToC::Wrap(browser), viewX, viewY, @@ -85,7 +88,8 @@ bool CefRenderHandlerCToCpp::GetScreenPoint(CefRefPtr browser, bool CefRenderHandlerCToCpp::GetScreenInfo(CefRefPtr browser, CefScreenInfo& screen_info) { - if (CEF_MEMBER_MISSING(struct_, get_screen_info)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_screen_info)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -96,7 +100,7 @@ bool CefRenderHandlerCToCpp::GetScreenInfo(CefRefPtr browser, return false; // Execute - int _retval = struct_->get_screen_info(struct_, + int _retval = _struct->get_screen_info(_struct, CefBrowserCppToC::Wrap(browser), &screen_info); @@ -106,7 +110,8 @@ bool CefRenderHandlerCToCpp::GetScreenInfo(CefRefPtr browser, void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, bool show) { - if (CEF_MEMBER_MISSING(struct_, on_popup_show)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_popup_show)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -117,14 +122,15 @@ void CefRenderHandlerCToCpp::OnPopupShow(CefRefPtr browser, return; // Execute - struct_->on_popup_show(struct_, + _struct->on_popup_show(_struct, CefBrowserCppToC::Wrap(browser), show); } void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, const CefRect& rect) { - if (CEF_MEMBER_MISSING(struct_, on_popup_size)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_popup_size)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -135,7 +141,7 @@ void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, return; // Execute - struct_->on_popup_size(struct_, + _struct->on_popup_size(_struct, CefBrowserCppToC::Wrap(browser), &rect); } @@ -143,7 +149,8 @@ void CefRenderHandlerCToCpp::OnPopupSize(CefRefPtr browser, void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, PaintElementType type, const RectList& dirtyRects, const void* buffer, int width, int height) { - if (CEF_MEMBER_MISSING(struct_, on_paint)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_paint)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -171,7 +178,7 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, } // Execute - struct_->on_paint(struct_, + _struct->on_paint(_struct, CefBrowserCppToC::Wrap(browser), type, dirtyRectsCount, @@ -188,7 +195,8 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr browser, void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, CefCursorHandle cursor, CursorType type, const CefCursorInfo& custom_cursor_info) { - if (CEF_MEMBER_MISSING(struct_, on_cursor_change)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_cursor_change)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -199,7 +207,7 @@ void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, return; // Execute - struct_->on_cursor_change(struct_, + _struct->on_cursor_change(_struct, CefBrowserCppToC::Wrap(browser), cursor, type, @@ -209,7 +217,8 @@ void CefRenderHandlerCToCpp::OnCursorChange(CefRefPtr browser, bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr browser, CefRefPtr drag_data, DragOperationsMask allowed_ops, int x, int y) { - if (CEF_MEMBER_MISSING(struct_, start_dragging)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, start_dragging)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -224,7 +233,7 @@ bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr browser, return false; // Execute - int _retval = struct_->start_dragging(struct_, + int _retval = _struct->start_dragging(_struct, CefBrowserCppToC::Wrap(browser), CefDragDataCppToC::Wrap(drag_data), allowed_ops, @@ -237,7 +246,8 @@ bool CefRenderHandlerCToCpp::StartDragging(CefRefPtr browser, void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr browser, DragOperation operation) { - if (CEF_MEMBER_MISSING(struct_, update_drag_cursor)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, update_drag_cursor)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -248,14 +258,15 @@ void CefRenderHandlerCToCpp::UpdateDragCursor(CefRefPtr browser, return; // Execute - struct_->update_drag_cursor(struct_, + _struct->update_drag_cursor(_struct, CefBrowserCppToC::Wrap(browser), operation); } void CefRenderHandlerCToCpp::OnScrollOffsetChanged( CefRefPtr browser, double x, double y) { - if (CEF_MEMBER_MISSING(struct_, on_scroll_offset_changed)) + cef_render_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_scroll_offset_changed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -266,15 +277,29 @@ void CefRenderHandlerCToCpp::OnScrollOffsetChanged( return; // Execute - struct_->on_scroll_offset_changed(struct_, + _struct->on_scroll_offset_changed(_struct, CefBrowserCppToC::Wrap(browser), x, y); } +// CONSTRUCTOR - Do not edit by hand. + +CefRenderHandlerCToCpp::CefRenderHandlerCToCpp() { +} + +template<> cef_render_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefRenderHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_RENDER_HANDLER; diff --git a/libcef_dll/ctocpp/render_handler_ctocpp.h b/libcef_dll/ctocpp/render_handler_ctocpp.h index 54b5c3121..08a93f206 100644 --- a/libcef_dll/ctocpp/render_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefRenderHandlerCToCpp : public CefCToCpp { public: - explicit CefRenderHandlerCToCpp(cef_render_handler_t* str) - : CefCToCpp(str) {} + CefRenderHandlerCToCpp(); - // CefRenderHandler methods + // CefRenderHandler methods. bool GetRootScreenRect(CefRefPtr browser, CefRect& rect) override; bool GetViewRect(CefRefPtr browser, CefRect& rect) override; bool GetScreenPoint(CefRefPtr browser, int viewX, int viewY, @@ -57,4 +55,3 @@ class CefRenderHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc index 06f4ce15c..bea91a581 100644 --- a/libcef_dll/ctocpp/render_process_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.cc @@ -27,7 +27,8 @@ void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated( CefRefPtr extra_info) { - if (CEF_MEMBER_MISSING(struct_, on_render_thread_created)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_render_thread_created)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -38,23 +39,25 @@ void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated( return; // Execute - struct_->on_render_thread_created(struct_, + _struct->on_render_thread_created(_struct, CefListValueCppToC::Wrap(extra_info)); } void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() { - if (CEF_MEMBER_MISSING(struct_, on_web_kit_initialized)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_web_kit_initialized)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_web_kit_initialized(struct_); + _struct->on_web_kit_initialized(_struct); } void CefRenderProcessHandlerCToCpp::OnBrowserCreated( CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_browser_created)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_browser_created)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -65,13 +68,14 @@ void CefRenderProcessHandlerCToCpp::OnBrowserCreated( return; // Execute - struct_->on_browser_created(struct_, + _struct->on_browser_created(_struct, CefBrowserCppToC::Wrap(browser)); } void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed( CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_browser_destroyed)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_browser_destroyed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -82,18 +86,19 @@ void CefRenderProcessHandlerCToCpp::OnBrowserDestroyed( return; // Execute - struct_->on_browser_destroyed(struct_, + _struct->on_browser_destroyed(_struct, CefBrowserCppToC::Wrap(browser)); } CefRefPtr CefRenderProcessHandlerCToCpp::GetLoadHandler() { - if (CEF_MEMBER_MISSING(struct_, get_load_handler)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_load_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_load_handler_t* _retval = struct_->get_load_handler(struct_); + cef_load_handler_t* _retval = _struct->get_load_handler(_struct); // Return type: refptr_same return CefLoadHandlerCToCpp::Wrap(_retval); @@ -103,7 +108,8 @@ bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation( CefRefPtr browser, CefRefPtr frame, CefRefPtr request, NavigationType navigation_type, bool is_redirect) { - if (CEF_MEMBER_MISSING(struct_, on_before_navigation)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_navigation)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -122,7 +128,7 @@ bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation( return false; // Execute - int _retval = struct_->on_before_navigation(struct_, + int _retval = _struct->on_before_navigation(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), @@ -136,7 +142,8 @@ bool CefRenderProcessHandlerCToCpp::OnBeforeNavigation( void CefRenderProcessHandlerCToCpp::OnContextCreated( CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { - if (CEF_MEMBER_MISSING(struct_, on_context_created)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_context_created)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -155,7 +162,7 @@ void CefRenderProcessHandlerCToCpp::OnContextCreated( return; // Execute - struct_->on_context_created(struct_, + _struct->on_context_created(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefV8ContextCppToC::Wrap(context)); @@ -164,7 +171,8 @@ void CefRenderProcessHandlerCToCpp::OnContextCreated( void CefRenderProcessHandlerCToCpp::OnContextReleased( CefRefPtr browser, CefRefPtr frame, CefRefPtr context) { - if (CEF_MEMBER_MISSING(struct_, on_context_released)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_context_released)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -183,7 +191,7 @@ void CefRenderProcessHandlerCToCpp::OnContextReleased( return; // Execute - struct_->on_context_released(struct_, + _struct->on_context_released(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefV8ContextCppToC::Wrap(context)); @@ -193,7 +201,8 @@ void CefRenderProcessHandlerCToCpp::OnUncaughtException( CefRefPtr browser, CefRefPtr frame, CefRefPtr context, CefRefPtr exception, CefRefPtr stackTrace) { - if (CEF_MEMBER_MISSING(struct_, on_uncaught_exception)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_uncaught_exception)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -220,7 +229,7 @@ void CefRenderProcessHandlerCToCpp::OnUncaughtException( return; // Execute - struct_->on_uncaught_exception(struct_, + _struct->on_uncaught_exception(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefV8ContextCppToC::Wrap(context), @@ -231,7 +240,8 @@ void CefRenderProcessHandlerCToCpp::OnUncaughtException( void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged( CefRefPtr browser, CefRefPtr frame, CefRefPtr node) { - if (CEF_MEMBER_MISSING(struct_, on_focused_node_changed)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_focused_node_changed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -243,7 +253,7 @@ void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged( // Unverified params: frame, node // Execute - struct_->on_focused_node_changed(struct_, + _struct->on_focused_node_changed(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefDOMNodeCppToC::Wrap(node)); @@ -252,7 +262,8 @@ void CefRenderProcessHandlerCToCpp::OnFocusedNodeChanged( bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived( CefRefPtr browser, CefProcessId source_process, CefRefPtr message) { - if (CEF_MEMBER_MISSING(struct_, on_process_message_received)) + cef_render_process_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_process_message_received)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -267,7 +278,7 @@ bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived( return false; // Execute - int _retval = struct_->on_process_message_received(struct_, + int _retval = _struct->on_process_message_received(_struct, CefBrowserCppToC::Wrap(browser), source_process, CefProcessMessageCppToC::Wrap(message)); @@ -277,8 +288,23 @@ bool CefRenderProcessHandlerCToCpp::OnProcessMessageReceived( } +// CONSTRUCTOR - Do not edit by hand. + +CefRenderProcessHandlerCToCpp::CefRenderProcessHandlerCToCpp() { +} + +template<> cef_render_process_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRenderProcessHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_RENDER_PROCESS_HANDLER; diff --git a/libcef_dll/ctocpp/render_process_handler_ctocpp.h b/libcef_dll/ctocpp/render_process_handler_ctocpp.h index 59be0932d..9b6d8443b 100644 --- a/libcef_dll/ctocpp/render_process_handler_ctocpp.h +++ b/libcef_dll/ctocpp/render_process_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefRenderProcessHandlerCToCpp : public CefCToCpp { public: - explicit CefRenderProcessHandlerCToCpp(cef_render_process_handler_t* str) - : CefCToCpp(str) {} + CefRenderProcessHandlerCToCpp(); - // CefRenderProcessHandler methods + // CefRenderProcessHandler methods. void OnRenderThreadCreated(CefRefPtr extra_info) override; void OnWebKitInitialized() override; void OnBrowserCreated(CefRefPtr browser) override; @@ -58,4 +56,3 @@ class CefRenderProcessHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.cc b/libcef_dll/ctocpp/request_callback_ctocpp.cc index 94319de6b..590c7a2aa 100644 --- a/libcef_dll/ctocpp/request_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/request_callback_ctocpp.cc @@ -16,29 +16,46 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefRequestCallbackCToCpp::Continue(bool allow) { - if (CEF_MEMBER_MISSING(struct_, cont)) + cef_request_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cont)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cont(struct_, + _struct->cont(_struct, allow); } void CefRequestCallbackCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_request_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefRequestCallbackCToCpp::CefRequestCallbackCToCpp() { +} + +template<> cef_request_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRequestCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_REQUEST_CALLBACK; diff --git a/libcef_dll/ctocpp/request_callback_ctocpp.h b/libcef_dll/ctocpp/request_callback_ctocpp.h index b5876ecb6..d32d8fe6b 100644 --- a/libcef_dll/ctocpp/request_callback_ctocpp.h +++ b/libcef_dll/ctocpp/request_callback_ctocpp.h @@ -28,15 +28,12 @@ class CefRequestCallbackCToCpp : public CefCToCpp { public: - explicit CefRequestCallbackCToCpp(cef_request_callback_t* str) - : CefCToCpp(str) {} + CefRequestCallbackCToCpp(); - // CefRequestCallback methods - virtual void Continue(bool allow) OVERRIDE; - virtual void Cancel() OVERRIDE; + // CefRequestCallback methods. + void Continue(bool allow) OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/request_context_ctocpp.cc b/libcef_dll/ctocpp/request_context_ctocpp.cc index c2801388a..e981b3ca2 100644 --- a/libcef_dll/ctocpp/request_context_ctocpp.cc +++ b/libcef_dll/ctocpp/request_context_ctocpp.cc @@ -69,7 +69,8 @@ CefRefPtr CefRequestContext::CreateContext( // VIRTUAL METHODS - Body may be edited by hand. bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -80,7 +81,7 @@ bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefRequestContextCToCpp::Unwrap(other)); // Return type: bool @@ -89,7 +90,8 @@ bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { bool CefRequestContextCToCpp::IsSharingWith( CefRefPtr other) { - if (CEF_MEMBER_MISSING(struct_, is_sharing_with)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_sharing_with)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -100,7 +102,7 @@ bool CefRequestContextCToCpp::IsSharingWith( return false; // Execute - int _retval = struct_->is_sharing_with(struct_, + int _retval = _struct->is_sharing_with(_struct, CefRequestContextCToCpp::Unwrap(other)); // Return type: bool @@ -108,39 +110,42 @@ bool CefRequestContextCToCpp::IsSharingWith( } bool CefRequestContextCToCpp::IsGlobal() { - if (CEF_MEMBER_MISSING(struct_, is_global)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_global)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_global(struct_); + int _retval = _struct->is_global(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefRequestContextCToCpp::GetHandler() { - if (CEF_MEMBER_MISSING(struct_, get_handler)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_request_context_handler_t* _retval = struct_->get_handler(struct_); + cef_request_context_handler_t* _retval = _struct->get_handler(_struct); // Return type: refptr_diff return CefRequestContextHandlerCppToC::Unwrap(_retval); } CefString CefRequestContextCToCpp::GetCachePath() { - if (CEF_MEMBER_MISSING(struct_, get_cache_path)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_cache_path)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_cache_path(struct_); + cef_string_userfree_t _retval = _struct->get_cache_path(_struct); // Return type: string CefString _retvalStr; @@ -150,7 +155,8 @@ CefString CefRequestContextCToCpp::GetCachePath() { CefRefPtr CefRequestContextCToCpp::GetDefaultCookieManager( CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, get_default_cookie_manager)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_default_cookie_manager)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -158,7 +164,7 @@ CefRefPtr CefRequestContextCToCpp::GetDefaultCookieManager( // Unverified params: callback // Execute - cef_cookie_manager_t* _retval = struct_->get_default_cookie_manager(struct_, + cef_cookie_manager_t* _retval = _struct->get_default_cookie_manager(_struct, CefCompletionCallbackCppToC::Wrap(callback)); // Return type: refptr_same @@ -168,7 +174,8 @@ CefRefPtr CefRequestContextCToCpp::GetDefaultCookieManager( bool CefRequestContextCToCpp::RegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory) { - if (CEF_MEMBER_MISSING(struct_, register_scheme_handler_factory)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, register_scheme_handler_factory)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -180,7 +187,7 @@ bool CefRequestContextCToCpp::RegisterSchemeHandlerFactory( // Unverified params: domain_name, factory // Execute - int _retval = struct_->register_scheme_handler_factory(struct_, + int _retval = _struct->register_scheme_handler_factory(_struct, scheme_name.GetStruct(), domain_name.GetStruct(), CefSchemeHandlerFactoryCppToC::Wrap(factory)); @@ -190,21 +197,36 @@ bool CefRequestContextCToCpp::RegisterSchemeHandlerFactory( } bool CefRequestContextCToCpp::ClearSchemeHandlerFactories() { - if (CEF_MEMBER_MISSING(struct_, clear_scheme_handler_factories)) + cef_request_context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clear_scheme_handler_factories)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->clear_scheme_handler_factories(struct_); + int _retval = _struct->clear_scheme_handler_factories(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefRequestContextCToCpp::CefRequestContextCToCpp() { +} + +template<> cef_request_context_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRequestContext* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_REQUEST_CONTEXT; diff --git a/libcef_dll/ctocpp/request_context_ctocpp.h b/libcef_dll/ctocpp/request_context_ctocpp.h index af5e5234f..6a1cfe722 100644 --- a/libcef_dll/ctocpp/request_context_ctocpp.h +++ b/libcef_dll/ctocpp/request_context_ctocpp.h @@ -30,24 +30,21 @@ class CefRequestContextCToCpp : public CefCToCpp { public: - explicit CefRequestContextCToCpp(cef_request_context_t* str) - : CefCToCpp(str) {} + CefRequestContextCToCpp(); - // CefRequestContext methods - virtual bool IsSame(CefRefPtr other) OVERRIDE; - virtual bool IsSharingWith(CefRefPtr other) OVERRIDE; - virtual bool IsGlobal() OVERRIDE; - virtual CefRefPtr GetHandler() OVERRIDE; - virtual CefString GetCachePath() OVERRIDE; - virtual CefRefPtr GetDefaultCookieManager( + // CefRequestContext methods. + bool IsSame(CefRefPtr other) OVERRIDE; + bool IsSharingWith(CefRefPtr other) OVERRIDE; + bool IsGlobal() OVERRIDE; + CefRefPtr GetHandler() OVERRIDE; + CefString GetCachePath() OVERRIDE; + CefRefPtr GetDefaultCookieManager( CefRefPtr callback) OVERRIDE; - virtual bool RegisterSchemeHandlerFactory(const CefString& scheme_name, + bool RegisterSchemeHandlerFactory(const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory) OVERRIDE; - virtual bool ClearSchemeHandlerFactories() OVERRIDE; + bool ClearSchemeHandlerFactories() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc index dd0ba9e98..cd82c7911 100644 --- a/libcef_dll/ctocpp/request_context_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.cc @@ -17,21 +17,37 @@ // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefRequestContextHandlerCToCpp::GetCookieManager() { - if (CEF_MEMBER_MISSING(struct_, get_cookie_manager)) + cef_request_context_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_cookie_manager)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_cookie_manager_t* _retval = struct_->get_cookie_manager(struct_); + cef_cookie_manager_t* _retval = _struct->get_cookie_manager(_struct); // Return type: refptr_diff return CefCookieManagerCppToC::Unwrap(_retval); } +// CONSTRUCTOR - Do not edit by hand. + +CefRequestContextHandlerCToCpp::CefRequestContextHandlerCToCpp() { +} + +template<> cef_request_context_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRequestContextHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_REQUEST_CONTEXT_HANDLER; diff --git a/libcef_dll/ctocpp/request_context_handler_ctocpp.h b/libcef_dll/ctocpp/request_context_handler_ctocpp.h index 133b01dbe..a8568270f 100644 --- a/libcef_dll/ctocpp/request_context_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_context_handler_ctocpp.h @@ -28,14 +28,11 @@ class CefRequestContextHandlerCToCpp : public CefCToCpp { public: - explicit CefRequestContextHandlerCToCpp(cef_request_context_handler_t* str) - : CefCToCpp(str) {} + CefRequestContextHandlerCToCpp(); - // CefRequestContextHandler methods + // CefRequestContextHandler methods. CefRefPtr GetCookieManager() override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/request_ctocpp.cc b/libcef_dll/ctocpp/request_ctocpp.cc index 5371cbdea..253b1c4dc 100644 --- a/libcef_dll/ctocpp/request_ctocpp.cc +++ b/libcef_dll/ctocpp/request_ctocpp.cc @@ -31,26 +31,28 @@ CefRefPtr CefRequest::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefRequestCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } CefString CefRequestCToCpp::GetURL() { - if (CEF_MEMBER_MISSING(struct_, get_url)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_url(struct_); + cef_string_userfree_t _retval = _struct->get_url(_struct); // Return type: string CefString _retvalStr; @@ -59,7 +61,8 @@ CefString CefRequestCToCpp::GetURL() { } void CefRequestCToCpp::SetURL(const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, set_url)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_url)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -70,18 +73,19 @@ void CefRequestCToCpp::SetURL(const CefString& url) { return; // Execute - struct_->set_url(struct_, + _struct->set_url(_struct, url.GetStruct()); } CefString CefRequestCToCpp::GetMethod() { - if (CEF_MEMBER_MISSING(struct_, get_method)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_method)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_method(struct_); + cef_string_userfree_t _retval = _struct->get_method(_struct); // Return type: string CefString _retvalStr; @@ -90,7 +94,8 @@ CefString CefRequestCToCpp::GetMethod() { } void CefRequestCToCpp::SetMethod(const CefString& method) { - if (CEF_MEMBER_MISSING(struct_, set_method)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_method)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -101,25 +106,27 @@ void CefRequestCToCpp::SetMethod(const CefString& method) { return; // Execute - struct_->set_method(struct_, + _struct->set_method(_struct, method.GetStruct()); } CefRefPtr CefRequestCToCpp::GetPostData() { - if (CEF_MEMBER_MISSING(struct_, get_post_data)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_post_data)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_post_data_t* _retval = struct_->get_post_data(struct_); + cef_post_data_t* _retval = _struct->get_post_data(_struct); // Return type: refptr_same return CefPostDataCToCpp::Wrap(_retval); } void CefRequestCToCpp::SetPostData(CefRefPtr postData) { - if (CEF_MEMBER_MISSING(struct_, set_post_data)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_post_data)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -130,12 +137,13 @@ void CefRequestCToCpp::SetPostData(CefRefPtr postData) { return; // Execute - struct_->set_post_data(struct_, + _struct->set_post_data(_struct, CefPostDataCToCpp::Unwrap(postData)); } void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { - if (CEF_MEMBER_MISSING(struct_, get_header_map)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_header_map)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -147,7 +155,7 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - struct_->get_header_map(struct_, + _struct->get_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref @@ -159,7 +167,8 @@ void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { } void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { - if (CEF_MEMBER_MISSING(struct_, set_header_map)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_header_map)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -171,7 +180,7 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - struct_->set_header_map(struct_, + _struct->set_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref_const @@ -181,7 +190,8 @@ void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { void CefRequestCToCpp::Set(const CefString& url, const CefString& method, CefRefPtr postData, const HeaderMap& headerMap) { - if (CEF_MEMBER_MISSING(struct_, set)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -203,7 +213,7 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method, transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - struct_->set(struct_, + _struct->set(_struct, url.GetStruct(), method.GetStruct(), CefPostDataCToCpp::Unwrap(postData), @@ -215,37 +225,40 @@ void CefRequestCToCpp::Set(const CefString& url, const CefString& method, } int CefRequestCToCpp::GetFlags() { - if (CEF_MEMBER_MISSING(struct_, get_flags)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_flags)) return UR_FLAG_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_flags(struct_); + int _retval = _struct->get_flags(_struct); // Return type: simple return _retval; } void CefRequestCToCpp::SetFlags(int flags) { - if (CEF_MEMBER_MISSING(struct_, set_flags)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_flags)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_flags(struct_, + _struct->set_flags(_struct, flags); } CefString CefRequestCToCpp::GetFirstPartyForCookies() { - if (CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_first_party_for_cookies)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_first_party_for_cookies(struct_); + cef_string_userfree_t _retval = _struct->get_first_party_for_cookies(_struct); // Return type: string CefString _retvalStr; @@ -254,7 +267,8 @@ CefString CefRequestCToCpp::GetFirstPartyForCookies() { } void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { - if (CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_first_party_for_cookies)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -265,52 +279,68 @@ void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { return; // Execute - struct_->set_first_party_for_cookies(struct_, + _struct->set_first_party_for_cookies(_struct, url.GetStruct()); } CefRequest::ResourceType CefRequestCToCpp::GetResourceType() { - if (CEF_MEMBER_MISSING(struct_, get_resource_type)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_resource_type)) return RT_SUB_RESOURCE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_resource_type_t _retval = struct_->get_resource_type(struct_); + cef_resource_type_t _retval = _struct->get_resource_type(_struct); // Return type: simple return _retval; } CefRequest::TransitionType CefRequestCToCpp::GetTransitionType() { - if (CEF_MEMBER_MISSING(struct_, get_transition_type)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_transition_type)) return TT_EXPLICIT; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_transition_type_t _retval = struct_->get_transition_type(struct_); + cef_transition_type_t _retval = _struct->get_transition_type(_struct); // Return type: simple return _retval; } uint64 CefRequestCToCpp::GetIdentifier() { - if (CEF_MEMBER_MISSING(struct_, get_identifier)) + cef_request_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_identifier)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - uint64 _retval = struct_->get_identifier(struct_); + uint64 _retval = _struct->get_identifier(_struct); // Return type: simple return _retval; } +// CONSTRUCTOR - Do not edit by hand. + +CefRequestCToCpp::CefRequestCToCpp() { +} + +template<> cef_request_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefRequest* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_REQUEST; diff --git a/libcef_dll/ctocpp/request_ctocpp.h b/libcef_dll/ctocpp/request_ctocpp.h index 4fda56a90..95a76aa4e 100644 --- a/libcef_dll/ctocpp/request_ctocpp.h +++ b/libcef_dll/ctocpp/request_ctocpp.h @@ -27,30 +27,28 @@ class CefRequestCToCpp : public CefCToCpp { public: - explicit CefRequestCToCpp(cef_request_t* str) - : CefCToCpp(str) {} + CefRequestCToCpp(); - // CefRequest methods - virtual bool IsReadOnly() OVERRIDE; - virtual CefString GetURL() OVERRIDE; - virtual void SetURL(const CefString& url) OVERRIDE; - virtual CefString GetMethod() OVERRIDE; - virtual void SetMethod(const CefString& method) OVERRIDE; - virtual CefRefPtr GetPostData() OVERRIDE; - virtual void SetPostData(CefRefPtr postData) OVERRIDE; - virtual void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; - virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; - virtual void Set(const CefString& url, const CefString& method, + // CefRequest methods. + bool IsReadOnly() OVERRIDE; + CefString GetURL() OVERRIDE; + void SetURL(const CefString& url) OVERRIDE; + CefString GetMethod() OVERRIDE; + void SetMethod(const CefString& method) OVERRIDE; + CefRefPtr GetPostData() OVERRIDE; + void SetPostData(CefRefPtr postData) OVERRIDE; + void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; + void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; + void Set(const CefString& url, const CefString& method, CefRefPtr postData, const HeaderMap& headerMap) OVERRIDE; - virtual int GetFlags() OVERRIDE; - virtual void SetFlags(int flags) OVERRIDE; - virtual CefString GetFirstPartyForCookies() OVERRIDE; - virtual void SetFirstPartyForCookies(const CefString& url) OVERRIDE; - virtual ResourceType GetResourceType() OVERRIDE; - virtual TransitionType GetTransitionType() OVERRIDE; - virtual uint64 GetIdentifier() OVERRIDE; + int GetFlags() OVERRIDE; + void SetFlags(int flags) OVERRIDE; + CefString GetFirstPartyForCookies() OVERRIDE; + void SetFirstPartyForCookies(const CefString& url) OVERRIDE; + ResourceType GetResourceType() OVERRIDE; + TransitionType GetTransitionType() OVERRIDE; + uint64 GetIdentifier() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.cc b/libcef_dll/ctocpp/request_handler_ctocpp.cc index 1ad9bfec7..b9446e128 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/request_handler_ctocpp.cc @@ -27,7 +27,8 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool is_redirect) { - if (CEF_MEMBER_MISSING(struct_, on_before_browse)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_browse)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -46,7 +47,7 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_before_browse(struct_, + int _retval = _struct->on_before_browse(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), @@ -59,7 +60,8 @@ bool CefRequestHandlerCToCpp::OnBeforeBrowse(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnOpenURLFromTab(CefRefPtr browser, CefRefPtr frame, const CefString& target_url, WindowOpenDisposition target_disposition, bool user_gesture) { - if (CEF_MEMBER_MISSING(struct_, on_open_urlfrom_tab)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_open_urlfrom_tab)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -78,7 +80,7 @@ bool CefRequestHandlerCToCpp::OnOpenURLFromTab(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_open_urlfrom_tab(struct_, + int _retval = _struct->on_open_urlfrom_tab(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), target_url.GetStruct(), @@ -92,7 +94,8 @@ bool CefRequestHandlerCToCpp::OnOpenURLFromTab(CefRefPtr browser, CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_before_resource_load)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_resource_load)) return RV_CONTINUE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -115,7 +118,7 @@ CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( return RV_CONTINUE; // Execute - cef_return_value_t _retval = struct_->on_before_resource_load(struct_, + cef_return_value_t _retval = _struct->on_before_resource_load(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), @@ -128,7 +131,8 @@ CefRequestHandler::ReturnValue CefRequestHandlerCToCpp::OnBeforeResourceLoad( CefRefPtr CefRequestHandlerCToCpp::GetResourceHandler( CefRefPtr browser, CefRefPtr frame, CefRefPtr request) { - if (CEF_MEMBER_MISSING(struct_, get_resource_handler)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_resource_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -147,7 +151,7 @@ CefRefPtr CefRequestHandlerCToCpp::GetResourceHandler( return NULL; // Execute - cef_resource_handler_t* _retval = struct_->get_resource_handler(struct_, + cef_resource_handler_t* _retval = _struct->get_resource_handler(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request)); @@ -159,7 +163,8 @@ CefRefPtr CefRequestHandlerCToCpp::GetResourceHandler( void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefString& new_url) { - if (CEF_MEMBER_MISSING(struct_, on_resource_redirect)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_resource_redirect)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -178,7 +183,7 @@ void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, return; // Execute - struct_->on_resource_redirect(struct_, + _struct->on_resource_redirect(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), @@ -188,7 +193,8 @@ void CefRequestHandlerCToCpp::OnResourceRedirect(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, CefRefPtr response) { - if (CEF_MEMBER_MISSING(struct_, on_resource_response)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_resource_response)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -211,7 +217,7 @@ bool CefRequestHandlerCToCpp::OnResourceResponse(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_resource_response(struct_, + int _retval = _struct->on_resource_response(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request), @@ -225,7 +231,8 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, CefRefPtr frame, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, get_auth_credentials)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_auth_credentials)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -253,7 +260,7 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, // Unverified params: realm // Execute - int _retval = struct_->get_auth_credentials(struct_, + int _retval = _struct->get_auth_credentials(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), isProxy, @@ -270,7 +277,8 @@ bool CefRequestHandlerCToCpp::GetAuthCredentials(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr browser, const CefString& origin_url, int64 new_size, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_quota_request)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_quota_request)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -289,7 +297,7 @@ bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_quota_request(struct_, + int _retval = _struct->on_quota_request(_struct, CefBrowserCppToC::Wrap(browser), origin_url.GetStruct(), new_size, @@ -301,7 +309,8 @@ bool CefRequestHandlerCToCpp::OnQuotaRequest(CefRefPtr browser, void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, const CefString& url, bool& allow_os_execution) { - if (CEF_MEMBER_MISSING(struct_, on_protocol_execution)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_protocol_execution)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -319,7 +328,7 @@ void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, int allow_os_executionInt = allow_os_execution; // Execute - struct_->on_protocol_execution(struct_, + _struct->on_protocol_execution(_struct, CefBrowserCppToC::Wrap(browser), url.GetStruct(), &allow_os_executionInt); @@ -331,7 +340,8 @@ void CefRequestHandlerCToCpp::OnProtocolExecution(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, on_certificate_error)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_certificate_error)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -354,7 +364,7 @@ bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr browser, return false; // Execute - int _retval = struct_->on_certificate_error(struct_, + int _retval = _struct->on_certificate_error(_struct, CefBrowserCppToC::Wrap(browser), cert_error, request_url.GetStruct(), @@ -368,7 +378,8 @@ bool CefRequestHandlerCToCpp::OnCertificateError(CefRefPtr browser, bool CefRequestHandlerCToCpp::OnBeforePluginLoad(CefRefPtr browser, const CefString& url, const CefString& policy_url, CefRefPtr info) { - if (CEF_MEMBER_MISSING(struct_, on_before_plugin_load)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_before_plugin_load)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -384,7 +395,7 @@ bool CefRequestHandlerCToCpp::OnBeforePluginLoad(CefRefPtr browser, // Unverified params: url, policy_url // Execute - int _retval = struct_->on_before_plugin_load(struct_, + int _retval = _struct->on_before_plugin_load(_struct, CefBrowserCppToC::Wrap(browser), url.GetStruct(), policy_url.GetStruct(), @@ -396,7 +407,8 @@ bool CefRequestHandlerCToCpp::OnBeforePluginLoad(CefRefPtr browser, void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr browser, const CefString& plugin_path) { - if (CEF_MEMBER_MISSING(struct_, on_plugin_crashed)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_plugin_crashed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -411,13 +423,14 @@ void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr browser, return; // Execute - struct_->on_plugin_crashed(struct_, + _struct->on_plugin_crashed(_struct, CefBrowserCppToC::Wrap(browser), plugin_path.GetStruct()); } void CefRequestHandlerCToCpp::OnRenderViewReady(CefRefPtr browser) { - if (CEF_MEMBER_MISSING(struct_, on_render_view_ready)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_render_view_ready)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -428,13 +441,14 @@ void CefRequestHandlerCToCpp::OnRenderViewReady(CefRefPtr browser) { return; // Execute - struct_->on_render_view_ready(struct_, + _struct->on_render_view_ready(_struct, CefBrowserCppToC::Wrap(browser)); } void CefRequestHandlerCToCpp::OnRenderProcessTerminated( CefRefPtr browser, TerminationStatus status) { - if (CEF_MEMBER_MISSING(struct_, on_render_process_terminated)) + cef_request_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_render_process_terminated)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -445,14 +459,28 @@ void CefRequestHandlerCToCpp::OnRenderProcessTerminated( return; // Execute - struct_->on_render_process_terminated(struct_, + _struct->on_render_process_terminated(_struct, CefBrowserCppToC::Wrap(browser), status); } +// CONSTRUCTOR - Do not edit by hand. + +CefRequestHandlerCToCpp::CefRequestHandlerCToCpp() { +} + +template<> cef_request_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRequestHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_REQUEST_HANDLER; diff --git a/libcef_dll/ctocpp/request_handler_ctocpp.h b/libcef_dll/ctocpp/request_handler_ctocpp.h index a3c0cbb01..7fd6b32e5 100644 --- a/libcef_dll/ctocpp/request_handler_ctocpp.h +++ b/libcef_dll/ctocpp/request_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefRequestHandlerCToCpp : public CefCToCpp { public: - explicit CefRequestHandlerCToCpp(cef_request_handler_t* str) - : CefCToCpp(str) {} + CefRequestHandlerCToCpp(); - // CefRequestHandler methods + // CefRequestHandler methods. bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool is_redirect) override; bool OnOpenURLFromTab(CefRefPtr browser, @@ -74,4 +72,3 @@ class CefRequestHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc index 85b2ab24f..b40133f26 100644 --- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.cc @@ -17,13 +17,14 @@ bool CefResourceBundleHandlerCToCpp::GetLocalizedString(int message_id, CefString& string) { - if (CEF_MEMBER_MISSING(struct_, get_localized_string)) + cef_resource_bundle_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_localized_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_localized_string(struct_, + int _retval = _struct->get_localized_string(_struct, message_id, string.GetWritableStruct()); @@ -33,13 +34,14 @@ bool CefResourceBundleHandlerCToCpp::GetLocalizedString(int message_id, bool CefResourceBundleHandlerCToCpp::GetDataResource(int resource_id, void*& data, size_t& data_size) { - if (CEF_MEMBER_MISSING(struct_, get_data_resource)) + cef_resource_bundle_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_data_resource)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_data_resource(struct_, + int _retval = _struct->get_data_resource(_struct, resource_id, &data, &data_size); @@ -49,8 +51,23 @@ bool CefResourceBundleHandlerCToCpp::GetDataResource(int resource_id, } +// CONSTRUCTOR - Do not edit by hand. + +CefResourceBundleHandlerCToCpp::CefResourceBundleHandlerCToCpp() { +} + +template<> cef_resource_bundle_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefResourceBundleHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_RESOURCE_BUNDLE_HANDLER; diff --git a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h index fa61b6ee2..aeafdea18 100644 --- a/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h +++ b/libcef_dll/ctocpp/resource_bundle_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefResourceBundleHandlerCToCpp : public CefCToCpp { public: - explicit CefResourceBundleHandlerCToCpp(cef_resource_bundle_handler_t* str) - : CefCToCpp(str) {} + CefResourceBundleHandlerCToCpp(); - // CefResourceBundleHandler methods + // CefResourceBundleHandler methods. bool GetLocalizedString(int message_id, CefString& string) override; bool GetDataResource(int resource_id, void*& data, size_t& data_size) override; @@ -40,4 +38,3 @@ class CefResourceBundleHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RESOURCE_BUNDLE_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.cc b/libcef_dll/ctocpp/resource_handler_ctocpp.cc index 39a09e72a..5a54cfa18 100644 --- a/libcef_dll/ctocpp/resource_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/resource_handler_ctocpp.cc @@ -20,7 +20,8 @@ bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr request, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, process_request)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, process_request)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -35,7 +36,7 @@ bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr request, return false; // Execute - int _retval = struct_->process_request(struct_, + int _retval = _struct->process_request(_struct, CefRequestCppToC::Wrap(request), CefCallbackCppToC::Wrap(callback)); @@ -46,7 +47,8 @@ bool CefResourceHandlerCToCpp::ProcessRequest(CefRefPtr request, void CefResourceHandlerCToCpp::GetResponseHeaders( CefRefPtr response, int64& response_length, CefString& redirectUrl) { - if (CEF_MEMBER_MISSING(struct_, get_response_headers)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_response_headers)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -57,7 +59,7 @@ void CefResourceHandlerCToCpp::GetResponseHeaders( return; // Execute - struct_->get_response_headers(struct_, + _struct->get_response_headers(_struct, CefResponseCppToC::Wrap(response), &response_length, redirectUrl.GetWritableStruct()); @@ -65,7 +67,8 @@ void CefResourceHandlerCToCpp::GetResponseHeaders( bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, read_response)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, read_response)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -80,7 +83,7 @@ bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, return false; // Execute - int _retval = struct_->read_response(struct_, + int _retval = _struct->read_response(_struct, data_out, bytes_to_read, &bytes_read, @@ -91,13 +94,14 @@ bool CefResourceHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read, } bool CefResourceHandlerCToCpp::CanGetCookie(const CefCookie& cookie) { - if (CEF_MEMBER_MISSING(struct_, can_get_cookie)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, can_get_cookie)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->can_get_cookie(struct_, + int _retval = _struct->can_get_cookie(_struct, &cookie); // Return type: bool @@ -105,13 +109,14 @@ bool CefResourceHandlerCToCpp::CanGetCookie(const CefCookie& cookie) { } bool CefResourceHandlerCToCpp::CanSetCookie(const CefCookie& cookie) { - if (CEF_MEMBER_MISSING(struct_, can_set_cookie)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, can_set_cookie)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->can_set_cookie(struct_, + int _retval = _struct->can_set_cookie(_struct, &cookie); // Return type: bool @@ -119,18 +124,34 @@ bool CefResourceHandlerCToCpp::CanSetCookie(const CefCookie& cookie) { } void CefResourceHandlerCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_resource_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefResourceHandlerCToCpp::CefResourceHandlerCToCpp() { +} + +template<> cef_resource_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefResourceHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_RESOURCE_HANDLER; diff --git a/libcef_dll/ctocpp/resource_handler_ctocpp.h b/libcef_dll/ctocpp/resource_handler_ctocpp.h index 1d65272bc..fe06d4495 100644 --- a/libcef_dll/ctocpp/resource_handler_ctocpp.h +++ b/libcef_dll/ctocpp/resource_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefResourceHandlerCToCpp : public CefCToCpp { public: - explicit CefResourceHandlerCToCpp(cef_resource_handler_t* str) - : CefCToCpp(str) {} + CefResourceHandlerCToCpp(); - // CefResourceHandler methods + // CefResourceHandler methods. bool ProcessRequest(CefRefPtr request, CefRefPtr callback) override; void GetResponseHeaders(CefRefPtr response, @@ -46,4 +44,3 @@ class CefResourceHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RESOURCE_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/response_ctocpp.cc b/libcef_dll/ctocpp/response_ctocpp.cc index 6d5373dec..83e17bea1 100644 --- a/libcef_dll/ctocpp/response_ctocpp.cc +++ b/libcef_dll/ctocpp/response_ctocpp.cc @@ -30,50 +30,54 @@ CefRefPtr CefResponse::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefResponseCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } int CefResponseCToCpp::GetStatus() { - if (CEF_MEMBER_MISSING(struct_, get_status)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_status)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_status(struct_); + int _retval = _struct->get_status(_struct); // Return type: simple return _retval; } void CefResponseCToCpp::SetStatus(int status) { - if (CEF_MEMBER_MISSING(struct_, set_status)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_status)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->set_status(struct_, + _struct->set_status(_struct, status); } CefString CefResponseCToCpp::GetStatusText() { - if (CEF_MEMBER_MISSING(struct_, get_status_text)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_status_text)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_status_text(struct_); + cef_string_userfree_t _retval = _struct->get_status_text(_struct); // Return type: string CefString _retvalStr; @@ -82,7 +86,8 @@ CefString CefResponseCToCpp::GetStatusText() { } void CefResponseCToCpp::SetStatusText(const CefString& statusText) { - if (CEF_MEMBER_MISSING(struct_, set_status_text)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_status_text)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -93,18 +98,19 @@ void CefResponseCToCpp::SetStatusText(const CefString& statusText) { return; // Execute - struct_->set_status_text(struct_, + _struct->set_status_text(_struct, statusText.GetStruct()); } CefString CefResponseCToCpp::GetMimeType() { - if (CEF_MEMBER_MISSING(struct_, get_mime_type)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_mime_type)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_mime_type(struct_); + cef_string_userfree_t _retval = _struct->get_mime_type(_struct); // Return type: string CefString _retvalStr; @@ -113,7 +119,8 @@ CefString CefResponseCToCpp::GetMimeType() { } void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { - if (CEF_MEMBER_MISSING(struct_, set_mime_type)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_mime_type)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -124,12 +131,13 @@ void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { return; // Execute - struct_->set_mime_type(struct_, + _struct->set_mime_type(_struct, mimeType.GetStruct()); } CefString CefResponseCToCpp::GetHeader(const CefString& name) { - if (CEF_MEMBER_MISSING(struct_, get_header)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_header)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -140,7 +148,7 @@ CefString CefResponseCToCpp::GetHeader(const CefString& name) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_header(struct_, + cef_string_userfree_t _retval = _struct->get_header(_struct, name.GetStruct()); // Return type: string @@ -150,7 +158,8 @@ CefString CefResponseCToCpp::GetHeader(const CefString& name) { } void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { - if (CEF_MEMBER_MISSING(struct_, get_header_map)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_header_map)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -162,7 +171,7 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - struct_->get_header_map(struct_, + _struct->get_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref @@ -174,7 +183,8 @@ void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { } void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { - if (CEF_MEMBER_MISSING(struct_, set_header_map)) + cef_response_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_header_map)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -186,7 +196,7 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { transfer_string_multimap_contents(headerMap, headerMapMultimap); // Execute - struct_->set_header_map(struct_, + _struct->set_header_map(_struct, headerMapMultimap); // Restore param:headerMap; type: string_map_multi_byref_const @@ -195,8 +205,21 @@ void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { } +// CONSTRUCTOR - Do not edit by hand. + +CefResponseCToCpp::CefResponseCToCpp() { +} + +template<> cef_response_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefResponse* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_RESPONSE; diff --git a/libcef_dll/ctocpp/response_ctocpp.h b/libcef_dll/ctocpp/response_ctocpp.h index 9aa557018..6d102e367 100644 --- a/libcef_dll/ctocpp/response_ctocpp.h +++ b/libcef_dll/ctocpp/response_ctocpp.h @@ -27,22 +27,20 @@ class CefResponseCToCpp : public CefCToCpp { public: - explicit CefResponseCToCpp(cef_response_t* str) - : CefCToCpp(str) {} + CefResponseCToCpp(); - // CefResponse methods - virtual bool IsReadOnly() OVERRIDE; - virtual int GetStatus() OVERRIDE; - virtual void SetStatus(int status) OVERRIDE; - virtual CefString GetStatusText() OVERRIDE; - virtual void SetStatusText(const CefString& statusText) OVERRIDE; - virtual CefString GetMimeType() OVERRIDE; - virtual void SetMimeType(const CefString& mimeType) OVERRIDE; - virtual CefString GetHeader(const CefString& name) OVERRIDE; - virtual void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; - virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; + // CefResponse methods. + bool IsReadOnly() OVERRIDE; + int GetStatus() OVERRIDE; + void SetStatus(int status) OVERRIDE; + CefString GetStatusText() OVERRIDE; + void SetStatusText(const CefString& statusText) OVERRIDE; + CefString GetMimeType() OVERRIDE; + void SetMimeType(const CefString& mimeType) OVERRIDE; + CefString GetHeader(const CefString& name) OVERRIDE; + void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; + void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc index ce7a70f38..50ff771fb 100644 --- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.cc @@ -18,7 +18,8 @@ void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed( int selected_accept_filter, const std::vector& file_paths) { - if (CEF_MEMBER_MISSING(struct_, on_file_dialog_dismissed)) + cef_run_file_dialog_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_file_dialog_dismissed)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -36,7 +37,7 @@ void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed( transfer_string_list_contents(file_paths, file_pathsList); // Execute - struct_->on_file_dialog_dismissed(struct_, + _struct->on_file_dialog_dismissed(_struct, selected_accept_filter, file_pathsList); @@ -46,8 +47,23 @@ void CefRunFileDialogCallbackCToCpp::OnFileDialogDismissed( } +// CONSTRUCTOR - Do not edit by hand. + +CefRunFileDialogCallbackCToCpp::CefRunFileDialogCallbackCToCpp() { +} + +template<> cef_run_file_dialog_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefRunFileDialogCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_RUN_FILE_DIALOG_CALLBACK; diff --git a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h index af1300cfa..90b57ba4c 100644 --- a/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h +++ b/libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h @@ -31,15 +31,12 @@ class CefRunFileDialogCallbackCToCpp : public CefCToCpp { public: - explicit CefRunFileDialogCallbackCToCpp(cef_run_file_dialog_callback_t* str) - : CefCToCpp(str) {} + CefRunFileDialogCallbackCToCpp(); - // CefRunFileDialogCallback methods + // CefRunFileDialogCallback methods. void OnFileDialogDismissed(int selected_accept_filter, const std::vector& file_paths) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_RUN_FILE_DIALOG_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc index cbc02d5be..0266ee74a 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.cc @@ -22,7 +22,8 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, CefRefPtr request) { - if (CEF_MEMBER_MISSING(struct_, create)) + cef_scheme_handler_factory_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, create)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -38,7 +39,7 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( // Unverified params: browser, frame // Execute - cef_resource_handler_t* _retval = struct_->create(struct_, + cef_resource_handler_t* _retval = _struct->create(_struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), scheme_name.GetStruct(), @@ -49,8 +50,23 @@ CefRefPtr CefSchemeHandlerFactoryCToCpp::Create( } +// CONSTRUCTOR - Do not edit by hand. + +CefSchemeHandlerFactoryCToCpp::CefSchemeHandlerFactoryCToCpp() { +} + +template<> cef_scheme_handler_factory_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefSchemeHandlerFactory* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_SCHEME_HANDLER_FACTORY; diff --git a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h index 660c5ed8c..ebe64236f 100644 --- a/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h @@ -28,11 +28,9 @@ class CefSchemeHandlerFactoryCToCpp : public CefCToCpp { public: - explicit CefSchemeHandlerFactoryCToCpp(cef_scheme_handler_factory_t* str) - : CefCToCpp(str) {} + CefSchemeHandlerFactoryCToCpp(); - // CefSchemeHandlerFactory methods + // CefSchemeHandlerFactory methods. CefRefPtr Create(CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, CefRefPtr request) override; @@ -40,4 +38,3 @@ class CefSchemeHandlerFactoryCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_HANDLER_FACTORY_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc b/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc index cb4bb0b5a..03d9b0099 100644 --- a/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc +++ b/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc @@ -17,7 +17,8 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, bool is_standard, bool is_local, bool is_display_isolated) { - if (CEF_MEMBER_MISSING(struct_, add_custom_scheme)) + cef_scheme_registrar_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, add_custom_scheme)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -28,7 +29,7 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, return false; // Execute - int _retval = struct_->add_custom_scheme(struct_, + int _retval = _struct->add_custom_scheme(_struct, scheme_name.GetStruct(), is_standard, is_local, @@ -39,8 +40,23 @@ bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, } +// CONSTRUCTOR - Do not edit by hand. + +CefSchemeRegistrarCToCpp::CefSchemeRegistrarCToCpp() { +} + +template<> cef_scheme_registrar_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefSchemeRegistrar* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_SCHEME_REGISTRAR; diff --git a/libcef_dll/ctocpp/scheme_registrar_ctocpp.h b/libcef_dll/ctocpp/scheme_registrar_ctocpp.h index a5141999d..c2a60215b 100644 --- a/libcef_dll/ctocpp/scheme_registrar_ctocpp.h +++ b/libcef_dll/ctocpp/scheme_registrar_ctocpp.h @@ -28,15 +28,12 @@ class CefSchemeRegistrarCToCpp : public CefCToCpp { public: - explicit CefSchemeRegistrarCToCpp(cef_scheme_registrar_t* str) - : CefCToCpp(str) {} + CefSchemeRegistrarCToCpp(); - // CefSchemeRegistrar methods - virtual bool AddCustomScheme(const CefString& scheme_name, bool is_standard, + // CefSchemeRegistrar methods. + bool AddCustomScheme(const CefString& scheme_name, bool is_standard, bool is_local, bool is_display_isolated) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc index f69195762..a79833afd 100644 --- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.cc @@ -16,19 +16,35 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefSetCookieCallbackCToCpp::OnComplete(bool success) { - if (CEF_MEMBER_MISSING(struct_, on_complete)) + cef_set_cookie_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_complete)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->on_complete(struct_, + _struct->on_complete(_struct, success); } +// CONSTRUCTOR - Do not edit by hand. + +CefSetCookieCallbackCToCpp::CefSetCookieCallbackCToCpp() { +} + +template<> cef_set_cookie_callback_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefSetCookieCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_SET_COOKIE_CALLBACK; diff --git a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h index c95d313dc..0a68f344c 100644 --- a/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h +++ b/libcef_dll/ctocpp/set_cookie_callback_ctocpp.h @@ -28,14 +28,11 @@ class CefSetCookieCallbackCToCpp : public CefCToCpp { public: - explicit CefSetCookieCallbackCToCpp(cef_set_cookie_callback_t* str) - : CefCToCpp(str) {} + CefSetCookieCallbackCToCpp(); - // CefSetCookieCallback methods + // CefSetCookieCallback methods. void OnComplete(bool success) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_SET_COOKIE_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/sslcert_principal_ctocpp.cc b/libcef_dll/ctocpp/sslcert_principal_ctocpp.cc index d83814b36..8df8bc77a 100644 --- a/libcef_dll/ctocpp/sslcert_principal_ctocpp.cc +++ b/libcef_dll/ctocpp/sslcert_principal_ctocpp.cc @@ -17,13 +17,14 @@ // VIRTUAL METHODS - Body may be edited by hand. CefString CefSSLCertPrincipalCToCpp::GetDisplayName() { - if (CEF_MEMBER_MISSING(struct_, get_display_name)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_display_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_display_name(struct_); + cef_string_userfree_t _retval = _struct->get_display_name(_struct); // Return type: string CefString _retvalStr; @@ -32,13 +33,14 @@ CefString CefSSLCertPrincipalCToCpp::GetDisplayName() { } CefString CefSSLCertPrincipalCToCpp::GetCommonName() { - if (CEF_MEMBER_MISSING(struct_, get_common_name)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_common_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_common_name(struct_); + cef_string_userfree_t _retval = _struct->get_common_name(_struct); // Return type: string CefString _retvalStr; @@ -47,13 +49,14 @@ CefString CefSSLCertPrincipalCToCpp::GetCommonName() { } CefString CefSSLCertPrincipalCToCpp::GetLocalityName() { - if (CEF_MEMBER_MISSING(struct_, get_locality_name)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_locality_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_locality_name(struct_); + cef_string_userfree_t _retval = _struct->get_locality_name(_struct); // Return type: string CefString _retvalStr; @@ -62,13 +65,14 @@ CefString CefSSLCertPrincipalCToCpp::GetLocalityName() { } CefString CefSSLCertPrincipalCToCpp::GetStateOrProvinceName() { - if (CEF_MEMBER_MISSING(struct_, get_state_or_province_name)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_state_or_province_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_state_or_province_name(struct_); + cef_string_userfree_t _retval = _struct->get_state_or_province_name(_struct); // Return type: string CefString _retvalStr; @@ -77,13 +81,14 @@ CefString CefSSLCertPrincipalCToCpp::GetStateOrProvinceName() { } CefString CefSSLCertPrincipalCToCpp::GetCountryName() { - if (CEF_MEMBER_MISSING(struct_, get_country_name)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_country_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_country_name(struct_); + cef_string_userfree_t _retval = _struct->get_country_name(_struct); // Return type: string CefString _retvalStr; @@ -93,7 +98,8 @@ CefString CefSSLCertPrincipalCToCpp::GetCountryName() { void CefSSLCertPrincipalCToCpp::GetStreetAddresses( std::vector& addresses) { - if (CEF_MEMBER_MISSING(struct_, get_street_addresses)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_street_addresses)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -105,7 +111,7 @@ void CefSSLCertPrincipalCToCpp::GetStreetAddresses( transfer_string_list_contents(addresses, addressesList); // Execute - struct_->get_street_addresses(struct_, + _struct->get_street_addresses(_struct, addressesList); // Restore param:addresses; type: string_vec_byref @@ -118,7 +124,8 @@ void CefSSLCertPrincipalCToCpp::GetStreetAddresses( void CefSSLCertPrincipalCToCpp::GetOrganizationNames( std::vector& names) { - if (CEF_MEMBER_MISSING(struct_, get_organization_names)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_organization_names)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -130,7 +137,7 @@ void CefSSLCertPrincipalCToCpp::GetOrganizationNames( transfer_string_list_contents(names, namesList); // Execute - struct_->get_organization_names(struct_, + _struct->get_organization_names(_struct, namesList); // Restore param:names; type: string_vec_byref @@ -143,7 +150,8 @@ void CefSSLCertPrincipalCToCpp::GetOrganizationNames( void CefSSLCertPrincipalCToCpp::GetOrganizationUnitNames( std::vector& names) { - if (CEF_MEMBER_MISSING(struct_, get_organization_unit_names)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_organization_unit_names)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -155,7 +163,7 @@ void CefSSLCertPrincipalCToCpp::GetOrganizationUnitNames( transfer_string_list_contents(names, namesList); // Execute - struct_->get_organization_unit_names(struct_, + _struct->get_organization_unit_names(_struct, namesList); // Restore param:names; type: string_vec_byref @@ -168,7 +176,8 @@ void CefSSLCertPrincipalCToCpp::GetOrganizationUnitNames( void CefSSLCertPrincipalCToCpp::GetDomainComponents( std::vector& components) { - if (CEF_MEMBER_MISSING(struct_, get_domain_components)) + cef_sslcert_principal_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_domain_components)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -180,7 +189,7 @@ void CefSSLCertPrincipalCToCpp::GetDomainComponents( transfer_string_list_contents(components, componentsList); // Execute - struct_->get_domain_components(struct_, + _struct->get_domain_components(_struct, componentsList); // Restore param:components; type: string_vec_byref @@ -192,8 +201,23 @@ void CefSSLCertPrincipalCToCpp::GetDomainComponents( } +// CONSTRUCTOR - Do not edit by hand. + +CefSSLCertPrincipalCToCpp::CefSSLCertPrincipalCToCpp() { +} + +template<> cef_sslcert_principal_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefSSLCertPrincipal* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_SSLCERT_PRINCIPAL; diff --git a/libcef_dll/ctocpp/sslcert_principal_ctocpp.h b/libcef_dll/ctocpp/sslcert_principal_ctocpp.h index 1d745cdab..1bfa9ee77 100644 --- a/libcef_dll/ctocpp/sslcert_principal_ctocpp.h +++ b/libcef_dll/ctocpp/sslcert_principal_ctocpp.h @@ -29,22 +29,19 @@ class CefSSLCertPrincipalCToCpp : public CefCToCpp { public: - explicit CefSSLCertPrincipalCToCpp(cef_sslcert_principal_t* str) - : CefCToCpp(str) {} + CefSSLCertPrincipalCToCpp(); - // CefSSLCertPrincipal methods - virtual CefString GetDisplayName() OVERRIDE; - virtual CefString GetCommonName() OVERRIDE; - virtual CefString GetLocalityName() OVERRIDE; - virtual CefString GetStateOrProvinceName() OVERRIDE; - virtual CefString GetCountryName() OVERRIDE; - virtual void GetStreetAddresses(std::vector& addresses) OVERRIDE; - virtual void GetOrganizationNames(std::vector& names) OVERRIDE; - virtual void GetOrganizationUnitNames(std::vector& names) OVERRIDE; - virtual void GetDomainComponents(std::vector& components) OVERRIDE; + // CefSSLCertPrincipal methods. + CefString GetDisplayName() OVERRIDE; + CefString GetCommonName() OVERRIDE; + CefString GetLocalityName() OVERRIDE; + CefString GetStateOrProvinceName() OVERRIDE; + CefString GetCountryName() OVERRIDE; + void GetStreetAddresses(std::vector& addresses) OVERRIDE; + void GetOrganizationNames(std::vector& names) OVERRIDE; + void GetOrganizationUnitNames(std::vector& names) OVERRIDE; + void GetDomainComponents(std::vector& components) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_SSLCERT_PRINCIPAL_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.cc b/libcef_dll/ctocpp/sslinfo_ctocpp.cc index 36b9d031c..2bf3a819a 100644 --- a/libcef_dll/ctocpp/sslinfo_ctocpp.cc +++ b/libcef_dll/ctocpp/sslinfo_ctocpp.cc @@ -18,99 +18,119 @@ // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefSSLInfoCToCpp::GetSubject() { - if (CEF_MEMBER_MISSING(struct_, get_subject)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_subject)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_sslcert_principal_t* _retval = struct_->get_subject(struct_); + cef_sslcert_principal_t* _retval = _struct->get_subject(_struct); // Return type: refptr_same return CefSSLCertPrincipalCToCpp::Wrap(_retval); } CefRefPtr CefSSLInfoCToCpp::GetIssuer() { - if (CEF_MEMBER_MISSING(struct_, get_issuer)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_issuer)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_sslcert_principal_t* _retval = struct_->get_issuer(struct_); + cef_sslcert_principal_t* _retval = _struct->get_issuer(_struct); // Return type: refptr_same return CefSSLCertPrincipalCToCpp::Wrap(_retval); } CefRefPtr CefSSLInfoCToCpp::GetSerialNumber() { - if (CEF_MEMBER_MISSING(struct_, get_serial_number)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_serial_number)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = struct_->get_serial_number(struct_); + cef_binary_value_t* _retval = _struct->get_serial_number(_struct); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } CefTime CefSSLInfoCToCpp::GetValidStart() { - if (CEF_MEMBER_MISSING(struct_, get_valid_start)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_valid_start)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_valid_start(struct_); + cef_time_t _retval = _struct->get_valid_start(_struct); // Return type: simple return _retval; } CefTime CefSSLInfoCToCpp::GetValidExpiry() { - if (CEF_MEMBER_MISSING(struct_, get_valid_expiry)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_valid_expiry)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_valid_expiry(struct_); + cef_time_t _retval = _struct->get_valid_expiry(_struct); // Return type: simple return _retval; } CefRefPtr CefSSLInfoCToCpp::GetDEREncoded() { - if (CEF_MEMBER_MISSING(struct_, get_derencoded)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_derencoded)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = struct_->get_derencoded(struct_); + cef_binary_value_t* _retval = _struct->get_derencoded(_struct); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } CefRefPtr CefSSLInfoCToCpp::GetPEMEncoded() { - if (CEF_MEMBER_MISSING(struct_, get_pemencoded)) + cef_sslinfo_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_pemencoded)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = struct_->get_pemencoded(struct_); + cef_binary_value_t* _retval = _struct->get_pemencoded(_struct); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } +// CONSTRUCTOR - Do not edit by hand. + +CefSSLInfoCToCpp::CefSSLInfoCToCpp() { +} + +template<> cef_sslinfo_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefSSLInfo* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_SSLINFO; diff --git a/libcef_dll/ctocpp/sslinfo_ctocpp.h b/libcef_dll/ctocpp/sslinfo_ctocpp.h index 57ca90a16..468257423 100644 --- a/libcef_dll/ctocpp/sslinfo_ctocpp.h +++ b/libcef_dll/ctocpp/sslinfo_ctocpp.h @@ -27,19 +27,17 @@ class CefSSLInfoCToCpp : public CefCToCpp { public: - explicit CefSSLInfoCToCpp(cef_sslinfo_t* str) - : CefCToCpp(str) {} + CefSSLInfoCToCpp(); - // CefSSLInfo methods - virtual CefRefPtr GetSubject() OVERRIDE; - virtual CefRefPtr GetIssuer() OVERRIDE; - virtual CefRefPtr GetSerialNumber() OVERRIDE; - virtual CefTime GetValidStart() OVERRIDE; - virtual CefTime GetValidExpiry() OVERRIDE; - virtual CefRefPtr GetDEREncoded() OVERRIDE; - virtual CefRefPtr GetPEMEncoded() OVERRIDE; + // CefSSLInfo methods. + CefRefPtr GetSubject() OVERRIDE; + CefRefPtr GetIssuer() OVERRIDE; + CefRefPtr GetSerialNumber() OVERRIDE; + CefTime GetValidStart() OVERRIDE; + CefTime GetValidExpiry() OVERRIDE; + CefRefPtr GetDEREncoded() OVERRIDE; + CefRefPtr GetPEMEncoded() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_SSLINFO_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/libcef_dll/ctocpp/stream_reader_ctocpp.cc index 051c96def..433e10ad8 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -72,7 +72,8 @@ CefRefPtr CefStreamReader::CreateForHandler( // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { - if (CEF_MEMBER_MISSING(struct_, read)) + cef_stream_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, read)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -83,7 +84,7 @@ size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = struct_->read(struct_, + size_t _retval = _struct->read(_struct, ptr, size, n); @@ -93,13 +94,14 @@ size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { } int CefStreamReaderCToCpp::Seek(int64 offset, int whence) { - if (CEF_MEMBER_MISSING(struct_, seek)) + cef_stream_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, seek)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->seek(struct_, + int _retval = _struct->seek(_struct, offset, whence); @@ -108,47 +110,64 @@ int CefStreamReaderCToCpp::Seek(int64 offset, int whence) { } int64 CefStreamReaderCToCpp::Tell() { - if (CEF_MEMBER_MISSING(struct_, tell)) + cef_stream_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->tell(struct_); + int64 _retval = _struct->tell(_struct); // Return type: simple return _retval; } int CefStreamReaderCToCpp::Eof() { - if (CEF_MEMBER_MISSING(struct_, eof)) + cef_stream_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, eof)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->eof(struct_); + int _retval = _struct->eof(_struct); // Return type: simple return _retval; } bool CefStreamReaderCToCpp::MayBlock() { - if (CEF_MEMBER_MISSING(struct_, may_block)) + cef_stream_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, may_block)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->may_block(struct_); + int _retval = _struct->may_block(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefStreamReaderCToCpp::CefStreamReaderCToCpp() { +} + +template<> cef_stream_reader_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefStreamReader* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_STREAM_READER; diff --git a/libcef_dll/ctocpp/stream_reader_ctocpp.h b/libcef_dll/ctocpp/stream_reader_ctocpp.h index 41459a9b5..b9b3fd308 100644 --- a/libcef_dll/ctocpp/stream_reader_ctocpp.h +++ b/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -28,18 +28,15 @@ class CefStreamReaderCToCpp : public CefCToCpp { public: - explicit CefStreamReaderCToCpp(cef_stream_reader_t* str) - : CefCToCpp( - str) {} + CefStreamReaderCToCpp(); - // CefStreamReader methods - virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(int64 offset, int whence) OVERRIDE; - virtual int64 Tell() OVERRIDE; - virtual int Eof() OVERRIDE; - virtual bool MayBlock() OVERRIDE; + // CefStreamReader methods. + size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; + int Seek(int64 offset, int whence) OVERRIDE; + int64 Tell() OVERRIDE; + int Eof() OVERRIDE; + bool MayBlock() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/libcef_dll/ctocpp/stream_writer_ctocpp.cc index 382efdc1f..2e7ef147e 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.cc +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -54,7 +54,8 @@ CefRefPtr CefStreamWriter::CreateForHandler( // VIRTUAL METHODS - Body may be edited by hand. size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { - if (CEF_MEMBER_MISSING(struct_, write)) + cef_stream_writer_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, write)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -65,7 +66,7 @@ size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = struct_->write(struct_, + size_t _retval = _struct->write(_struct, ptr, size, n); @@ -75,13 +76,14 @@ size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { } int CefStreamWriterCToCpp::Seek(int64 offset, int whence) { - if (CEF_MEMBER_MISSING(struct_, seek)) + cef_stream_writer_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, seek)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->seek(struct_, + int _retval = _struct->seek(_struct, offset, whence); @@ -90,47 +92,64 @@ int CefStreamWriterCToCpp::Seek(int64 offset, int whence) { } int64 CefStreamWriterCToCpp::Tell() { - if (CEF_MEMBER_MISSING(struct_, tell)) + cef_stream_writer_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->tell(struct_); + int64 _retval = _struct->tell(_struct); // Return type: simple return _retval; } int CefStreamWriterCToCpp::Flush() { - if (CEF_MEMBER_MISSING(struct_, flush)) + cef_stream_writer_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, flush)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->flush(struct_); + int _retval = _struct->flush(_struct); // Return type: simple return _retval; } bool CefStreamWriterCToCpp::MayBlock() { - if (CEF_MEMBER_MISSING(struct_, may_block)) + cef_stream_writer_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, may_block)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->may_block(struct_); + int _retval = _struct->may_block(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefStreamWriterCToCpp::CefStreamWriterCToCpp() { +} + +template<> cef_stream_writer_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefStreamWriter* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_STREAM_WRITER; diff --git a/libcef_dll/ctocpp/stream_writer_ctocpp.h b/libcef_dll/ctocpp/stream_writer_ctocpp.h index 03fe511fa..fd923d579 100644 --- a/libcef_dll/ctocpp/stream_writer_ctocpp.h +++ b/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -28,18 +28,15 @@ class CefStreamWriterCToCpp : public CefCToCpp { public: - explicit CefStreamWriterCToCpp(cef_stream_writer_t* str) - : CefCToCpp( - str) {} + CefStreamWriterCToCpp(); - // CefStreamWriter methods - virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; - virtual int Seek(int64 offset, int whence) OVERRIDE; - virtual int64 Tell() OVERRIDE; - virtual int Flush() OVERRIDE; - virtual bool MayBlock() OVERRIDE; + // CefStreamWriter methods. + size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; + int Seek(int64 offset, int whence) OVERRIDE; + int64 Tell() OVERRIDE; + int Flush() OVERRIDE; + bool MayBlock() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.cc b/libcef_dll/ctocpp/string_visitor_ctocpp.cc index e6b6915d5..25958098c 100644 --- a/libcef_dll/ctocpp/string_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/string_visitor_ctocpp.cc @@ -16,7 +16,8 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefStringVisitorCToCpp::Visit(const CefString& string) { - if (CEF_MEMBER_MISSING(struct_, visit)) + cef_string_visitor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -24,13 +25,27 @@ void CefStringVisitorCToCpp::Visit(const CefString& string) { // Unverified params: string // Execute - struct_->visit(struct_, + _struct->visit(_struct, string.GetStruct()); } +// CONSTRUCTOR - Do not edit by hand. + +CefStringVisitorCToCpp::CefStringVisitorCToCpp() { +} + +template<> cef_string_visitor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefStringVisitor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_STRING_VISITOR; diff --git a/libcef_dll/ctocpp/string_visitor_ctocpp.h b/libcef_dll/ctocpp/string_visitor_ctocpp.h index 788a8fcde..26184422b 100644 --- a/libcef_dll/ctocpp/string_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/string_visitor_ctocpp.h @@ -28,14 +28,11 @@ class CefStringVisitorCToCpp : public CefCToCpp { public: - explicit CefStringVisitorCToCpp(cef_string_visitor_t* str) - : CefCToCpp(str) {} + CefStringVisitorCToCpp(); - // CefStringVisitor methods + // CefStringVisitor methods. void Visit(const CefString& string) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_STRING_VISITOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/task_ctocpp.cc b/libcef_dll/ctocpp/task_ctocpp.cc index 9f28e3980..4fe0eaad9 100644 --- a/libcef_dll/ctocpp/task_ctocpp.cc +++ b/libcef_dll/ctocpp/task_ctocpp.cc @@ -16,18 +16,32 @@ // VIRTUAL METHODS - Body may be edited by hand. void CefTaskCToCpp::Execute() { - if (CEF_MEMBER_MISSING(struct_, execute)) + cef_task_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, execute)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->execute(struct_); + _struct->execute(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefTaskCToCpp::CefTaskCToCpp() { +} + +template<> cef_task_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefTask* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_TASK; diff --git a/libcef_dll/ctocpp/task_ctocpp.h b/libcef_dll/ctocpp/task_ctocpp.h index c2fb222b8..92c464da5 100644 --- a/libcef_dll/ctocpp/task_ctocpp.h +++ b/libcef_dll/ctocpp/task_ctocpp.h @@ -27,13 +27,11 @@ class CefTaskCToCpp : public CefCToCpp { public: - explicit CefTaskCToCpp(cef_task_t* str) - : CefCToCpp(str) {} + CefTaskCToCpp(); - // CefTask methods + // CefTask methods. void Execute() override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_TASK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.cc b/libcef_dll/ctocpp/task_runner_ctocpp.cc index a7f6c46cb..d906e5214 100644 --- a/libcef_dll/ctocpp/task_runner_ctocpp.cc +++ b/libcef_dll/ctocpp/task_runner_ctocpp.cc @@ -41,7 +41,8 @@ CefRefPtr CefTaskRunner::GetForThread(CefThreadId threadId) { // VIRTUAL METHODS - Body may be edited by hand. bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_task_runner_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -52,7 +53,7 @@ bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefTaskRunnerCToCpp::Unwrap(that)); // Return type: bool @@ -60,26 +61,28 @@ bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { } bool CefTaskRunnerCToCpp::BelongsToCurrentThread() { - if (CEF_MEMBER_MISSING(struct_, belongs_to_current_thread)) + cef_task_runner_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, belongs_to_current_thread)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->belongs_to_current_thread(struct_); + int _retval = _struct->belongs_to_current_thread(_struct); // Return type: bool return _retval?true:false; } bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) { - if (CEF_MEMBER_MISSING(struct_, belongs_to_thread)) + cef_task_runner_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, belongs_to_thread)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->belongs_to_thread(struct_, + int _retval = _struct->belongs_to_thread(_struct, threadId); // Return type: bool @@ -87,7 +90,8 @@ bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) { } bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { - if (CEF_MEMBER_MISSING(struct_, post_task)) + cef_task_runner_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, post_task)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -98,7 +102,7 @@ bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { return false; // Execute - int _retval = struct_->post_task(struct_, + int _retval = _struct->post_task(_struct, CefTaskCppToC::Wrap(task)); // Return type: bool @@ -107,7 +111,8 @@ bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, int64 delay_ms) { - if (CEF_MEMBER_MISSING(struct_, post_delayed_task)) + cef_task_runner_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, post_delayed_task)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -118,7 +123,7 @@ bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, return false; // Execute - int _retval = struct_->post_delayed_task(struct_, + int _retval = _struct->post_delayed_task(_struct, CefTaskCppToC::Wrap(task), delay_ms); @@ -127,8 +132,21 @@ bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, } +// CONSTRUCTOR - Do not edit by hand. + +CefTaskRunnerCToCpp::CefTaskRunnerCToCpp() { +} + +template<> cef_task_runner_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefTaskRunner* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_TASK_RUNNER; diff --git a/libcef_dll/ctocpp/task_runner_ctocpp.h b/libcef_dll/ctocpp/task_runner_ctocpp.h index ce9fa6b3e..ad264d01e 100644 --- a/libcef_dll/ctocpp/task_runner_ctocpp.h +++ b/libcef_dll/ctocpp/task_runner_ctocpp.h @@ -27,18 +27,15 @@ class CefTaskRunnerCToCpp : public CefCToCpp { public: - explicit CefTaskRunnerCToCpp(cef_task_runner_t* str) - : CefCToCpp(str) {} + CefTaskRunnerCToCpp(); - // CefTaskRunner methods - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool BelongsToCurrentThread() OVERRIDE; - virtual bool BelongsToThread(CefThreadId threadId) OVERRIDE; - virtual bool PostTask(CefRefPtr task) OVERRIDE; - virtual bool PostDelayedTask(CefRefPtr task, - int64 delay_ms) OVERRIDE; + // CefTaskRunner methods. + bool IsSame(CefRefPtr that) OVERRIDE; + bool BelongsToCurrentThread() OVERRIDE; + bool BelongsToThread(CefThreadId threadId) OVERRIDE; + bool PostTask(CefRefPtr task) OVERRIDE; + bool PostDelayedTask(CefRefPtr task, int64 delay_ms) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc new file mode 100644 index 000000000..b830aa572 --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.cc @@ -0,0 +1,1042 @@ +// 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 +#include "libcef_dll/cpptoc/test/translator_test_handler_cpptoc.h" +#include "libcef_dll/cpptoc/test/translator_test_handler_child_cpptoc.h" +#include "libcef_dll/ctocpp/test/translator_test_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_object_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefTranslatorTest::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_translator_test_t* _retval = cef_translator_test_create(); + + // Return type: refptr_same + return CefTranslatorTestCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefTranslatorTestCToCpp::GetVoid() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_void)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->get_void(_struct); +} + +bool CefTranslatorTestCToCpp::GetBool() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_bool(_struct); + + // Return type: bool + return _retval?true:false; +} + +int CefTranslatorTestCToCpp::GetInt() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_int(_struct); + + // Return type: simple + return _retval; +} + +double CefTranslatorTestCToCpp::GetDouble() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_double)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + double _retval = _struct->get_double(_struct); + + // Return type: simple + return _retval; +} + +long CefTranslatorTestCToCpp::GetLong() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_long)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + long _retval = _struct->get_long(_struct); + + // Return type: simple + return _retval; +} + +size_t CefTranslatorTestCToCpp::GetSizet() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_sizet)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = _struct->get_sizet(_struct); + + // Return type: simple + return _retval; +} + +bool CefTranslatorTestCToCpp::SetVoid() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_void)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_void(_struct); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetBool(bool val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_bool(_struct, + val); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetInt(int val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_int)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_int(_struct, + val); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetDouble(double val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_double)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_double(_struct, + val); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetLong(long val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_long)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_long(_struct, + val); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetSizet(size_t val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_sizet)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_sizet(_struct, + val); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetIntList(const std::vector& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_int_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: simple_vec_byref_const + const size_t valCount = val.size(); + int* valList = NULL; + if (valCount > 0) { + valList = new int[valCount]; + DCHECK(valList); + if (valList) { + for (size_t i = 0; i < valCount; ++i) { + valList[i] = val[i]; + } + } + } + + // Execute + int _retval = _struct->set_int_list(_struct, + valCount, + valList); + + // Restore param:val; type: simple_vec_byref_const + if (valList) + delete [] valList; + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetIntListByRef(IntList& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int_list_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: simple_vec_byref + size_t valSize = val.size(); + size_t valCount = std::max(GetIntListSize(), valSize); + int* valList = NULL; + if (valCount > 0) { + valList = new int[valCount]; + DCHECK(valList); + if (valList) { + memset(valList, 0, sizeof(int)*valCount); + } + if (valList && valSize > 0) { + for (size_t i = 0; i < valSize; ++i) { + valList[i] = val[i]; + } + } + } + + // Execute + int _retval = _struct->get_int_list_by_ref(_struct, + &valCount, + valList); + + // Restore param:val; type: simple_vec_byref + val.clear(); + if (valCount > 0 && valList) { + for (size_t i = 0; i < valCount; ++i) { + val.push_back(valList[i]); + } + delete [] valList; + } + + // Return type: bool + return _retval?true:false; +} + +size_t CefTranslatorTestCToCpp::GetIntListSize() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int_list_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = _struct->get_int_list_size(_struct); + + // Return type: simple + return _retval; +} + +CefString CefTranslatorTestCToCpp::GetString() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = _struct->get_string(_struct); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefTranslatorTestCToCpp::SetString(const CefString& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: string_byref_const + DCHECK(!val.empty()); + if (val.empty()) + return false; + + // Execute + int _retval = _struct->set_string(_struct, + val.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +void CefTranslatorTestCToCpp::GetStringByRef(CefString& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string_by_ref)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->get_string_by_ref(_struct, + val.GetWritableStruct()); +} + +bool CefTranslatorTestCToCpp::SetStringList(const std::vector& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_vec_byref_const + cef_string_list_t valList = cef_string_list_alloc(); + DCHECK(valList); + if (valList) + transfer_string_list_contents(val, valList); + + // Execute + int _retval = _struct->set_string_list(_struct, + valList); + + // Restore param:val; type: string_vec_byref_const + if (valList) + cef_string_list_free(valList); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetStringListByRef(StringList& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string_list_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_vec_byref + cef_string_list_t valList = cef_string_list_alloc(); + DCHECK(valList); + if (valList) + transfer_string_list_contents(val, valList); + + // Execute + int _retval = _struct->get_string_list_by_ref(_struct, + valList); + + // Restore param:val; type: string_vec_byref + if (valList) { + val.clear(); + transfer_string_list_contents(valList, val); + cef_string_list_free(valList); + } + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetStringMap(const StringMap& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string_map)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_map_single_byref_const + cef_string_map_t valMap = cef_string_map_alloc(); + DCHECK(valMap); + if (valMap) + transfer_string_map_contents(val, valMap); + + // Execute + int _retval = _struct->set_string_map(_struct, + valMap); + + // Restore param:val; type: string_map_single_byref_const + if (valMap) + cef_string_map_free(valMap); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetStringMapByRef(std::map& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string_map_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_map_single_byref + cef_string_map_t valMap = cef_string_map_alloc(); + DCHECK(valMap); + if (valMap) + transfer_string_map_contents(val, valMap); + + // Execute + int _retval = _struct->get_string_map_by_ref(_struct, + valMap); + + // Restore param:val; type: string_map_single_byref + if (valMap) { + val.clear(); + transfer_string_map_contents(valMap, val); + cef_string_map_free(valMap); + } + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::SetStringMultimap(const std::multimap& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string_multimap)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_map_multi_byref_const + cef_string_multimap_t valMultimap = cef_string_multimap_alloc(); + DCHECK(valMultimap); + if (valMultimap) + transfer_string_multimap_contents(val, valMultimap); + + // Execute + int _retval = _struct->set_string_multimap(_struct, + valMultimap); + + // Restore param:val; type: string_map_multi_byref_const + if (valMultimap) + cef_string_multimap_free(valMultimap); + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetStringMultimapByRef(StringMultimap& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string_multimap_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: string_map_multi_byref + cef_string_multimap_t valMultimap = cef_string_multimap_alloc(); + DCHECK(valMultimap); + if (valMultimap) + transfer_string_multimap_contents(val, valMultimap); + + // Execute + int _retval = _struct->get_string_multimap_by_ref(_struct, + valMultimap); + + // Restore param:val; type: string_map_multi_byref + if (valMultimap) { + val.clear(); + transfer_string_multimap_contents(valMultimap, val); + cef_string_multimap_free(valMultimap); + } + + // Return type: bool + return _retval?true:false; +} + +CefPoint CefTranslatorTestCToCpp::GetPoint() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_point)) + return CefPoint(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_point_t _retval = _struct->get_point(_struct); + + // Return type: simple + return _retval; +} + +bool CefTranslatorTestCToCpp::SetPoint(const CefPoint& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_point)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->set_point(_struct, + &val); + + // Return type: bool + return _retval?true:false; +} + +void CefTranslatorTestCToCpp::GetPointByRef(CefPoint& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_point_by_ref)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->get_point_by_ref(_struct, + &val); +} + +bool CefTranslatorTestCToCpp::SetPointList(const std::vector& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_point_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: simple_vec_byref_const + const size_t valCount = val.size(); + cef_point_t* valList = NULL; + if (valCount > 0) { + valList = new cef_point_t[valCount]; + DCHECK(valList); + if (valList) { + for (size_t i = 0; i < valCount; ++i) { + valList[i] = val[i]; + } + } + } + + // Execute + int _retval = _struct->set_point_list(_struct, + valCount, + valList); + + // Restore param:val; type: simple_vec_byref_const + if (valList) + delete [] valList; + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetPointListByRef(PointList& val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_point_list_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: simple_vec_byref + size_t valSize = val.size(); + size_t valCount = std::max(GetPointListSize(), valSize); + cef_point_t* valList = NULL; + if (valCount > 0) { + valList = new cef_point_t[valCount]; + DCHECK(valList); + if (valList) { + memset(valList, 0, sizeof(cef_point_t)*valCount); + } + if (valList && valSize > 0) { + for (size_t i = 0; i < valSize; ++i) { + valList[i] = val[i]; + } + } + } + + // Execute + int _retval = _struct->get_point_list_by_ref(_struct, + &valCount, + valList); + + // Restore param:val; type: simple_vec_byref + val.clear(); + if (valCount > 0 && valList) { + for (size_t i = 0; i < valCount; ++i) { + val.push_back(valList[i]); + } + delete [] valList; + } + + // Return type: bool + return _retval?true:false; +} + +size_t CefTranslatorTestCToCpp::GetPointListSize() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_point_list_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = _struct->get_point_list_size(_struct); + + // Return type: simple + return _retval; +} + +CefRefPtr CefTranslatorTestCToCpp::GetObject(int val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_object)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_translator_test_object_t* _retval = _struct->get_object(_struct, + val); + + // Return type: refptr_same + return CefTranslatorTestObjectCToCpp::Wrap(_retval); +} + +int CefTranslatorTestCToCpp::SetObject(CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_object)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_same + DCHECK(val.get()); + if (!val.get()) + return 0; + + // Execute + int _retval = _struct->set_object(_struct, + CefTranslatorTestObjectCToCpp::Unwrap(val)); + + // Return type: simple + return _retval; +} + +CefRefPtr CefTranslatorTestCToCpp::SetObjectAndReturn( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_object_and_return)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_same + DCHECK(val.get()); + if (!val.get()) + return NULL; + + // Execute + cef_translator_test_object_t* _retval = _struct->set_object_and_return( + _struct, + CefTranslatorTestObjectCToCpp::Unwrap(val)); + + // Return type: refptr_same + return CefTranslatorTestObjectCToCpp::Wrap(_retval); +} + +int CefTranslatorTestCToCpp::SetChildObject( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_child_object)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_same + DCHECK(val.get()); + if (!val.get()) + return 0; + + // Execute + int _retval = _struct->set_child_object(_struct, + CefTranslatorTestObjectChildCToCpp::Unwrap(val)); + + // Return type: simple + return _retval; +} + +CefRefPtr CefTranslatorTestCToCpp::SetChildObjectAndReturnParent( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_child_object_and_return_parent)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_same + DCHECK(val.get()); + if (!val.get()) + return NULL; + + // Execute + cef_translator_test_object_t* _retval = + _struct->set_child_object_and_return_parent(_struct, + CefTranslatorTestObjectChildCToCpp::Unwrap(val)); + + // Return type: refptr_same + return CefTranslatorTestObjectCToCpp::Wrap(_retval); +} + +bool CefTranslatorTestCToCpp::SetObjectList( + const std::vector>& val, int val1, + int val2) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_object_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: refptr_vec_same_byref_const + const size_t valCount = val.size(); + cef_translator_test_object_t** valList = NULL; + if (valCount > 0) { + valList = new cef_translator_test_object_t*[valCount]; + DCHECK(valList); + if (valList) { + for (size_t i = 0; i < valCount; ++i) { + valList[i] = CefTranslatorTestObjectCToCpp::Unwrap(val[i]); + } + } + } + + // Execute + int _retval = _struct->set_object_list(_struct, + valCount, + valList, + val1, + val2); + + // Restore param:val; type: refptr_vec_same_byref_const + if (valList) + delete [] valList; + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetObjectListByRef(ObjectList& val, int val1, + int val2) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_object_list_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: refptr_vec_same_byref + size_t valSize = val.size(); + size_t valCount = std::max(GetObjectListSize(), valSize); + cef_translator_test_object_t** valList = NULL; + if (valCount > 0) { + valList = new cef_translator_test_object_t*[valCount]; + DCHECK(valList); + if (valList) { + memset(valList, 0, sizeof(cef_translator_test_object_t*)*valCount); + } + if (valList && valSize > 0) { + for (size_t i = 0; i < valSize; ++i) { + valList[i] = CefTranslatorTestObjectCToCpp::Unwrap(val[i]); + } + } + } + + // Execute + int _retval = _struct->get_object_list_by_ref(_struct, + &valCount, + valList, + val1, + val2); + + // Restore param:val; type: refptr_vec_same_byref + val.clear(); + if (valCount > 0 && valList) { + for (size_t i = 0; i < valCount; ++i) { + val.push_back(CefTranslatorTestObjectCToCpp::Wrap(valList[i])); + } + delete [] valList; + } + + // Return type: bool + return _retval?true:false; +} + +size_t CefTranslatorTestCToCpp::GetObjectListSize() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_object_list_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = _struct->get_object_list_size(_struct); + + // Return type: simple + return _retval; +} + +int CefTranslatorTestCToCpp::SetHandler( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_handler)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_diff + DCHECK(val.get()); + if (!val.get()) + return 0; + + // Execute + int _retval = _struct->set_handler(_struct, + CefTranslatorTestHandlerCppToC::Wrap(val)); + + // Return type: simple + return _retval; +} + +CefRefPtr CefTranslatorTestCToCpp::SetHandlerAndReturn( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_handler_and_return)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_diff + DCHECK(val.get()); + if (!val.get()) + return NULL; + + // Execute + cef_translator_test_handler_t* _retval = _struct->set_handler_and_return( + _struct, + CefTranslatorTestHandlerCppToC::Wrap(val)); + + // Return type: refptr_diff + return CefTranslatorTestHandlerCppToC::Unwrap(_retval); +} + +int CefTranslatorTestCToCpp::SetChildHandler( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_child_handler)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_diff + DCHECK(val.get()); + if (!val.get()) + return 0; + + // Execute + int _retval = _struct->set_child_handler(_struct, + CefTranslatorTestHandlerChildCppToC::Wrap(val)); + + // Return type: simple + return _retval; +} + +CefRefPtr CefTranslatorTestCToCpp::SetChildHandlerAndReturnParent( + CefRefPtr val) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_child_handler_and_return_parent)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val; type: refptr_diff + DCHECK(val.get()); + if (!val.get()) + return NULL; + + // Execute + cef_translator_test_handler_t* _retval = + _struct->set_child_handler_and_return_parent(_struct, + CefTranslatorTestHandlerChildCppToC::Wrap(val)); + + // Return type: refptr_diff + return CefTranslatorTestHandlerCppToC::Unwrap(_retval); +} + +bool CefTranslatorTestCToCpp::SetHandlerList( + const std::vector>& val, int val1, + int val2) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_handler_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: val; type: refptr_vec_diff_byref_const + const size_t valCount = val.size(); + cef_translator_test_handler_t** valList = NULL; + if (valCount > 0) { + valList = new cef_translator_test_handler_t*[valCount]; + DCHECK(valList); + if (valList) { + for (size_t i = 0; i < valCount; ++i) { + valList[i] = CefTranslatorTestHandlerCppToC::Wrap(val[i]); + } + } + } + + // Execute + int _retval = _struct->set_handler_list(_struct, + valCount, + valList, + val1, + val2); + + // Restore param:val; type: refptr_vec_diff_byref_const + if (valList) + delete [] valList; + + // Return type: bool + return _retval?true:false; +} + +bool CefTranslatorTestCToCpp::GetHandlerListByRef(HandlerList& val, + CefRefPtr val1, + CefRefPtr val2) { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_handler_list_by_ref)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: val1; type: refptr_diff + DCHECK(val1.get()); + if (!val1.get()) + return false; + // Verify param: val2; type: refptr_diff + DCHECK(val2.get()); + if (!val2.get()) + return false; + + // Translate param: val; type: refptr_vec_diff_byref + size_t valSize = val.size(); + size_t valCount = std::max(GetObjectListSize(), valSize); + cef_translator_test_handler_t** valList = NULL; + if (valCount > 0) { + valList = new cef_translator_test_handler_t*[valCount]; + DCHECK(valList); + if (valList) { + memset(valList, 0, sizeof(cef_translator_test_handler_t*)*valCount); + } + if (valList && valSize > 0) { + for (size_t i = 0; i < valSize; ++i) { + valList[i] = CefTranslatorTestHandlerCppToC::Wrap(val[i]); + } + } + } + + // Execute + int _retval = _struct->get_handler_list_by_ref(_struct, + &valCount, + valList, + CefTranslatorTestHandlerCppToC::Wrap(val1), + CefTranslatorTestHandlerCppToC::Wrap(val2)); + + // Restore param:val; type: refptr_vec_diff_byref + val.clear(); + if (valCount > 0 && valList) { + for (size_t i = 0; i < valCount; ++i) { + val.push_back(CefTranslatorTestHandlerCppToC::Unwrap(valList[i])); + } + delete [] valList; + } + + // Return type: bool + return _retval?true:false; +} + +size_t CefTranslatorTestCToCpp::GetHandlerListSize() { + cef_translator_test_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_handler_list_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = _struct->get_handler_list_size(_struct); + + // Return type: simple + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestCToCpp::CefTranslatorTestCToCpp() { +} + +template<> cef_translator_test_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefTranslatorTest* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = WT_TRANSLATOR_TEST; diff --git a/libcef_dll/ctocpp/test/translator_test_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_ctocpp.h new file mode 100644 index 000000000..a199fd02f --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_ctocpp.h @@ -0,0 +1,94 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include +#include "include/test/cef_translator_test.h" +#include "include/capi/test/cef_translator_test_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefTranslatorTestCToCpp + : public CefCToCpp { + public: + CefTranslatorTestCToCpp(); + + // CefTranslatorTest methods. + void GetVoid() OVERRIDE; + bool GetBool() OVERRIDE; + int GetInt() OVERRIDE; + double GetDouble() OVERRIDE; + long GetLong() OVERRIDE; + size_t GetSizet() OVERRIDE; + bool SetVoid() OVERRIDE; + bool SetBool(bool val) OVERRIDE; + bool SetInt(int val) OVERRIDE; + bool SetDouble(double val) OVERRIDE; + bool SetLong(long val) OVERRIDE; + bool SetSizet(size_t val) OVERRIDE; + bool SetIntList(const std::vector& val) OVERRIDE; + bool GetIntListByRef(IntList& val) OVERRIDE; + size_t GetIntListSize() OVERRIDE; + CefString GetString() OVERRIDE; + bool SetString(const CefString& val) OVERRIDE; + void GetStringByRef(CefString& val) OVERRIDE; + bool SetStringList(const std::vector& val) OVERRIDE; + bool GetStringListByRef(StringList& val) OVERRIDE; + bool SetStringMap(const StringMap& val) OVERRIDE; + bool GetStringMapByRef(std::map& val) OVERRIDE; + bool SetStringMultimap(const std::multimap& val) OVERRIDE; + bool GetStringMultimapByRef(StringMultimap& val) OVERRIDE; + CefPoint GetPoint() OVERRIDE; + bool SetPoint(const CefPoint& val) OVERRIDE; + void GetPointByRef(CefPoint& val) OVERRIDE; + bool SetPointList(const std::vector& val) OVERRIDE; + bool GetPointListByRef(PointList& val) OVERRIDE; + size_t GetPointListSize() OVERRIDE; + CefRefPtr GetObject(int val) OVERRIDE; + int SetObject(CefRefPtr val) OVERRIDE; + CefRefPtr SetObjectAndReturn( + CefRefPtr val) OVERRIDE; + int SetChildObject(CefRefPtr val) OVERRIDE; + CefRefPtr SetChildObjectAndReturnParent( + CefRefPtr val) OVERRIDE; + bool SetObjectList(const std::vector>& val, + int val1, int val2) OVERRIDE; + bool GetObjectListByRef(ObjectList& val, int val1, int val2) OVERRIDE; + size_t GetObjectListSize() OVERRIDE; + int SetHandler(CefRefPtr val) OVERRIDE; + CefRefPtr SetHandlerAndReturn( + CefRefPtr val) OVERRIDE; + int SetChildHandler(CefRefPtr val) OVERRIDE; + CefRefPtr SetChildHandlerAndReturnParent( + CefRefPtr val) OVERRIDE; + bool SetHandlerList( + const std::vector>& val, int val1, + int val2) OVERRIDE; + bool GetHandlerListByRef(HandlerList& val, + CefRefPtr val1, + CefRefPtr val2) OVERRIDE; + size_t GetHandlerListSize() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc new file mode 100644 index 000000000..b28fccbe5 --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.cc @@ -0,0 +1,70 @@ +// 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/ctocpp/test/translator_test_handler_child_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefTranslatorTestHandlerChildCToCpp::GetOtherValue() { + cef_translator_test_handler_child_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_other_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_other_value(_struct); + + // Return type: simple + return _retval; +} + +int CefTranslatorTestHandlerChildCToCpp::GetValue() { + cef_translator_test_handler_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, get_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_value(_struct); + + // Return type: simple + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestHandlerChildCToCpp::CefTranslatorTestHandlerChildCToCpp() { +} + +template<> cef_translator_test_handler_child_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefTranslatorTestHandlerChild* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_TRANSLATOR_TEST_HANDLER_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h new file mode 100644 index 000000000..fcdb63e7b --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h @@ -0,0 +1,41 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_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/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed DLL-side only. +class CefTranslatorTestHandlerChildCToCpp + : public CefCToCpp { + public: + CefTranslatorTestHandlerChildCToCpp(); + + // CefTranslatorTestHandlerChild methods. + int GetOtherValue() override; + + // CefTranslatorTestHandler methods. + int GetValue() override; +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CHILD_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc new file mode 100644 index 000000000..54d3805b6 --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.cc @@ -0,0 +1,58 @@ +// 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/ctocpp/test/translator_test_handler_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_handler_child_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefTranslatorTestHandlerCToCpp::GetValue() { + cef_translator_test_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_value(_struct); + + // Return type: simple + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestHandlerCToCpp::CefTranslatorTestHandlerCToCpp() { +} + +template<> cef_translator_test_handler_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefTranslatorTestHandler* c) { + if (type == WT_TRANSLATOR_TEST_HANDLER_CHILD) { + return reinterpret_cast( + CefTranslatorTestHandlerChildCToCpp::Unwrap( + reinterpret_cast(c))); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_TRANSLATOR_TEST_HANDLER; diff --git a/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h new file mode 100644 index 000000000..cab34d21f --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_handler_ctocpp.h @@ -0,0 +1,38 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_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/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed DLL-side only. +class CefTranslatorTestHandlerCToCpp + : public CefCToCpp { + public: + CefTranslatorTestHandlerCToCpp(); + + // CefTranslatorTestHandler methods. + int GetValue() override; +}; + +#endif // BUILDING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_HANDLER_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc new file mode 100644 index 000000000..08f83e7f2 --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.cc @@ -0,0 +1,142 @@ +// 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/ctocpp/test/translator_test_object_child_child_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefTranslatorTestObjectChildChild::Create( + int value, int other_value, int other_other_value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_translator_test_object_child_child_t* _retval = + cef_translator_test_object_child_child_create( + value, + other_value, + other_other_value); + + // Return type: refptr_same + return CefTranslatorTestObjectChildChildCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefTranslatorTestObjectChildChildCToCpp::GetOtherOtherValue() { + cef_translator_test_object_child_child_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_other_other_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_other_other_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectChildChildCToCpp::SetOtherOtherValue(int value) { + cef_translator_test_object_child_child_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_other_other_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_other_other_value(_struct, + value); +} + +int CefTranslatorTestObjectChildChildCToCpp::GetOtherValue() { + cef_translator_test_object_child_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, get_other_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_other_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectChildChildCToCpp::SetOtherValue(int value) { + cef_translator_test_object_child_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, set_other_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_other_value(_struct, + value); +} + +int CefTranslatorTestObjectChildChildCToCpp::GetValue() { + cef_translator_test_object_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, get_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectChildChildCToCpp::SetValue(int value) { + cef_translator_test_object_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, set_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_value(_struct, + value); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestObjectChildChildCToCpp::CefTranslatorTestObjectChildChildCToCpp( + ) { +} + +template<> cef_translator_test_object_child_child_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefTranslatorTestObjectChildChild* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h new file mode 100644 index 000000000..7f9c0c80b --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h @@ -0,0 +1,48 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_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/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefTranslatorTestObjectChildChildCToCpp + : public CefCToCpp { + public: + CefTranslatorTestObjectChildChildCToCpp(); + + // CefTranslatorTestObjectChildChild methods. + int GetOtherOtherValue() OVERRIDE; + void SetOtherOtherValue(int value) OVERRIDE; + + // CefTranslatorTestObjectChild methods. + int GetOtherValue() OVERRIDE; + void SetOtherValue(int value) OVERRIDE; + + // CefTranslatorTestObject methods. + int GetValue() OVERRIDE; + void SetValue(int value) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CHILD_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc new file mode 100644 index 000000000..cd49b0386 --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.cc @@ -0,0 +1,118 @@ +// 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/ctocpp/test/translator_test_object_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefTranslatorTestObjectChild::Create( + int value, int other_value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_translator_test_object_child_t* _retval = + cef_translator_test_object_child_create( + value, + other_value); + + // Return type: refptr_same + return CefTranslatorTestObjectChildCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefTranslatorTestObjectChildCToCpp::GetOtherValue() { + cef_translator_test_object_child_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_other_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_other_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectChildCToCpp::SetOtherValue(int value) { + cef_translator_test_object_child_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_other_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_other_value(_struct, + value); +} + +int CefTranslatorTestObjectChildCToCpp::GetValue() { + cef_translator_test_object_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, get_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectChildCToCpp::SetValue(int value) { + cef_translator_test_object_t* _struct = + reinterpret_cast(GetStruct()); + if (CEF_MEMBER_MISSING(_struct, set_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_value(_struct, + value); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestObjectChildCToCpp::CefTranslatorTestObjectChildCToCpp() { +} + +template<> cef_translator_test_object_child_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefTranslatorTestObjectChild* c) { + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) { + return reinterpret_cast( + CefTranslatorTestObjectChildChildCToCpp::Unwrap( + reinterpret_cast(c))); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT_CHILD; diff --git a/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h new file mode 100644 index 000000000..34a55377f --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h @@ -0,0 +1,43 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_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/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefTranslatorTestObjectChildCToCpp + : public CefCToCpp { + public: + CefTranslatorTestObjectChildCToCpp(); + + // CefTranslatorTestObjectChild methods. + int GetOtherValue() OVERRIDE; + void SetOtherValue(int value) OVERRIDE; + + // CefTranslatorTestObject methods. + int GetValue() OVERRIDE; + void SetValue(int value) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CHILD_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc b/libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc new file mode 100644 index 000000000..70f26c6da --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_ctocpp.cc @@ -0,0 +1,90 @@ +// 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/ctocpp/test/translator_test_object_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_object_child_ctocpp.h" +#include "libcef_dll/ctocpp/test/translator_test_object_child_child_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefTranslatorTestObject::Create(int value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_translator_test_object_t* _retval = cef_translator_test_object_create( + value); + + // Return type: refptr_same + return CefTranslatorTestObjectCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefTranslatorTestObjectCToCpp::GetValue() { + cef_translator_test_object_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = _struct->get_value(_struct); + + // Return type: simple + return _retval; +} + +void CefTranslatorTestObjectCToCpp::SetValue(int value) { + cef_translator_test_object_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + _struct->set_value(_struct, + value); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTranslatorTestObjectCToCpp::CefTranslatorTestObjectCToCpp() { +} + +template<> cef_translator_test_object_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefTranslatorTestObject* c) { + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD) { + return reinterpret_cast( + CefTranslatorTestObjectChildCToCpp::Unwrap( + reinterpret_cast(c))); + } + if (type == WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD) { + return reinterpret_cast( + CefTranslatorTestObjectChildChildCToCpp::Unwrap( + reinterpret_cast(c))); + } + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_TRANSLATOR_TEST_OBJECT; diff --git a/libcef_dll/ctocpp/test/translator_test_object_ctocpp.h b/libcef_dll/ctocpp/test/translator_test_object_ctocpp.h new file mode 100644 index 000000000..8f5090e3f --- /dev/null +++ b/libcef_dll/ctocpp/test/translator_test_object_ctocpp.h @@ -0,0 +1,39 @@ +// 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_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_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/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefTranslatorTestObjectCToCpp + : public CefCToCpp { + public: + CefTranslatorTestObjectCToCpp(); + + // CefTranslatorTestObject methods. + int GetValue() OVERRIDE; + void SetValue(int value) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TEST_TRANSLATOR_TEST_OBJECT_CTOCPP_H_ diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc index c3e3560d0..c6c855257 100644 --- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc +++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.cc @@ -19,7 +19,8 @@ void CefURLRequestClientCToCpp::OnRequestComplete( CefRefPtr request) { - if (CEF_MEMBER_MISSING(struct_, on_request_complete)) + cef_urlrequest_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_request_complete)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -30,13 +31,14 @@ void CefURLRequestClientCToCpp::OnRequestComplete( return; // Execute - struct_->on_request_complete(struct_, + _struct->on_request_complete(_struct, CefURLRequestCppToC::Wrap(request)); } void CefURLRequestClientCToCpp::OnUploadProgress( CefRefPtr request, int64 current, int64 total) { - if (CEF_MEMBER_MISSING(struct_, on_upload_progress)) + cef_urlrequest_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_upload_progress)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -47,7 +49,7 @@ void CefURLRequestClientCToCpp::OnUploadProgress( return; // Execute - struct_->on_upload_progress(struct_, + _struct->on_upload_progress(_struct, CefURLRequestCppToC::Wrap(request), current, total); @@ -55,7 +57,8 @@ void CefURLRequestClientCToCpp::OnUploadProgress( void CefURLRequestClientCToCpp::OnDownloadProgress( CefRefPtr request, int64 current, int64 total) { - if (CEF_MEMBER_MISSING(struct_, on_download_progress)) + cef_urlrequest_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_download_progress)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -66,7 +69,7 @@ void CefURLRequestClientCToCpp::OnDownloadProgress( return; // Execute - struct_->on_download_progress(struct_, + _struct->on_download_progress(_struct, CefURLRequestCppToC::Wrap(request), current, total); @@ -74,7 +77,8 @@ void CefURLRequestClientCToCpp::OnDownloadProgress( void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr request, const void* data, size_t data_length) { - if (CEF_MEMBER_MISSING(struct_, on_download_data)) + cef_urlrequest_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, on_download_data)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -89,7 +93,7 @@ void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr request, return; // Execute - struct_->on_download_data(struct_, + _struct->on_download_data(_struct, CefURLRequestCppToC::Wrap(request), data, data_length); @@ -98,7 +102,8 @@ void CefURLRequestClientCToCpp::OnDownloadData(CefRefPtr request, bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) { - if (CEF_MEMBER_MISSING(struct_, get_auth_credentials)) + cef_urlrequest_client_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_auth_credentials)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -118,7 +123,7 @@ bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy, // Unverified params: realm // Execute - int _retval = struct_->get_auth_credentials(struct_, + int _retval = _struct->get_auth_credentials(_struct, isProxy, host.GetStruct(), port, @@ -131,8 +136,23 @@ bool CefURLRequestClientCToCpp::GetAuthCredentials(bool isProxy, } +// CONSTRUCTOR - Do not edit by hand. + +CefURLRequestClientCToCpp::CefURLRequestClientCToCpp() { +} + +template<> cef_urlrequest_client_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefURLRequestClient* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_URLREQUEST_CLIENT; diff --git a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h index 3c2e61640..f25349a43 100644 --- a/libcef_dll/ctocpp/urlrequest_client_ctocpp.h +++ b/libcef_dll/ctocpp/urlrequest_client_ctocpp.h @@ -28,11 +28,9 @@ class CefURLRequestClientCToCpp : public CefCToCpp { public: - explicit CefURLRequestClientCToCpp(cef_urlrequest_client_t* str) - : CefCToCpp(str) {} + CefURLRequestClientCToCpp(); - // CefURLRequestClient methods + // CefURLRequestClient methods. void OnRequestComplete(CefRefPtr request) override; void OnUploadProgress(CefRefPtr request, int64 current, int64 total) override; @@ -47,4 +45,3 @@ class CefURLRequestClientCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CLIENT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.cc b/libcef_dll/ctocpp/urlrequest_ctocpp.cc index b99047504..c8412f564 100644 --- a/libcef_dll/ctocpp/urlrequest_ctocpp.cc +++ b/libcef_dll/ctocpp/urlrequest_ctocpp.cc @@ -48,83 +48,102 @@ CefRefPtr CefURLRequest::Create(CefRefPtr request, // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefURLRequestCToCpp::GetRequest() { - if (CEF_MEMBER_MISSING(struct_, get_request)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_request)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_request_t* _retval = struct_->get_request(struct_); + cef_request_t* _retval = _struct->get_request(_struct); // Return type: refptr_same return CefRequestCToCpp::Wrap(_retval); } CefRefPtr CefURLRequestCToCpp::GetClient() { - if (CEF_MEMBER_MISSING(struct_, get_client)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_client)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_urlrequest_client_t* _retval = struct_->get_client(struct_); + cef_urlrequest_client_t* _retval = _struct->get_client(_struct); // Return type: refptr_diff return CefURLRequestClientCppToC::Unwrap(_retval); } CefURLRequest::Status CefURLRequestCToCpp::GetRequestStatus() { - if (CEF_MEMBER_MISSING(struct_, get_request_status)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_request_status)) return UR_UNKNOWN; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_urlrequest_status_t _retval = struct_->get_request_status(struct_); + cef_urlrequest_status_t _retval = _struct->get_request_status(_struct); // Return type: simple return _retval; } CefURLRequest::ErrorCode CefURLRequestCToCpp::GetRequestError() { - if (CEF_MEMBER_MISSING(struct_, get_request_error)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_request_error)) return ERR_NONE; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_errorcode_t _retval = struct_->get_request_error(struct_); + cef_errorcode_t _retval = _struct->get_request_error(_struct); // Return type: simple return _retval; } CefRefPtr CefURLRequestCToCpp::GetResponse() { - if (CEF_MEMBER_MISSING(struct_, get_response)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_response)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_response_t* _retval = struct_->get_response(struct_); + cef_response_t* _retval = _struct->get_response(_struct); // Return type: refptr_same return CefResponseCToCpp::Wrap(_retval); } void CefURLRequestCToCpp::Cancel() { - if (CEF_MEMBER_MISSING(struct_, cancel)) + cef_urlrequest_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, cancel)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - struct_->cancel(struct_); + _struct->cancel(_struct); } +// CONSTRUCTOR - Do not edit by hand. + +CefURLRequestCToCpp::CefURLRequestCToCpp() { +} + +template<> cef_urlrequest_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefURLRequest* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_URLREQUEST; diff --git a/libcef_dll/ctocpp/urlrequest_ctocpp.h b/libcef_dll/ctocpp/urlrequest_ctocpp.h index 0dcf7427c..8cb9b7f8a 100644 --- a/libcef_dll/ctocpp/urlrequest_ctocpp.h +++ b/libcef_dll/ctocpp/urlrequest_ctocpp.h @@ -27,18 +27,16 @@ class CefURLRequestCToCpp : public CefCToCpp { public: - explicit CefURLRequestCToCpp(cef_urlrequest_t* str) - : CefCToCpp(str) {} + CefURLRequestCToCpp(); - // CefURLRequest methods - virtual CefRefPtr GetRequest() OVERRIDE; - virtual CefRefPtr GetClient() OVERRIDE; - virtual Status GetRequestStatus() OVERRIDE; - virtual ErrorCode GetRequestError() OVERRIDE; - virtual CefRefPtr GetResponse() OVERRIDE; - virtual void Cancel() OVERRIDE; + // CefURLRequest methods. + CefRefPtr GetRequest() OVERRIDE; + CefRefPtr GetClient() OVERRIDE; + Status GetRequestStatus() OVERRIDE; + ErrorCode GetRequestError() OVERRIDE; + CefRefPtr GetResponse() OVERRIDE; + void Cancel() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.cc b/libcef_dll/ctocpp/v8accessor_ctocpp.cc index fc6b824ef..84c31f515 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.cc +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.cc @@ -19,7 +19,8 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, CefString& exception) { - if (CEF_MEMBER_MISSING(struct_, get)) + cef_v8accessor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -40,7 +41,7 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = struct_->get(struct_, + int _retval = _struct->get(_struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), &retvalStruct, @@ -62,7 +63,8 @@ bool CefV8AccessorCToCpp::Get(const CefString& name, bool CefV8AccessorCToCpp::Set(const CefString& name, const CefRefPtr object, const CefRefPtr value, CefString& exception) { - if (CEF_MEMBER_MISSING(struct_, set)) + cef_v8accessor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -81,7 +83,7 @@ bool CefV8AccessorCToCpp::Set(const CefString& name, return false; // Execute - int _retval = struct_->set(struct_, + int _retval = _struct->set(_struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), CefV8ValueCppToC::Wrap(value), @@ -92,8 +94,21 @@ bool CefV8AccessorCToCpp::Set(const CefString& name, } +// CONSTRUCTOR - Do not edit by hand. + +CefV8AccessorCToCpp::CefV8AccessorCToCpp() { +} + +template<> cef_v8accessor_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Accessor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8ACCESSOR; diff --git a/libcef_dll/ctocpp/v8accessor_ctocpp.h b/libcef_dll/ctocpp/v8accessor_ctocpp.h index 078a3f940..957ee2e7d 100644 --- a/libcef_dll/ctocpp/v8accessor_ctocpp.h +++ b/libcef_dll/ctocpp/v8accessor_ctocpp.h @@ -27,10 +27,9 @@ class CefV8AccessorCToCpp : public CefCToCpp { public: - explicit CefV8AccessorCToCpp(cef_v8accessor_t* str) - : CefCToCpp(str) {} + CefV8AccessorCToCpp(); - // CefV8Accessor methods + // CefV8Accessor methods. bool Get(const CefString& name, const CefRefPtr object, CefRefPtr& retval, CefString& exception) override; bool Set(const CefString& name, const CefRefPtr object, @@ -39,4 +38,3 @@ class CefV8AccessorCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8ACCESSOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8context_ctocpp.cc b/libcef_dll/ctocpp/v8context_ctocpp.cc index ca95b4004..e10b1ec29 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.cc +++ b/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -54,98 +54,106 @@ bool CefV8Context::InContext() { // VIRTUAL METHODS - Body may be edited by hand. CefRefPtr CefV8ContextCToCpp::GetTaskRunner() { - if (CEF_MEMBER_MISSING(struct_, get_task_runner)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_task_runner)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_task_runner_t* _retval = struct_->get_task_runner(struct_); + cef_task_runner_t* _retval = _struct->get_task_runner(_struct); // Return type: refptr_same return CefTaskRunnerCToCpp::Wrap(_retval); } bool CefV8ContextCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefV8ContextCToCpp::GetBrowser() { - if (CEF_MEMBER_MISSING(struct_, get_browser)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_browser)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_browser_t* _retval = struct_->get_browser(struct_); + cef_browser_t* _retval = _struct->get_browser(_struct); // Return type: refptr_same return CefBrowserCToCpp::Wrap(_retval); } CefRefPtr CefV8ContextCToCpp::GetFrame() { - if (CEF_MEMBER_MISSING(struct_, get_frame)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_frame_t* _retval = struct_->get_frame(struct_); + cef_frame_t* _retval = _struct->get_frame(_struct); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); } CefRefPtr CefV8ContextCToCpp::GetGlobal() { - if (CEF_MEMBER_MISSING(struct_, get_global)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_global)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8value_t* _retval = struct_->get_global(struct_); + cef_v8value_t* _retval = _struct->get_global(_struct); // Return type: refptr_same return CefV8ValueCToCpp::Wrap(_retval); } bool CefV8ContextCToCpp::Enter() { - if (CEF_MEMBER_MISSING(struct_, enter)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, enter)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->enter(struct_); + int _retval = _struct->enter(_struct); // Return type: bool return _retval?true:false; } bool CefV8ContextCToCpp::Exit() { - if (CEF_MEMBER_MISSING(struct_, exit)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, exit)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->exit(struct_); + int _retval = _struct->exit(_struct); // Return type: bool return _retval?true:false; } bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -156,7 +164,7 @@ bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefV8ContextCToCpp::Unwrap(that)); // Return type: bool @@ -165,7 +173,8 @@ bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { bool CefV8ContextCToCpp::Eval(const CefString& code, CefRefPtr& retval, CefRefPtr& exception) { - if (CEF_MEMBER_MISSING(struct_, eval)) + cef_v8context_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, eval)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -187,7 +196,7 @@ bool CefV8ContextCToCpp::Eval(const CefString& code, cef_v8exception_t* exceptionOrig = exceptionStruct; // Execute - int _retval = struct_->eval(struct_, + int _retval = _struct->eval(_struct, code.GetStruct(), &retvalStruct, &exceptionStruct); @@ -214,8 +223,21 @@ bool CefV8ContextCToCpp::Eval(const CefString& code, } +// CONSTRUCTOR - Do not edit by hand. + +CefV8ContextCToCpp::CefV8ContextCToCpp() { +} + +template<> cef_v8context_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Context* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8CONTEXT; diff --git a/libcef_dll/ctocpp/v8context_ctocpp.h b/libcef_dll/ctocpp/v8context_ctocpp.h index aef9d2993..6f833143d 100644 --- a/libcef_dll/ctocpp/v8context_ctocpp.h +++ b/libcef_dll/ctocpp/v8context_ctocpp.h @@ -27,22 +27,20 @@ class CefV8ContextCToCpp : public CefCToCpp { public: - explicit CefV8ContextCToCpp(cef_v8context_t* str) - : CefCToCpp(str) {} + CefV8ContextCToCpp(); - // CefV8Context methods - virtual CefRefPtr GetTaskRunner() OVERRIDE; - virtual bool IsValid() OVERRIDE; - virtual CefRefPtr GetBrowser() OVERRIDE; - virtual CefRefPtr GetFrame() OVERRIDE; - virtual CefRefPtr GetGlobal() OVERRIDE; - virtual bool Enter() OVERRIDE; - virtual bool Exit() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool Eval(const CefString& code, CefRefPtr& retval, + // CefV8Context methods. + CefRefPtr GetTaskRunner() OVERRIDE; + bool IsValid() OVERRIDE; + CefRefPtr GetBrowser() OVERRIDE; + CefRefPtr GetFrame() OVERRIDE; + CefRefPtr GetGlobal() OVERRIDE; + bool Enter() OVERRIDE; + bool Exit() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool Eval(const CefString& code, CefRefPtr& retval, CefRefPtr& exception) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.cc b/libcef_dll/ctocpp/v8exception_ctocpp.cc index 707035105..836907303 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.cc +++ b/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -16,13 +16,14 @@ // VIRTUAL METHODS - Body may be edited by hand. CefString CefV8ExceptionCToCpp::GetMessage() { - if (CEF_MEMBER_MISSING(struct_, get_message)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_message)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_message(struct_); + cef_string_userfree_t _retval = _struct->get_message(_struct); // Return type: string CefString _retvalStr; @@ -31,13 +32,14 @@ CefString CefV8ExceptionCToCpp::GetMessage() { } CefString CefV8ExceptionCToCpp::GetSourceLine() { - if (CEF_MEMBER_MISSING(struct_, get_source_line)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_source_line)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_source_line(struct_); + cef_string_userfree_t _retval = _struct->get_source_line(_struct); // Return type: string CefString _retvalStr; @@ -46,13 +48,14 @@ CefString CefV8ExceptionCToCpp::GetSourceLine() { } CefString CefV8ExceptionCToCpp::GetScriptResourceName() { - if (CEF_MEMBER_MISSING(struct_, get_script_resource_name)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_script_resource_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_script_resource_name(struct_); + cef_string_userfree_t _retval = _struct->get_script_resource_name(_struct); // Return type: string CefString _retvalStr; @@ -61,73 +64,92 @@ CefString CefV8ExceptionCToCpp::GetScriptResourceName() { } int CefV8ExceptionCToCpp::GetLineNumber() { - if (CEF_MEMBER_MISSING(struct_, get_line_number)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_line_number)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_line_number(struct_); + int _retval = _struct->get_line_number(_struct); // Return type: simple return _retval; } int CefV8ExceptionCToCpp::GetStartPosition() { - if (CEF_MEMBER_MISSING(struct_, get_start_position)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_start_position)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_start_position(struct_); + int _retval = _struct->get_start_position(_struct); // Return type: simple return _retval; } int CefV8ExceptionCToCpp::GetEndPosition() { - if (CEF_MEMBER_MISSING(struct_, get_end_position)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_end_position)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_end_position(struct_); + int _retval = _struct->get_end_position(_struct); // Return type: simple return _retval; } int CefV8ExceptionCToCpp::GetStartColumn() { - if (CEF_MEMBER_MISSING(struct_, get_start_column)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_start_column)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_start_column(struct_); + int _retval = _struct->get_start_column(_struct); // Return type: simple return _retval; } int CefV8ExceptionCToCpp::GetEndColumn() { - if (CEF_MEMBER_MISSING(struct_, get_end_column)) + cef_v8exception_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_end_column)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_end_column(struct_); + int _retval = _struct->get_end_column(_struct); // Return type: simple return _retval; } +// CONSTRUCTOR - Do not edit by hand. + +CefV8ExceptionCToCpp::CefV8ExceptionCToCpp() { +} + +template<> cef_v8exception_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefV8Exception* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8EXCEPTION; diff --git a/libcef_dll/ctocpp/v8exception_ctocpp.h b/libcef_dll/ctocpp/v8exception_ctocpp.h index 07610ce63..2a19ac6f3 100644 --- a/libcef_dll/ctocpp/v8exception_ctocpp.h +++ b/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -28,21 +28,18 @@ class CefV8ExceptionCToCpp : public CefCToCpp { public: - explicit CefV8ExceptionCToCpp(cef_v8exception_t* str) - : CefCToCpp( - str) {} + CefV8ExceptionCToCpp(); - // CefV8Exception methods - virtual CefString GetMessage() OVERRIDE; - virtual CefString GetSourceLine() OVERRIDE; - virtual CefString GetScriptResourceName() OVERRIDE; - virtual int GetLineNumber() OVERRIDE; - virtual int GetStartPosition() OVERRIDE; - virtual int GetEndPosition() OVERRIDE; - virtual int GetStartColumn() OVERRIDE; - virtual int GetEndColumn() OVERRIDE; + // CefV8Exception methods. + CefString GetMessage() OVERRIDE; + CefString GetSourceLine() OVERRIDE; + CefString GetScriptResourceName() OVERRIDE; + int GetLineNumber() OVERRIDE; + int GetStartPosition() OVERRIDE; + int GetEndPosition() OVERRIDE; + int GetStartColumn() OVERRIDE; + int GetEndColumn() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.cc b/libcef_dll/ctocpp/v8handler_ctocpp.cc index 370890f54..4d404519d 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.cc +++ b/libcef_dll/ctocpp/v8handler_ctocpp.cc @@ -19,7 +19,8 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) { - if (CEF_MEMBER_MISSING(struct_, execute)) + cef_v8handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, execute)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -52,7 +53,7 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, cef_v8value_t* retvalOrig = retvalStruct; // Execute - int _retval = struct_->execute(struct_, + int _retval = _struct->execute(_struct, name.GetStruct(), CefV8ValueCppToC::Wrap(object), argumentsCount, @@ -77,8 +78,21 @@ bool CefV8HandlerCToCpp::Execute(const CefString& name, } +// CONSTRUCTOR - Do not edit by hand. + +CefV8HandlerCToCpp::CefV8HandlerCToCpp() { +} + +template<> cef_v8handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Handler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8HANDLER; diff --git a/libcef_dll/ctocpp/v8handler_ctocpp.h b/libcef_dll/ctocpp/v8handler_ctocpp.h index 8df864f36..2cea871f1 100644 --- a/libcef_dll/ctocpp/v8handler_ctocpp.h +++ b/libcef_dll/ctocpp/v8handler_ctocpp.h @@ -27,10 +27,9 @@ class CefV8HandlerCToCpp : public CefCToCpp { public: - explicit CefV8HandlerCToCpp(cef_v8handler_t* str) - : CefCToCpp(str) {} + CefV8HandlerCToCpp(); - // CefV8Handler methods + // CefV8Handler methods. bool Execute(const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception) override; @@ -38,4 +37,3 @@ class CefV8HandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc index 3446ac24f..f982ca21f 100644 --- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc +++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc @@ -16,26 +16,28 @@ // VIRTUAL METHODS - Body may be edited by hand. bool CefV8StackFrameCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } CefString CefV8StackFrameCToCpp::GetScriptName() { - if (CEF_MEMBER_MISSING(struct_, get_script_name)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_script_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_script_name(struct_); + cef_string_userfree_t _retval = _struct->get_script_name(_struct); // Return type: string CefString _retvalStr; @@ -44,14 +46,15 @@ CefString CefV8StackFrameCToCpp::GetScriptName() { } CefString CefV8StackFrameCToCpp::GetScriptNameOrSourceURL() { - if (CEF_MEMBER_MISSING(struct_, get_script_name_or_source_url)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_script_name_or_source_url)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_script_name_or_source_url( - struct_); + cef_string_userfree_t _retval = _struct->get_script_name_or_source_url( + _struct); // Return type: string CefString _retvalStr; @@ -60,13 +63,14 @@ CefString CefV8StackFrameCToCpp::GetScriptNameOrSourceURL() { } CefString CefV8StackFrameCToCpp::GetFunctionName() { - if (CEF_MEMBER_MISSING(struct_, get_function_name)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_function_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_function_name(struct_); + cef_string_userfree_t _retval = _struct->get_function_name(_struct); // Return type: string CefString _retvalStr; @@ -75,60 +79,78 @@ CefString CefV8StackFrameCToCpp::GetFunctionName() { } int CefV8StackFrameCToCpp::GetLineNumber() { - if (CEF_MEMBER_MISSING(struct_, get_line_number)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_line_number)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_line_number(struct_); + int _retval = _struct->get_line_number(_struct); // Return type: simple return _retval; } int CefV8StackFrameCToCpp::GetColumn() { - if (CEF_MEMBER_MISSING(struct_, get_column)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_column)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_column(struct_); + int _retval = _struct->get_column(_struct); // Return type: simple return _retval; } bool CefV8StackFrameCToCpp::IsEval() { - if (CEF_MEMBER_MISSING(struct_, is_eval)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_eval)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_eval(struct_); + int _retval = _struct->is_eval(_struct); // Return type: bool return _retval?true:false; } bool CefV8StackFrameCToCpp::IsConstructor() { - if (CEF_MEMBER_MISSING(struct_, is_constructor)) + cef_v8stack_frame_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_constructor)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_constructor(struct_); + int _retval = _struct->is_constructor(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefV8StackFrameCToCpp::CefV8StackFrameCToCpp() { +} + +template<> cef_v8stack_frame_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefV8StackFrame* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8STACK_FRAME; diff --git a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h index 62bbf6275..2e05f3dcc 100644 --- a/libcef_dll/ctocpp/v8stack_frame_ctocpp.h +++ b/libcef_dll/ctocpp/v8stack_frame_ctocpp.h @@ -28,21 +28,18 @@ class CefV8StackFrameCToCpp : public CefCToCpp { public: - explicit CefV8StackFrameCToCpp(cef_v8stack_frame_t* str) - : CefCToCpp( - str) {} + CefV8StackFrameCToCpp(); - // CefV8StackFrame methods - virtual bool IsValid() OVERRIDE; - virtual CefString GetScriptName() OVERRIDE; - virtual CefString GetScriptNameOrSourceURL() OVERRIDE; - virtual CefString GetFunctionName() OVERRIDE; - virtual int GetLineNumber() OVERRIDE; - virtual int GetColumn() OVERRIDE; - virtual bool IsEval() OVERRIDE; - virtual bool IsConstructor() OVERRIDE; + // CefV8StackFrame methods. + bool IsValid() OVERRIDE; + CefString GetScriptName() OVERRIDE; + CefString GetScriptNameOrSourceURL() OVERRIDE; + CefString GetFunctionName() OVERRIDE; + int GetLineNumber() OVERRIDE; + int GetColumn() OVERRIDE; + bool IsEval() OVERRIDE; + bool IsConstructor() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc index 129497430..a164ccece 100644 --- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc +++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc @@ -31,39 +31,42 @@ CefRefPtr CefV8StackTrace::GetCurrent(int frame_limit) { // VIRTUAL METHODS - Body may be edited by hand. bool CefV8StackTraceCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_v8stack_trace_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } int CefV8StackTraceCToCpp::GetFrameCount() { - if (CEF_MEMBER_MISSING(struct_, get_frame_count)) + cef_v8stack_trace_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_frame_count(struct_); + int _retval = _struct->get_frame_count(_struct); // Return type: simple return _retval; } CefRefPtr CefV8StackTraceCToCpp::GetFrame(int index) { - if (CEF_MEMBER_MISSING(struct_, get_frame)) + cef_v8stack_trace_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_frame)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8stack_frame_t* _retval = struct_->get_frame(struct_, + cef_v8stack_frame_t* _retval = _struct->get_frame(_struct, index); // Return type: refptr_same @@ -71,8 +74,22 @@ CefRefPtr CefV8StackTraceCToCpp::GetFrame(int index) { } +// CONSTRUCTOR - Do not edit by hand. + +CefV8StackTraceCToCpp::CefV8StackTraceCToCpp() { +} + +template<> cef_v8stack_trace_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefV8StackTrace* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8STACK_TRACE; diff --git a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h index ff7b02a0a..92a88111f 100644 --- a/libcef_dll/ctocpp/v8stack_trace_ctocpp.h +++ b/libcef_dll/ctocpp/v8stack_trace_ctocpp.h @@ -28,16 +28,13 @@ class CefV8StackTraceCToCpp : public CefCToCpp { public: - explicit CefV8StackTraceCToCpp(cef_v8stack_trace_t* str) - : CefCToCpp( - str) {} + CefV8StackTraceCToCpp(); - // CefV8StackTrace methods - virtual bool IsValid() OVERRIDE; - virtual int GetFrameCount() OVERRIDE; - virtual CefRefPtr GetFrame(int index) OVERRIDE; + // CefV8StackTrace methods. + bool IsValid() OVERRIDE; + int GetFrameCount() OVERRIDE; + CefRefPtr GetFrame(int index) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/v8value_ctocpp.cc b/libcef_dll/ctocpp/v8value_ctocpp.cc index 848a481ff..27c88662b 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.cc +++ b/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -160,163 +160,176 @@ CefRefPtr CefV8Value::CreateFunction(const CefString& name, // VIRTUAL METHODS - Body may be edited by hand. bool CefV8ValueCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsUndefined() { - if (CEF_MEMBER_MISSING(struct_, is_undefined)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_undefined)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_undefined(struct_); + int _retval = _struct->is_undefined(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsNull() { - if (CEF_MEMBER_MISSING(struct_, is_null)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_null)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_null(struct_); + int _retval = _struct->is_null(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsBool() { - if (CEF_MEMBER_MISSING(struct_, is_bool)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_bool(struct_); + int _retval = _struct->is_bool(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsInt() { - if (CEF_MEMBER_MISSING(struct_, is_int)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_int)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_int(struct_); + int _retval = _struct->is_int(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsUInt() { - if (CEF_MEMBER_MISSING(struct_, is_uint)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_uint)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_uint(struct_); + int _retval = _struct->is_uint(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsDouble() { - if (CEF_MEMBER_MISSING(struct_, is_double)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_double)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_double(struct_); + int _retval = _struct->is_double(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsDate() { - if (CEF_MEMBER_MISSING(struct_, is_date)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_date)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_date(struct_); + int _retval = _struct->is_date(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsString() { - if (CEF_MEMBER_MISSING(struct_, is_string)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_string(struct_); + int _retval = _struct->is_string(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsObject() { - if (CEF_MEMBER_MISSING(struct_, is_object)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_object)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_object(struct_); + int _retval = _struct->is_object(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsArray() { - if (CEF_MEMBER_MISSING(struct_, is_array)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_array)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_array(struct_); + int _retval = _struct->is_array(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsFunction() { - if (CEF_MEMBER_MISSING(struct_, is_function)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_function)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_function(struct_); + int _retval = _struct->is_function(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -327,7 +340,7 @@ bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefV8ValueCToCpp::Unwrap(that)); // Return type: bool @@ -335,78 +348,84 @@ bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { } bool CefV8ValueCToCpp::GetBoolValue() { - if (CEF_MEMBER_MISSING(struct_, get_bool_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bool_value)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_bool_value(struct_); + int _retval = _struct->get_bool_value(_struct); // Return type: bool return _retval?true:false; } int32 CefV8ValueCToCpp::GetIntValue() { - if (CEF_MEMBER_MISSING(struct_, get_int_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int_value)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int32 _retval = struct_->get_int_value(struct_); + int32 _retval = _struct->get_int_value(_struct); // Return type: simple return _retval; } uint32 CefV8ValueCToCpp::GetUIntValue() { - if (CEF_MEMBER_MISSING(struct_, get_uint_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_uint_value)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - uint32 _retval = struct_->get_uint_value(struct_); + uint32 _retval = _struct->get_uint_value(_struct); // Return type: simple return _retval; } double CefV8ValueCToCpp::GetDoubleValue() { - if (CEF_MEMBER_MISSING(struct_, get_double_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_double_value)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - double _retval = struct_->get_double_value(struct_); + double _retval = _struct->get_double_value(_struct); // Return type: simple return _retval; } CefTime CefV8ValueCToCpp::GetDateValue() { - if (CEF_MEMBER_MISSING(struct_, get_date_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_date_value)) return CefTime(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_time_t _retval = struct_->get_date_value(struct_); + cef_time_t _retval = _struct->get_date_value(_struct); // Return type: simple return _retval; } CefString CefV8ValueCToCpp::GetStringValue() { - if (CEF_MEMBER_MISSING(struct_, get_string_value)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string_value)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_string_value(struct_); + cef_string_userfree_t _retval = _struct->get_string_value(_struct); // Return type: string CefString _retvalStr; @@ -415,78 +434,84 @@ CefString CefV8ValueCToCpp::GetStringValue() { } bool CefV8ValueCToCpp::IsUserCreated() { - if (CEF_MEMBER_MISSING(struct_, is_user_created)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_user_created)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_user_created(struct_); + int _retval = _struct->is_user_created(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::HasException() { - if (CEF_MEMBER_MISSING(struct_, has_exception)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_exception)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_exception(struct_); + int _retval = _struct->has_exception(_struct); // Return type: bool return _retval?true:false; } CefRefPtr CefV8ValueCToCpp::GetException() { - if (CEF_MEMBER_MISSING(struct_, get_exception)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_exception)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8exception_t* _retval = struct_->get_exception(struct_); + cef_v8exception_t* _retval = _struct->get_exception(_struct); // Return type: refptr_same return CefV8ExceptionCToCpp::Wrap(_retval); } bool CefV8ValueCToCpp::ClearException() { - if (CEF_MEMBER_MISSING(struct_, clear_exception)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, clear_exception)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->clear_exception(struct_); + int _retval = _struct->clear_exception(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::WillRethrowExceptions() { - if (CEF_MEMBER_MISSING(struct_, will_rethrow_exceptions)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, will_rethrow_exceptions)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->will_rethrow_exceptions(struct_); + int _retval = _struct->will_rethrow_exceptions(_struct); // Return type: bool return _retval?true:false; } bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) { - if (CEF_MEMBER_MISSING(struct_, set_rethrow_exceptions)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_rethrow_exceptions)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_rethrow_exceptions(struct_, + int _retval = _struct->set_rethrow_exceptions(_struct, rethrow); // Return type: bool @@ -494,7 +519,8 @@ bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) { } bool CefV8ValueCToCpp::HasValue(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, has_value_bykey)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_value_bykey)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -502,7 +528,7 @@ bool CefV8ValueCToCpp::HasValue(const CefString& key) { // Unverified params: key // Execute - int _retval = struct_->has_value_bykey(struct_, + int _retval = _struct->has_value_bykey(_struct, key.GetStruct()); // Return type: bool @@ -510,7 +536,8 @@ bool CefV8ValueCToCpp::HasValue(const CefString& key) { } bool CefV8ValueCToCpp::HasValue(int index) { - if (CEF_MEMBER_MISSING(struct_, has_value_byindex)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -521,7 +548,7 @@ bool CefV8ValueCToCpp::HasValue(int index) { return false; // Execute - int _retval = struct_->has_value_byindex(struct_, + int _retval = _struct->has_value_byindex(_struct, index); // Return type: bool @@ -529,7 +556,8 @@ bool CefV8ValueCToCpp::HasValue(int index) { } bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, delete_value_bykey)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, delete_value_bykey)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -537,7 +565,7 @@ bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { // Unverified params: key // Execute - int _retval = struct_->delete_value_bykey(struct_, + int _retval = _struct->delete_value_bykey(_struct, key.GetStruct()); // Return type: bool @@ -545,7 +573,8 @@ bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { } bool CefV8ValueCToCpp::DeleteValue(int index) { - if (CEF_MEMBER_MISSING(struct_, delete_value_byindex)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, delete_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -556,7 +585,7 @@ bool CefV8ValueCToCpp::DeleteValue(int index) { return false; // Execute - int _retval = struct_->delete_value_byindex(struct_, + int _retval = _struct->delete_value_byindex(_struct, index); // Return type: bool @@ -564,7 +593,8 @@ bool CefV8ValueCToCpp::DeleteValue(int index) { } CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { - if (CEF_MEMBER_MISSING(struct_, get_value_bykey)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value_bykey)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -572,7 +602,7 @@ CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { // Unverified params: key // Execute - cef_v8value_t* _retval = struct_->get_value_bykey(struct_, + cef_v8value_t* _retval = _struct->get_value_bykey(_struct, key.GetStruct()); // Return type: refptr_same @@ -580,7 +610,8 @@ CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { } CefRefPtr CefV8ValueCToCpp::GetValue(int index) { - if (CEF_MEMBER_MISSING(struct_, get_value_byindex)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value_byindex)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -591,7 +622,7 @@ CefRefPtr CefV8ValueCToCpp::GetValue(int index) { return NULL; // Execute - cef_v8value_t* _retval = struct_->get_value_byindex(struct_, + cef_v8value_t* _retval = _struct->get_value_byindex(_struct, index); // Return type: refptr_same @@ -600,7 +631,8 @@ CefRefPtr CefV8ValueCToCpp::GetValue(int index) { bool CefV8ValueCToCpp::SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) { - if (CEF_MEMBER_MISSING(struct_, set_value_bykey)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value_bykey)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -612,7 +644,7 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, // Unverified params: key // Execute - int _retval = struct_->set_value_bykey(struct_, + int _retval = _struct->set_value_bykey(_struct, key.GetStruct(), CefV8ValueCToCpp::Unwrap(value), attribute); @@ -622,7 +654,8 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, } bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_value_byindex)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -637,7 +670,7 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { return false; // Execute - int _retval = struct_->set_value_byindex(struct_, + int _retval = _struct->set_value_byindex(_struct, index, CefV8ValueCToCpp::Unwrap(value)); @@ -647,7 +680,8 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) { - if (CEF_MEMBER_MISSING(struct_, set_value_byaccessor)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_value_byaccessor)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -655,7 +689,7 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, // Unverified params: key // Execute - int _retval = struct_->set_value_byaccessor(struct_, + int _retval = _struct->set_value_byaccessor(_struct, key.GetStruct(), settings, attribute); @@ -665,7 +699,8 @@ bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, } bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { - if (CEF_MEMBER_MISSING(struct_, get_keys)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_keys)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -677,7 +712,7 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { transfer_string_list_contents(keys, keysList); // Execute - int _retval = struct_->get_keys(struct_, + int _retval = _struct->get_keys(_struct, keysList); // Restore param:keys; type: string_vec_byref @@ -692,7 +727,8 @@ bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { } bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { - if (CEF_MEMBER_MISSING(struct_, set_user_data)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_user_data)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -700,7 +736,7 @@ bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { // Unverified params: user_data // Execute - int _retval = struct_->set_user_data(struct_, + int _retval = _struct->set_user_data(_struct, CefBaseCppToC::Wrap(user_data)); // Return type: bool @@ -708,39 +744,42 @@ bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { } CefRefPtr CefV8ValueCToCpp::GetUserData() { - if (CEF_MEMBER_MISSING(struct_, get_user_data)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_user_data)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_base_t* _retval = struct_->get_user_data(struct_); + cef_base_t* _retval = _struct->get_user_data(_struct); // Return type: refptr_diff return CefBaseCppToC::Unwrap(_retval); } int CefV8ValueCToCpp::GetExternallyAllocatedMemory() { - if (CEF_MEMBER_MISSING(struct_, get_externally_allocated_memory)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_externally_allocated_memory)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_externally_allocated_memory(struct_); + int _retval = _struct->get_externally_allocated_memory(_struct); // Return type: simple return _retval; } int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) { - if (CEF_MEMBER_MISSING(struct_, adjust_externally_allocated_memory)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, adjust_externally_allocated_memory)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->adjust_externally_allocated_memory(struct_, + int _retval = _struct->adjust_externally_allocated_memory(_struct, change_in_bytes); // Return type: simple @@ -748,26 +787,28 @@ int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) { } int CefV8ValueCToCpp::GetArrayLength() { - if (CEF_MEMBER_MISSING(struct_, get_array_length)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_array_length)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_array_length(struct_); + int _retval = _struct->get_array_length(_struct); // Return type: simple return _retval; } CefString CefV8ValueCToCpp::GetFunctionName() { - if (CEF_MEMBER_MISSING(struct_, get_function_name)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_function_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_function_name(struct_); + cef_string_userfree_t _retval = _struct->get_function_name(_struct); // Return type: string CefString _retvalStr; @@ -776,13 +817,14 @@ CefString CefV8ValueCToCpp::GetFunctionName() { } CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { - if (CEF_MEMBER_MISSING(struct_, get_function_handler)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_function_handler)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_v8handler_t* _retval = struct_->get_function_handler(struct_); + cef_v8handler_t* _retval = _struct->get_function_handler(_struct); // Return type: refptr_diff return CefV8HandlerCppToC::Unwrap(_retval); @@ -790,7 +832,8 @@ CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { CefRefPtr CefV8ValueCToCpp::ExecuteFunction( CefRefPtr object, const CefV8ValueList& arguments) { - if (CEF_MEMBER_MISSING(struct_, execute_function)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, execute_function)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -811,7 +854,7 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunction( } // Execute - cef_v8value_t* _retval = struct_->execute_function(struct_, + cef_v8value_t* _retval = _struct->execute_function(_struct, CefV8ValueCToCpp::Unwrap(object), argumentsCount, argumentsList); @@ -827,7 +870,8 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunction( CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments) { - if (CEF_MEMBER_MISSING(struct_, execute_function_with_context)) + cef_v8value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, execute_function_with_context)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -852,7 +896,7 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( } // Execute - cef_v8value_t* _retval = struct_->execute_function_with_context(struct_, + cef_v8value_t* _retval = _struct->execute_function_with_context(_struct, CefV8ContextCToCpp::Unwrap(context), CefV8ValueCToCpp::Unwrap(object), argumentsCount, @@ -867,8 +911,21 @@ CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( } +// CONSTRUCTOR - Do not edit by hand. + +CefV8ValueCToCpp::CefV8ValueCToCpp() { +} + +template<> cef_v8value_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefV8Value* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_V8VALUE; diff --git a/libcef_dll/ctocpp/v8value_ctocpp.h b/libcef_dll/ctocpp/v8value_ctocpp.h index 9101bf9e0..7a8409ccf 100644 --- a/libcef_dll/ctocpp/v8value_ctocpp.h +++ b/libcef_dll/ctocpp/v8value_ctocpp.h @@ -28,61 +28,59 @@ class CefV8ValueCToCpp : public CefCToCpp { public: - explicit CefV8ValueCToCpp(cef_v8value_t* str) - : CefCToCpp(str) {} + CefV8ValueCToCpp(); - // CefV8Value methods - virtual bool IsValid() OVERRIDE; - virtual bool IsUndefined() OVERRIDE; - virtual bool IsNull() OVERRIDE; - virtual bool IsBool() OVERRIDE; - virtual bool IsInt() OVERRIDE; - virtual bool IsUInt() OVERRIDE; - virtual bool IsDouble() OVERRIDE; - virtual bool IsDate() OVERRIDE; - virtual bool IsString() OVERRIDE; - virtual bool IsObject() OVERRIDE; - virtual bool IsArray() OVERRIDE; - virtual bool IsFunction() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool GetBoolValue() OVERRIDE; - virtual int32 GetIntValue() OVERRIDE; - virtual uint32 GetUIntValue() OVERRIDE; - virtual double GetDoubleValue() OVERRIDE; - virtual CefTime GetDateValue() OVERRIDE; - virtual CefString GetStringValue() OVERRIDE; - virtual bool IsUserCreated() OVERRIDE; - virtual bool HasException() OVERRIDE; - virtual CefRefPtr GetException() OVERRIDE; - virtual bool ClearException() OVERRIDE; - virtual bool WillRethrowExceptions() OVERRIDE; - virtual bool SetRethrowExceptions(bool rethrow) OVERRIDE; - virtual bool HasValue(const CefString& key) OVERRIDE; - virtual bool HasValue(int index) OVERRIDE; - virtual bool DeleteValue(const CefString& key) OVERRIDE; - virtual bool DeleteValue(int index) OVERRIDE; - virtual CefRefPtr GetValue(const CefString& key) OVERRIDE; - virtual CefRefPtr GetValue(int index) OVERRIDE; - virtual bool SetValue(const CefString& key, CefRefPtr value, + // CefV8Value methods. + bool IsValid() OVERRIDE; + bool IsUndefined() OVERRIDE; + bool IsNull() OVERRIDE; + bool IsBool() OVERRIDE; + bool IsInt() OVERRIDE; + bool IsUInt() OVERRIDE; + bool IsDouble() OVERRIDE; + bool IsDate() OVERRIDE; + bool IsString() OVERRIDE; + bool IsObject() OVERRIDE; + bool IsArray() OVERRIDE; + bool IsFunction() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool GetBoolValue() OVERRIDE; + int32 GetIntValue() OVERRIDE; + uint32 GetUIntValue() OVERRIDE; + double GetDoubleValue() OVERRIDE; + CefTime GetDateValue() OVERRIDE; + CefString GetStringValue() OVERRIDE; + bool IsUserCreated() OVERRIDE; + bool HasException() OVERRIDE; + CefRefPtr GetException() OVERRIDE; + bool ClearException() OVERRIDE; + bool WillRethrowExceptions() OVERRIDE; + bool SetRethrowExceptions(bool rethrow) OVERRIDE; + bool HasValue(const CefString& key) OVERRIDE; + bool HasValue(int index) OVERRIDE; + bool DeleteValue(const CefString& key) OVERRIDE; + bool DeleteValue(int index) OVERRIDE; + CefRefPtr GetValue(const CefString& key) OVERRIDE; + CefRefPtr GetValue(int index) OVERRIDE; + bool SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) OVERRIDE; - virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; - virtual bool SetValue(const CefString& key, AccessControl settings, + bool SetValue(int index, CefRefPtr value) OVERRIDE; + bool SetValue(const CefString& key, AccessControl settings, PropertyAttribute attribute) OVERRIDE; - virtual bool GetKeys(std::vector& keys) OVERRIDE; - virtual bool SetUserData(CefRefPtr user_data) OVERRIDE; - virtual CefRefPtr GetUserData() OVERRIDE; - virtual int GetExternallyAllocatedMemory() OVERRIDE; - virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE; - virtual int GetArrayLength() OVERRIDE; - virtual CefString GetFunctionName() OVERRIDE; - virtual CefRefPtr GetFunctionHandler() OVERRIDE; - virtual CefRefPtr ExecuteFunction(CefRefPtr object, + bool GetKeys(std::vector& keys) OVERRIDE; + bool SetUserData(CefRefPtr user_data) OVERRIDE; + CefRefPtr GetUserData() OVERRIDE; + int GetExternallyAllocatedMemory() OVERRIDE; + int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE; + int GetArrayLength() OVERRIDE; + CefString GetFunctionName() OVERRIDE; + CefRefPtr GetFunctionHandler() OVERRIDE; + CefRefPtr ExecuteFunction(CefRefPtr object, const CefV8ValueList& arguments) OVERRIDE; - virtual CefRefPtr ExecuteFunctionWithContext( + CefRefPtr ExecuteFunctionWithContext( CefRefPtr context, CefRefPtr object, const CefV8ValueList& arguments) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/value_ctocpp.cc b/libcef_dll/ctocpp/value_ctocpp.cc index c72be05ef..6443fde28 100644 --- a/libcef_dll/ctocpp/value_ctocpp.cc +++ b/libcef_dll/ctocpp/value_ctocpp.cc @@ -32,46 +32,50 @@ CefRefPtr CefValue::Create() { // VIRTUAL METHODS - Body may be edited by hand. bool CefValueCToCpp::IsValid() { - if (CEF_MEMBER_MISSING(struct_, is_valid)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_valid)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_valid(struct_); + int _retval = _struct->is_valid(_struct); // Return type: bool return _retval?true:false; } bool CefValueCToCpp::IsOwned() { - if (CEF_MEMBER_MISSING(struct_, is_owned)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_owned)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_owned(struct_); + int _retval = _struct->is_owned(_struct); // Return type: bool return _retval?true:false; } bool CefValueCToCpp::IsReadOnly() { - if (CEF_MEMBER_MISSING(struct_, is_read_only)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_read_only)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_read_only(struct_); + int _retval = _struct->is_read_only(_struct); // Return type: bool return _retval?true:false; } bool CefValueCToCpp::IsSame(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_same)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_same)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -82,7 +86,7 @@ bool CefValueCToCpp::IsSame(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_same(struct_, + int _retval = _struct->is_same(_struct, CefValueCToCpp::Unwrap(that)); // Return type: bool @@ -90,7 +94,8 @@ bool CefValueCToCpp::IsSame(CefRefPtr that) { } bool CefValueCToCpp::IsEqual(CefRefPtr that) { - if (CEF_MEMBER_MISSING(struct_, is_equal)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_equal)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -101,7 +106,7 @@ bool CefValueCToCpp::IsEqual(CefRefPtr that) { return false; // Execute - int _retval = struct_->is_equal(struct_, + int _retval = _struct->is_equal(_struct, CefValueCToCpp::Unwrap(that)); // Return type: bool @@ -109,78 +114,84 @@ bool CefValueCToCpp::IsEqual(CefRefPtr that) { } CefRefPtr CefValueCToCpp::Copy() { - if (CEF_MEMBER_MISSING(struct_, copy)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, copy)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_value_t* _retval = struct_->copy(struct_); + cef_value_t* _retval = _struct->copy(_struct); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); } CefValueType CefValueCToCpp::GetType() { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return VTYPE_INVALID; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_value_type_t _retval = struct_->get_type(struct_); + cef_value_type_t _retval = _struct->get_type(_struct); // Return type: simple return _retval; } bool CefValueCToCpp::GetBool() { - if (CEF_MEMBER_MISSING(struct_, get_bool)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_bool(struct_); + int _retval = _struct->get_bool(_struct); // Return type: bool return _retval?true:false; } int CefValueCToCpp::GetInt() { - if (CEF_MEMBER_MISSING(struct_, get_int)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_int)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_int(struct_); + int _retval = _struct->get_int(_struct); // Return type: simple return _retval; } double CefValueCToCpp::GetDouble() { - if (CEF_MEMBER_MISSING(struct_, get_double)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_double)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - double _retval = struct_->get_double(struct_); + double _retval = _struct->get_double(_struct); // Return type: simple return _retval; } CefString CefValueCToCpp::GetString() { - if (CEF_MEMBER_MISSING(struct_, get_string)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_string)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_string(struct_); + cef_string_userfree_t _retval = _struct->get_string(_struct); // Return type: string CefString _retvalStr; @@ -189,65 +200,70 @@ CefString CefValueCToCpp::GetString() { } CefRefPtr CefValueCToCpp::GetBinary() { - if (CEF_MEMBER_MISSING(struct_, get_binary)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_binary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_binary_value_t* _retval = struct_->get_binary(struct_); + cef_binary_value_t* _retval = _struct->get_binary(_struct); // Return type: refptr_same return CefBinaryValueCToCpp::Wrap(_retval); } CefRefPtr CefValueCToCpp::GetDictionary() { - if (CEF_MEMBER_MISSING(struct_, get_dictionary)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_dictionary)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_); + cef_dictionary_value_t* _retval = _struct->get_dictionary(_struct); // Return type: refptr_same return CefDictionaryValueCToCpp::Wrap(_retval); } CefRefPtr CefValueCToCpp::GetList() { - if (CEF_MEMBER_MISSING(struct_, get_list)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_list)) return NULL; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_list_value_t* _retval = struct_->get_list(struct_); + cef_list_value_t* _retval = _struct->get_list(_struct); // Return type: refptr_same return CefListValueCToCpp::Wrap(_retval); } bool CefValueCToCpp::SetNull() { - if (CEF_MEMBER_MISSING(struct_, set_null)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_null)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_null(struct_); + int _retval = _struct->set_null(_struct); // Return type: bool return _retval?true:false; } bool CefValueCToCpp::SetBool(bool value) { - if (CEF_MEMBER_MISSING(struct_, set_bool)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_bool)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_bool(struct_, + int _retval = _struct->set_bool(_struct, value); // Return type: bool @@ -255,13 +271,14 @@ bool CefValueCToCpp::SetBool(bool value) { } bool CefValueCToCpp::SetInt(int value) { - if (CEF_MEMBER_MISSING(struct_, set_int)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_int)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_int(struct_, + int _retval = _struct->set_int(_struct, value); // Return type: bool @@ -269,13 +286,14 @@ bool CefValueCToCpp::SetInt(int value) { } bool CefValueCToCpp::SetDouble(double value) { - if (CEF_MEMBER_MISSING(struct_, set_double)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_double)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->set_double(struct_, + int _retval = _struct->set_double(_struct, value); // Return type: bool @@ -283,7 +301,8 @@ bool CefValueCToCpp::SetDouble(double value) { } bool CefValueCToCpp::SetString(const CefString& value) { - if (CEF_MEMBER_MISSING(struct_, set_string)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_string)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -291,7 +310,7 @@ bool CefValueCToCpp::SetString(const CefString& value) { // Unverified params: value // Execute - int _retval = struct_->set_string(struct_, + int _retval = _struct->set_string(_struct, value.GetStruct()); // Return type: bool @@ -299,7 +318,8 @@ bool CefValueCToCpp::SetString(const CefString& value) { } bool CefValueCToCpp::SetBinary(CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_binary)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_binary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -310,7 +330,7 @@ bool CefValueCToCpp::SetBinary(CefRefPtr value) { return false; // Execute - int _retval = struct_->set_binary(struct_, + int _retval = _struct->set_binary(_struct, CefBinaryValueCToCpp::Unwrap(value)); // Return type: bool @@ -318,7 +338,8 @@ bool CefValueCToCpp::SetBinary(CefRefPtr value) { } bool CefValueCToCpp::SetDictionary(CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_dictionary)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_dictionary)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -329,7 +350,7 @@ bool CefValueCToCpp::SetDictionary(CefRefPtr value) { return false; // Execute - int _retval = struct_->set_dictionary(struct_, + int _retval = _struct->set_dictionary(_struct, CefDictionaryValueCToCpp::Unwrap(value)); // Return type: bool @@ -337,7 +358,8 @@ bool CefValueCToCpp::SetDictionary(CefRefPtr value) { } bool CefValueCToCpp::SetList(CefRefPtr value) { - if (CEF_MEMBER_MISSING(struct_, set_list)) + cef_value_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, set_list)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -348,7 +370,7 @@ bool CefValueCToCpp::SetList(CefRefPtr value) { return false; // Execute - int _retval = struct_->set_list(struct_, + int _retval = _struct->set_list(_struct, CefListValueCToCpp::Unwrap(value)); // Return type: bool @@ -356,8 +378,21 @@ bool CefValueCToCpp::SetList(CefRefPtr value) { } +// CONSTRUCTOR - Do not edit by hand. + +CefValueCToCpp::CefValueCToCpp() { +} + +template<> cef_value_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefValue* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_VALUE; diff --git a/libcef_dll/ctocpp/value_ctocpp.h b/libcef_dll/ctocpp/value_ctocpp.h index b597150dd..248de0386 100644 --- a/libcef_dll/ctocpp/value_ctocpp.h +++ b/libcef_dll/ctocpp/value_ctocpp.h @@ -27,34 +27,32 @@ class CefValueCToCpp : public CefCToCpp { public: - explicit CefValueCToCpp(cef_value_t* str) - : CefCToCpp(str) {} + CefValueCToCpp(); - // CefValue methods - virtual bool IsValid() OVERRIDE; - virtual bool IsOwned() OVERRIDE; - virtual bool IsReadOnly() OVERRIDE; - virtual bool IsSame(CefRefPtr that) OVERRIDE; - virtual bool IsEqual(CefRefPtr that) OVERRIDE; - virtual CefRefPtr Copy() OVERRIDE; - virtual CefValueType GetType() OVERRIDE; - virtual bool GetBool() OVERRIDE; - virtual int GetInt() OVERRIDE; - virtual double GetDouble() OVERRIDE; - virtual CefString GetString() OVERRIDE; - virtual CefRefPtr GetBinary() OVERRIDE; - virtual CefRefPtr GetDictionary() OVERRIDE; - virtual CefRefPtr GetList() OVERRIDE; - virtual bool SetNull() OVERRIDE; - virtual bool SetBool(bool value) OVERRIDE; - virtual bool SetInt(int value) OVERRIDE; - virtual bool SetDouble(double value) OVERRIDE; - virtual bool SetString(const CefString& value) OVERRIDE; - virtual bool SetBinary(CefRefPtr value) OVERRIDE; - virtual bool SetDictionary(CefRefPtr value) OVERRIDE; - virtual bool SetList(CefRefPtr value) OVERRIDE; + // CefValue methods. + bool IsValid() OVERRIDE; + bool IsOwned() OVERRIDE; + bool IsReadOnly() OVERRIDE; + bool IsSame(CefRefPtr that) OVERRIDE; + bool IsEqual(CefRefPtr that) OVERRIDE; + CefRefPtr Copy() OVERRIDE; + CefValueType GetType() OVERRIDE; + bool GetBool() OVERRIDE; + int GetInt() OVERRIDE; + double GetDouble() OVERRIDE; + CefString GetString() OVERRIDE; + CefRefPtr GetBinary() OVERRIDE; + CefRefPtr GetDictionary() OVERRIDE; + CefRefPtr GetList() OVERRIDE; + bool SetNull() OVERRIDE; + bool SetBool(bool value) OVERRIDE; + bool SetInt(int value) OVERRIDE; + bool SetDouble(double value) OVERRIDE; + bool SetString(const CefString& value) OVERRIDE; + bool SetBinary(CefRefPtr value) OVERRIDE; + bool SetDictionary(CefRefPtr value) OVERRIDE; + bool SetList(CefRefPtr value) OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_VALUE_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc index d693125d3..6a1213367 100644 --- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc @@ -16,13 +16,14 @@ // VIRTUAL METHODS - Body may be edited by hand. CefString CefWebPluginInfoCToCpp::GetName() { - if (CEF_MEMBER_MISSING(struct_, get_name)) + cef_web_plugin_info_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_name(struct_); + cef_string_userfree_t _retval = _struct->get_name(_struct); // Return type: string CefString _retvalStr; @@ -31,13 +32,14 @@ CefString CefWebPluginInfoCToCpp::GetName() { } CefString CefWebPluginInfoCToCpp::GetPath() { - if (CEF_MEMBER_MISSING(struct_, get_path)) + cef_web_plugin_info_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_path)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_path(struct_); + cef_string_userfree_t _retval = _struct->get_path(_struct); // Return type: string CefString _retvalStr; @@ -46,13 +48,14 @@ CefString CefWebPluginInfoCToCpp::GetPath() { } CefString CefWebPluginInfoCToCpp::GetVersion() { - if (CEF_MEMBER_MISSING(struct_, get_version)) + cef_web_plugin_info_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_version)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_version(struct_); + cef_string_userfree_t _retval = _struct->get_version(_struct); // Return type: string CefString _retvalStr; @@ -61,13 +64,14 @@ CefString CefWebPluginInfoCToCpp::GetVersion() { } CefString CefWebPluginInfoCToCpp::GetDescription() { - if (CEF_MEMBER_MISSING(struct_, get_description)) + cef_web_plugin_info_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_description)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_description(struct_); + cef_string_userfree_t _retval = _struct->get_description(_struct); // Return type: string CefString _retvalStr; @@ -76,8 +80,22 @@ CefString CefWebPluginInfoCToCpp::GetDescription() { } +// CONSTRUCTOR - Do not edit by hand. + +CefWebPluginInfoCToCpp::CefWebPluginInfoCToCpp() { +} + +template<> cef_web_plugin_info_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefWebPluginInfo* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_WEB_PLUGIN_INFO; diff --git a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h index 1d12cfb6f..a1ff1f94c 100644 --- a/libcef_dll/ctocpp/web_plugin_info_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_info_ctocpp.h @@ -28,17 +28,14 @@ class CefWebPluginInfoCToCpp : public CefCToCpp { public: - explicit CefWebPluginInfoCToCpp(cef_web_plugin_info_t* str) - : CefCToCpp(str) {} + CefWebPluginInfoCToCpp(); - // CefWebPluginInfo methods - virtual CefString GetName() OVERRIDE; - virtual CefString GetPath() OVERRIDE; - virtual CefString GetVersion() OVERRIDE; - virtual CefString GetDescription() OVERRIDE; + // CefWebPluginInfo methods. + CefString GetName() OVERRIDE; + CefString GetPath() OVERRIDE; + CefString GetVersion() OVERRIDE; + CefString GetDescription() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc index 011691d92..d97439a63 100644 --- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.cc @@ -18,7 +18,8 @@ bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info, int count, int total) { - if (CEF_MEMBER_MISSING(struct_, visit)) + cef_web_plugin_info_visitor_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, visit)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -29,7 +30,7 @@ bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info, return false; // Execute - int _retval = struct_->visit(struct_, + int _retval = _struct->visit(_struct, CefWebPluginInfoCppToC::Wrap(info), count, total); @@ -39,8 +40,23 @@ bool CefWebPluginInfoVisitorCToCpp::Visit(CefRefPtr info, } +// CONSTRUCTOR - Do not edit by hand. + +CefWebPluginInfoVisitorCToCpp::CefWebPluginInfoVisitorCToCpp() { +} + +template<> cef_web_plugin_info_visitor_t* CefCToCpp::UnwrapDerived( + CefWrapperType type, CefWebPluginInfoVisitor* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_WEB_PLUGIN_INFO_VISITOR; diff --git a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h index f96165726..83a6fd074 100644 --- a/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_info_visitor_ctocpp.h @@ -28,14 +28,11 @@ class CefWebPluginInfoVisitorCToCpp : public CefCToCpp { public: - explicit CefWebPluginInfoVisitorCToCpp(cef_web_plugin_info_visitor_t* str) - : CefCToCpp(str) {} + CefWebPluginInfoVisitorCToCpp(); - // CefWebPluginInfoVisitor methods + // CefWebPluginInfoVisitor methods. bool Visit(CefRefPtr info, int count, int total) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_VISITOR_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc index 179141fae..d63870957 100644 --- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc +++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.cc @@ -17,7 +17,8 @@ void CefWebPluginUnstableCallbackCToCpp::IsUnstable(const CefString& path, bool unstable) { - if (CEF_MEMBER_MISSING(struct_, is_unstable)) + cef_web_plugin_unstable_callback_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_unstable)) return; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -28,15 +29,32 @@ void CefWebPluginUnstableCallbackCToCpp::IsUnstable(const CefString& path, return; // Execute - struct_->is_unstable(struct_, + _struct->is_unstable(_struct, path.GetStruct(), unstable); } +// CONSTRUCTOR - Do not edit by hand. + +CefWebPluginUnstableCallbackCToCpp::CefWebPluginUnstableCallbackCToCpp() { +} + +template<> cef_web_plugin_unstable_callback_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefWebPluginUnstableCallback* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = + WT_WEB_PLUGIN_UNSTABLE_CALLBACK; diff --git a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h index 256e28dcd..767ad1c95 100644 --- a/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h +++ b/libcef_dll/ctocpp/web_plugin_unstable_callback_ctocpp.h @@ -28,16 +28,11 @@ class CefWebPluginUnstableCallbackCToCpp : public CefCToCpp { public: - explicit CefWebPluginUnstableCallbackCToCpp( - cef_web_plugin_unstable_callback_t* str) - : CefCToCpp( - str) {} + CefWebPluginUnstableCallbackCToCpp(); - // CefWebPluginUnstableCallback methods + // CefWebPluginUnstableCallback methods. void IsUnstable(const CefString& path, bool unstable) override; }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_UNSTABLE_CALLBACK_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.cc b/libcef_dll/ctocpp/write_handler_ctocpp.cc index 074c7b885..f143f23ba 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.cc +++ b/libcef_dll/ctocpp/write_handler_ctocpp.cc @@ -16,7 +16,8 @@ // VIRTUAL METHODS - Body may be edited by hand. size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { - if (CEF_MEMBER_MISSING(struct_, write)) + cef_write_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, write)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -27,7 +28,7 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { return 0; // Execute - size_t _retval = struct_->write(struct_, + size_t _retval = _struct->write(_struct, ptr, size, n); @@ -37,13 +38,14 @@ size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n) { } int CefWriteHandlerCToCpp::Seek(int64 offset, int whence) { - if (CEF_MEMBER_MISSING(struct_, seek)) + cef_write_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, seek)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->seek(struct_, + int _retval = _struct->seek(_struct, offset, whence); @@ -52,47 +54,64 @@ int CefWriteHandlerCToCpp::Seek(int64 offset, int whence) { } int64 CefWriteHandlerCToCpp::Tell() { - if (CEF_MEMBER_MISSING(struct_, tell)) + cef_write_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->tell(struct_); + int64 _retval = _struct->tell(_struct); // Return type: simple return _retval; } int CefWriteHandlerCToCpp::Flush() { - if (CEF_MEMBER_MISSING(struct_, flush)) + cef_write_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, flush)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->flush(struct_); + int _retval = _struct->flush(_struct); // Return type: simple return _retval; } bool CefWriteHandlerCToCpp::MayBlock() { - if (CEF_MEMBER_MISSING(struct_, may_block)) + cef_write_handler_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, may_block)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->may_block(struct_); + int _retval = _struct->may_block(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefWriteHandlerCToCpp::CefWriteHandlerCToCpp() { +} + +template<> cef_write_handler_t* CefCToCpp::UnwrapDerived(CefWrapperType type, + CefWriteHandler* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_WRITE_HANDLER; diff --git a/libcef_dll/ctocpp/write_handler_ctocpp.h b/libcef_dll/ctocpp/write_handler_ctocpp.h index 84d35bfe3..e4ce54930 100644 --- a/libcef_dll/ctocpp/write_handler_ctocpp.h +++ b/libcef_dll/ctocpp/write_handler_ctocpp.h @@ -28,11 +28,9 @@ class CefWriteHandlerCToCpp : public CefCToCpp { public: - explicit CefWriteHandlerCToCpp(cef_write_handler_t* str) - : CefCToCpp( - str) {} + CefWriteHandlerCToCpp(); - // CefWriteHandler methods + // CefWriteHandler methods. size_t Write(const void* ptr, size_t size, size_t n) override; int Seek(int64 offset, int whence) override; int64 Tell() override; @@ -42,4 +40,3 @@ class CefWriteHandlerCToCpp #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_WRITE_HANDLER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/libcef_dll/ctocpp/xml_reader_ctocpp.cc index 248775da3..c3483a484 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -43,52 +43,56 @@ CefRefPtr CefXmlReader::Create(CefRefPtr stream, // VIRTUAL METHODS - Body may be edited by hand. bool CefXmlReaderCToCpp::MoveToNextNode() { - if (CEF_MEMBER_MISSING(struct_, move_to_next_node)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_next_node)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_next_node(struct_); + int _retval = _struct->move_to_next_node(_struct); // Return type: bool return _retval?true:false; } bool CefXmlReaderCToCpp::Close() { - if (CEF_MEMBER_MISSING(struct_, close)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, close)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->close(struct_); + int _retval = _struct->close(_struct); // Return type: bool return _retval?true:false; } bool CefXmlReaderCToCpp::HasError() { - if (CEF_MEMBER_MISSING(struct_, has_error)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_error)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_error(struct_); + int _retval = _struct->has_error(_struct); // Return type: bool return _retval?true:false; } CefString CefXmlReaderCToCpp::GetError() { - if (CEF_MEMBER_MISSING(struct_, get_error)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_error)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_error(struct_); + cef_string_userfree_t _retval = _struct->get_error(_struct); // Return type: string CefString _retvalStr; @@ -97,39 +101,42 @@ CefString CefXmlReaderCToCpp::GetError() { } CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() { - if (CEF_MEMBER_MISSING(struct_, get_type)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_type)) return XML_NODE_UNSUPPORTED; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_xml_node_type_t _retval = struct_->get_type(struct_); + cef_xml_node_type_t _retval = _struct->get_type(_struct); // Return type: simple return _retval; } int CefXmlReaderCToCpp::GetDepth() { - if (CEF_MEMBER_MISSING(struct_, get_depth)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_depth)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_depth(struct_); + int _retval = _struct->get_depth(_struct); // Return type: simple return _retval; } CefString CefXmlReaderCToCpp::GetLocalName() { - if (CEF_MEMBER_MISSING(struct_, get_local_name)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_local_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_local_name(struct_); + cef_string_userfree_t _retval = _struct->get_local_name(_struct); // Return type: string CefString _retvalStr; @@ -138,13 +145,14 @@ CefString CefXmlReaderCToCpp::GetLocalName() { } CefString CefXmlReaderCToCpp::GetPrefix() { - if (CEF_MEMBER_MISSING(struct_, get_prefix)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_prefix)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_prefix(struct_); + cef_string_userfree_t _retval = _struct->get_prefix(_struct); // Return type: string CefString _retvalStr; @@ -153,13 +161,14 @@ CefString CefXmlReaderCToCpp::GetPrefix() { } CefString CefXmlReaderCToCpp::GetQualifiedName() { - if (CEF_MEMBER_MISSING(struct_, get_qualified_name)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_qualified_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_qualified_name(struct_); + cef_string_userfree_t _retval = _struct->get_qualified_name(_struct); // Return type: string CefString _retvalStr; @@ -168,13 +177,14 @@ CefString CefXmlReaderCToCpp::GetQualifiedName() { } CefString CefXmlReaderCToCpp::GetNamespaceURI() { - if (CEF_MEMBER_MISSING(struct_, get_namespace_uri)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_namespace_uri)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_namespace_uri(struct_); + cef_string_userfree_t _retval = _struct->get_namespace_uri(_struct); // Return type: string CefString _retvalStr; @@ -183,13 +193,14 @@ CefString CefXmlReaderCToCpp::GetNamespaceURI() { } CefString CefXmlReaderCToCpp::GetBaseURI() { - if (CEF_MEMBER_MISSING(struct_, get_base_uri)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_base_uri)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_base_uri(struct_); + cef_string_userfree_t _retval = _struct->get_base_uri(_struct); // Return type: string CefString _retvalStr; @@ -198,13 +209,14 @@ CefString CefXmlReaderCToCpp::GetBaseURI() { } CefString CefXmlReaderCToCpp::GetXmlLang() { - if (CEF_MEMBER_MISSING(struct_, get_xml_lang)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_xml_lang)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_xml_lang(struct_); + cef_string_userfree_t _retval = _struct->get_xml_lang(_struct); // Return type: string CefString _retvalStr; @@ -213,39 +225,42 @@ CefString CefXmlReaderCToCpp::GetXmlLang() { } bool CefXmlReaderCToCpp::IsEmptyElement() { - if (CEF_MEMBER_MISSING(struct_, is_empty_element)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, is_empty_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->is_empty_element(struct_); + int _retval = _struct->is_empty_element(_struct); // Return type: bool return _retval?true:false; } bool CefXmlReaderCToCpp::HasValue() { - if (CEF_MEMBER_MISSING(struct_, has_value)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_value)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_value(struct_); + int _retval = _struct->has_value(_struct); // Return type: bool return _retval?true:false; } CefString CefXmlReaderCToCpp::GetValue() { - if (CEF_MEMBER_MISSING(struct_, get_value)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_value)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_value(struct_); + cef_string_userfree_t _retval = _struct->get_value(_struct); // Return type: string CefString _retvalStr; @@ -254,33 +269,36 @@ CefString CefXmlReaderCToCpp::GetValue() { } bool CefXmlReaderCToCpp::HasAttributes() { - if (CEF_MEMBER_MISSING(struct_, has_attributes)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, has_attributes)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->has_attributes(struct_); + int _retval = _struct->has_attributes(_struct); // Return type: bool return _retval?true:false; } size_t CefXmlReaderCToCpp::GetAttributeCount() { - if (CEF_MEMBER_MISSING(struct_, get_attribute_count)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_attribute_count)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - size_t _retval = struct_->get_attribute_count(struct_); + size_t _retval = _struct->get_attribute_count(_struct); // Return type: simple return _retval; } CefString CefXmlReaderCToCpp::GetAttribute(int index) { - if (CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_attribute_byindex)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -291,7 +309,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(int index) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_attribute_byindex(struct_, + cef_string_userfree_t _retval = _struct->get_attribute_byindex(_struct, index); // Return type: string @@ -301,7 +319,8 @@ CefString CefXmlReaderCToCpp::GetAttribute(int index) { } CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { - if (CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_attribute_byqname)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -312,7 +331,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_attribute_byqname(struct_, + cef_string_userfree_t _retval = _struct->get_attribute_byqname(_struct, qualifiedName.GetStruct()); // Return type: string @@ -323,7 +342,8 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, const CefString& namespaceURI) { - if (CEF_MEMBER_MISSING(struct_, get_attribute_bylname)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_attribute_bylname)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -338,7 +358,7 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, return CefString(); // Execute - cef_string_userfree_t _retval = struct_->get_attribute_bylname(struct_, + cef_string_userfree_t _retval = _struct->get_attribute_bylname(_struct, localName.GetStruct(), namespaceURI.GetStruct()); @@ -349,13 +369,14 @@ CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, } CefString CefXmlReaderCToCpp::GetInnerXml() { - if (CEF_MEMBER_MISSING(struct_, get_inner_xml)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_inner_xml)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_inner_xml(struct_); + cef_string_userfree_t _retval = _struct->get_inner_xml(_struct); // Return type: string CefString _retvalStr; @@ -364,13 +385,14 @@ CefString CefXmlReaderCToCpp::GetInnerXml() { } CefString CefXmlReaderCToCpp::GetOuterXml() { - if (CEF_MEMBER_MISSING(struct_, get_outer_xml)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_outer_xml)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_outer_xml(struct_); + cef_string_userfree_t _retval = _struct->get_outer_xml(_struct); // Return type: string CefString _retvalStr; @@ -379,20 +401,22 @@ CefString CefXmlReaderCToCpp::GetOuterXml() { } int CefXmlReaderCToCpp::GetLineNumber() { - if (CEF_MEMBER_MISSING(struct_, get_line_number)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_line_number)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->get_line_number(struct_); + int _retval = _struct->get_line_number(_struct); // Return type: simple return _retval; } bool CefXmlReaderCToCpp::MoveToAttribute(int index) { - if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_attribute_byindex)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -403,7 +427,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(int index) { return false; // Execute - int _retval = struct_->move_to_attribute_byindex(struct_, + int _retval = _struct->move_to_attribute_byindex(_struct, index); // Return type: bool @@ -411,7 +435,8 @@ bool CefXmlReaderCToCpp::MoveToAttribute(int index) { } bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { - if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_attribute_byqname)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -422,7 +447,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { return false; // Execute - int _retval = struct_->move_to_attribute_byqname(struct_, + int _retval = _struct->move_to_attribute_byqname(_struct, qualifiedName.GetStruct()); // Return type: bool @@ -431,7 +456,8 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, const CefString& namespaceURI) { - if (CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_attribute_bylname)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -446,7 +472,7 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, return false; // Execute - int _retval = struct_->move_to_attribute_bylname(struct_, + int _retval = _struct->move_to_attribute_bylname(_struct, localName.GetStruct(), namespaceURI.GetStruct()); @@ -455,47 +481,63 @@ bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, } bool CefXmlReaderCToCpp::MoveToFirstAttribute() { - if (CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_first_attribute)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_first_attribute(struct_); + int _retval = _struct->move_to_first_attribute(_struct); // Return type: bool return _retval?true:false; } bool CefXmlReaderCToCpp::MoveToNextAttribute() { - if (CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_next_attribute)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_next_attribute(struct_); + int _retval = _struct->move_to_next_attribute(_struct); // Return type: bool return _retval?true:false; } bool CefXmlReaderCToCpp::MoveToCarryingElement() { - if (CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) + cef_xml_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_carrying_element)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_carrying_element(struct_); + int _retval = _struct->move_to_carrying_element(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefXmlReaderCToCpp::CefXmlReaderCToCpp() { +} + +template<> cef_xml_reader_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefXmlReader* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_XML_READER; diff --git a/libcef_dll/ctocpp/xml_reader_ctocpp.h b/libcef_dll/ctocpp/xml_reader_ctocpp.h index 640c13077..a61116637 100644 --- a/libcef_dll/ctocpp/xml_reader_ctocpp.h +++ b/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -27,43 +27,41 @@ class CefXmlReaderCToCpp : public CefCToCpp { public: - explicit CefXmlReaderCToCpp(cef_xml_reader_t* str) - : CefCToCpp(str) {} + CefXmlReaderCToCpp(); - // CefXmlReader methods - virtual bool MoveToNextNode() OVERRIDE; - virtual bool Close() OVERRIDE; - virtual bool HasError() OVERRIDE; - virtual CefString GetError() OVERRIDE; - virtual NodeType GetType() OVERRIDE; - virtual int GetDepth() OVERRIDE; - virtual CefString GetLocalName() OVERRIDE; - virtual CefString GetPrefix() OVERRIDE; - virtual CefString GetQualifiedName() OVERRIDE; - virtual CefString GetNamespaceURI() OVERRIDE; - virtual CefString GetBaseURI() OVERRIDE; - virtual CefString GetXmlLang() OVERRIDE; - virtual bool IsEmptyElement() OVERRIDE; - virtual bool HasValue() OVERRIDE; - virtual CefString GetValue() OVERRIDE; - virtual bool HasAttributes() OVERRIDE; - virtual size_t GetAttributeCount() OVERRIDE; - virtual CefString GetAttribute(int index) OVERRIDE; - virtual CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; - virtual CefString GetAttribute(const CefString& localName, + // CefXmlReader methods. + bool MoveToNextNode() OVERRIDE; + bool Close() OVERRIDE; + bool HasError() OVERRIDE; + CefString GetError() OVERRIDE; + NodeType GetType() OVERRIDE; + int GetDepth() OVERRIDE; + CefString GetLocalName() OVERRIDE; + CefString GetPrefix() OVERRIDE; + CefString GetQualifiedName() OVERRIDE; + CefString GetNamespaceURI() OVERRIDE; + CefString GetBaseURI() OVERRIDE; + CefString GetXmlLang() OVERRIDE; + bool IsEmptyElement() OVERRIDE; + bool HasValue() OVERRIDE; + CefString GetValue() OVERRIDE; + bool HasAttributes() OVERRIDE; + size_t GetAttributeCount() OVERRIDE; + CefString GetAttribute(int index) OVERRIDE; + CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; + CefString GetAttribute(const CefString& localName, const CefString& namespaceURI) OVERRIDE; - virtual CefString GetInnerXml() OVERRIDE; - virtual CefString GetOuterXml() OVERRIDE; - virtual int GetLineNumber() OVERRIDE; - virtual bool MoveToAttribute(int index) OVERRIDE; - virtual bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; - virtual bool MoveToAttribute(const CefString& localName, + CefString GetInnerXml() OVERRIDE; + CefString GetOuterXml() OVERRIDE; + int GetLineNumber() OVERRIDE; + bool MoveToAttribute(int index) OVERRIDE; + bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; + bool MoveToAttribute(const CefString& localName, const CefString& namespaceURI) OVERRIDE; - virtual bool MoveToFirstAttribute() OVERRIDE; - virtual bool MoveToNextAttribute() OVERRIDE; - virtual bool MoveToCarryingElement() OVERRIDE; + bool MoveToFirstAttribute() OVERRIDE; + bool MoveToNextAttribute() OVERRIDE; + bool MoveToCarryingElement() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ - diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/libcef_dll/ctocpp/zip_reader_ctocpp.cc index ec8314546..0941bc7fc 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.cc +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -37,26 +37,28 @@ CefRefPtr CefZipReader::Create( // VIRTUAL METHODS - Body may be edited by hand. bool CefZipReaderCToCpp::MoveToFirstFile() { - if (CEF_MEMBER_MISSING(struct_, move_to_first_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_first_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_first_file(struct_); + int _retval = _struct->move_to_first_file(_struct); // Return type: bool return _retval?true:false; } bool CefZipReaderCToCpp::MoveToNextFile() { - if (CEF_MEMBER_MISSING(struct_, move_to_next_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_next_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->move_to_next_file(struct_); + int _retval = _struct->move_to_next_file(_struct); // Return type: bool return _retval?true:false; @@ -64,7 +66,8 @@ bool CefZipReaderCToCpp::MoveToNextFile() { bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, bool caseSensitive) { - if (CEF_MEMBER_MISSING(struct_, move_to_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, move_to_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -75,7 +78,7 @@ bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, return false; // Execute - int _retval = struct_->move_to_file(struct_, + int _retval = _struct->move_to_file(_struct, fileName.GetStruct(), caseSensitive); @@ -84,26 +87,28 @@ bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, } bool CefZipReaderCToCpp::Close() { - if (CEF_MEMBER_MISSING(struct_, close)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, close)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->close(struct_); + int _retval = _struct->close(_struct); // Return type: bool return _retval?true:false; } CefString CefZipReaderCToCpp::GetFileName() { - if (CEF_MEMBER_MISSING(struct_, get_file_name)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_name)) return CefString(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - cef_string_userfree_t _retval = struct_->get_file_name(struct_); + cef_string_userfree_t _retval = _struct->get_file_name(_struct); // Return type: string CefString _retvalStr; @@ -112,33 +117,36 @@ CefString CefZipReaderCToCpp::GetFileName() { } int64 CefZipReaderCToCpp::GetFileSize() { - if (CEF_MEMBER_MISSING(struct_, get_file_size)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_size)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->get_file_size(struct_); + int64 _retval = _struct->get_file_size(_struct); // Return type: simple return _retval; } time_t CefZipReaderCToCpp::GetFileLastModified() { - if (CEF_MEMBER_MISSING(struct_, get_file_last_modified)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, get_file_last_modified)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - time_t _retval = struct_->get_file_last_modified(struct_); + time_t _retval = _struct->get_file_last_modified(_struct); // Return type: simple return _retval; } bool CefZipReaderCToCpp::OpenFile(const CefString& password) { - if (CEF_MEMBER_MISSING(struct_, open_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, open_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -146,7 +154,7 @@ bool CefZipReaderCToCpp::OpenFile(const CefString& password) { // Unverified params: password // Execute - int _retval = struct_->open_file(struct_, + int _retval = _struct->open_file(_struct, password.GetStruct()); // Return type: bool @@ -154,20 +162,22 @@ bool CefZipReaderCToCpp::OpenFile(const CefString& password) { } bool CefZipReaderCToCpp::CloseFile() { - if (CEF_MEMBER_MISSING(struct_, close_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, close_file)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->close_file(struct_); + int _retval = _struct->close_file(_struct); // Return type: bool return _retval?true:false; } int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { - if (CEF_MEMBER_MISSING(struct_, read_file)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, read_file)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -178,7 +188,7 @@ int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { return 0; // Execute - int _retval = struct_->read_file(struct_, + int _retval = _struct->read_file(_struct, buffer, bufferSize); @@ -187,34 +197,49 @@ int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { } int64 CefZipReaderCToCpp::Tell() { - if (CEF_MEMBER_MISSING(struct_, tell)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, tell)) return 0; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64 _retval = struct_->tell(struct_); + int64 _retval = _struct->tell(_struct); // Return type: simple return _retval; } bool CefZipReaderCToCpp::Eof() { - if (CEF_MEMBER_MISSING(struct_, eof)) + cef_zip_reader_t* _struct = GetStruct(); + if (CEF_MEMBER_MISSING(_struct, eof)) return false; // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int _retval = struct_->eof(struct_); + int _retval = _struct->eof(_struct); // Return type: bool return _retval?true:false; } +// CONSTRUCTOR - Do not edit by hand. + +CefZipReaderCToCpp::CefZipReaderCToCpp() { +} + +template<> cef_zip_reader_t* CefCToCpp::UnwrapDerived(CefWrapperType type, CefZipReader* c) { + NOTREACHED() << "Unexpected class type: " << type; + return NULL; +} + #ifndef NDEBUG template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; #endif +template<> CefWrapperType CefCToCpp::kWrapperType = WT_ZIP_READER; diff --git a/libcef_dll/ctocpp/zip_reader_ctocpp.h b/libcef_dll/ctocpp/zip_reader_ctocpp.h index e245305fb..f700a292a 100644 --- a/libcef_dll/ctocpp/zip_reader_ctocpp.h +++ b/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -27,25 +27,22 @@ class CefZipReaderCToCpp : public CefCToCpp { public: - explicit CefZipReaderCToCpp(cef_zip_reader_t* str) - : CefCToCpp(str) {} + CefZipReaderCToCpp(); - // CefZipReader methods - virtual bool MoveToFirstFile() OVERRIDE; - virtual bool MoveToNextFile() OVERRIDE; - virtual bool MoveToFile(const CefString& fileName, - bool caseSensitive) OVERRIDE; - virtual bool Close() OVERRIDE; - virtual CefString GetFileName() OVERRIDE; - virtual int64 GetFileSize() OVERRIDE; - virtual time_t GetFileLastModified() OVERRIDE; - virtual bool OpenFile(const CefString& password) OVERRIDE; - virtual bool CloseFile() OVERRIDE; - virtual int ReadFile(void* buffer, size_t bufferSize) OVERRIDE; - virtual int64 Tell() OVERRIDE; - virtual bool Eof() OVERRIDE; + // CefZipReader methods. + bool MoveToFirstFile() OVERRIDE; + bool MoveToNextFile() OVERRIDE; + bool MoveToFile(const CefString& fileName, bool caseSensitive) OVERRIDE; + bool Close() OVERRIDE; + CefString GetFileName() OVERRIDE; + int64 GetFileSize() OVERRIDE; + time_t GetFileLastModified() OVERRIDE; + bool OpenFile(const CefString& password) OVERRIDE; + bool CloseFile() OVERRIDE; + int ReadFile(void* buffer, size_t bufferSize) OVERRIDE; + int64 Tell() OVERRIDE; + bool Eof() OVERRIDE; }; #endif // USING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ - diff --git a/libcef_dll/wrapper_types.h b/libcef_dll/wrapper_types.h new file mode 100644 index 000000000..79ae60687 --- /dev/null +++ b/libcef_dll/wrapper_types.h @@ -0,0 +1,116 @@ +// 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_WRAPPER_TYPES_H_ +#define CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ +#pragma once + +enum CefWrapperType { + WT_BASE = 1, + WT_APP, + WT_AUTH_CALLBACK, + WT_BEFORE_DOWNLOAD_CALLBACK, + WT_BINARY_VALUE, + WT_BROWSER, + WT_BROWSER_HOST, + WT_BROWSER_PROCESS_HANDLER, + WT_CALLBACK, + WT_CLIENT, + WT_COMMAND_LINE, + WT_COMPLETION_CALLBACK, + WT_CONTEXT_MENU_HANDLER, + WT_CONTEXT_MENU_PARAMS, + WT_COOKIE_MANAGER, + WT_COOKIE_VISITOR, + WT_DOMDOCUMENT, + WT_DOMNODE, + WT_DOMVISITOR, + WT_DELETE_COOKIES_CALLBACK, + WT_DIALOG_HANDLER, + WT_DICTIONARY_VALUE, + WT_DISPLAY_HANDLER, + WT_DOWNLOAD_HANDLER, + WT_DOWNLOAD_ITEM, + WT_DOWNLOAD_ITEM_CALLBACK, + WT_DRAG_DATA, + WT_DRAG_HANDLER, + WT_END_TRACING_CALLBACK, + WT_FILE_DIALOG_CALLBACK, + WT_FIND_HANDLER, + WT_FOCUS_HANDLER, + WT_FRAME, + WT_GEOLOCATION_CALLBACK, + WT_GEOLOCATION_HANDLER, + WT_GET_GEOLOCATION_CALLBACK, + WT_JSDIALOG_CALLBACK, + WT_JSDIALOG_HANDLER, + WT_KEYBOARD_HANDLER, + WT_LIFE_SPAN_HANDLER, + WT_LIST_VALUE, + WT_LOAD_HANDLER, + WT_MENU_MODEL, + WT_NAVIGATION_ENTRY, + WT_NAVIGATION_ENTRY_VISITOR, + WT_POST_DATA, + WT_POST_DATA_ELEMENT, + WT_PRINT_DIALOG_CALLBACK, + WT_PRINT_HANDLER, + WT_PRINT_JOB_CALLBACK, + WT_PRINT_SETTINGS, + WT_PROCESS_MESSAGE, + WT_READ_HANDLER, + WT_RENDER_HANDLER, + WT_RENDER_PROCESS_HANDLER, + WT_REQUEST, + WT_REQUEST_CALLBACK, + WT_REQUEST_CONTEXT, + WT_REQUEST_CONTEXT_HANDLER, + WT_REQUEST_HANDLER, + WT_RESOURCE_BUNDLE_HANDLER, + WT_RESOURCE_HANDLER, + WT_RESPONSE, + WT_RUN_FILE_DIALOG_CALLBACK, + WT_SSLCERT_PRINCIPAL, + WT_SSLINFO, + WT_SCHEME_HANDLER_FACTORY, + WT_SCHEME_REGISTRAR, + WT_SET_COOKIE_CALLBACK, + WT_STREAM_READER, + WT_STREAM_WRITER, + WT_STRING_VISITOR, + WT_TASK, + WT_TASK_RUNNER, + WT_TRANSLATOR_TEST, + WT_TRANSLATOR_TEST_HANDLER, + WT_TRANSLATOR_TEST_HANDLER_CHILD, + WT_TRANSLATOR_TEST_OBJECT, + WT_TRANSLATOR_TEST_OBJECT_CHILD, + WT_TRANSLATOR_TEST_OBJECT_CHILD_CHILD, + WT_URLREQUEST, + WT_URLREQUEST_CLIENT, + WT_V8ACCESSOR, + WT_V8CONTEXT, + WT_V8EXCEPTION, + WT_V8HANDLER, + WT_V8STACK_FRAME, + WT_V8STACK_TRACE, + WT_V8VALUE, + WT_VALUE, + WT_WEB_PLUGIN_INFO, + WT_WEB_PLUGIN_INFO_VISITOR, + WT_WEB_PLUGIN_UNSTABLE_CALLBACK, + WT_WRITE_HANDLER, + WT_XML_READER, + WT_ZIP_READER, +}; + +#endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_ diff --git a/tests/unittests/translator_unittest.cc b/tests/unittests/translator_unittest.cc new file mode 100644 index 000000000..9450454c6 --- /dev/null +++ b/tests/unittests/translator_unittest.cc @@ -0,0 +1,394 @@ +// 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. + +// Include this first to avoid type conflicts with CEF headers. +#include "tests/unittests/chromium_includes.h" + +#include "include/test/cef_translator_test.h" +#include "testing/gtest/include/gtest/gtest.h" + +// Test getting/setting primitive types. +TEST(TranslatorTest, Primitive) { + CefRefPtr obj = CefTranslatorTest::Create(); + obj->GetVoid(); // Does nothing, but shouldn't crash. + EXPECT_EQ(TEST_BOOL_VAL, obj->GetBool()); + EXPECT_EQ(TEST_INT_VAL, obj->GetInt()); + EXPECT_EQ(TEST_DOUBLE_VAL, obj->GetDouble()); + EXPECT_EQ(TEST_LONG_VAL, obj->GetLong()); + EXPECT_EQ(TEST_SIZET_VAL, obj->GetSizet()); + EXPECT_TRUE(obj->SetVoid()); // Does nothing, but shouldn't crash. + EXPECT_TRUE(obj->SetBool(TEST_BOOL_VAL)); + EXPECT_TRUE(obj->SetInt(TEST_INT_VAL)); + EXPECT_TRUE(obj->SetDouble(TEST_DOUBLE_VAL)); + EXPECT_TRUE(obj->SetLong(TEST_LONG_VAL)); + EXPECT_TRUE(obj->SetSizet(TEST_SIZET_VAL)); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting primitive list types. +TEST(TranslatorTest, PrimitiveList) { + CefRefPtr obj = CefTranslatorTest::Create(); + + std::vector list; + list.push_back(TEST_INT_VAL); + list.push_back(TEST_INT_VAL2); + EXPECT_TRUE(obj->SetIntList(list)); + + list.clear(); + EXPECT_TRUE(obj->GetIntListByRef(list)); + EXPECT_EQ(2U, list.size()); + EXPECT_EQ(TEST_INT_VAL, list[0]); + EXPECT_EQ(TEST_INT_VAL2, list[1]); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting string types. +TEST(TranslatorTest, String) { + CefRefPtr obj = CefTranslatorTest::Create(); + EXPECT_STREQ(TEST_STRING_VAL, obj->GetString().ToString().c_str()); + EXPECT_TRUE(obj->SetString(TEST_STRING_VAL)); + + CefString str; + obj->GetStringByRef(str); + EXPECT_STREQ(TEST_STRING_VAL, str.ToString().c_str()); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting string list types. +TEST(TranslatorTest, StringList) { + CefRefPtr obj = CefTranslatorTest::Create(); + + std::vector list; + list.push_back(TEST_STRING_VAL); + list.push_back(TEST_STRING_VAL2); + list.push_back(TEST_STRING_VAL3); + EXPECT_TRUE(obj->SetStringList(list)); + + list.clear(); + EXPECT_TRUE(obj->GetStringListByRef(list)); + EXPECT_EQ(3U, list.size()); + EXPECT_STREQ(TEST_STRING_VAL, list[0].ToString().c_str()); + EXPECT_STREQ(TEST_STRING_VAL2, list[1].ToString().c_str()); + EXPECT_STREQ(TEST_STRING_VAL3, list[2].ToString().c_str()); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting string map types. +TEST(TranslatorTest, StringMap) { + CefRefPtr obj = CefTranslatorTest::Create(); + + CefTranslatorTest::StringMap map; + map.insert(std::make_pair(TEST_STRING_KEY, TEST_STRING_VAL)); + map.insert(std::make_pair(TEST_STRING_KEY2, TEST_STRING_VAL2)); + map.insert(std::make_pair(TEST_STRING_KEY3, TEST_STRING_VAL3)); + EXPECT_TRUE(obj->SetStringMap(map)); + + map.clear(); + EXPECT_TRUE(obj->GetStringMapByRef(map)); + EXPECT_EQ(3U, map.size()); + + CefTranslatorTest::StringMap::const_iterator it; + + it = map.find(TEST_STRING_KEY); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL); + it = map.find(TEST_STRING_KEY2); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL2); + it = map.find(TEST_STRING_KEY3); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL3); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting string multimap types. +TEST(TranslatorTest, StringMultimap) { + CefRefPtr obj = CefTranslatorTest::Create(); + + CefTranslatorTest::StringMultimap map; + map.insert(std::make_pair(TEST_STRING_KEY, TEST_STRING_VAL)); + map.insert(std::make_pair(TEST_STRING_KEY2, TEST_STRING_VAL2)); + map.insert(std::make_pair(TEST_STRING_KEY3, TEST_STRING_VAL3)); + EXPECT_TRUE(obj->SetStringMultimap(map)); + + map.clear(); + EXPECT_TRUE(obj->GetStringMultimapByRef(map)); + EXPECT_EQ(3U, map.size()); + + CefTranslatorTest::StringMultimap::const_iterator it; + + it = map.find(TEST_STRING_KEY); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL); + it = map.find(TEST_STRING_KEY2); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL2); + it = map.find(TEST_STRING_KEY3); + EXPECT_TRUE(it != map.end() && it->second == TEST_STRING_VAL3); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting struct types. +TEST(TranslatorTest, Struct) { + CefRefPtr obj = CefTranslatorTest::Create(); + + CefPoint point(TEST_X_VAL, TEST_Y_VAL); + EXPECT_EQ(point, obj->GetPoint()); + EXPECT_TRUE(obj->SetPoint(point)); + + CefPoint point2; + obj->GetPointByRef(point2); + EXPECT_EQ(point, point2); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting struct list types. +TEST(TranslatorTest, StructList) { + CefRefPtr obj = CefTranslatorTest::Create(); + + std::vector list; + list.push_back(CefPoint(TEST_X_VAL, TEST_Y_VAL)); + list.push_back(CefPoint(TEST_X_VAL2, TEST_Y_VAL2)); + EXPECT_TRUE(obj->SetPointList(list)); + + list.clear(); + EXPECT_TRUE(obj->GetPointListByRef(list)); + EXPECT_EQ(2U, list.size()); + EXPECT_EQ(CefPoint(TEST_X_VAL, TEST_Y_VAL), list[0]); + EXPECT_EQ(CefPoint(TEST_X_VAL2, TEST_Y_VAL2), list[1]); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); +} + +// Test getting/setting library-side object types. +TEST(TranslatorTest, Object) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kTestVal = 12; + CefRefPtr test_obj = + CefTranslatorTestObject::Create(kTestVal); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + int retval = obj->SetObject(test_obj); + EXPECT_EQ(kTestVal, retval); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + + const int kTestVal2 = 30; + CefRefPtr test_obj2 = obj->GetObject(kTestVal2); + EXPECT_EQ(kTestVal2, test_obj2->GetValue()); + int retval2 = obj->SetObject(test_obj2); + EXPECT_EQ(kTestVal2, retval2); + EXPECT_EQ(kTestVal2, test_obj2->GetValue()); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(test_obj->HasOneRef()); + EXPECT_TRUE(test_obj2->HasOneRef()); +} + +// Test getting/setting inherited library-side object types. +TEST(TranslatorTest, ObjectInherit) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kTestVal = 12; + const int kTestVal2 = 40; + CefRefPtr test_obj = + CefTranslatorTestObjectChild::Create(kTestVal, kTestVal2); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + EXPECT_EQ(kTestVal2, test_obj->GetOtherValue()); + int retval = obj->SetObject(test_obj); + EXPECT_EQ(kTestVal, retval); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + EXPECT_EQ(kTestVal2, test_obj->GetOtherValue()); + + EXPECT_EQ(kTestVal, obj->SetChildObject(test_obj)); + EXPECT_EQ(kTestVal, obj->SetChildObjectAndReturnParent(test_obj)->GetValue()); + + const int kTestVal3 = 100; + CefRefPtr test_obj2 = + CefTranslatorTestObjectChildChild::Create(kTestVal, kTestVal2, kTestVal3); + EXPECT_EQ(kTestVal, test_obj2->GetValue()); + EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue()); + EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue()); + int retval2 = obj->SetObject(test_obj2); + EXPECT_EQ(kTestVal, retval2); + EXPECT_EQ(kTestVal, test_obj2->GetValue()); + EXPECT_EQ(kTestVal2, test_obj2->GetOtherValue()); + EXPECT_EQ(kTestVal3, test_obj2->GetOtherOtherValue()); + + EXPECT_EQ(kTestVal, obj->SetChildObject(test_obj2)); + EXPECT_EQ(kTestVal, + obj->SetChildObjectAndReturnParent(test_obj2)->GetValue()); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(test_obj->HasOneRef()); + EXPECT_TRUE(test_obj2->HasOneRef()); +} + +// Test getting/setting library-side object list types. +TEST(TranslatorTest, ObjectList) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kVal1 = 34; + const int kVal2 = 10; + + CefRefPtr val1 = + CefTranslatorTestObject::Create(kVal1); + CefRefPtr val2 = + CefTranslatorTestObjectChild::Create(kVal2, 0); + + std::vector > list; + list.push_back(val1); + list.push_back(val2); + EXPECT_TRUE(obj->SetObjectList(list, kVal1, kVal2)); + + list.clear(); + EXPECT_TRUE(obj->GetObjectListByRef(list, kVal1, kVal2)); + EXPECT_EQ(2U, list.size()); + EXPECT_EQ(kVal1, list[0]->GetValue()); + EXPECT_EQ(kVal2, list[1]->GetValue()); + + list.clear(); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(val1->HasOneRef()); + EXPECT_TRUE(val2->HasOneRef()); +} + +namespace { + +class TranslatorTestHandler : public CefTranslatorTestHandler { + public: + explicit TranslatorTestHandler(const int val) + : val_(val) { + } + + virtual int GetValue() override { + return val_; + } + + private: + const int val_; + + IMPLEMENT_REFCOUNTING(TranslatorTestHandler); + DISALLOW_COPY_AND_ASSIGN(TranslatorTestHandler); +}; + +class TranslatorTestHandlerChild : public CefTranslatorTestHandlerChild { + public: + TranslatorTestHandlerChild(const int val, + const int other_val) + : val_(val), + other_val_(other_val) { + } + + virtual int GetValue() override { + return val_; + } + + virtual int GetOtherValue() override { + return other_val_; + } + + private: + const int val_; + const int other_val_; + + IMPLEMENT_REFCOUNTING(TranslatorTestHandlerChild); + DISALLOW_COPY_AND_ASSIGN(TranslatorTestHandlerChild); +}; + +} // namespace + +// Test getting/setting client-side handler types. +TEST(TranslatorTest, Handler) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kTestVal = 12; + + CefRefPtr test_obj = + new TranslatorTestHandler(kTestVal); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + EXPECT_EQ(kTestVal, obj->SetHandler(test_obj.get())); + CefRefPtr handler = + obj->SetHandlerAndReturn(test_obj.get()); + EXPECT_EQ(test_obj.get(), handler.get()); + EXPECT_EQ(kTestVal, handler->GetValue()); + handler = NULL; + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(test_obj->HasOneRef()); +} + +// Test getting/setting inherited client-side handler types. +TEST(TranslatorTest, HandlerInherit) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kTestVal = 12; + const int kTestVal2 = 86; + + CefRefPtr test_obj = + new TranslatorTestHandlerChild(kTestVal, kTestVal2); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + EXPECT_EQ(kTestVal2, test_obj->GetOtherValue()); + int retval = obj->SetHandler(test_obj); + EXPECT_EQ(kTestVal, retval); + EXPECT_EQ(kTestVal, test_obj->GetValue()); + EXPECT_EQ(kTestVal2, test_obj->GetOtherValue()); + + EXPECT_EQ(kTestVal, obj->SetChildHandler(test_obj)); + CefRefPtr handler = + obj->SetChildHandlerAndReturnParent(test_obj); + EXPECT_EQ(kTestVal, handler->GetValue()); + EXPECT_EQ(test_obj.get(), handler.get()); + handler = NULL; + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(test_obj->HasOneRef()); +} + +// Test getting/setting client-side object list types. +TEST(TranslatorTest, HandlerList) { + CefRefPtr obj = CefTranslatorTest::Create(); + + const int kVal1 = 34; + const int kVal2 = 10; + + CefRefPtr val1 = new TranslatorTestHandler(kVal1); + CefRefPtr val2 = + new TranslatorTestHandlerChild(kVal2, 0); + + std::vector > list; + list.push_back(val1); + list.push_back(val2); + EXPECT_TRUE(obj->SetHandlerList(list, kVal1, kVal2)); + + list.clear(); + EXPECT_TRUE(obj->GetHandlerListByRef(list, val1, val2)); + EXPECT_EQ(2U, list.size()); + EXPECT_EQ(kVal1, list[0]->GetValue()); + EXPECT_EQ(val1.get(), list[0].get()); + EXPECT_EQ(kVal2, list[1]->GetValue()); + EXPECT_EQ(val2.get(), list[1].get()); + + list.clear(); + + // Only one reference to the object should exist. + EXPECT_TRUE(obj->HasOneRef()); + EXPECT_TRUE(val1->HasOneRef()); + EXPECT_TRUE(val2->HasOneRef()); +} diff --git a/tools/cef_parser.py b/tools/cef_parser.py index 71bbcedc6..8895d80c1 100644 --- a/tools/cef_parser.py +++ b/tools/cef_parser.py @@ -26,17 +26,17 @@ def wrap_text(text, indent = '', maxchars = 80): for line in lines: result += indent+line+'\n' return result - + def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'): """ Wrap the code lines to the specified number of characters. If necessary a line will be broken and wrapped after one of the split characters. """ output = '' - + # normalize line endings code = code.replace("\r\n", "\n") - + # break the code chunk into lines lines = string.split(code, '\n') for line in lines: @@ -44,7 +44,7 @@ def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'): # line is short enough that it doesn't need to be wrapped output += line + '\n' continue - + # retrieve the whitespace at the beginning of the line for later use # as padding ws = '' @@ -53,7 +53,7 @@ def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'): ws += char else: break - + # iterate over all characters in the string keeping track of where the # last valid break character was found and wrapping the line # accordingly @@ -91,7 +91,7 @@ def wrap_code(code, indent = ' ', maxchars = 80, splitchars = '(=,'): section = string.strip(section) output += section output += '\n' - + return output def get_capi_file_name(cppname): @@ -111,10 +111,10 @@ def get_capi_name(cppname, isclassname, prefix = None): result += '_' result += string.lower(chr) lastchr = chr - + if isclassname: result += '_t' - + if not prefix is None: if prefix[0:3] == 'cef': # if the prefix name is duplicated in the function name @@ -124,9 +124,14 @@ def get_capi_name(cppname, isclassname, prefix = None): if pos >= 0: result = result[0:pos]+ result[pos+len(subprefix):] result = prefix+'_'+result - + return result +def get_wrapper_type_enum(cppname): + """ Returns the wrapper type enumeration value for the specified C++ class + name. """ + return 'WT_'+get_capi_name(cppname, False)[4:].upper() + def get_prev_line(body, pos): """ Retrieve the start and end positions and value for the line immediately before the line containing the specified position. @@ -135,11 +140,11 @@ def get_prev_line(body, pos): start = body.rfind('\n', 0, end)+1 line = body[start:end] return { 'start' : start, 'end' : end, 'line' : line } - + def get_comment(body, name): """ Retrieve the comment for a class or function. """ result = [] - + pos = body.find(name) while pos > 0: data = get_prev_line(body, pos) @@ -159,7 +164,7 @@ def get_comment(body, name): result.append(line[2:]) else: break - + result.reverse() return result @@ -187,7 +192,7 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80): # output the previous paragraph result += wrap_text(wrapme, indent+'// ', maxchars) wrapme = '' - + if not line is None: if len(line) == 0 or line[0:1] == ' ' or line[0:1] == '/': # blank lines or anything that's further indented should be @@ -206,7 +211,7 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80): # output an empty line hasemptyline = True result += '\n' - + if len(wrapme) > 0: if not translate_map is None: # apply the translation @@ -214,7 +219,7 @@ def format_comment(comment, indent, translate_map = None, maxchars = 80): wrapme = wrapme.replace(key, translate_map[key]) # output the previous paragraph result += wrap_text(wrapme, indent+'// ', maxchars) - + if hasemptyline: # an empty line means a break between comments, so the comment is # probably a section heading and should have an extra line before it @@ -227,44 +232,44 @@ def format_translation_changes(old, new): """ changed = False result = '' - + # normalize C API attributes oldargs = [x.replace('struct _', '') for x in old['args']] oldretval = old['retval'].replace('struct _', '') newargs = [x.replace('struct _', '') for x in new['args']] newretval = new['retval'].replace('struct _', '') - + # check if the prototype has changed oldset = set(oldargs) newset = set(newargs) if len(oldset.symmetric_difference(newset)) > 0: changed = True result += '\n // WARNING - CHANGED ATTRIBUTES' - + # in the implementation set only oldonly = oldset.difference(newset) for arg in oldonly: result += '\n // REMOVED: '+arg - + # in the current set only newonly = newset.difference(oldset) for arg in newonly: result += '\n // ADDED: '+arg - + # check if the return value has changed if oldretval != newretval: changed = True result += '\n // WARNING - CHANGED RETURN VALUE'+ \ '\n // WAS: '+old['retval']+ \ '\n // NOW: '+new['retval'] - + if changed: result += '\n #pragma message("Warning: "__FILE__": '+new['name']+ \ ' prototype has changed")\n' - + return result -def format_translation_includes(body): +def format_translation_includes(header, body): """ Return the necessary list of includes based on the contents of the body. """ @@ -281,14 +286,26 @@ def format_translation_includes(body): p = re.compile('([A-Za-z0-9_]{1,})CppToC') list = sorted(set(p.findall(body))) for item in list: - result += '#include "libcef_dll/cpptoc/'+ \ + directory = '' + if item != 'CefBase': + cls = header.get_class(item) + dir = cls.get_file_directory() + if not dir is None: + directory = dir+'/' + result += '#include "libcef_dll/cpptoc/'+directory+ \ get_capi_name(item[3:], False)+'_cpptoc.h"\n' # identify what CToCpp classes are being used p = re.compile('([A-Za-z0-9_]{1,})CToCpp') list = sorted(set(p.findall(body))) for item in list: - result += '#include "libcef_dll/ctocpp/'+ \ + directory = '' + if item != 'CefBase': + cls = header.get_class(item) + dir = cls.get_file_directory() + if not dir is None: + directory = dir+'/' + result += '#include "libcef_dll/ctocpp/'+directory+ \ get_capi_name(item[3:], False)+'_ctocpp.h"\n' if body.find('transfer_') > 0: @@ -353,9 +370,11 @@ _cre_typedef = '([A-Za-z0-9_<>:,\*\& ]{1,})' # regex for matching function return value and name combination _cre_func = '([A-Za-z][A-Za-z0-9_<>:,\*\& ]{1,})' # regex for matching virtual function modifiers -_cre_vfmod = '([A-Za-z0-9_]{0,})' +_cre_vfmod = '([A-Za-z0-9_]{0,})' # regex for matching arbitrary whitespace -_cre_space = '[\s]{1,}' +_cre_space = '[\s]{1,}' +# regex for matching optional virtual keyword +_cre_virtual = '(?:[\s]{1,}virtual){0,1}' # Simple translation types. Format is: # 'cpp_type' : ['capi_type', 'capi_default_value'] @@ -407,24 +426,24 @@ def get_function_impls(content, ident): if retval.find(ident) < 0: # the identifier was not found continue - + # remove the identifier retval = string.replace(retval, ident, '') retval = string.strip(retval) - + # retrieve the function name parts = string.split(retval, ' ') name = parts[-1] del parts[-1] retval = string.join(parts, ' ') - + # parse the arguments args = [] for v in string.split(argval, ','): v = string.strip(v) if len(v) > 0: args.append(v) - + result.append({ 'retval' : string.strip(retval), 'name' : name, @@ -432,7 +451,7 @@ def get_function_impls(content, ident): 'vfmod' : string.strip(vfmod), 'body' : body }) - + return result def get_next_function_impl(existing, name): @@ -465,13 +484,18 @@ def get_copyright(): class obj_header: """ Class representing a C++ header file. """ - + def __init__(self): self.filenames = [] self.typedefs = [] self.funcs = [] self.classes = [] - + self.root_directory = None + + def set_root_directory(self, root_directory): + """ Set the root directory. """ + self.root_directory = root_directory + def add_directory(self, directory, excluded_files = []): """ Add all header files from the specified directory. """ files = get_files(os.path.join(directory, '*.h')) @@ -482,16 +506,24 @@ class obj_header: def add_file(self, filepath): """ Add a header file. """ - - filename = os.path.split(filepath)[1] - added = False - + + if self.root_directory is None: + filename = os.path.split(filepath)[1] + else: + filename = os.path.relpath(filepath, self.root_directory) + filename = filename.replace('\\', '/') + # read the input file into memory - data = read_file(filepath) - + self.add_data(filename, read_file(filepath)) + + def add_data(self, filename, data): + """ Add header file contents. """ + + added = False + # remove space from between template definition end brackets data = data.replace("> >", ">>") - + # extract global typedefs p = re.compile('\ntypedef'+_cre_space+_cre_typedef+';', re.MULTILINE | re.DOTALL) @@ -505,7 +537,7 @@ class obj_header: alias = value[pos+1:] value = value[:pos] self.typedefs.append(obj_typedef(self, filename, value, alias)) - + # extract global functions p = re.compile('\n'+_cre_attrib+'\n'+_cre_func+'\((.*?)\)', re.MULTILINE | re.DOTALL) @@ -526,23 +558,23 @@ class obj_header: # extract forward declarations p = re.compile('\nclass'+_cre_space+_cre_cfname+';') forward_declares = p.findall(data) - + # extract classes p = re.compile('\n'+_cre_attrib+ '\nclass'+_cre_space+_cre_cfname+_cre_space+ - ':'+_cre_space+'public'+_cre_space+'virtual'+ - _cre_space+'CefBase'+_cre_space+ + ':'+_cre_space+'public'+_cre_virtual+ + _cre_space+_cre_cfname+_cre_space+ '{(.*?)};', re.MULTILINE | re.DOTALL) list = p.findall(data) if len(list) > 0: added = True # build the class objects - for attrib, name, body in list: - comment = get_comment(data, name+' : public virtual CefBase') + for attrib, name, parent_name, body in list: + comment = get_comment(data, name+' : public') self.classes.append( - obj_class(self, filename, attrib, name, body, comment, - includes, forward_declares)) + obj_class(self, filename, attrib, name, parent_name, body, + comment, includes, forward_declares)) if added: # a global function or class was read from the header file @@ -550,35 +582,35 @@ class obj_header: def __repr__(self): result = '' - + if len(self.typedefs) > 0: strlist = [] for cls in self.typedefs: strlist.append(str(cls)) result += string.join(strlist, "\n") + "\n\n" - + if len(self.funcs) > 0: strlist = [] for cls in self.funcs: strlist.append(str(cls)) result += string.join(strlist, "\n") + "\n\n" - + if len(self.classes) > 0: strlist = [] for cls in self.classes: strlist.append(str(cls)) result += string.join(strlist, "\n") - + return result - + def get_file_names(self): """ Return the array of header file names. """ return self.filenames - + def get_typedefs(self): """ Return the array of typedef objects. """ return self.typedefs - + def get_funcs(self, filename = None): """ Return the array of function objects. """ if filename is None: @@ -590,7 +622,7 @@ class obj_header: if func.get_file_name() == filename: res.append(func) return res - + def get_classes(self, filename = None): """ Return the array of class objects. """ if filename is None: @@ -602,7 +634,7 @@ class obj_header: if cls.get_file_name() == filename: res.append(cls) return res - + def get_class(self, classname, defined_structs = None): """ Return the specified class or None if not found. """ for cls in self.classes: @@ -611,22 +643,22 @@ class obj_header: elif not defined_structs is None: defined_structs.append(cls.get_capi_name()) return None - + def get_class_names(self): """ Returns the names of all classes in this object. """ result = [] for cls in self.classes: result.append(cls.get_name()) return result - + def get_types(self, list): """ Return a dictionary mapping data types to analyzed values. """ for cls in self.typedefs: cls.get_types(list) - + for cls in self.classes: cls.get_types(list) - + def get_alias_translation(self, alias): """ Return a translation of alias to value based on typedef statements. """ @@ -634,15 +666,15 @@ class obj_header: if cls.alias == alias: return cls.value return None - + def get_analysis(self, value, named = True): """ Return an analysis of the value based the header file context. """ return obj_analysis([self], value, named) - + def get_defined_structs(self): """ Return a list of names already defined structure names. """ return ['cef_print_info_t', 'cef_window_info_t', 'cef_base_t'] - + def get_capi_translations(self): """ Return a dictionary that maps C++ terminology to C API terminology. """ @@ -657,43 +689,44 @@ class obj_header: 'empty' : 'NULL', 'method' : 'function' } - + # add mappings for all classes and functions funcs = self.get_funcs() for func in funcs: map[func.get_name()+'()'] = func.get_capi_name()+'()' - + classes = self.get_classes() for cls in classes: map[cls.get_name()] = cls.get_capi_name() - + funcs = cls.get_virtual_funcs() for func in funcs: map[func.get_name()+'()'] = func.get_capi_name()+'()' - + funcs = cls.get_static_funcs() for func in funcs: map[func.get_name()+'()'] = func.get_capi_name()+'()' - + return map class obj_class: """ Class representing a C++ class. """ - - def __init__(self, parent, filename, attrib, name, body, comment, - includes, forward_declares): + + def __init__(self, parent, filename, attrib, name, parent_name, body, + comment, includes, forward_declares): if not isinstance(parent, obj_header): raise Exception('Invalid parent object type') - + self.parent = parent self.filename = filename self.attribs = str_to_dict(attrib) self.name = name + self.parent_name = parent_name self.comment = comment self.includes = includes self.forward_declares = forward_declares - + # extract typedefs p = re.compile('\n'+_cre_space+'typedef'+_cre_space+_cre_typedef+';', re.MULTILINE | re.DOTALL) @@ -708,26 +741,26 @@ class obj_class: alias = value[pos+1:] value = value[:pos] self.typedefs.append(obj_typedef(self, filename, value, alias)) - + # extract static functions p = re.compile('\n'+_cre_space+_cre_attrib+'\n'+_cre_space+'static'+ _cre_space+_cre_func+'\((.*?)\)', re.MULTILINE | re.DOTALL) list = p.findall(body) - + # build the static function objects self.staticfuncs = [] for attrib, retval, argval in list: comment = get_comment(body, retval+'('+argval+')') self.staticfuncs.append( obj_function_static(self, attrib, retval, argval, comment)) - + # extract virtual functions p = re.compile('\n'+_cre_space+_cre_attrib+'\n'+_cre_space+'virtual'+ _cre_space+_cre_func+'\((.*?)\)'+_cre_space+_cre_vfmod, re.MULTILINE | re.DOTALL) list = p.findall(body) - + # build the virtual function objects self.virtualfuncs = [] for attrib, retval, argval, vfmod in list: @@ -735,72 +768,109 @@ class obj_class: self.virtualfuncs.append( obj_function_virtual(self, attrib, retval, argval, comment, vfmod)) - + def __repr__(self): result = '/* '+dict_to_str(self.attribs)+' */ class '+self.name+"\n{" - + if len(self.typedefs) > 0: result += "\n\t" strlist = [] for cls in self.typedefs: strlist.append(str(cls)) result += string.join(strlist, "\n\t") - + if len(self.staticfuncs) > 0: result += "\n\t" strlist = [] for cls in self.staticfuncs: strlist.append(str(cls)) result += string.join(strlist, "\n\t") - + if len(self.virtualfuncs) > 0: result += "\n\t" strlist = [] for cls in self.virtualfuncs: strlist.append(str(cls)) result += string.join(strlist, "\n\t") - + result += "\n};\n" return result - + def get_file_name(self): - """ Return the C++ header file name. """ + """ Return the C++ header file name. Includes the directory component, + if any. """ return self.filename - + def get_capi_file_name(self): - """ Return the CAPI header file name. """ + """ Return the CAPI header file name. Includes the directory component, + if any. """ return get_capi_file_name(self.filename) - + + def get_file_directory(self): + """ Return the file directory component, if any. """ + pos = self.filename.rfind('/') + if pos >= 0: + return self.filename[:pos] + return None + def get_name(self): """ Return the class name. """ return self.name - + def get_capi_name(self): """ Return the CAPI structure name for this class. """ return get_capi_name(self.name, True) - + + def get_parent_name(self): + """ Return the parent class name. """ + return self.parent_name + + def get_parent_capi_name(self): + """ Return the CAPI structure name for the parent class. """ + return get_capi_name(self.parent_name, True) + + def has_parent(self, parent_name): + """ Returns true if this class has the specified class anywhere in its + inheritance hierarchy. """ + # Every class has CefBase as the top-most parent. + if parent_name == 'CefBase' or parent_name == self.parent_name: + return True + if self.parent_name == 'CefBase': + return False + + cur_cls = self.parent.get_class(self.parent_name) + while True: + cur_parent_name = cur_cls.get_parent_name() + if cur_parent_name == 'CefBase': + break + elif cur_parent_name == parent_name: + return True + cur_cls = self.parent.get_class(cur_parent_name) + + return False + def get_comment(self): """ Return the class comment as an array of lines. """ return self.comment - + def get_includes(self): """ Return the list of classes that are included from this class' header file. """ return self.includes - + def get_forward_declares(self): """ Return the list of classes that are forward declared for this class. """ return self.forward_declares - + def get_attribs(self): """ Return all attributes as a dictionary. """ return self.attribs - + def has_attrib(self, name): """ Return true if the specified attribute exists. """ return name in self.attribs - + def get_attrib(self, name): """ Return the first or only value for specified attribute. """ if name in self.attribs: @@ -811,7 +881,7 @@ class obj_class: # the value is a string return self.attribs[name] return None - + def get_attrib_list(self, name): """ Return all values for specified attribute as a list. """ if name in self.attribs: @@ -822,11 +892,11 @@ class obj_class: # convert the value to a list return [self.attribs[name]] return None - + def get_typedefs(self): """ Return the array of typedef objects. """ return self.typedefs - + def has_typedef_alias(self, alias): """ Returns true if the specified typedef alias is defined in the scope of this class declaration. """ @@ -834,38 +904,38 @@ class obj_class: if typedef.get_alias() == alias: return True return False - + def get_static_funcs(self): """ Return the array of static function objects. """ return self.staticfuncs - + def get_virtual_funcs(self): """ Return the array of virtual function objects. """ return self.virtualfuncs - + def get_types(self, list): """ Return a dictionary mapping data types to analyzed values. """ for cls in self.typedefs: cls.get_types(list) - + for cls in self.staticfuncs: cls.get_types(list) - + for cls in self.virtualfuncs: cls.get_types(list) - + def get_alias_translation(self, alias): for cls in self.typedefs: if cls.alias == alias: return cls.value return None - + def get_analysis(self, value, named = True): """ Return an analysis of the value based on the class definition context. """ return obj_analysis([self, self.parent], value, named) - + def is_library_side(self): """ Returns true if the class is implemented by the library. """ return self.attribs['source'] == 'library' @@ -877,12 +947,12 @@ class obj_class: class obj_typedef: """ Class representing a typedef statement. """ - + def __init__(self, parent, filename, value, alias): if not isinstance(parent, obj_header) \ and not isinstance(parent, obj_class): raise Exception('Invalid parent object type') - + self.parent = parent self.filename = filename self.alias = alias @@ -890,35 +960,35 @@ class obj_typedef: def __repr__(self): return 'typedef '+self.value.get_type()+' '+self.alias+';' - + def get_file_name(self): """ Return the C++ header file name. """ return self.filename - + def get_capi_file_name(self): """ Return the CAPI header file name. """ return get_capi_file_name(self.filename) - + def get_alias(self): """ Return the alias. """ return self.alias - + def get_value(self): """ Return an analysis of the value based on the class or header file definition context. """ return self.value - + def get_types(self, list): """ Return a dictionary mapping data types to analyzed values. """ name = self.value.get_type() if not name in list: list[name] = self.value - - + + class obj_function: """ Class representing a function. """ - + def __init__(self, parent, filename, attrib, retval, argval, comment): self.parent = parent self.filename = filename @@ -926,11 +996,19 @@ class obj_function: self.retval = obj_argument(self, retval) self.name = self.retval.remove_name() self.comment = comment - + # build the argument objects self.arguments = [] arglist = string.split(argval, ',') - for arg in arglist: + argindex = 0 + while argindex < len(arglist): + arg = arglist[argindex] + if arg.find('<') >= 0 and arg.find('>') == -1: + # We've split inside of a template type declaration. Join the + # next argument with this argument. + argindex += 1 + arg += ',' + arglist[argindex] + arg = string.strip(arg) if len(arg) > 0: argument = obj_argument(self, arg) @@ -941,6 +1019,8 @@ class obj_function: "' parameter to "+self.get_qualified_name()) self.arguments.append(argument) + argindex += 1 + if self.retval.needs_attrib_default_retval() and \ self.retval.get_attrib_default_retval() is None: raise Exception("A 'default_retval' attribute is required for "+ \ @@ -948,19 +1028,19 @@ class obj_function: def __repr__(self): return '/* '+dict_to_str(self.attribs)+' */ '+self.get_cpp_proto() - + def get_file_name(self): """ Return the C++ header file name. """ return self.filename - + def get_capi_file_name(self): """ Return the CAPI header file name. """ return get_capi_file_name(self.filename) - + def get_name(self): """ Return the function name. """ return self.name - + def get_qualified_name(self): """ Return the fully qualified function name. """ if isinstance(self.parent, obj_header): @@ -969,25 +1049,25 @@ class obj_function: else: # member function return self.parent.get_name()+'::'+self.name - + def get_capi_name(self, prefix = None): """ Return the CAPI function name. """ if 'capi_name' in self.attribs: return self.attribs['capi_name'] return get_capi_name(self.name, False, prefix) - + def get_comment(self): """ Return the function comment as an array of lines. """ return self.comment - + def get_attribs(self): """ Return all attributes as a dictionary. """ return self.attribs - + def has_attrib(self, name): """ Return true if the specified attribute exists. """ return name in self.attribs - + def get_attrib(self, name): """ Return the first or only value for specified attribute. """ if name in self.attribs: @@ -998,7 +1078,7 @@ class obj_function: # the value is a string return self.attribs[name] return None - + def get_attrib_list(self, name): """ Return all values for specified attribute as a list. """ if name in self.attribs: @@ -1009,30 +1089,30 @@ class obj_function: # convert the value to a list return [self.attribs[name]] return None - + def get_retval(self): """ Return the return value object. """ return self.retval - + def get_arguments(self): """ Return the argument array. """ return self.arguments - + def get_types(self, list): """ Return a dictionary mapping data types to analyzed values. """ for cls in self.arguments: cls.get_types(list) - + def get_capi_parts(self, defined_structs = [], prefix = None): """ Return the parts of the C API function definition. """ retval = '' dict = self.retval.get_type().get_capi(defined_structs) if dict['format'] == 'single': retval = dict['value'] - + name = self.get_capi_name(prefix) args = [] - + if isinstance(self, obj_function_virtual): # virtual functions get themselves as the first argument str = 'struct _'+self.parent.get_capi_name()+'* self' @@ -1040,7 +1120,7 @@ class obj_function: # const virtual functions get const self pointers str = 'const '+str args.append(str) - + if len(self.arguments) > 0: for cls in self.arguments: type = cls.get_type() @@ -1057,7 +1137,7 @@ class obj_function: # for non-const arrays pass the size argument by address args.append('size_t* '+type_name+'Count') args.append(dict['value']) - + return { 'retval' : retval, 'name' : name, 'args' : args } def get_capi_proto(self, defined_structs = [], prefix = None): @@ -1066,17 +1146,17 @@ class obj_function: result = parts['retval']+' '+parts['name']+ \ '('+string.join(parts['args'], ', ')+')' return result - + def get_cpp_parts(self, isimpl = False): """ Return the parts of the C++ function definition. """ retval = str(self.retval) name = self.name - + args = [] if len(self.arguments) > 0: for cls in self.arguments: args.append(str(cls)) - + if isimpl and isinstance(self, obj_function_virtual): # enumeration return values must be qualified with the class name # if the type is defined in the class declaration scope. @@ -1084,9 +1164,9 @@ class obj_function: if type.is_result_struct() and type.is_result_struct_enum() and \ self.parent.has_typedef_alias(retval): retval = self.parent.get_name()+'::'+retval - + return { 'retval' : retval, 'name' : name, 'args' : args } - + def get_cpp_proto(self, classname = None): """ Return the prototype of the C++ function. """ parts = self.get_cpp_parts() @@ -1097,7 +1177,7 @@ class obj_function: if isinstance(self, obj_function_virtual) and self.is_const(): result += ' const' return result - + def is_same_side(self, other_class_name): """ Returns true if this function is on the same side (library or client) and the specified class. """ @@ -1109,7 +1189,7 @@ class obj_function: # this function is global this_is_library_side = True header = self.parent - + if other_class_name == 'CefBase': other_is_library_side = False else: @@ -1117,13 +1197,13 @@ class obj_function: if other_class is None: raise Exception('Unknown class: '+other_class_name) other_is_library_side = other_class.is_library_side() - + return other_is_library_side == this_is_library_side class obj_function_static(obj_function): """ Class representing a static function. """ - + def __init__(self, parent, attrib, retval, argval, comment): if not isinstance(parent, obj_class): raise Exception('Invalid parent object type') @@ -1139,10 +1219,10 @@ class obj_function_static(obj_function): # by default static functions are prefixed with the class name prefix = get_capi_name(self.parent.get_name(), False) return obj_function.get_capi_name(self, prefix) - + class obj_function_virtual(obj_function): """ Class representing a virtual function. """ - + def __init__(self, parent, attrib, retval, argval, comment, vfmod): if not isinstance(parent, obj_class): raise Exception('Invalid parent object type') @@ -1152,10 +1232,10 @@ class obj_function_virtual(obj_function): self.isconst = True else: self.isconst = False - + def __repr__(self): return 'virtual '+obj_function.__repr__(self)+';' - + def is_const(self): """ Returns true if the method declaration is const. """ return self.isconst @@ -1163,14 +1243,14 @@ class obj_function_virtual(obj_function): class obj_argument: """ Class representing a function argument. """ - + def __init__(self, parent, argval): if not isinstance(parent, obj_function): raise Exception('Invalid parent object type') - + self.parent = parent self.type = self.parent.parent.get_analysis(argval) - + def __repr__(self): result = '' if self.type.is_const(): @@ -1183,17 +1263,17 @@ class obj_argument: if self.type.has_name(): result += ' '+self.type.get_name() return result - + def get_name(self): """ Return the name for this argument. """ return self.type.get_name() - + def remove_name(self): """ Remove and return the name value. """ name = self.type.get_name() self.type.name = None return name - + def get_type(self): """ Return an analysis of the argument type based on the class definition context. @@ -1205,7 +1285,7 @@ class obj_argument: name = self.type.get_type() if not name in list: list[name] = self.type - + def needs_attrib_count_func(self): """ Returns true if this argument requires a 'count_func' attribute. """ # A 'count_func' attribute is required for non-const non-string vector @@ -1214,7 +1294,7 @@ class obj_argument: self.type.is_result_vector() and \ not self.type.is_result_vector_string() and \ not self.type.is_const() - + def get_attrib_count_func(self): """ Returns the count function for this argument. """ # The 'count_func' attribute value format is name:function @@ -1230,7 +1310,7 @@ class obj_argument: if string.strip(parts[0]) == name: return string.strip(parts[1]) return None - + def needs_attrib_default_retval(self): """ Returns true if this argument requires a 'default_retval' attribute. """ @@ -1239,16 +1319,16 @@ class obj_argument: return not self.type.has_name() and \ self.type.is_result_struct() and \ self.type.is_result_struct_enum() - + def get_attrib_default_retval(self): """ Returns the defualt return value for this argument. """ return self.parent.get_attrib('default_retval') - + def get_arg_type(self): """ Returns the argument type as defined in translator.README.txt. """ if not self.type.has_name(): raise Exception('Cannot be called for retval types') - + # simple or enumeration type if (self.type.is_result_simple() and \ self.type.get_type() != 'bool') or \ @@ -1261,7 +1341,7 @@ class obj_argument: elif self.type.is_byaddr(): return 'simple_byaddr' return 'simple_byval' - + # boolean type if self.type.get_type() == 'bool': if self.type.is_byref(): @@ -1269,19 +1349,19 @@ class obj_argument: elif self.type.is_byaddr(): return 'bool_byaddr' return 'bool_byval' - + # structure type if self.type.is_result_struct() and self.type.is_byref(): if self.type.is_const(): return 'struct_byref_const' return 'struct_byref' - + # string type if self.type.is_result_string() and self.type.is_byref(): if self.type.is_const(): return 'string_byref_const' return 'string_byref' - + # refptr type if self.type.is_result_refptr(): same_side = self.parent.is_same_side(self.type.get_refptr_type()) @@ -1292,31 +1372,31 @@ class obj_argument: if same_side: return 'refptr_same' return 'refptr_diff' - - + + if self.type.is_result_vector(): # all vector types must be passed by reference if not self.type.is_byref(): return 'invalid' - + if self.type.is_result_vector_string(): # string vector type if self.type.is_const(): return 'string_vec_byref_const' return 'string_vec_byref' - + if self.type.is_result_vector_simple(): if self.type.get_vector_type() != 'bool': # simple/enumeration vector types if self.type.is_const(): return 'simple_vec_byref_const' return 'simple_vec_byref' - + # boolean vector types if self.type.is_const(): return 'bool_vec_byref_const' return 'bool_vec_byref' - + if self.type.is_result_vector_refptr(): # refptr vector types same_side = self.parent.is_same_side(self.type.get_refptr_type()) @@ -1327,8 +1407,8 @@ class obj_argument: if same_side: return 'refptr_vec_same_byref' return 'refptr_vec_diff_byref' - - + + # string single map type if self.type.is_result_map_single(): if not self.type.is_byref(): @@ -1336,7 +1416,7 @@ class obj_argument: if self.type.is_const(): return 'string_map_single_byref_const' return 'string_map_single_byref' - + # string multi map type if self.type.is_result_map_multi(): if not self.type.is_byref(): @@ -1344,14 +1424,14 @@ class obj_argument: if self.type.is_const(): return 'string_map_multi_byref_const' return 'string_map_multi_byref' - + return 'invalid' def get_retval_type(self): """ Returns the retval type as defined in translator.README.txt. """ if self.type.has_name(): raise Exception('Cannot be called for argument types') - + # unsupported modifiers if self.type.is_const() or self.type.is_byref() or \ self.type.is_byaddr(): @@ -1392,7 +1472,7 @@ class obj_argument: if retval == 'false': return '0' return retval - + # next look at the retval type value. type = self.get_retval_type() if type == 'simple': @@ -1407,63 +1487,66 @@ class obj_argument: return 'CefString()' elif type == 'refptr_same' or type == 'refptr_diff': return 'NULL' - + return '' - + class obj_analysis: """ Class representing an analysis of a data type value. """ - + def __init__(self, scopelist, value, named): self.value = value self.result_type = 'unknown' self.result_value = None self.result_default = None self.refptr_type = None - + # parse the argument string partlist = string.split(string.strip(value)) - + if named == True: # extract the name value self.name = partlist[-1] del partlist[-1] else: self.name = None - + if len(partlist) == 0: raise Exception('Invalid argument value: '+value) - + # check const status if partlist[0] == 'const': self.isconst = True del partlist[0] else: self.isconst = False - + + if len(partlist) == 0: + raise Exception('Invalid argument value: '+value) + # combine the data type self.type = string.join(partlist, ' ') - + # extract the last character of the data type endchar = self.type[-1] - + # check if the value is passed by reference if endchar == '&': self.isbyref = True self.type = self.type[:-1] else: self.isbyref = False - + # check if the value is passed by address if endchar == '*': self.isbyaddr = True self.type = self.type[:-1] else: self.isbyaddr = False - + # see if the value is directly identifiable if self._check_advanced(self.type) == True: return - + # not identifiable, so look it up translation = None for scope in scopelist: @@ -1473,14 +1556,14 @@ class obj_analysis: translation = scope.get_alias_translation(self.type) if not translation is None: break - + if translation is None: raise Exception('Failed to translate type: '+self.type) - + # the translation succeeded so keep the result self.result_type = translation.result_type self.result_value = translation.result_value - + def _check_advanced(self, value): # check for vectors if value.find('std::vector') == 0: @@ -1491,7 +1574,7 @@ class obj_analysis: ] self.result_value[0]['vector_type'] = val return True - + # check for maps if value.find('std::map') == 0: self.result_type = 'map' @@ -1513,7 +1596,7 @@ class obj_analysis: self._get_basic(string.strip(vals[1])) ] return True - + # check for basic types basic = self._get_basic(value) if not basic is None: @@ -1524,9 +1607,9 @@ class obj_analysis: if 'result_default' in basic: self.result_default = basic['result_default'] return True - + return False - + def _get_basic(self, value): # check for string values if value == "CefString": @@ -1534,7 +1617,7 @@ class obj_analysis: 'result_type' : 'string', 'result_value' : None } - + # check for simple direct translations if value in _simpletypes.keys(): return { @@ -1542,14 +1625,14 @@ class obj_analysis: 'result_value' : _simpletypes[value][0], 'result_default' : _simpletypes[value][1], } - + # check if already a C API structure if value[-2:] == '_t': return { 'result_type' : 'structure', 'result_value' : value } - + # check for CEF reference pointers p = re.compile('^CefRefPtr<(.*?)>$', re.DOTALL) list = p.findall(value) @@ -1566,28 +1649,28 @@ class obj_analysis: 'result_type' : 'structure', 'result_value' : get_capi_name(value, True) } - + return None - + def __repr__(self): return '('+self.result_type+') '+str(self.result_value) - + def has_name(self): """ Returns true if a name value exists. """ return (not self.name is None) - + def get_name(self): """ Return the name. """ return self.name - + def get_value(self): """ Return the C++ value (type + name). """ return self.value - + def get_type(self): """ Return the C++ type. """ return self.type - + def get_refptr_type(self): """ Return the C++ class type referenced by a CefRefPtr. """ if self.is_result_vector() and self.is_result_vector_refptr(): @@ -1595,33 +1678,33 @@ class obj_analysis: return self.result_value[0]['refptr_type'] # return the basic RefPtr type return self.refptr_type - + def get_vector_type(self): """ Return the C++ class type referenced by a std::vector. """ if self.is_result_vector(): return self.result_value[0]['vector_type'] return None - + def is_const(self): """ Returns true if the argument value is constant. """ return self.isconst - + def is_byref(self): """ Returns true if the argument is passed by reference. """ return self.isbyref - + def is_byaddr(self): """ Returns true if the argument is passed by address. """ return self.isbyaddr - + def is_result_simple(self): """ Returns true if this is a simple argument type. """ return (self.result_type == 'simple') - + def get_result_simple_type_root(self): """ Return the simple structure or basic type name. """ return self.result_value - + def get_result_simple_type(self): """ Return the simple type. """ result = '' @@ -1631,19 +1714,19 @@ class obj_analysis: if self.is_byaddr() or self.is_byref(): result += '*' return result - + def get_result_simple_default(self): """ Return the default value fo the basic type. """ return self.result_default - + def is_result_refptr(self): """ Returns true if this is a reference pointer type. """ return (self.result_type == 'refptr') - + def get_result_refptr_type_root(self): """ Return the refptr type structure name. """ return self.result_value[:-1] - + def get_result_refptr_type(self, defined_structs = []): """ Return the refptr type. """ result = '' @@ -1653,11 +1736,11 @@ class obj_analysis: if self.is_byref() or self.is_byaddr(): result += '*' return result - + def is_result_struct(self): """ Returns true if this is a structure type. """ return (self.result_type == 'structure') - + def is_result_struct_enum(self): """ Returns true if this struct type is likely an enumeration. """ # structure values that are passed by reference or address must be @@ -1665,7 +1748,7 @@ class obj_analysis: if not self.is_byref() and not self.is_byaddr(): return True return False - + def get_result_struct_type(self, defined_structs = []): """ Return the structure or enumeration type. """ result = '' @@ -1679,11 +1762,11 @@ class obj_analysis: if not is_enum: result += '*' return result - + def is_result_string(self): """ Returns true if this is a string type. """ return (self.result_type == 'string') - + def get_result_string_type(self): """ Return the string type. """ if not self.has_name(): @@ -1700,37 +1783,37 @@ class obj_analysis: def is_result_vector(self): """ Returns true if this is a vector type. """ return (self.result_type == 'vector') - + def is_result_vector_string(self): """ Returns true if this is a string vector. """ return self.result_value[0]['result_type'] == 'string' - + def is_result_vector_simple(self): """ Returns true if this is a string vector. """ return self.result_value[0]['result_type'] == 'simple' - + def is_result_vector_refptr(self): """ Returns true if this is a string vector. """ return self.result_value[0]['result_type'] == 'refptr' - + def get_result_vector_type_root(self): """ Return the vector structure or basic type name. """ return self.result_value[0]['result_value'] - + def get_result_vector_type(self, defined_structs = []): """ Return the vector type. """ if not self.has_name(): raise Exception('Cannot use vector as a return type') - + type = self.result_value[0]['result_type'] value = self.result_value[0]['result_value'] - + result = {} if type == 'string': result['value'] = 'cef_string_list_t' result['format'] = 'single' return result - + if type == 'simple': str = value if self.is_const(): @@ -1748,24 +1831,24 @@ class obj_analysis: result['value'] = str else: raise Exception('Unsupported vector type: '+type) - + # vector values must be passed as a value array parameter # and a size parameter result['format'] = 'multi-arg' return result - + def is_result_map(self): """ Returns true if this is a map type. """ return (self.result_type == 'map' or self.result_type == 'multimap') - + def is_result_map_single(self): """ Returns true if this is a single map type. """ return (self.result_type == 'map') - + def is_result_map_multi(self): """ Returns true if this is a multi map type. """ return (self.result_type == 'multimap') - + def get_result_map_type(self, defined_structs = []): """ Return the map type. """ if not self.has_name(): @@ -1807,10 +1890,10 @@ class obj_analysis: if resdict['format'] != 'single': format = resdict['format'] result += resdict['value'] - + if self.has_name(): result += ' '+self.get_name() - + return {'format' : format, 'value' : result} @@ -1818,38 +1901,38 @@ class obj_analysis: if __name__ == "__main__": import pprint import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) != 2: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + pp = pprint.PrettyPrinter(indent=4) - + # create the header object header = obj_header() header.add_directory(sys.argv[1]) - + # output the type mapping types = {} header.get_types(types) pp.pprint(types) sys.stdout.write('\n') - + # output the parsed C++ data sys.stdout.write(wrap_code(str(header), '\t')) - + # output the C API formatted data defined_names = header.get_defined_structs() result = '' - + # global functions funcs = header.get_funcs() if len(funcs) > 0: for func in funcs: result += func.get_capi_proto(defined_names)+';\n' result += '\n' - + classes = header.get_classes() for cls in classes: # virtual functions are inside a structure @@ -1859,9 +1942,9 @@ if __name__ == "__main__": for func in funcs: result += '\t'+func.get_capi_proto(defined_names)+';\n' result += '}\n\n' - + defined_names.append(cls.get_capi_name()) - + # static functions become global funcs = cls.get_static_funcs() if len(funcs) > 0: diff --git a/tools/make_capi_header.py b/tools/make_capi_header.py index 8cf897773..3d8e13ad0 100644 --- a/tools/make_capi_header.py +++ b/tools/make_capi_header.py @@ -40,10 +40,10 @@ def make_capi_member_funcs(funcs, defined_names, translate_map, indent): def make_capi_header(header, filename): # structure names that have already been defined defined_names = header.get_defined_structs() - + # map of strings that will be changed in C++ comments translate_map = header.get_capi_translations() - + # header string result = \ """// Copyright (c) $YEAR$ Marshall A. Greenblatt. All rights reserved. @@ -127,15 +127,18 @@ extern "C" { # virtual functions are inside the structure classname = cls.get_capi_name() result += '\n'+format_comment(cls.get_comment(), '', translate_map); - result += 'typedef struct _'+classname+ \ - ' {\n ///\n // Base structure.\n ///\n cef_base_t base;\n' + result += 'typedef struct _'+classname+' {\n'+\ + ' ///\n'+\ + ' // Base structure.\n'+\ + ' ///\n'+\ + ' '+cls.get_parent_capi_name()+' base;\n' funcs = cls.get_virtual_funcs() result += make_capi_member_funcs(funcs, defined_names, translate_map, ' ') result += '} '+classname+';\n\n' - + defined_names.append(cls.get_capi_name()) - + # static functions become global funcs = cls.get_static_funcs() if len(funcs) > 0: @@ -156,47 +159,46 @@ extern "C" { #endif // $GUARD$ """ - + # add the copyright year result = result.replace('$YEAR$', get_year()) # add the guard string - guard = 'CEF_INCLUDE_CAPI_'+string.upper(filename.replace('.', '_capi_'))+'_' + guard = 'CEF_INCLUDE_CAPI_'+string.upper(filename.replace('/', '_').replace('.', '_capi_'))+'_' result = result.replace('$GUARD$', guard) - + return result -def write_capi_header(header, filepath, backup): - capi_path = get_capi_file_name(filepath) +def write_capi_header(header, header_dir, filename, backup): + capi_path = get_capi_file_name(os.path.join(header_dir, filename)) if path_exists(capi_path): oldcontents = read_file(capi_path) else: oldcontents = '' - filename = os.path.split(filepath)[1] newcontents = make_capi_header(header, filename) if newcontents != oldcontents: if backup and oldcontents != '': backup_file(capi_path) write_file(capi_path, newcontents) return True - + return False # test the module if __name__ == "__main__": import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) < 2: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + # create the header object header = obj_header() header.add_file(sys.argv[1]) - + # dump the result to stdout filename = os.path.split(sys.argv[1])[1] sys.stdout.write(make_capi_header(header, filename)) diff --git a/tools/make_cmake.py b/tools/make_cmake.py index 7aa0807bc..3357e6f5f 100644 --- a/tools/make_cmake.py +++ b/tools/make_cmake.py @@ -36,6 +36,9 @@ def get_files_for_variable(cmake_path, variables, variable): if path[0] == '<': # Skip gyp include variables continue + if path.find('/test/') >= 0: + # Skip test files + continue abspath = os.path.join(cef_dir, path) newpath = normalize_path(os.path.relpath(abspath, cmake_dirname)) diff --git a/tools/make_cpptoc_header.py b/tools/make_cpptoc_header.py index 2bf5a5f6d..536266076 100644 --- a/tools/make_cpptoc_header.py +++ b/tools/make_cpptoc_header.py @@ -8,17 +8,24 @@ def make_cpptoc_header(header, clsname): cls = header.get_class(clsname) if cls is None: raise Exception('Class does not exist: '+clsname) - + dllside = cls.is_library_side() - defname = string.upper(get_capi_name(clsname[3:], False)) + + directory = cls.get_file_directory() + defname = '' + if not directory is None: + defname += directory + '_' + defname += get_capi_name(clsname[3:], False) + defname = defname.upper() + capiname = cls.get_capi_name() - + result = get_copyright() result += '#ifndef CEF_LIBCEF_DLL_CPPTOC_'+defname+'_CPPTOC_H_\n'+ \ '#define CEF_LIBCEF_DLL_CPPTOC_'+defname+'_CPPTOC_H_\n' + \ '#pragma once\n' - + if dllside: result += """ #ifndef BUILDING_CEF_SHARED @@ -53,53 +60,56 @@ def make_cpptoc_header(header, clsname): result += '// This class may be instantiated and accessed DLL-side only.\n' else: result += '// This class may be instantiated and accessed wrapper-side only.\n' - + result += 'class '+clsname+'CppToC\n'+ \ ' : public CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'> {\n'+ \ ' public:\n'+ \ - ' explicit '+clsname+'CppToC('+clsname+'* cls);\n'+ \ + ' '+clsname+'CppToC();\n'+ \ '};\n\n' - + if dllside: result += '#endif // BUILDING_CEF_SHARED\n' else: result += '#endif // USING_CEF_SHARED\n' - - result += '#endif // CEF_LIBCEF_DLL_CPPTOC_'+defname+'_CPPTOC_H_\n' - + + result += '#endif // CEF_LIBCEF_DLL_CPPTOC_'+defname+'_CPPTOC_H_' + return wrap_code(result) def write_cpptoc_header(header, clsname, dir, backup): - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_cpptoc.h' - + # give the output file the same directory offset as the input file + cls = header.get_class(clsname) + dir = os.path.dirname(os.path.join(dir, cls.get_file_name())) + file = os.path.join(dir, get_capi_name(clsname[3:], False)+'_cpptoc.h') + if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - + newcontents = make_cpptoc_header(header, clsname) if newcontents != oldcontents: if backup and oldcontents != '': backup_file(file) write_file(file, newcontents) return True - + return False # test the module if __name__ == "__main__": import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) < 3: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + # create the header object header = obj_header() header.add_file(sys.argv[1]) - + # dump the result to stdout sys.stdout.write(make_cpptoc_header(header, sys.argv[2])) diff --git a/tools/make_cpptoc_impl.py b/tools/make_cpptoc_impl.py index 7d7f0aedb..38adcd1c2 100644 --- a/tools/make_cpptoc_impl.py +++ b/tools/make_cpptoc_impl.py @@ -9,39 +9,39 @@ def make_cpptoc_impl_proto(name, func, parts): proto = parts['retval']+' CEF_CALLBACK' else: proto = 'CEF_EXPORT '+parts['retval'] - + proto += ' '+name+'('+string.join(parts['args'], ', ')+')' return proto -def make_cpptoc_function_impl_existing(name, func, impl, defined_names): +def make_cpptoc_function_impl_existing(cls, name, func, impl, defined_names): notify(name+' has manual edits') - + # retrieve the C API prototype parts parts = func.get_capi_parts(defined_names) - + changes = format_translation_changes(impl, parts) if len(changes) > 0: notify(name+' prototype changed') - + return wrap_code(make_cpptoc_impl_proto(name, func, parts))+'{'+ \ changes+impl['body']+'\n}\n' return result -def make_cpptoc_function_impl_new(name, func, defined_names): +def make_cpptoc_function_impl_new(cls, name, func, defined_names): # retrieve the C API prototype parts parts = func.get_capi_parts(defined_names) result = make_cpptoc_impl_proto(name, func, parts)+' {' - + invalid = [] - + # retrieve the function arguments args = func.get_arguments() - + # determine the argument types for arg in args: if arg.get_arg_type() == 'invalid': invalid.append(arg.get_name()) - + # retrieve the function return value retval = func.get_retval() retval_type = retval.get_retval_type() @@ -52,7 +52,7 @@ def make_cpptoc_function_impl_new(name, func, defined_names): retval_default = retval.get_retval_default(True) if len(retval_default) > 0: retval_default = ' '+retval_default; - + if len(invalid) > 0: notify(name+' could not be autogenerated') # code could not be auto-generated @@ -63,29 +63,29 @@ def make_cpptoc_function_impl_new(name, func, defined_names): result += '\n // END DELETE BEFORE MODIFYING' result += '\n}\n\n' return wrap_code(result) - + result += '\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n' - + result_len = len(result) - + optional = [] - + # parameter verification if isinstance(func, obj_function_virtual): result += '\n DCHECK(self);'\ '\n if (!self)'\ '\n return'+retval_default+';' - + for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + # skip optional params optional_params = arg.parent.get_attrib_list('optional_param') if not optional_params is None and arg_name in optional_params: optional.append(arg_name) continue - + comment = '\n // Verify param: '+arg_name+'; type: '+arg_type if arg_type == 'simple_byref' or arg_type == 'simple_byref_const' or \ @@ -136,16 +136,16 @@ def make_cpptoc_function_impl_new(name, func, defined_names): if len(result) != result_len: result += '\n' result_len = len(result) - + # parameter translation params = [] - + for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + comment = '\n // Translate param: '+arg_name+'; type: '+arg_type - + if arg_type == 'simple_byval' or arg_type == 'simple_byaddr': params.append(arg_name) elif arg_type == 'simple_byref' or arg_type == 'simple_byref_const': @@ -258,11 +258,11 @@ def make_cpptoc_function_impl_new(name, func, defined_names): '\n }'\ '\n }' params.append(arg_name+'List') - + if len(result) != result_len: result += '\n' result_len = len(result) - + # execution result += '\n // Execute\n ' @@ -273,29 +273,34 @@ def make_cpptoc_function_impl_new(name, func, defined_names): else: result += retval.get_type().get_type() result += ' _retval = ' - + if isinstance(func.parent, obj_class): # virtual and static class methods if isinstance(func, obj_function_virtual): - result += func.parent.get_name()+'CppToC::Get(self)->' + if cls.get_name() == func.parent.get_name(): + # virtual method for the current class + result += func.parent.get_name()+'CppToC::Get(self)->' + else: + # virtual method for a parent class + result += cls.get_name()+'CppToC::Get(reinterpret_cast<'+cls.get_capi_name()+'*>(self))->' else: result += func.parent.get_name()+'::' result += func.get_name()+'(' - + if len(params) > 0: result += '\n '+string.join(params,',\n ') - + result += ');\n' - + result_len = len(result) - + # parameter restoration for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + comment = '\n // Restore param: '+arg_name+'; type: '+arg_type - + if arg_type == 'simple_byref': result += comment+\ '\n if ('+arg_name+')'\ @@ -355,25 +360,25 @@ def make_cpptoc_function_impl_new(name, func, defined_names): '\n }'\ '\n }'\ '\n }' - + if len(result) != result_len: result += '\n' result_len = len(result) - + # special handling for the global cef_shutdown function if name == 'cef_shutdown' and isinstance(func.parent, obj_header): classes = func.parent.get_classes() - + names = [] - for cls in classes: - if cls.has_attrib('no_debugct_check'): + for tmpcls in classes: + if tmpcls.has_attrib('no_debugct_check'): continue; - if cls.is_library_side(): - names.append(cls.get_name()+'CppToC') + if tmpcls.is_library_side(): + names.append(tmpcls.get_name()+'CppToC') else: - names.append(cls.get_name()+'CToCpp') - + names.append(tmpcls.get_name()+'CToCpp') + if len(names) > 0: names = sorted(names) result += '\n#ifndef NDEBUG'\ @@ -381,11 +386,11 @@ def make_cpptoc_function_impl_new(name, func, defined_names): for name in names: result += '\n DCHECK(base::AtomicRefCountIsZero(&'+name+'::DebugObjCt));'; result += '\n#endif // !NDEBUG' - + if len(result) != result_len: result += '\n' result_len = len(result) - + # return translation if retval_type != 'none': # has a return value @@ -400,16 +405,16 @@ def make_cpptoc_function_impl_new(name, func, defined_names): elif retval_type == 'refptr_diff': refptr_class = retval.get_type().get_refptr_type() result += '\n return '+refptr_class+'CToCpp::Unwrap(_retval);' - + if len(result) != result_len: result += '\n' - + result += '}\n' return wrap_code(result) -def make_cpptoc_function_impl(funcs, existing, prefixname, defined_names): +def make_cpptoc_function_impl(cls, funcs, existing, prefixname, defined_names): impl = '' - + for func in funcs: if not prefixname is None: name = prefixname+'_'+func.get_capi_name() @@ -419,84 +424,155 @@ def make_cpptoc_function_impl(funcs, existing, prefixname, defined_names): if not value is None \ and value['body'].find('// AUTO-GENERATED CONTENT') < 0: # an implementation exists that was not auto-generated - impl += make_cpptoc_function_impl_existing(name, func, value, defined_names) + impl += make_cpptoc_function_impl_existing(cls, name, func, value, defined_names) else: - impl += make_cpptoc_function_impl_new(name, func, defined_names) - + impl += make_cpptoc_function_impl_new(cls, name, func, defined_names) + return impl - + +def make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined_names): + funcs = [] + funcs.extend(cls.get_virtual_funcs()) + cur_cls = cls + while True: + parent_name = cur_cls.get_parent_name() + if parent_name == 'CefBase': + break + else: + parent_cls = header.get_class(parent_name, defined_names) + if parent_cls is None: + raise Exception('Class does not exist: '+parent_name) + funcs.extend(parent_cls.get_virtual_funcs()) + cur_cls = header.get_class(parent_name, defined_names) + + return make_cpptoc_function_impl(cls, funcs, existing, prefixname, defined_names) + +def make_cpptoc_virtual_function_assignment_block(funcs, offset, prefixname): + impl = '' + for func in funcs: + name = func.get_capi_name() + impl += ' GetStruct()->'+offset+name+' = '+prefixname+'_'+name+';\n' + return impl + +def make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_names): + impl = make_cpptoc_virtual_function_assignment_block(cls.get_virtual_funcs(), '', prefixname) + + cur_cls = cls + offset = '' + while True: + parent_name = cur_cls.get_parent_name() + offset += 'base.' + if parent_name == 'CefBase': + break + else: + parent_cls = header.get_class(parent_name, defined_names) + if parent_cls is None: + raise Exception('Class does not exist: '+parent_name) + impl += make_cpptoc_virtual_function_assignment_block(parent_cls.get_virtual_funcs(), offset, prefixname) + cur_cls = header.get_class(parent_name, defined_names) + + return impl + +def make_cpptoc_unwrap_derived(header, cls): + # identify all classes that derive from cls + derived_classes = [] + clsname = cls.get_name() + allclasses = header.get_classes() + for cur_cls in allclasses: + if cur_cls.get_name() == clsname: + continue + if cur_cls.has_parent(clsname): + derived_classes.append(cur_cls.get_name()) + + derived_classes = sorted(derived_classes) + + impl = '' + for clsname in derived_classes: + impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\ + ' return '+clsname+'CppToC::Unwrap(reinterpret_cast<'+\ + get_capi_name(clsname, True)+'*>(s));\n'+\ + ' }\n' + return impl + def make_cpptoc_class_impl(header, clsname, impl): # structure names that have already been defined defined_names = header.get_defined_structs() - + # retrieve the class and populate the defined names cls = header.get_class(clsname, defined_names) if cls is None: raise Exception('Class does not exist: '+clsname) - + capiname = cls.get_capi_name() prefixname = get_capi_name(clsname[3:], False) - + # retrieve the existing virtual function implementations existing = get_function_impls(impl, 'CEF_CALLBACK') - + # generate virtual functions - virtualimpl = make_cpptoc_function_impl(cls.get_virtual_funcs(), existing, prefixname, defined_names) + virtualimpl = make_cpptoc_virtual_function_impl(header, cls, existing, prefixname, defined_names) if len(virtualimpl) > 0: - virtualimpl = '\n// MEMBER FUNCTIONS - Body may be edited by hand.\n\n'+virtualimpl - - # the current class is already defined for static functions + virtualimpl = '\nnamespace {\n\n// MEMBER FUNCTIONS - Body may be edited by hand.\n\n'+virtualimpl+'} // namespace' + + # the current class is already defined for static functions defined_names.append(cls.get_capi_name()) - + # retrieve the existing static function implementations existing = get_function_impls(impl, 'CEF_EXPORT') - + # generate static functions - staticimpl = make_cpptoc_function_impl(cls.get_static_funcs(), existing, None, defined_names) + staticimpl = make_cpptoc_function_impl(cls, cls.get_static_funcs(), existing, None, defined_names) if len(staticimpl) > 0: staticimpl = '\n// GLOBAL FUNCTIONS - Body may be edited by hand.\n\n'+staticimpl - + resultingimpl = staticimpl + virtualimpl - + + # any derived classes can be unwrapped + unwrapderived = make_cpptoc_unwrap_derived(header, cls) + # determine what includes are required by identifying what translation # classes are being used - includes = format_translation_includes(resultingimpl) - + includes = format_translation_includes(header, resultingimpl + unwrapderived) + # build the final output result = get_copyright() result += includes+'\n'+resultingimpl+'\n' - + + parent_sig = 'CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'>' + const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \ - clsname+'CppToC::'+clsname+'CppToC('+clsname+'* cls)\n'+ \ - ' : CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'>(cls) '+ \ - '{\n'; - - funcs = cls.get_virtual_funcs() - for func in funcs: - name = func.get_capi_name() - const += ' struct_.struct_.'+name+' = '+prefixname+'_'+name+';\n' - + clsname+'CppToC::'+clsname+'CppToC() {\n' + + const += make_cpptoc_virtual_function_assignment(header, cls, prefixname, defined_names) + const += '}\n\n'+ \ + 'template<> CefRefPtr<'+clsname+'> '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+capiname+'* s) {\n' + \ + unwrapderived + \ + ' NOTREACHED() << "Unexpected class type: " << type;\n'+ \ + ' return NULL;\n'+ \ + '}\n\n'+ \ '#ifndef NDEBUG\n'+ \ - 'template<> base::AtomicRefCount CefCppToC<'+clsname+'CppToC, '+clsname+', '+capiname+'>::DebugObjCt = 0;\n'+ \ - '#endif\n' - result += wrap_code(const) + 'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \ + '#endif\n\n'+ \ + 'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';' + + result += '\n\n'+wrap_code(const) return result def make_cpptoc_global_impl(header, impl): # structure names that have already been defined defined_names = header.get_defined_structs() - + # retrieve the existing global function implementations existing = get_function_impls(impl, 'CEF_EXPORT') - + # generate global functions - impl = make_cpptoc_function_impl(header.get_funcs(), existing, None, defined_names) + impl = make_cpptoc_function_impl(None, header.get_funcs(), existing, None, defined_names) if len(impl) > 0: impl = '\n// GLOBAL FUNCTIONS - Body may be edited by hand.\n\n'+impl - + includes = '' # include required headers for global functions @@ -507,10 +583,10 @@ def make_cpptoc_global_impl(header, impl): includes += '#include "include/'+func.get_file_name()+'"\n' \ '#include "include/capi/'+func.get_capi_file_name()+'"\n' filenames.append(filename) - + # determine what includes are required by identifying what translation # classes are being used - includes += format_translation_includes(impl) + includes += format_translation_includes(header, impl) # build the final output result = get_copyright() @@ -525,13 +601,16 @@ def write_cpptoc_impl(header, clsname, dir, backup): file = dir else: # class file - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_cpptoc.cc' - + # give the output file the same directory offset as the input file + cls = header.get_class(clsname) + dir = os.path.dirname(os.path.join(dir, cls.get_file_name())) + file = os.path.join(dir, get_capi_name(clsname[3:], False)+'_cpptoc.cc') + if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - + if clsname is None: newcontents = make_cpptoc_global_impl(header, oldcontents) else: @@ -541,23 +620,23 @@ def write_cpptoc_impl(header, clsname, dir, backup): backup_file(file) write_file(file, newcontents) return True - + return False # test the module if __name__ == "__main__": import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) < 4: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + # create the header object header = obj_header() header.add_file(sys.argv[1]) - + # read the existing implementation file into memory try: f = open(sys.argv[3], 'r') @@ -566,6 +645,6 @@ if __name__ == "__main__": raise Exception('Failed to read file '+sys.argv[3]+': '+strerror) else: f.close() - + # dump the result to stdout sys.stdout.write(make_cpptoc_class_impl(header, sys.argv[2], data)) diff --git a/tools/make_ctocpp_header.py b/tools/make_ctocpp_header.py index ac352b7a6..94d54f861 100644 --- a/tools/make_ctocpp_header.py +++ b/tools/make_ctocpp_header.py @@ -4,21 +4,60 @@ from cef_parser import * +def make_function_body_block(cls): + impl = ' // '+cls.get_name()+' methods.\n'; + + funcs = cls.get_virtual_funcs() + for func in funcs: + impl += ' '+func.get_cpp_proto() + if cls.is_client_side(): + impl += ' override;\n' + else: + impl += ' OVERRIDE;\n' + + return impl + +def make_function_body(header, cls): + impl = make_function_body_block(cls) + + cur_cls = cls + while True: + parent_name = cur_cls.get_parent_name() + if parent_name == 'CefBase': + break + else: + parent_cls = header.get_class(parent_name) + if parent_cls is None: + raise Exception('Class does not exist: '+parent_name) + if len(impl) > 0: + impl += '\n' + impl += make_function_body_block(parent_cls) + cur_cls = header.get_class(parent_name) + + return impl + def make_ctocpp_header(header, clsname): cls = header.get_class(clsname) if cls is None: raise Exception('Class does not exist: '+clsname) - + clientside = cls.is_client_side() - defname = string.upper(get_capi_name(clsname[3:], False)) + + directory = cls.get_file_directory() + defname = '' + if not directory is None: + defname += directory + '_' + defname += get_capi_name(clsname[3:], False) + defname = defname.upper() + capiname = cls.get_capi_name() - + result = get_copyright() result += '#ifndef CEF_LIBCEF_DLL_CTOCPP_'+defname+'_CTOCPP_H_\n'+ \ '#define CEF_LIBCEF_DLL_CTOCPP_'+defname+'_CTOCPP_H_\n' + \ '#pragma once\n' - + if clientside: result += """ #ifndef BUILDING_CEF_SHARED @@ -33,13 +72,7 @@ def make_ctocpp_header(header, clsname): """ # build the function body - func_body = '' - funcs = cls.get_virtual_funcs() - for func in funcs: - if clientside: - func_body += ' '+func.get_cpp_proto()+' override;\n' - else: - func_body += ' virtual '+func.get_cpp_proto()+' OVERRIDE;\n' + func_body = make_function_body(header, cls) # include standard headers if func_body.find('std::map') > 0 or func_body.find('std::multimap') > 0: @@ -58,7 +91,7 @@ def make_ctocpp_header(header, clsname): if dcls.get_file_name() != cls.get_file_name(): result += '#include "include/'+dcls.get_file_name()+'"\n' \ '#include "include/capi/'+dcls.get_capi_file_name()+'"\n' - + result += """#include "libcef_dll/ctocpp/ctocpp.h" // Wrap a C structure with a C++ class. @@ -68,57 +101,58 @@ def make_ctocpp_header(header, clsname): result += '// This class may be instantiated and accessed DLL-side only.\n' else: result += '// This class may be instantiated and accessed wrapper-side only.\n' - + result += 'class '+clsname+'CToCpp\n'+ \ ' : public CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'> {\n'+ \ ' public:\n'+ \ - ' explicit '+clsname+'CToCpp('+capiname+'* str)\n'+ \ - ' : CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'>(str) {}\n\n'+ \ - ' // '+clsname+' methods\n'; - + ' '+clsname+'CToCpp();\n\n' + result += func_body result += '};\n\n' - + if clientside: result += '#endif // BUILDING_CEF_SHARED\n' else: result += '#endif // USING_CEF_SHARED\n' - - result += '#endif // CEF_LIBCEF_DLL_CTOCPP_'+defname+'_CTOCPP_H_\n' - + + result += '#endif // CEF_LIBCEF_DLL_CTOCPP_'+defname+'_CTOCPP_H_' + return wrap_code(result) def write_ctocpp_header(header, clsname, dir, backup): - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_ctocpp.h' - + # give the output file the same directory offset as the input file + cls = header.get_class(clsname) + dir = os.path.dirname(os.path.join(dir, cls.get_file_name())) + file = os.path.join(dir, get_capi_name(clsname[3:], False)+'_ctocpp.h') + if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - + newcontents = make_ctocpp_header(header, clsname) if newcontents != oldcontents: if backup and oldcontents != '': backup_file(file) write_file(file, newcontents) return True - + return False # test the module if __name__ == "__main__": import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) < 3: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + # create the header object header = obj_header() header.add_file(sys.argv[1]) - + # dump the result to stdout sys.stdout.write(make_ctocpp_header(header, sys.argv[2])) diff --git a/tools/make_ctocpp_impl.py b/tools/make_ctocpp_impl.py index 1d109fb7c..edca5e97e 100644 --- a/tools/make_ctocpp_impl.py +++ b/tools/make_ctocpp_impl.py @@ -6,7 +6,7 @@ from cef_parser import * def make_ctocpp_impl_proto(clsname, name, func, parts): const = '' - + if clsname is None: proto = 'CEF_GLOBAL '+parts['retval']+' ' else: @@ -15,22 +15,22 @@ def make_ctocpp_impl_proto(clsname, name, func, parts): proto += 'CToCpp' if func.is_const(): const = ' const' - + proto += '::' - + proto += name+'('+string.join(parts['args'], ', ')+')'+const return proto def make_ctocpp_function_impl_existing(clsname, name, func, impl): notify(name+' has manual edits') - + # retrieve the C++ prototype parts parts = func.get_cpp_parts(True) - + changes = format_translation_changes(impl, parts) if len(changes) > 0: notify(name+' prototype changed') - + return wrap_code(make_ctocpp_impl_proto(clsname, name, func, parts))+'{'+ \ changes+impl['body']+'\n}\n' @@ -38,17 +38,25 @@ def make_ctocpp_function_impl_new(clsname, name, func): # build the C++ prototype parts = func.get_cpp_parts(True) result = make_ctocpp_impl_proto(clsname, name, func, parts)+' {' - + + if isinstance(func, obj_function_virtual): + # determine how the struct should be referenced + if clsname == func.parent.get_name(): + result += '\n '+get_capi_name(clsname, True)+'* _struct = GetStruct();' + else: + result += '\n '+func.parent.get_capi_name()+'* _struct = reinterpret_cast<'+\ + func.parent.get_capi_name()+'*>(GetStruct());' + invalid = [] - + # retrieve the function arguments args = func.get_arguments() - + # determine the argument types for arg in args: if arg.get_arg_type() == 'invalid': invalid.append(arg.get_name()) - + # retrieve the function return value retval = func.get_retval() retval_type = retval.get_retval_type() @@ -59,7 +67,7 @@ def make_ctocpp_function_impl_new(clsname, name, func): retval_default = retval.get_retval_default(False) if len(retval_default) > 0: retval_default = ' '+retval_default; - + # add API hash check if func.has_attrib('api_hash_check'): result += '\n const char* api_hash = cef_api_hash(0);'\ @@ -68,10 +76,10 @@ def make_ctocpp_function_impl_new(clsname, name, func): '\n NOTREACHED();'\ '\n return'+retval_default+';'\ '\n }\n' - + if isinstance(func, obj_function_virtual): # add the structure size check - result += '\n if (CEF_MEMBER_MISSING(struct_, '+func.get_capi_name()+'))' + result += '\n if (CEF_MEMBER_MISSING(_struct, '+func.get_capi_name()+'))' result += '\n return'+retval_default+';\n' if len(invalid) > 0: @@ -84,24 +92,24 @@ def make_ctocpp_function_impl_new(clsname, name, func): result += '\n // END DELETE BEFORE MODIFYING' result += '\n}\n\n' return wrap_code(result) - + result += '\n // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING\n' - + result_len = len(result) - + optional = [] - + # parameter verification for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + # skip optional params optional_params = arg.parent.get_attrib_list('optional_param') if not optional_params is None and arg_name in optional_params: optional.append(arg_name) continue - + comment = '\n // Verify param: '+arg_name+'; type: '+arg_type if arg_type == 'simple_byaddr' or arg_type == 'bool_byaddr': @@ -118,7 +126,7 @@ def make_ctocpp_function_impl_new(clsname, name, func): result += comment+\ '\n DCHECK(!'+arg_name+'.empty());'\ '\n if ('+arg_name+'.empty())'\ - '\n return'+retval_default+';' + '\n return'+retval_default+';' # check index params index_params = arg.parent.get_attrib_list('index_param') @@ -142,16 +150,16 @@ def make_ctocpp_function_impl_new(clsname, name, func): if len(result) != result_len: result += '\n' result_len = len(result) - + # parameter translation params = [] if isinstance(func, obj_function_virtual): - params.append('struct_') - + params.append('_struct') + for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + comment = '\n // Translate param: '+arg_name+'; type: '+arg_type if arg_type == 'simple_byval' or arg_type == 'simple_byaddr' or \ @@ -272,7 +280,7 @@ def make_ctocpp_function_impl_new(clsname, name, func): if len(result) != result_len: result += '\n' result_len = len(result) - + # execution result += '\n // Execute\n ' @@ -285,27 +293,27 @@ def make_ctocpp_function_impl_new(clsname, name, func): elif retval_type == 'refptr_same' or retval_type == 'refptr_diff': refptr_struct = retval.get_type().get_result_refptr_type_root() result += refptr_struct+'*' - + result += ' _retval = ' - + if isinstance(func, obj_function_virtual): - result += 'struct_->' + result += '_struct->' result += func.get_capi_name()+'(' - + if len(params) > 0: if not isinstance(func, obj_function_virtual): result += '\n ' result += string.join(params,',\n ') - + result += ');\n' - + result_len = len(result) - + # parameter restoration for arg in args: arg_type = arg.get_arg_type() arg_name = arg.get_type().get_name() - + comment = '\n // Restore param:'+arg_name+'; type: '+arg_type if arg_type == 'bool_byref': @@ -394,11 +402,11 @@ def make_ctocpp_function_impl_new(clsname, name, func): if len(result) != result_len: result += '\n' result_len = len(result) - + # special handling for the global CefShutdown function if name == 'CefShutdown' and isinstance(func.parent, obj_header): classes = func.parent.get_classes() - + names = [] for cls in classes: if cls.has_attrib('no_debugct_check'): @@ -408,7 +416,7 @@ def make_ctocpp_function_impl_new(clsname, name, func): names.append(cls.get_name()+'CToCpp') else: names.append(cls.get_name()+'CppToC') - + if len(names) > 0: names = sorted(names) result += '\n#ifndef NDEBUG'\ @@ -416,11 +424,11 @@ def make_ctocpp_function_impl_new(clsname, name, func): for name in names: result += '\n DCHECK(base::AtomicRefCountIsZero(&'+name+'::DebugObjCt));'; result += '\n#endif // !NDEBUG' - + if len(result) != result_len: result += '\n' result_len = len(result) - + # return translation if retval_type != 'none': # has a return value @@ -439,10 +447,10 @@ def make_ctocpp_function_impl_new(clsname, name, func): elif retval_type == 'refptr_diff': refptr_class = retval.get_type().get_refptr_type() result += '\n return '+refptr_class+'CppToC::Unwrap(_retval);' - + if len(result) != result_len: result += '\n' - + result += '}\n' return wrap_code(result) @@ -458,53 +466,107 @@ def make_ctocpp_function_impl(clsname, funcs, existing): impl += make_ctocpp_function_impl_existing(clsname, name, func, value) else: impl += make_ctocpp_function_impl_new(clsname, name, func) + + return impl + +def make_ctocpp_virtual_function_impl(header, cls, existing): + impl = make_ctocpp_function_impl(cls.get_name(), cls.get_virtual_funcs(), existing) + + cur_cls = cls + while True: + parent_name = cur_cls.get_parent_name() + if parent_name == 'CefBase': + break + else: + parent_cls = header.get_class(parent_name) + if parent_cls is None: + raise Exception('Class does not exist: '+parent_name) + impl += make_ctocpp_function_impl(cls.get_name(), parent_cls.get_virtual_funcs(), existing) + cur_cls = header.get_class(parent_name) return impl + +def make_ctocpp_unwrap_derived(header, cls): + # identify all classes that derive from cls + derived_classes = [] + clsname = cls.get_name() + allclasses = header.get_classes() + for cur_cls in allclasses: + if cur_cls.get_name() == clsname: + continue + if cur_cls.has_parent(clsname): + derived_classes.append(cur_cls.get_name()) + + derived_classes = sorted(derived_classes) + impl = '' + for clsname in derived_classes: + impl += ' if (type == '+get_wrapper_type_enum(clsname)+') {\n'+\ + ' return reinterpret_cast<'+get_capi_name(cls.get_name(), True)+'*>('+\ + clsname+'CToCpp::Unwrap(reinterpret_cast<'+clsname+'*>(c)));\n'+\ + ' }\n' + return impl + def make_ctocpp_class_impl(header, clsname, impl): cls = header.get_class(clsname) if cls is None: raise Exception('Class does not exist: '+clsname) - + capiname = cls.get_capi_name() - + # retrieve the existing virtual function implementations existing = get_function_impls(impl, clsname+'CToCpp::') - + # generate virtual functions - virtualimpl = make_ctocpp_function_impl(clsname, cls.get_virtual_funcs(), existing) + virtualimpl = make_ctocpp_virtual_function_impl(header, cls, existing) if len(virtualimpl) > 0: virtualimpl = '\n// VIRTUAL METHODS - Body may be edited by hand.\n\n'+virtualimpl - + # retrieve the existing static function implementations existing = get_function_impls(impl, clsname+'::') - + # generate static functions staticimpl = make_ctocpp_function_impl(clsname, cls.get_static_funcs(), existing) if len(staticimpl) > 0: staticimpl = '\n// STATIC METHODS - Body may be edited by hand.\n\n'+staticimpl - + resultingimpl = staticimpl + virtualimpl + # any derived classes can be unwrapped + unwrapderived = make_ctocpp_unwrap_derived(header, cls) + # determine what includes are required by identifying what translation # classes are being used - includes = format_translation_includes(resultingimpl) - + includes = format_translation_includes(header, resultingimpl + unwrapderived) + # build the final output result = get_copyright() result += includes+'\n'+resultingimpl+'\n' - - result += wrap_code('#ifndef NDEBUG\n'+ \ - 'template<> base::AtomicRefCount CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'>::DebugObjCt = 0;\n'+ \ - '#endif\n') + + parent_sig = 'CefCToCpp<'+clsname+'CToCpp, '+clsname+', '+capiname+'>' + + const = '// CONSTRUCTOR - Do not edit by hand.\n\n'+ \ + clsname+'CToCpp::'+clsname+'CToCpp() {\n'+ \ + '}\n\n'+ \ + 'template<> '+capiname+'* '+parent_sig+'::UnwrapDerived(CefWrapperType type, '+clsname+'* c) {\n'+ \ + unwrapderived + \ + ' NOTREACHED() << "Unexpected class type: " << type;\n'+ \ + ' return NULL;\n'+ \ + '}\n\n'+ \ + '#ifndef NDEBUG\n'+ \ + 'template<> base::AtomicRefCount '+parent_sig+'::DebugObjCt = 0;\n'+ \ + '#endif\n\n'+ \ + 'template<> CefWrapperType '+parent_sig+'::kWrapperType = '+get_wrapper_type_enum(clsname)+';' + + result += wrap_code(const) return result def make_ctocpp_global_impl(header, impl): # retrieve the existing global function implementations existing = get_function_impls(impl, 'CEF_GLOBAL') - + # generate static functions impl = make_ctocpp_function_impl(None, header.get_funcs(), existing) if len(impl) > 0: @@ -520,11 +582,11 @@ def make_ctocpp_global_impl(header, impl): includes += '#include "include/'+func.get_file_name()+'"\n' \ '#include "include/capi/'+func.get_capi_file_name()+'"\n' filenames.append(filename) - + # determine what includes are required by identifying what translation # classes are being used - includes += format_translation_includes(impl) - + includes += format_translation_includes(header, impl) + # build the final output result = get_copyright() @@ -538,13 +600,16 @@ def write_ctocpp_impl(header, clsname, dir, backup): file = dir else: # class file - file = dir+os.sep+get_capi_name(clsname[3:], False)+'_ctocpp.cc' - + # give the output file the same directory offset as the input file + cls = header.get_class(clsname) + dir = os.path.dirname(os.path.join(dir, cls.get_file_name())) + file = os.path.join(dir, get_capi_name(clsname[3:], False)+'_ctocpp.cc') + if path_exists(file): oldcontents = read_file(file) else: oldcontents = '' - + if clsname is None: newcontents = make_ctocpp_global_impl(header, oldcontents) else: @@ -554,23 +619,23 @@ def write_ctocpp_impl(header, clsname, dir, backup): backup_file(file) write_file(file, newcontents) return True - + return False # test the module if __name__ == "__main__": import sys - + # verify that the correct number of command-line arguments are provided if len(sys.argv) < 4: sys.stderr.write('Usage: '+sys.argv[0]+' ') sys.exit() - + # create the header object header = obj_header() header.add_file(sys.argv[1]) - + # read the existing implementation file into memory try: f = open(sys.argv[3], 'r') @@ -579,6 +644,6 @@ if __name__ == "__main__": raise Exception('Failed to read file '+sys.argv[3]+': '+strerror) else: f.close() - + # dump the result to stdout sys.stdout.write(make_ctocpp_class_impl(header, sys.argv[2], data)) diff --git a/tools/make_distrib.py b/tools/make_distrib.py index ec7ec1907..e5027415a 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -120,6 +120,9 @@ def transfer_gypi_files(src_dir, gypi_paths, gypi_path_prefix, dst_dir, quiet): # skip gyp includes if path[:2] == '<@': continue + # skip test files + if path.find('/test/') >= 0: + continue src = os.path.join(src_dir, path) dst = os.path.join(dst_dir, path.replace(gypi_path_prefix, '')) dst_path = os.path.dirname(dst) diff --git a/tools/make_gypi_file.py b/tools/make_gypi_file.py index e5cefd7a9..465130ebd 100644 --- a/tools/make_gypi_file.py +++ b/tools/make_gypi_file.py @@ -43,6 +43,9 @@ def make_gypi_file(header): for clsname in classes: cls = header.get_class(clsname) filename = get_capi_name(clsname[3:], False) + dir = cls.get_file_directory() + if not dir is None: + filename = dir+'/'+filename if cls.is_library_side(): result += " 'libcef_dll/cpptoc/"+filename+"_cpptoc.cc',\n" \ " 'libcef_dll/cpptoc/"+filename+"_cpptoc.h',\n" @@ -56,6 +59,9 @@ def make_gypi_file(header): for clsname in classes: cls = header.get_class(clsname) filename = get_capi_name(clsname[3:], False) + dir = cls.get_file_directory() + if not dir is None: + filename = dir+'/'+filename if cls.is_library_side(): result += " 'libcef_dll/ctocpp/"+filename+"_ctocpp.cc',\n" \ " 'libcef_dll/ctocpp/"+filename+"_ctocpp.h',\n" diff --git a/tools/make_wrapper_types_header.py b/tools/make_wrapper_types_header.py new file mode 100644 index 000000000..39a751e6f --- /dev/null +++ b/tools/make_wrapper_types_header.py @@ -0,0 +1,57 @@ +# 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. + +from cef_parser import * + +def make_wrapper_types_header(header): + result = get_copyright() + + result += '#ifndef CEF_LIBCEF_DLL_WRAPPER_TYPES_H_\n'+ \ + '#define CEF_LIBCEF_DLL_WRAPPER_TYPES_H_\n' + \ + '#pragma once\n\n' + \ + 'enum CefWrapperType {\n' + \ + ' WT_BASE = 1,\n' + + clsnames = sorted(header.get_class_names()) + for clsname in clsnames: + result += ' '+get_wrapper_type_enum(clsname)+',\n' + + result += '};\n\n' + \ + '#endif // CEF_LIBCEF_DLL_WRAPPER_TYPES_H_' + + return wrap_code(result) + + +def write_wrapper_types_header(header, file, backup): + if path_exists(file): + oldcontents = read_file(file) + else: + oldcontents = '' + + newcontents = make_wrapper_types_header(header) + if newcontents != oldcontents: + if backup and oldcontents != '': + backup_file(file) + write_file(file, newcontents) + return True + + return False + + +# test the module +if __name__ == "__main__": + import sys + + # verify that the correct number of command-line arguments are provided + if len(sys.argv) < 2: + sys.stderr.write('Usage: '+sys.argv[0]+' ') + sys.exit() + + # create the header object + header = obj_header() + excluded_files = ['cef_application_mac.h', 'cef_version.h'] + header.add_directory(sys.argv[1], excluded_files) + + # dump the result to stdout + sys.stdout.write(make_wrapper_types_header(header)) diff --git a/tools/translator.bat b/tools/translator.bat index 4e5d7727f..2905032c4 100644 --- a/tools/translator.bat +++ b/tools/translator.bat @@ -1,3 +1,3 @@ @echo off -call python.bat translator.py --cpp-header-dir ..\include --capi-header-dir ..\include\capi --cpptoc-global-impl ..\libcef_dll\libcef_dll.cc --ctocpp-global-impl ..\libcef_dll\wrapper\libcef_dll_wrapper.cc --cpptoc-dir ..\libcef_dll\cpptoc --ctocpp-dir ..\libcef_dll\ctocpp --gypi-file ..\cef_paths.gypi +call python.bat translator.py --root-dir .. pause \ No newline at end of file diff --git a/tools/translator.py b/tools/translator.py index b587cf914..ce0b725be 100644 --- a/tools/translator.py +++ b/tools/translator.py @@ -10,6 +10,7 @@ from make_cpptoc_impl import * from make_ctocpp_header import * from make_ctocpp_impl import * from make_gypi_file import * +from make_wrapper_types_header import * from optparse import OptionParser @@ -17,7 +18,7 @@ from optparse import OptionParser if __name__ != "__main__": sys.stderr.write('This file cannot be loaded as a module!') sys.exit() - + # parse command-line options disc = """ @@ -25,35 +26,11 @@ This utility generates files for the CEF C++ to C API translation layer. """ parser = OptionParser(description=disc) -parser.add_option('--cpp-header-dir', dest='cppheaderdir', metavar='DIR', - help='input directory for C++ header files [required]') -parser.add_option('--capi-header-dir', dest='capiheaderdir', metavar='DIR', - help='output directory for C API header files') -parser.add_option('--cpptoc-global-impl', dest='cpptocglobalimpl', metavar='FILE', - help='input/output file for CppToC global translations') -parser.add_option('--ctocpp-global-impl', dest='ctocppglobalimpl', metavar='FILE', - help='input/output file for CppToC global translations') -parser.add_option('--cpptoc-dir', dest='cpptocdir', metavar='DIR', - help='input/output directory for CppToC class translations') -parser.add_option('--ctocpp-dir', dest='ctocppdir', metavar='DIR', - help='input/output directory for CppToC class translations') -parser.add_option('--gypi-file', dest='gypifile', metavar='FILE', - help='output file for path information') -parser.add_option('--no-cpptoc-header', - action='store_true', dest='nocpptocheader', default=False, - help='do not output the CppToC headers') -parser.add_option('--no-cpptoc-impl', - action='store_true', dest='nocpptocimpl', default=False, - help='do not output the CppToC implementations') -parser.add_option('--no-ctocpp-header', - action='store_true', dest='noctocppheader', default=False, - help='do not output the CToCpp headers') -parser.add_option('--no-ctocpp-impl', - action='store_true', dest='noctocppimpl', default=False, - help='do not output the CToCpp implementations') -parser.add_option('--no-backup', - action='store_true', dest='nobackup', default=False, - help='do not create a backup of modified files') +parser.add_option('--root-dir', dest='rootdir', metavar='DIR', + help='CEF root directory [required]') +parser.add_option('--backup', + action='store_true', dest='backup', default=False, + help='create a backup of modified files') parser.add_option('-c', '--classes', dest='classes', action='append', help='only translate the specified classes') parser.add_option('-q', '--quiet', @@ -61,37 +38,59 @@ parser.add_option('-q', '--quiet', help='do not output detailed status information') (options, args) = parser.parse_args() -# the cppheader option is required -if options.cppheaderdir is None: +# the rootdir option is required +if options.rootdir is None: parser.print_help(sys.stdout) sys.exit() -# make sure the header exists -if not path_exists(options.cppheaderdir): - sys.stderr.write('File '+options.cppheaderdir+' does not exist.') +# determine the paths +root_dir = os.path.abspath(options.rootdir) +cpp_header_dir = os.path.join(root_dir, 'include') +cpp_header_test_dir = os.path.join(cpp_header_dir, 'test') +capi_header_dir = os.path.join(cpp_header_dir, 'capi') +libcef_dll_dir = os.path.join(root_dir, 'libcef_dll') +cpptoc_global_impl = os.path.join(libcef_dll_dir, 'libcef_dll.cc') +ctocpp_global_impl = os.path.join(libcef_dll_dir, 'wrapper', 'libcef_dll_wrapper.cc') +wrapper_types_header = os.path.join(libcef_dll_dir, 'wrapper_types.h') +cpptoc_dir = os.path.join(libcef_dll_dir, 'cpptoc') +ctocpp_dir = os.path.join(libcef_dll_dir, 'ctocpp') +gypi_file = os.path.join(root_dir, 'cef_paths.gypi') + +# make sure the header directory exists +if not path_exists(cpp_header_dir): + sys.stderr.write('Directory '+cpp_header_dir+' does not exist.') sys.exit() # create the header object if not options.quiet: - sys.stdout.write('Parsing C++ headers from '+options.cppheaderdir+'...\n') + sys.stdout.write('Parsing C++ headers from '+cpp_header_dir+'...\n') header = obj_header() + +# add include files to be processed +header.set_root_directory(cpp_header_dir) excluded_files = ['cef_application_mac.h', 'cef_version.h'] -header.add_directory(options.cppheaderdir, excluded_files) +header.add_directory(cpp_header_dir, excluded_files) +header.add_directory(cpp_header_test_dir) writect = 0 -if not options.capiheaderdir is None: - #output the C API header +#output the C API header +if not options.quiet: + sys.stdout.write('In C API header directory '+capi_header_dir+'...\n') +filenames = sorted(header.get_file_names()) +for filename in filenames: if not options.quiet: - sys.stdout.write('In C API header directory '+options.capiheaderdir+'...\n') - filenames = sorted(header.get_file_names()) - for filename in filenames: - if not options.quiet: - sys.stdout.write('Generating '+filename+' C API header...\n') - writect += write_capi_header(header, - os.path.join(options.capiheaderdir, filename), - not options.nobackup) - + sys.stdout.write('Generating '+filename+' C API header...\n') + writect += write_capi_header(header, capi_header_dir, filename, + options.backup) + +# output the wrapper types header +if not options.quiet: + sys.stdout.write('Generating wrapper types header...\n') +writect += write_wrapper_types_header(header, + wrapper_types_header, + options.backup) + # build the list of classes to parse allclasses = header.get_class_names() if not options.classes is None: @@ -105,60 +104,42 @@ else: classes = sorted(classes) -if not options.cpptocglobalimpl is None: - # output CppToC global file - if not options.quiet: - sys.stdout.write('Generating CppToC global implementation...\n') - writect += write_cpptoc_impl(header, None, options.cpptocglobalimpl, \ - not options.nobackup) +# output CppToC global file +if not options.quiet: + sys.stdout.write('Generating CppToC global implementation...\n') +writect += write_cpptoc_impl(header, None, cpptoc_global_impl, options.backup) -if not options.ctocppglobalimpl is None: - # output CToCpp global file - if not options.quiet: - sys.stdout.write('Generating CToCpp global implementation...\n') - writect += write_ctocpp_impl(header, None, options.ctocppglobalimpl, \ - not options.nobackup) +# output CToCpp global file +if not options.quiet: + sys.stdout.write('Generating CToCpp global implementation...\n') +writect += write_ctocpp_impl(header, None, ctocpp_global_impl, options.backup) -if not options.cpptocdir is None: - # output CppToC class files +# output CppToC class files +if not options.quiet: + sys.stdout.write('In CppToC directory '+cpptoc_dir+'...\n') +for cls in classes: if not options.quiet: - sys.stdout.write('In CppToC directory '+options.cpptocdir+'...\n') - - for cls in classes: - if not options.nocpptocheader: - if not options.quiet: - sys.stdout.write('Generating '+cls+'CppToC class header...\n') - writect += write_cpptoc_header(header, cls, options.cpptocdir, - not options.nobackup) - if not options.nocpptocimpl: - if not options.quiet: - sys.stdout.write('Generating '+cls+'CppToC class implementation...\n') - writect += write_cpptoc_impl(header, cls, options.cpptocdir, - not options.nobackup) + sys.stdout.write('Generating '+cls+'CppToC class header...\n') + writect += write_cpptoc_header(header, cls, cpptoc_dir, options.backup) + if not options.quiet: + sys.stdout.write('Generating '+cls+'CppToC class implementation...\n') + writect += write_cpptoc_impl(header, cls, cpptoc_dir, options.backup) -if not options.ctocppdir is None: - # output CppToC class files +# output CppToC class files +if not options.quiet: + sys.stdout.write('In CToCpp directory '+ctocpp_dir+'...\n') +for cls in classes: if not options.quiet: - sys.stdout.write('In CToCpp directory '+options.ctocppdir+'...\n') - for cls in classes: - if not options.nocpptocheader: - if not options.quiet: - sys.stdout.write('Generating '+cls+'CToCpp class header...\n') - writect += write_ctocpp_header(header, cls, options.ctocppdir, - not options.nobackup) - if not options.nocpptocimpl: - if not options.quiet: - sys.stdout.write('Generating '+cls+'CToCpp class implementation...\n') - writect += write_ctocpp_impl(header, cls, options.ctocppdir, - not options.nobackup) + sys.stdout.write('Generating '+cls+'CToCpp class header...\n') + writect += write_ctocpp_header(header, cls, ctocpp_dir, options.backup) + if not options.quiet: + sys.stdout.write('Generating '+cls+'CToCpp class implementation...\n') + writect += write_ctocpp_impl(header, cls, ctocpp_dir, options.backup) -if not options.gypifile is None: - # output the gypi file - if not options.quiet: - sys.stdout.write('Generating '+options.gypifile+' file...\n') - writect += write_gypi_file(header, options.gypifile, not options.nobackup) +# output the gypi file +if not options.quiet: + sys.stdout.write('Generating '+gypi_file+' file...\n') +writect += write_gypi_file(header, gypi_file, options.backup) if not options.quiet: sys.stdout.write('Done - Wrote '+str(writect)+' files.\n') - - diff --git a/tools/translator.sh b/tools/translator.sh index abd1c6e91..03f5a2d8a 100755 --- a/tools/translator.sh +++ b/tools/translator.sh @@ -1,2 +1,2 @@ #!/bin/sh -python translator.py --cpp-header-dir ../include --capi-header-dir ../include/capi --cpptoc-global-impl ../libcef_dll/libcef_dll.cc --ctocpp-global-impl ../libcef_dll/wrapper/libcef_dll_wrapper.cc --cpptoc-dir ../libcef_dll/cpptoc --ctocpp-dir ../libcef_dll/ctocpp --gypi-file ../cef_paths.gypi +python translator.py --root-dir ..