cef/libcef_dll/cpptoc/domdocument_cpptoc.cc

280 lines
7.5 KiB
C++
Raw Permalink Normal View History

// Copyright (c) 2017 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/domdocument_cpptoc.h"
#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(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return DOM_DOCUMENT_TYPE_UNKNOWN;
// Execute
cef_dom_document_type_t _retval = CefDOMDocumentCppToC::Get(self)->GetType();
// Return type: simple
return _retval;
}
struct _cef_domnode_t* CEF_CALLBACK domdocument_get_document(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMDocumentCppToC::Get(self)->GetDocument(
);
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
struct _cef_domnode_t* CEF_CALLBACK domdocument_get_body(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMDocumentCppToC::Get(self)->GetBody();
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
struct _cef_domnode_t* CEF_CALLBACK domdocument_get_head(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMDocumentCppToC::Get(self)->GetHead();
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
cef_string_userfree_t CEF_CALLBACK domdocument_get_title(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefDOMDocumentCppToC::Get(self)->GetTitle();
// Return type: string
return _retval.DetachToUserFree();
}
struct _cef_domnode_t* CEF_CALLBACK domdocument_get_element_by_id(
struct _cef_domdocument_t* self, const cef_string_t* id) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Verify param: id; type: string_byref_const
DCHECK(id);
if (!id)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMDocumentCppToC::Get(
self)->GetElementById(
CefString(id));
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
struct _cef_domnode_t* CEF_CALLBACK domdocument_get_focused_node(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefDOMNode> _retval = CefDOMDocumentCppToC::Get(
self)->GetFocusedNode();
// Return type: refptr_same
return CefDOMNodeCppToC::Wrap(_retval);
}
int CEF_CALLBACK domdocument_has_selection(struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefDOMDocumentCppToC::Get(self)->HasSelection();
// Return type: bool
return _retval;
}
int CEF_CALLBACK domdocument_get_selection_start_offset(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionStartOffset();
// Return type: simple
return _retval;
}
int CEF_CALLBACK domdocument_get_selection_end_offset(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionEndOffset();
// Return type: simple
return _retval;
}
cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_markup(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionAsMarkup();
// Return type: string
return _retval.DetachToUserFree();
}
cef_string_userfree_t CEF_CALLBACK domdocument_get_selection_as_text(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefDOMDocumentCppToC::Get(self)->GetSelectionAsText();
// Return type: string
return _retval.DetachToUserFree();
}
cef_string_userfree_t CEF_CALLBACK domdocument_get_base_url(
struct _cef_domdocument_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefString _retval = CefDOMDocumentCppToC::Get(self)->GetBaseURL();
// Return type: string
return _retval.DetachToUserFree();
}
cef_string_userfree_t CEF_CALLBACK domdocument_get_complete_url(
struct _cef_domdocument_t* self, const cef_string_t* partialURL) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Verify param: partialURL; type: string_byref_const
DCHECK(partialURL);
if (!partialURL)
return NULL;
// Execute
CefString _retval = CefDOMDocumentCppToC::Get(self)->GetCompleteURL(
CefString(partialURL));
// Return type: string
return _retval.DetachToUserFree();
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
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;
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<CefDOMDocument> CefCppToC<CefDOMDocumentCppToC,
CefDOMDocument, cef_domdocument_t>::UnwrapDerived(CefWrapperType type,
cef_domdocument_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return NULL;
}
#if DCHECK_IS_ON()
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 CefCppToC<CefDOMDocumentCppToC, CefDOMDocument,
cef_domdocument_t>::DebugObjCt = 0;
#endif
template<> CefWrapperType CefCppToC<CefDOMDocumentCppToC, CefDOMDocument,
cef_domdocument_t>::kWrapperType = WT_DOMDOCUMENT;