2013-01-02 11:13:43 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// 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/client_cpptoc.h"
|
2012-10-16 21:28:07 +02:00
|
|
|
#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
|
2012-10-16 21:28:07 +02:00
|
|
|
#include "libcef_dll/transfer_util.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// STATIC METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
bool CefBrowserHost::CreateBrowser(const CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient> client, const CefString& url,
|
|
|
|
const CefBrowserSettings& settings) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2012-12-12 15:43:57 +01:00
|
|
|
// Unverified params: client, url
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = cef_browser_host_create_browser(
|
|
|
|
&windowInfo,
|
|
|
|
CefClientCppToC::Wrap(client),
|
|
|
|
url.GetStruct(),
|
|
|
|
&settings);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(
|
|
|
|
const CefWindowInfo& windowInfo, CefRefPtr<CefClient> client,
|
|
|
|
const CefString& url, const CefBrowserSettings& settings) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2012-12-12 15:43:57 +01:00
|
|
|
// Unverified params: client, url
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_browser_t* _retval = cef_browser_host_create_browser_sync(
|
|
|
|
&windowInfo,
|
|
|
|
CefClientCppToC::Wrap(client),
|
|
|
|
url.GetStruct(),
|
|
|
|
&settings);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBrowserCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowser> CefBrowserHostCToCpp::GetBrowser() {
|
|
|
|
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_);
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBrowserCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::ParentWindowWillClose() {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, parent_window_will_close))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->parent_window_will_close(struct_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::CloseBrowser() {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, close_browser))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->close_browser(struct_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::SetFocus(bool enable) {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, set_focus))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->set_focus(struct_,
|
|
|
|
enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefWindowHandle CefBrowserHostCToCpp::GetWindowHandle() {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, get_window_handle))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
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))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_window_handle_t _retval = struct_->get_opener_window_handle(struct_);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefClient> CefBrowserHostCToCpp::GetClient() {
|
|
|
|
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_);
|
|
|
|
|
|
|
|
// Return type: refptr_diff
|
|
|
|
return CefClientCppToC::Unwrap(_retval);
|
|
|
|
}
|
|
|
|
|
2012-05-18 17:04:56 +02:00
|
|
|
CefString CefBrowserHostCToCpp::GetDevToolsURL(bool http_scheme) {
|
2012-04-27 00:20:18 +02:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, get_dev_tools_url))
|
|
|
|
return CefString();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2012-05-18 17:04:56 +02:00
|
|
|
cef_string_userfree_t _retval = struct_->get_dev_tools_url(struct_,
|
|
|
|
http_scheme);
|
2012-04-27 00:20:18 +02:00
|
|
|
|
|
|
|
// Return type: string
|
|
|
|
CefString _retvalStr;
|
|
|
|
_retvalStr.AttachToUserFree(_retval);
|
|
|
|
return _retvalStr;
|
|
|
|
}
|
|
|
|
|
2012-06-12 21:50:24 +02:00
|
|
|
double CefBrowserHostCToCpp::GetZoomLevel() {
|
|
|
|
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_);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::SetZoomLevel(double zoomLevel) {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, set_zoom_level))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->set_zoom_level(struct_,
|
|
|
|
zoomLevel);
|
|
|
|
}
|
|
|
|
|
2012-10-16 21:28:07 +02:00
|
|
|
void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode,
|
|
|
|
const CefString& title, const CefString& default_file_name,
|
|
|
|
const std::vector<CefString>& accept_types,
|
|
|
|
CefRefPtr<CefRunFileDialogCallback> callback) {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, run_file_dialog))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return;
|
|
|
|
// Unverified params: title, default_file_name, accept_types
|
|
|
|
|
|
|
|
// Translate param: accept_types; type: string_vec_byref_const
|
|
|
|
cef_string_list_t accept_typesList = cef_string_list_alloc();
|
|
|
|
DCHECK(accept_typesList);
|
|
|
|
if (accept_typesList)
|
|
|
|
transfer_string_list_contents(accept_types, accept_typesList);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->run_file_dialog(struct_,
|
|
|
|
mode,
|
|
|
|
title.GetStruct(),
|
|
|
|
default_file_name.GetStruct(),
|
|
|
|
accept_typesList,
|
|
|
|
CefRunFileDialogCallbackCppToC::Wrap(callback));
|
|
|
|
|
|
|
|
// Restore param:accept_types; type: string_vec_byref_const
|
|
|
|
if (accept_typesList)
|
|
|
|
cef_string_list_free(accept_typesList);
|
|
|
|
}
|
|
|
|
|
2012-11-21 01:40:15 +01:00
|
|
|
bool CefBrowserHostCToCpp::IsWindowRenderingDisabled() {
|
|
|
|
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_);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::WasResized() {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, was_resized))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->was_resized(struct_);
|
|
|
|
}
|
|
|
|
|
2013-01-12 00:00:39 +01:00
|
|
|
void CefBrowserHostCToCpp::Invalidate(const CefRect& dirtyRect,
|
|
|
|
PaintElementType type) {
|
2012-11-21 01:40:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(struct_, invalidate))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->invalidate(struct_,
|
2013-01-12 00:00:39 +01:00
|
|
|
&dirtyRect,
|
|
|
|
type);
|
2012-11-21 01:40:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, send_key_event))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->send_key_event(struct_,
|
|
|
|
&event);
|
|
|
|
}
|
|
|
|
|
2013-01-12 00:00:39 +01:00
|
|
|
void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event,
|
2012-11-21 01:40:15 +01:00
|
|
|
MouseButtonType type, bool mouseUp, int clickCount) {
|
|
|
|
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_,
|
2013-01-12 00:00:39 +01:00
|
|
|
&event,
|
2012-11-21 01:40:15 +01:00
|
|
|
type,
|
|
|
|
mouseUp,
|
|
|
|
clickCount);
|
|
|
|
}
|
|
|
|
|
2013-01-12 00:00:39 +01:00
|
|
|
void CefBrowserHostCToCpp::SendMouseMoveEvent(const CefMouseEvent& event,
|
|
|
|
bool mouseLeave) {
|
2012-11-21 01:40:15 +01:00
|
|
|
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_,
|
2013-01-12 00:00:39 +01:00
|
|
|
&event,
|
2012-11-21 01:40:15 +01:00
|
|
|
mouseLeave);
|
|
|
|
}
|
|
|
|
|
2013-01-12 00:00:39 +01:00
|
|
|
void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event,
|
|
|
|
int deltaX, int deltaY) {
|
2012-11-21 01:40:15 +01:00
|
|
|
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_,
|
2013-01-12 00:00:39 +01:00
|
|
|
&event,
|
2012-11-21 01:40:15 +01:00
|
|
|
deltaX,
|
|
|
|
deltaY);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) {
|
|
|
|
if (CEF_MEMBER_MISSING(struct_, send_focus_event))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
struct_->send_focus_event(struct_,
|
|
|
|
setFocus);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserHostCToCpp::SendCaptureLostEvent() {
|
|
|
|
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_);
|
|
|
|
}
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> long CefCToCpp<CefBrowserHostCToCpp, CefBrowserHost,
|
|
|
|
cef_browser_host_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|