cef/libcef_dll/ctocpp/list_value_ctocpp.cc

477 lines
11 KiB
C++
Raw Normal View History

// 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/binary_value_ctocpp.h"
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefListValue> CefListValue::Create() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_list_value_t* _retval = cef_list_value_create();
// Return type: refptr_same
return CefListValueCToCpp::Wrap(_retval);
}
// VIRTUAL METHODS - Body may be edited by hand.
bool CefListValueCToCpp::IsValid() {
if (CEF_MEMBER_MISSING(struct_, is_valid))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->is_valid(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::IsOwned() {
if (CEF_MEMBER_MISSING(struct_, is_owned))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->is_owned(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::IsReadOnly() {
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_);
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefListValue> CefListValueCToCpp::Copy() {
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_);
// Return type: refptr_same
return CefListValueCToCpp::Wrap(_retval);
}
bool CefListValueCToCpp::SetSize(size_t size) {
if (CEF_MEMBER_MISSING(struct_, set_size))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->set_size(struct_,
size);
// Return type: bool
return _retval?true:false;
}
size_t CefListValueCToCpp::GetSize() {
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_);
// Return type: simple
return _retval;
}
bool CefListValueCToCpp::Clear() {
if (CEF_MEMBER_MISSING(struct_, clear))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->clear(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::Remove(int index) {
if (CEF_MEMBER_MISSING(struct_, remove))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->remove(struct_,
index);
// Return type: bool
return _retval?true:false;
}
CefValueType CefListValueCToCpp::GetType(int index) {
if (CEF_MEMBER_MISSING(struct_, get_type))
return VTYPE_INVALID;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return VTYPE_INVALID;
// Execute
cef_value_type_t _retval = struct_->get_type(struct_,
index);
// Return type: simple
return _retval;
}
bool CefListValueCToCpp::GetBool(int index) {
if (CEF_MEMBER_MISSING(struct_, get_bool))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->get_bool(struct_,
index);
// Return type: bool
return _retval?true:false;
}
int CefListValueCToCpp::GetInt(int index) {
if (CEF_MEMBER_MISSING(struct_, get_int))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return 0;
// Execute
int _retval = struct_->get_int(struct_,
index);
// Return type: simple
return _retval;
}
double CefListValueCToCpp::GetDouble(int index) {
if (CEF_MEMBER_MISSING(struct_, get_double))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return 0;
// Execute
double _retval = struct_->get_double(struct_,
index);
// Return type: simple
return _retval;
}
CefString CefListValueCToCpp::GetString(int index) {
if (CEF_MEMBER_MISSING(struct_, get_string))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return CefString();
// Execute
cef_string_userfree_t _retval = struct_->get_string(struct_,
index);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefRefPtr<CefBinaryValue> CefListValueCToCpp::GetBinary(int index) {
if (CEF_MEMBER_MISSING(struct_, get_binary))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return NULL;
// Execute
cef_binary_value_t* _retval = struct_->get_binary(struct_,
index);
// Return type: refptr_same
return CefBinaryValueCToCpp::Wrap(_retval);
}
CefRefPtr<CefDictionaryValue> CefListValueCToCpp::GetDictionary(int index) {
if (CEF_MEMBER_MISSING(struct_, get_dictionary))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return NULL;
// Execute
cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_,
index);
// Return type: refptr_same
return CefDictionaryValueCToCpp::Wrap(_retval);
}
CefRefPtr<CefListValue> CefListValueCToCpp::GetList(int index) {
if (CEF_MEMBER_MISSING(struct_, get_list))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return NULL;
// Execute
cef_list_value_t* _retval = struct_->get_list(struct_,
index);
// Return type: refptr_same
return CefListValueCToCpp::Wrap(_retval);
}
bool CefListValueCToCpp::SetNull(int index) {
if (CEF_MEMBER_MISSING(struct_, set_null))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->set_null(struct_,
index);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetBool(int index, bool value) {
if (CEF_MEMBER_MISSING(struct_, set_bool))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->set_bool(struct_,
index,
value);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetInt(int index, int value) {
if (CEF_MEMBER_MISSING(struct_, set_int))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->set_int(struct_,
index,
value);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetDouble(int index, double value) {
if (CEF_MEMBER_MISSING(struct_, set_double))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Execute
int _retval = struct_->set_double(struct_,
index,
value);
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetString(int index, const CefString& value) {
if (CEF_MEMBER_MISSING(struct_, set_string))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Unverified params: value
// Execute
int _retval = struct_->set_string(struct_,
index,
value.GetStruct());
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetBinary(int index, CefRefPtr<CefBinaryValue> value) {
if (CEF_MEMBER_MISSING(struct_, set_binary))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Verify param: value; type: refptr_same
DCHECK(value.get());
if (!value.get())
return false;
// Execute
int _retval = struct_->set_binary(struct_,
index,
CefBinaryValueCToCpp::Unwrap(value));
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetDictionary(int index,
CefRefPtr<CefDictionaryValue> value) {
if (CEF_MEMBER_MISSING(struct_, set_dictionary))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Verify param: value; type: refptr_same
DCHECK(value.get());
if (!value.get())
return false;
// Execute
int _retval = struct_->set_dictionary(struct_,
index,
CefDictionaryValueCToCpp::Unwrap(value));
// Return type: bool
return _retval?true:false;
}
bool CefListValueCToCpp::SetList(int index, CefRefPtr<CefListValue> value) {
if (CEF_MEMBER_MISSING(struct_, set_list))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: index; type: simple_byval
DCHECK_GE(index, 0);
if (index < 0)
return false;
// Verify param: value; type: refptr_same
DCHECK(value.get());
if (!value.get())
return false;
// Execute
int _retval = struct_->set_list(struct_,
index,
CefListValueCToCpp::Unwrap(value));
// Return type: bool
return _retval?true:false;
}
#ifndef NDEBUG
Introduce the use of Chromium types (issue #1336). Changes to the CEF public API: - Add base::Bind, base::Callback, base::Lock, base::WeakPtr, scoped_refptr, scoped_ptr and supporting types. - Add include/wrapper/cef_closure_task.h helpers for converting a base::Closure to a CefTask. - Change CefRefPtr to extend scoped_refptr. -- Change CefBase method signatures to match RefCountedThreadSafeBase. - Change IMPLEMENT_REFCOUNTING to use base::AtomicRefCount*. -- Remove the CefAtomic* functions. -- IMPLEMENT_REFCOUNTING now enforces via a compile-time error that the correct class name was passed to the macro. - Change IMPLEMENT_LOCKING to use base::Lock. -- Remove the CefCriticalSection class. -- Deprecate the IMPLEMENT_LOCKING macro. -- base::Lock will DCHECK() in Debug builds if lock usage is reentrant. - Move include/internal/cef_tuple.h to include/base/cef_tuple.h. - Allow an empty |callback| parameter passed to CefBeginTracing. Changes to the CEF implementation: - Fix incorrect names passed to the IMPLEMENT_REFCOUNTING macro. - Fix instances of reentrant locking in the CefXmlObject and CefRequest implementations. - Remove use of the IMPLEMENT_LOCKING macro. Changes to cef_unittests: - Add tests/unittests/chromium_includes.h and always include it first from unit test .cc files to avoid name conflicts with Chromium types. - Fix wrong header include ordering. - Remove use of the IMPLEMENT_LOCKING macro. Changes to cefclient and cefsimple: - Use base::Bind and cef_closure_task.h instead of NewCefRunnable*. - Remove use of the IMPEMENT_LOCKING macro. - Fix incorrect/unnecessary locking. - Add additional runtime thread checks. - Windows: Perform actions on the UI thread instead of the main thread when running in multi-threaded-message-loop mode to avoid excessive locking. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1769 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2014-07-15 00:18:51 +02:00
template<> base::AtomicRefCount CefCToCpp<CefListValueCToCpp, CefListValue,
cef_list_value_t>::DebugObjCt = 0;
#endif