Significant API changes for issue #218:

- Replace CefHandler with a new CefClient interface and separate handler interfaces.
- Add support for virtual inheritance to allow multiple CefBase parented interfaces to be implemented in the same class.
- Replace CefThreadSafeBase with IMPLEMENT_* macros to support virtual inheritance and to only provide locking implementations when needed.
- Move the CefBrowserSettings parameter from CefInitialize to CreateBrowser.
- Add a new cef_build.h header that provides platform-specific and OS_* defines.
- Introduce the use of OVERRIDE to generate compiler errors on Windows if a child virtual method declaration doesn't match the parent declaration.
- Use NDEBUG instead of _DEBUG because _DEBUG is not defined on Mac. (issue #240).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@235 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-05-20 14:42:25 +00:00
parent 9a69e96950
commit dbe8de277f
251 changed files with 7127 additions and 4945 deletions

View File

@ -11,7 +11,7 @@
// CefCppToC implementation for CefBase.
class CefBaseCppToC : public CefThreadSafeBase<CefBase>
class CefBaseCppToC : public CefBase
{
public:
// Use this method to retrieve the underlying class instance from our
@ -88,16 +88,20 @@ public:
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapper class.
virtual int AddRef()
int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<CefBase>::AddRef();
return refct_.AddRef();
}
virtual int Release()
int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<CefBase>::Release();
int retval = refct_.Release();
if (retval == 0)
delete this;
return retval;
}
int GetRefCt() { return refct_.GetRefCt(); }
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef() { return class_->AddRef(); }
@ -136,6 +140,7 @@ private:
}
protected:
CefRefCount refct_;
Struct struct_;
CefBase* class_;
};

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -12,41 +12,55 @@
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/frame_cpptoc.h"
#include "libcef_dll/ctocpp/handler_ctocpp.h"
#include "libcef_dll/ctocpp/client_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// GLOBAL FUNCTIONS - Body may be edited by hand.
CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo, int popup,
struct _cef_handler_t* handler, const cef_string_t* url)
CEF_EXPORT int cef_browser_create(cef_window_info_t* windowInfo,
struct _cef_client_t* client, const cef_string_t* url,
const struct _cef_browser_settings_t* settings)
{
DCHECK(windowInfo);
if (!windowInfo)
return 0;
CefRefPtr<CefHandler> handlerPtr;
CefWindowInfo wi = *windowInfo;
CefRefPtr<CefClient> clientPtr;
CefWindowInfo windowInfoObj;
CefBrowserSettings browserSettingsObj;
if(handler)
handlerPtr = CefHandlerCToCpp::Wrap(handler);
return CefBrowser::CreateBrowser(wi, popup?true:false, handlerPtr,
CefString(url));
windowInfoObj.Set(*windowInfo, false);
if(client)
clientPtr = CefClientCToCpp::Wrap(client);
if (settings)
browserSettingsObj.Set(*settings, false);
return CefBrowser::CreateBrowser(windowInfoObj, clientPtr, CefString(url),
browserSettingsObj);
}
CEF_EXPORT cef_browser_t* cef_browser_create_sync(cef_window_info_t* windowInfo,
int popup, struct _cef_handler_t* handler, const cef_string_t* url)
struct _cef_client_t* client, const cef_string_t* url,
const struct _cef_browser_settings_t* settings)
{
DCHECK(windowInfo);
if (!windowInfo)
return NULL;
CefRefPtr<CefHandler> handlerPtr;
CefWindowInfo wi = *windowInfo;
CefRefPtr<CefClient> clientPtr;
CefWindowInfo windowInfoObj;
CefBrowserSettings browserSettingsObj;
if(handler)
handlerPtr = CefHandlerCToCpp::Wrap(handler);
windowInfoObj.Set(*windowInfo, false);
if(client)
clientPtr = CefClientCToCpp::Wrap(client);
if (settings)
browserSettingsObj.Set(*settings, false);
CefRefPtr<CefBrowser> browserPtr(
CefBrowser::CreateBrowserSync(wi, popup?true:false, handlerPtr,
CefString(url)));
CefBrowser::CreateBrowserSync(windowInfoObj, clientPtr, CefString(url),
browserSettingsObj));
if(browserPtr.get())
return CefBrowserCppToC::Wrap(browserPtr);
return NULL;
@ -155,17 +169,16 @@ int CEF_CALLBACK browser_is_popup(struct _cef_browser_t* self)
return CefBrowserCppToC::Get(self)->IsPopup();
}
struct _cef_handler_t* CEF_CALLBACK browser_get_handler(
struct _cef_client_t* CEF_CALLBACK browser_get_client(
struct _cef_browser_t* self)
{
DCHECK(self);
if(!self)
if (!self)
return NULL;
CefRefPtr<CefBrowser> browserPtr = CefBrowserCppToC::Get(self);
CefRefPtr<CefHandler> handlerPtr = browserPtr->GetHandler();
if(handlerPtr.get())
return CefHandlerCToCpp::Unwrap(handlerPtr);
CefRefPtr<CefClient> clientPtr = CefBrowserCppToC::Get(self)->GetClient();
if(clientPtr.get())
return CefClientCToCpp::Unwrap(clientPtr);
return NULL;
}
@ -438,7 +451,7 @@ CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls)
struct_.struct_.set_focus = browser_set_focus;
struct_.struct_.get_window_handle = browser_get_window_handle;
struct_.struct_.is_popup = browser_is_popup;
struct_.struct_.get_handler = browser_get_handler;
struct_.struct_.get_client = browser_get_client;
struct_.struct_.get_main_frame = browser_get_main_frame;
struct_.struct_.get_focused_frame = browser_get_focused_frame;
struct_.struct_.get_frame = browser_get_frame;
@ -465,7 +478,7 @@ CefBrowserCppToC::CefBrowserCppToC(CefBrowser* cls)
struct_.struct_.send_capture_lost_event = browser_send_capture_lost_event;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefBrowserCppToC, CefBrowser,
cef_browser_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -0,0 +1,234 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/client_cpptoc.h"
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
#include "libcef_dll/cpptoc/jsbinding_handler_cpptoc.h"
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
#include "libcef_dll/cpptoc/load_handler_cpptoc.h"
#include "libcef_dll/cpptoc/menu_handler_cpptoc.h"
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefLifeSpanHandler> handlerPtr =
CefClientCppToC::Get(self)->GetLifeSpanHandler();
if(handlerPtr.get())
return CefLifeSpanHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_load_handler_t* CEF_CALLBACK client_get_load_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefLoadHandler> handlerPtr =
CefClientCppToC::Get(self)->GetLoadHandler();
if(handlerPtr.get())
return CefLoadHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_request_handler_t* CEF_CALLBACK client_get_request_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefRequestHandler> handlerPtr =
CefClientCppToC::Get(self)->GetRequestHandler();
if(handlerPtr.get())
return CefRequestHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_display_handler_t* CEF_CALLBACK client_get_display_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefDisplayHandler> handlerPtr =
CefClientCppToC::Get(self)->GetDisplayHandler();
if(handlerPtr.get())
return CefDisplayHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefFocusHandler> handlerPtr =
CefClientCppToC::Get(self)->GetFocusHandler();
if(handlerPtr.get())
return CefFocusHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefKeyboardHandler> handlerPtr =
CefClientCppToC::Get(self)->GetKeyboardHandler();
if(handlerPtr.get())
return CefKeyboardHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_menu_handler_t* CEF_CALLBACK client_get_menu_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefMenuHandler> handlerPtr =
CefClientCppToC::Get(self)->GetMenuHandler();
if(handlerPtr.get())
return CefMenuHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_print_handler_t* CEF_CALLBACK client_get_print_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefPrintHandler> handlerPtr =
CefClientCppToC::Get(self)->GetPrintHandler();
if(handlerPtr.get())
return CefPrintHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_find_handler_t* CEF_CALLBACK client_get_find_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefFindHandler> handlerPtr =
CefClientCppToC::Get(self)->GetFindHandler();
if(handlerPtr.get())
return CefFindHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefJSDialogHandler> handlerPtr =
CefClientCppToC::Get(self)->GetJSDialogHandler();
if(handlerPtr.get())
return CefJSDialogHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_jsbinding_handler_t* CEF_CALLBACK client_get_jsbinding_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefJSBindingHandler> handlerPtr =
CefClientCppToC::Get(self)->GetJSBindingHandler();
if(handlerPtr.get())
return CefJSBindingHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
cef_render_handler_t* CEF_CALLBACK client_get_render_handler(
struct _cef_client_t* self)
{
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefRenderHandler> handlerPtr =
CefClientCppToC::Get(self)->GetRenderHandler();
if(handlerPtr.get())
return CefRenderHandlerCppToC::Wrap(handlerPtr);
return NULL;
}
// CONSTRUCTOR - Do not edit by hand.
CefClientCppToC::CefClientCppToC(CefClient* cls)
: CefCppToC<CefClientCppToC, CefClient, cef_client_t>(cls)
{
struct_.struct_.get_life_span_handler = client_get_life_span_handler;
struct_.struct_.get_load_handler = client_get_load_handler;
struct_.struct_.get_request_handler = client_get_request_handler;
struct_.struct_.get_display_handler = client_get_display_handler;
struct_.struct_.get_focus_handler = client_get_focus_handler;
struct_.struct_.get_keyboard_handler = client_get_keyboard_handler;
struct_.struct_.get_menu_handler = client_get_menu_handler;
struct_.struct_.get_print_handler = client_get_print_handler;
struct_.struct_.get_find_handler = client_get_find_handler;
struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler;
struct_.struct_.get_jsbinding_handler = client_get_jsbinding_handler;
struct_.struct_.get_render_handler = client_get_render_handler;
}
#ifndef NDEBUG
template<> long CefCppToC<CefClientCppToC, CefClient,
cef_client_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -8,8 +8,8 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _HANDLER_CPPTOC_H
#define _HANDLER_CPPTOC_H
#ifndef _CLIENT_CPPTOC_H
#define _CLIENT_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
@ -21,14 +21,14 @@
// Wrap a C++ class with a C structure.
// This class may be instantiated and accessed wrapper-side only.
class CefHandlerCppToC
: public CefCppToC<CefHandlerCppToC, CefHandler, cef_handler_t>
class CefClientCppToC
: public CefCppToC<CefClientCppToC, CefClient, cef_client_t>
{
public:
CefHandlerCppToC(CefHandler* cls);
virtual ~CefHandlerCppToC() {}
CefClientCppToC(CefClient* cls);
virtual ~CefClientCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _HANDLER_CPPTOC_H
#endif // _CLIENT_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -46,7 +46,7 @@ CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls)
struct_.struct_.visit = cookie_visitor_visit;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefCookieVisitorCppToC, CefCookieVisitor,
cef_cookie_visitor_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -14,7 +14,7 @@
// implementation exists on this side of the DLL boundary but will have methods
// called from the other side of the DLL boundary.
template <class ClassName, class BaseName, class StructName>
class CefCppToC : public CefThreadSafeBase<CefBase>
class CefCppToC : public CefBase
{
public:
// Structure representation with pointer to the C++ class.
@ -78,13 +78,13 @@ public:
struct_.struct_.base.release = struct_release;
struct_.struct_.base.get_refct = struct_get_refct;
#ifdef _DEBUG
#ifndef NDEBUG
CefAtomicIncrement(&DebugObjCt);
#endif
}
virtual ~CefCppToC()
{
#ifdef _DEBUG
#ifndef NDEBUG
CefAtomicDecrement(&DebugObjCt);
#endif
}
@ -98,23 +98,27 @@ public:
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapper class.
virtual int AddRef()
int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<CefBase>::AddRef();
return refct_.AddRef();
}
virtual int Release()
int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<CefBase>::Release();
int retval = refct_.Release();
if (retval == 0)
delete this;
return retval;
}
int GetRefCt() { return refct_.GetRefCt(); }
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef() { return class_->AddRef(); }
int UnderlyingRelease() { return class_->Release(); }
int UnderlyingGetRefCt() { return class_->GetRefCt(); }
#ifdef _DEBUG
#ifndef NDEBUG
// Simple tracking of allocated objects.
static long DebugObjCt;
#endif
@ -151,6 +155,7 @@ private:
}
protected:
CefRefCount refct_;
Struct struct_;
BaseName* class_;
};

View File

@ -0,0 +1,123 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK display_handler_on_nav_state_change(
struct _cef_display_handler_t* self, cef_browser_t* browser, int canGoBack,
int canGoForward)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefDisplayHandlerCppToC::Get(self)->OnNavStateChange(
CefBrowserCToCpp::Wrap(browser), (canGoBack?true:false),
(canGoForward?true:false));
}
void CEF_CALLBACK display_handler_on_address_change(
struct _cef_display_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, const cef_string_t* url)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(url);
if (!self || !browser || !frame || !url)
return;
CefDisplayHandlerCppToC::Get(self)->OnAddressChange(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(url));
}
void CEF_CALLBACK display_handler_on_title_change(
struct _cef_display_handler_t* self, cef_browser_t* browser,
const cef_string_t* title)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefDisplayHandlerCppToC::Get(self)->OnTitleChange(
CefBrowserCToCpp::Wrap(browser), CefString(title));
}
int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self,
cef_browser_t* browser, cef_string_t* text)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return 0;
CefString textStr(text);
return CefDisplayHandlerCppToC::Get(self)->OnTooltip(
CefBrowserCToCpp::Wrap(browser), textStr);
}
void CEF_CALLBACK display_handler_on_status_message(
struct _cef_display_handler_t* self, cef_browser_t* browser,
const cef_string_t* value, enum cef_handler_statustype_t type)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefDisplayHandlerCppToC::Get(self)->OnStatusMessage(
CefBrowserCToCpp::Wrap(browser), CefString(value), type);
}
int CEF_CALLBACK display_handler_on_console_message(
struct _cef_display_handler_t* self, cef_browser_t* browser,
const cef_string_t* message, const cef_string_t* source, int line)
{
DCHECK(self);
DCHECK(browser);
DCHECK(message);
if (!self || !browser || !message)
return 0;
return CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage(
CefBrowserCToCpp::Wrap(browser), CefString(message), CefString(source),
line);
}
// CONSTRUCTOR - Do not edit by hand.
CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls)
: CefCppToC<CefDisplayHandlerCppToC, CefDisplayHandler,
cef_display_handler_t>(cls)
{
struct_.struct_.on_nav_state_change = display_handler_on_nav_state_change;
struct_.struct_.on_address_change = display_handler_on_address_change;
struct_.struct_.on_title_change = display_handler_on_title_change;
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;
}
#ifndef NDEBUG
template<> long CefCppToC<CefDisplayHandlerCppToC, CefDisplayHandler,
cef_display_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _DISPLAYHANDLER_CPPTOC_H
#define _DISPLAYHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefDisplayHandlerCppToC
: public CefCppToC<CefDisplayHandlerCppToC, CefDisplayHandler,
cef_display_handler_t>
{
public:
CefDisplayHandlerCppToC(CefDisplayHandler* cls);
virtual ~CefDisplayHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _DISPLAYHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -235,7 +235,7 @@ CefDOMDocumentCppToC::CefDOMDocumentCppToC(CefDOMDocument* cls)
struct_.struct_.get_complete_url = domdocument_get_complete_url;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDOMDocumentCppToC, CefDOMDocument,
cef_domdocument_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -122,7 +122,7 @@ CefDOMEventCppToC::CefDOMEventCppToC(CefDOMEvent* cls)
struct_.struct_.get_current_target = domevent_get_current_target;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDOMEventCppToC, CefDOMEvent,
cef_domevent_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -40,7 +40,7 @@ CefDOMEventListenerCppToC::CefDOMEventListenerCppToC(CefDOMEventListener* cls)
struct_.struct_.handle_event = domevent_listener_handle_event;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDOMEventListenerCppToC, CefDOMEventListener,
cef_domevent_listener_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -314,7 +314,7 @@ CefDOMNodeCppToC::CefDOMNodeCppToC(CefDOMNode* cls)
struct_.struct_.get_element_inner_text = domnode_get_element_inner_text;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDOMNodeCppToC, CefDOMNode,
cef_domnode_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -39,7 +39,7 @@ CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls)
struct_.struct_.visit = domvisitor_visit;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDOMVisitorCppToC, CefDOMVisitor,
cef_domvisitor_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -46,7 +46,7 @@ CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls)
struct_.struct_.complete = download_handler_complete;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefDownloadHandlerCppToC, CefDownloadHandler,
cef_download_handler_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -0,0 +1,48 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self,
cef_browser_t* browser, int identifier, int count,
const cef_rect_t* selectionRect, int activeMatchOrdinal, int finalUpdate)
{
DCHECK(self);
DCHECK(browser);
DCHECK(selectionRect);
if (!self || !browser || !selectionRect)
return;
CefRect rect(*selectionRect);
CefFindHandlerCppToC::Get(self)->OnFindResult(
CefBrowserCToCpp::Wrap(browser), identifier, count, rect,
activeMatchOrdinal, finalUpdate?true:false);
}
// CONSTRUCTOR - Do not edit by hand.
CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls)
: CefCppToC<CefFindHandlerCppToC, CefFindHandler, cef_find_handler_t>(cls)
{
struct_.struct_.on_find_result = find_handler_on_find_result;
}
#ifndef NDEBUG
template<> long CefCppToC<CefFindHandlerCppToC, CefFindHandler,
cef_find_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,34 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _FINDHANDLER_CPPTOC_H
#define _FINDHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefFindHandlerCppToC
: public CefCppToC<CefFindHandlerCppToC, CefFindHandler, cef_find_handler_t>
{
public:
CefFindHandlerCppToC(CefFindHandler* cls);
virtual ~CefFindHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _FINDHANDLER_CPPTOC_H

View File

@ -0,0 +1,58 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self,
cef_browser_t* browser, int next)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefFocusHandlerCppToC::Get(self)->OnTakeFocus(
CefBrowserCToCpp::Wrap(browser), next?true:false);
}
int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self,
cef_browser_t* browser, int isWidget)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return 0;
return CefFocusHandlerCppToC::Get(self)->OnSetFocus(
CefBrowserCToCpp::Wrap(browser), isWidget?true:false);
}
// CONSTRUCTOR - Do not edit by hand.
CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls)
: CefCppToC<CefFocusHandlerCppToC, CefFocusHandler, cef_focus_handler_t>(
cls)
{
struct_.struct_.on_take_focus = focus_handler_on_take_focus;
struct_.struct_.on_set_focus = focus_handler_on_set_focus;
}
#ifndef NDEBUG
template<> long CefCppToC<CefFocusHandlerCppToC, CefFocusHandler,
cef_focus_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _FOCUSHANDLER_CPPTOC_H
#define _FOCUSHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefFocusHandlerCppToC
: public CefCppToC<CefFocusHandlerCppToC, CefFocusHandler,
cef_focus_handler_t>
{
public:
CefFocusHandlerCppToC(CefFocusHandler* cls);
virtual ~CefFocusHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _FOCUSHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -267,7 +267,7 @@ CefFrameCppToC::CefFrameCppToC(CefFrame* cls)
struct_.struct_.visit_dom = frame_visit_dom;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefFrameCppToC, CefFrame, cef_frame_t>::DebugObjCt =
0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,681 +0,0 @@
// Copyright (c) 2010 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
#include "libcef_dll/cpptoc/handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/response_ctocpp.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
enum cef_retval_t CEF_CALLBACK handler_handle_before_created(
struct _cef_handler_t* self, cef_browser_t* parentBrowser,
cef_window_info_t* windowInfo, int popup,
const struct _cef_popup_features_t* popupFeatures,
struct _cef_handler_t** handler, const cef_string_t* url,
struct _cef_browser_settings_t* settings)
{
DCHECK(self);
DCHECK(windowInfo);
DCHECK(handler && *handler);
if(!self || !windowInfo || !handler || !*handler)
return RV_CONTINUE;
CefWindowInfo wndInfo;
CefBrowserSettings browserSettings;
CefPopupFeatures features;
// Take ownership of the values.
wndInfo.AttachTo(*windowInfo);
browserSettings.AttachTo(*settings);
// Reference the existing values instead of copying.
features.Set(*popupFeatures, false);
// |newHandler| will start off pointing to the current handler.
CefRefPtr<CefHandler> handlerPtr = CefHandlerCppToC::Unwrap(*handler);
CefHandler* origHandler = handlerPtr.get();
// |parentBrowser| will be NULL if this is a top-level browser window.
CefRefPtr<CefBrowser> browserPtr;
if(parentBrowser)
browserPtr = CefBrowserCToCpp::Wrap(parentBrowser);
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleBeforeCreated(
browserPtr, wndInfo, popup?true:false, features, handlerPtr,
CefString(url), browserSettings);
if(handlerPtr.get() != origHandler) {
// The handler has been changed.
*handler = CefHandlerCppToC::Wrap(handlerPtr);
}
// Return the values to the structures.
wndInfo.DetachTo(*windowInfo);
browserSettings.DetachTo(*settings);
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_after_created(
struct _cef_handler_t* self, cef_browser_t* browser)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleAfterCreated(
CefBrowserCToCpp::Wrap(browser));
}
enum cef_retval_t CEF_CALLBACK handler_handle_address_change(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
const cef_string_t* url)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
if(!self || !browser || !frame)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleAddressChange(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(url));
}
enum cef_retval_t CEF_CALLBACK handler_handle_title_change(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_string_t* title)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleTitleChange(
CefBrowserCToCpp::Wrap(browser), CefString(title));
}
enum cef_retval_t CEF_CALLBACK handler_handle_nav_state_change(
struct _cef_handler_t* self, cef_browser_t* browser, int canGoBack,
int canGoForward)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleNavStateChange(
CefBrowserCToCpp::Wrap(browser), (canGoBack?true:false),
(canGoForward?true:false));
}
enum cef_retval_t CEF_CALLBACK handler_handle_before_browse(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
struct _cef_request_t* request, enum cef_handler_navtype_t navType,
int isRedirect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(request);
if(!self || !browser || !request || !frame)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleBeforeBrowse(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefRequestCToCpp::Wrap(request), navType, (isRedirect ? true : false));
}
enum cef_retval_t CEF_CALLBACK handler_handle_load_start(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
CefRefPtr<CefFrame> framePtr;
if(frame)
framePtr = CefFrameCToCpp::Wrap(frame);
return CefHandlerCppToC::Get(self)->HandleLoadStart(
CefBrowserCToCpp::Wrap(browser), framePtr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_load_end(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
int httpStatusCode)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
CefRefPtr<CefFrame> framePtr;
if(frame)
framePtr = CefFrameCToCpp::Wrap(frame);
return CefHandlerCppToC::Get(self)->HandleLoadEnd(
CefBrowserCToCpp::Wrap(browser), framePtr, httpStatusCode);
}
enum cef_retval_t CEF_CALLBACK handler_handle_load_error(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl,
cef_string_t* errorText)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(errorText);
if(!self || !browser || !errorText || !frame)
return RV_CONTINUE;
CefString errorTextStr(errorText);
return CefHandlerCppToC::Get(self)->HandleLoadError(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode,
CefString(failedUrl), errorTextStr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_before_resource_load(
struct _cef_handler_t* self, cef_browser_t* browser,
struct _cef_request_t* request, cef_string_t* redirectUrl,
struct _cef_stream_reader_t** resourceStream,
struct _cef_response_t* response, int loadFlags)
{
DCHECK(self);
DCHECK(browser);
DCHECK(redirectUrl);
DCHECK(resourceStream);
DCHECK(response);
if(!self || !browser || !redirectUrl || !resourceStream || !response)
return RV_CONTINUE;
CefRefPtr<CefStreamReader> streamPtr;
CefString redirectUrlStr(redirectUrl);
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->
HandleBeforeResourceLoad(CefBrowserCToCpp::Wrap(browser),
CefRequestCToCpp::Wrap(request), redirectUrlStr, streamPtr,
CefResponseCToCpp::Wrap(response), loadFlags);
if(streamPtr.get())
*resourceStream = CefStreamReaderCToCpp::Unwrap(streamPtr);
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_protocol_execution(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_string_t* url, int* allow_os_execution)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
bool allowExec = *allow_os_execution?true:false;
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleProtocolExecution(
CefBrowserCToCpp::Wrap(browser), CefString(url), allowExec);
*allow_os_execution = allowExec;
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_download_response(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_string_t* mimeType, const cef_string_t* fileName,
int64 contentLength, struct _cef_download_handler_t** handler)
{
DCHECK(self);
DCHECK(browser);
DCHECK(mimeType);
DCHECK(fileName);
if(!self || !browser || !mimeType || !fileName)
return RV_CONTINUE;
CefRefPtr<CefDownloadHandler> downloadPtr;
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->
HandleDownloadResponse(CefBrowserCToCpp::Wrap(browser),
CefString(mimeType), CefString(fileName), contentLength, downloadPtr);
if(downloadPtr.get())
*handler = CefDownloadHandlerCppToC::Wrap(downloadPtr);
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_authentication_request(
struct _cef_handler_t* self, cef_browser_t* browser, int isProxy,
const cef_string_t* host, const cef_string_t* realm,
const cef_string_t* scheme, cef_string_t* username,
cef_string_t* password)
{
DCHECK(self);
DCHECK(browser);
DCHECK(username && password);
if (!self || !browser || !username || !password)
return RV_CONTINUE;
CefString usernameStr(username);
CefString passwordStr(password);
return CefHandlerCppToC::Get(self)->
HandleAuthenticationRequest(CefBrowserCToCpp::Wrap(browser),
(isProxy ? true : false), CefString(host), CefString(realm),
CefString(scheme), usernameStr, passwordStr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_before_menu(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_handler_menuinfo_t* menuInfo)
{
DCHECK(self);
DCHECK(browser);
DCHECK(menuInfo);
if(!self || !browser || !menuInfo)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleBeforeMenu(
CefBrowserCToCpp::Wrap(browser), *menuInfo);
}
enum cef_retval_t CEF_CALLBACK handler_handle_get_menu_label(
struct _cef_handler_t* self, cef_browser_t* browser,
enum cef_handler_menuid_t menuId, cef_string_t* label)
{
DCHECK(self);
DCHECK(browser);
DCHECK(label);
if(!self || !browser || !label)
return RV_CONTINUE;
CefString labelStr(label);
return CefHandlerCppToC::Get(self)->HandleGetMenuLabel(
CefBrowserCToCpp::Wrap(browser), menuId, labelStr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_menu_action(
struct _cef_handler_t* self, cef_browser_t* browser,
enum cef_handler_menuid_t menuId)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleMenuAction(
CefBrowserCToCpp::Wrap(browser), menuId);
}
enum cef_retval_t CEF_CALLBACK handler_handle_print_options(
struct _cef_handler_t* self, cef_browser_t* browser,
struct _cef_print_options_t* printOptions)
{
DCHECK(self);
DCHECK(browser);
DCHECK(printOptions);
if(!self || !browser || !printOptions)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandlePrintOptions(CefBrowserCToCpp::Wrap(browser), *printOptions);
}
enum cef_retval_t CEF_CALLBACK handler_handle_print_header_footer(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
cef_print_info_t* printInfo, const cef_string_t* url,
const cef_string_t* title, int currentPage, int maxPages,
cef_string_t* topLeft, cef_string_t* topCenter, cef_string_t* topRight,
cef_string_t* bottomLeft, cef_string_t* bottomCenter,
cef_string_t* bottomRight)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(printInfo);
DCHECK(topLeft && topCenter && topRight);
DCHECK(bottomLeft && bottomCenter && bottomRight);
if(!self || !browser || !frame || !printInfo || !topLeft || !topCenter
|| !topRight || !bottomLeft || !bottomCenter || !bottomRight)
return RV_CONTINUE;
CefPrintInfo info = *printInfo;
CefString topLeftStr(topLeft);
CefString topCenterStr(topCenter);
CefString topRightStr(topRight);
CefString bottomLeftStr(bottomLeft);
CefString bottomCenterStr(bottomCenter);
CefString bottomRightStr(bottomRight);
return CefHandlerCppToC::Get(self)->
HandlePrintHeaderFooter(CefBrowserCToCpp::Wrap(browser),
CefFrameCToCpp::Wrap(frame), info, CefString(url), CefString(title),
currentPage, maxPages, topLeftStr, topCenterStr, topRightStr,
bottomLeftStr, bottomCenterStr, bottomRightStr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_jsalert(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
const cef_string_t* message)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
if(!self || !browser || !frame)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleJSAlert(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message));
}
enum cef_retval_t CEF_CALLBACK handler_handle_jsconfirm(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
const cef_string_t* message, int* retval)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(retval);
if(!self || !browser || !retval || !frame)
return RV_CONTINUE;
bool ret = false;
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleJSConfirm(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message), ret);
*retval = (ret ? 1 : 0);
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_jsprompt(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
const cef_string_t* message, const cef_string_t* defaultValue, int* retval,
cef_string_t* result)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(retval);
DCHECK(result);
if(!self || !browser || !frame || !retval || !result)
return RV_CONTINUE;
bool ret = false;
CefString resultStr(result);
enum cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleJSPrompt(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message), CefString(defaultValue), ret, resultStr);
*retval = (ret ? 1 : 0);
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_jsbinding(
struct _cef_handler_t* self, cef_browser_t* browser, cef_frame_t* frame,
struct _cef_v8value_t* object)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(object);
if(!self || !browser || !frame || !object)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleJSBinding(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefV8ValueCToCpp::Wrap(object));
}
enum cef_retval_t CEF_CALLBACK handler_handle_before_window_close(
struct _cef_handler_t* self, cef_browser_t* browser)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleBeforeWindowClose(
CefBrowserCToCpp::Wrap(browser));
}
enum cef_retval_t CEF_CALLBACK handler_handle_take_focus(
struct _cef_handler_t* self, cef_browser_t* browser, int reverse)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleTakeFocus(
CefBrowserCToCpp::Wrap(browser), (reverse ? true : false));
}
enum cef_retval_t CEF_CALLBACK handler_handle_set_focus(
struct _cef_handler_t* self, cef_browser_t* browser, int isWidget)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleSetFocus(
CefBrowserCToCpp::Wrap(browser), isWidget?true:false);
}
enum cef_retval_t CEF_CALLBACK handler_handle_key_event(
struct _cef_handler_t* self, cef_browser_t* browser,
enum cef_handler_keyevent_type_t type, int code, int modifiers,
int isSystemKey)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleKeyEvent(
CefBrowserCToCpp::Wrap(browser), type, code,
modifiers, isSystemKey?true:false);
}
enum cef_retval_t CEF_CALLBACK handler_handle_tooltip(
struct _cef_handler_t* self, cef_browser_t* browser, cef_string_t* text)
{
DCHECK(self);
DCHECK(browser);
DCHECK(text);
if(!self || !browser || !text)
return RV_CONTINUE;
CefString textStr(text);
return CefHandlerCppToC::Get(self)->HandleTooltip(
CefBrowserCToCpp::Wrap(browser), textStr);
}
enum cef_retval_t CEF_CALLBACK handler_handle_status(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_string_t* value, enum cef_handler_statustype_t type)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleStatus(
CefBrowserCToCpp::Wrap(browser), CefString(value), type);
}
enum cef_retval_t CEF_CALLBACK handler_handle_console_message(
struct _cef_handler_t* self, cef_browser_t* browser,
const cef_string_t* message, const cef_string_t* source, int line)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleConsoleMessage(
CefBrowserCToCpp::Wrap(browser), CefString(message), CefString(source),
line);
}
enum cef_retval_t CEF_CALLBACK handler_handle_find_result(
struct _cef_handler_t* self, cef_browser_t* browser, int identifier,
int count, const cef_rect_t* selectionRect, int activeMatchOrdinal,
int finalUpdate)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
CefRect rect(*selectionRect);
return CefHandlerCppToC::Get(self)->HandleFindResult(
CefBrowserCToCpp::Wrap(browser), identifier, count, rect,
activeMatchOrdinal, finalUpdate?true:false);
}
enum cef_retval_t CEF_CALLBACK handler_handle_get_rect(
struct _cef_handler_t* self, cef_browser_t* browser, int screen,
cef_rect_t* rect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(rect);
if(!self || !browser || !rect)
return RV_CONTINUE;
CefRect changeRect(*rect);
cef_retval_t rv = CefHandlerCppToC::Get(self)->HandleGetRect(
CefBrowserCToCpp::Wrap(browser), screen?true:false, changeRect);
*rect = changeRect;
return rv;
}
enum cef_retval_t CEF_CALLBACK handler_handle_get_screen_point(
struct _cef_handler_t* self, cef_browser_t* browser, int viewX, int viewY,
int* screenX, int* screenY)
{
DCHECK(self);
DCHECK(browser);
DCHECK(screenX);
DCHECK(screenY);
if(!self || !browser || !screenX || !screenY)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleGetScreenPoint(
CefBrowserCToCpp::Wrap(browser), viewX, viewY, *screenX, *screenY);
}
enum cef_retval_t CEF_CALLBACK handler_handle_popup_change(
struct _cef_handler_t* self, cef_browser_t* browser, int show,
const cef_rect_t* rect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(rect);
if(!self || !browser || !rect)
return RV_CONTINUE;
CefRect changeRect(*rect);
return CefHandlerCppToC::Get(self)->HandlePopupChange(
CefBrowserCToCpp::Wrap(browser), show?true:false, changeRect);
}
enum cef_retval_t CEF_CALLBACK handler_handle_paint(struct _cef_handler_t* self,
cef_browser_t* browser, enum cef_paint_element_type_t type,
const cef_rect_t* dirtyRect, const void* buffer)
{
DCHECK(self);
DCHECK(browser);
DCHECK(dirtyRect);
if(!self || !browser || !dirtyRect)
return RV_CONTINUE;
CefRect rect(*dirtyRect);
return CefHandlerCppToC::Get(self)->HandlePaint(
CefBrowserCToCpp::Wrap(browser), type, rect, buffer);
}
enum cef_retval_t CEF_CALLBACK handler_handle_cursor_change(
struct _cef_handler_t* self, cef_browser_t* browser,
cef_cursor_handle_t cursor)
{
DCHECK(self);
DCHECK(browser);
if(!self || !browser)
return RV_CONTINUE;
return CefHandlerCppToC::Get(self)->HandleCursorChange(
CefBrowserCToCpp::Wrap(browser), cursor);
}
// CONSTRUCTOR - Do not edit by hand.
CefHandlerCppToC::CefHandlerCppToC(CefHandler* cls)
: CefCppToC<CefHandlerCppToC, CefHandler, cef_handler_t>(cls)
{
struct_.struct_.handle_before_created = handler_handle_before_created;
struct_.struct_.handle_after_created = handler_handle_after_created;
struct_.struct_.handle_address_change = handler_handle_address_change;
struct_.struct_.handle_title_change = handler_handle_title_change;
struct_.struct_.handle_nav_state_change = handler_handle_nav_state_change;
struct_.struct_.handle_before_browse = handler_handle_before_browse;
struct_.struct_.handle_load_start = handler_handle_load_start;
struct_.struct_.handle_load_end = handler_handle_load_end;
struct_.struct_.handle_load_error = handler_handle_load_error;
struct_.struct_.handle_before_resource_load =
handler_handle_before_resource_load;
struct_.struct_.handle_protocol_execution = handler_handle_protocol_execution;
struct_.struct_.handle_download_response = handler_handle_download_response;
struct_.struct_.handle_authentication_request =
handler_handle_authentication_request;
struct_.struct_.handle_before_menu = handler_handle_before_menu;
struct_.struct_.handle_get_menu_label = handler_handle_get_menu_label;
struct_.struct_.handle_menu_action = handler_handle_menu_action;
struct_.struct_.handle_print_options = handler_handle_print_options;
struct_.struct_.handle_print_header_footer =
handler_handle_print_header_footer;
struct_.struct_.handle_jsalert = handler_handle_jsalert;
struct_.struct_.handle_jsconfirm = handler_handle_jsconfirm;
struct_.struct_.handle_jsprompt = handler_handle_jsprompt;
struct_.struct_.handle_jsbinding = handler_handle_jsbinding;
struct_.struct_.handle_before_window_close =
handler_handle_before_window_close;
struct_.struct_.handle_take_focus = handler_handle_take_focus;
struct_.struct_.handle_set_focus = handler_handle_set_focus;
struct_.struct_.handle_key_event = handler_handle_key_event;
struct_.struct_.handle_tooltip = handler_handle_tooltip;
struct_.struct_.handle_status = handler_handle_status;
struct_.struct_.handle_console_message = handler_handle_console_message;
struct_.struct_.handle_find_result = handler_handle_find_result;
struct_.struct_.handle_get_rect = handler_handle_get_rect;
struct_.struct_.handle_get_screen_point = handler_handle_get_screen_point;
struct_.struct_.handle_popup_change = handler_handle_popup_change;
struct_.struct_.handle_paint = handler_handle_paint;
struct_.struct_.handle_cursor_change = handler_handle_cursor_change;
}
#ifdef _DEBUG
template<> long CefCppToC<CefHandlerCppToC, CefHandler,
cef_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,51 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/jsbinding_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK jsbinding_handler_on_jsbinding(
struct _cef_jsbinding_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, struct _cef_v8value_t* object)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(object);
if (!self || !browser || !frame || !object)
return;
return CefJSBindingHandlerCppToC::Get(self)->OnJSBinding(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefV8ValueCToCpp::Wrap(object));
}
// CONSTRUCTOR - Do not edit by hand.
CefJSBindingHandlerCppToC::CefJSBindingHandlerCppToC(CefJSBindingHandler* cls)
: CefCppToC<CefJSBindingHandlerCppToC, CefJSBindingHandler,
cef_jsbinding_handler_t>(cls)
{
struct_.struct_.on_jsbinding = jsbinding_handler_on_jsbinding;
}
#ifndef NDEBUG
template<> long CefCppToC<CefJSBindingHandlerCppToC, CefJSBindingHandler,
cef_jsbinding_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _JSBINDINGHANDLER_CPPTOC_H
#define _JSBINDINGHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefJSBindingHandlerCppToC
: public CefCppToC<CefJSBindingHandlerCppToC, CefJSBindingHandler,
cef_jsbinding_handler_t>
{
public:
CefJSBindingHandlerCppToC(CefJSBindingHandler* cls);
virtual ~CefJSBindingHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _JSBINDINGHANDLER_CPPTOC_H

View File

@ -0,0 +1,99 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK jsdialog_handler_on_jsalert(
struct _cef_jsdialog_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, const cef_string_t* message)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(message);
if (!self || !browser || !frame || !message)
return 0;
return CefJSDialogHandlerCppToC::Get(self)->OnJSAlert(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message));
}
int CEF_CALLBACK jsdialog_handler_on_jsconfirm(
struct _cef_jsdialog_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, const cef_string_t* message, int* retval)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(message);
DCHECK(retval);
if (!self || !browser || !frame || !message || !retval)
return 0;
bool ret = false;
int rv = CefJSDialogHandlerCppToC::Get(self)->OnJSConfirm(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message), ret);
*retval = (ret ? 1 : 0);
return rv;
}
int CEF_CALLBACK jsdialog_handler_on_jsprompt(
struct _cef_jsdialog_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, const cef_string_t* message,
const cef_string_t* defaultValue, int* retval, cef_string_t* result)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(message);
DCHECK(defaultValue);
DCHECK(retval);
DCHECK(result);
if (!self || !browser || !frame || !message || !defaultValue || !retval ||
!result)
return 0;
bool ret = false;
CefString resultStr(result);
int rv = CefJSDialogHandlerCppToC::Get(self)->OnJSPrompt(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefString(message), CefString(defaultValue), ret, resultStr);
*retval = (ret ? 1 : 0);
return rv;
}
// CONSTRUCTOR - Do not edit by hand.
CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls)
: CefCppToC<CefJSDialogHandlerCppToC, CefJSDialogHandler,
cef_jsdialog_handler_t>(cls)
{
struct_.struct_.on_jsalert = jsdialog_handler_on_jsalert;
struct_.struct_.on_jsconfirm = jsdialog_handler_on_jsconfirm;
struct_.struct_.on_jsprompt = jsdialog_handler_on_jsprompt;
}
#ifndef NDEBUG
template<> long CefCppToC<CefJSDialogHandlerCppToC, CefJSDialogHandler,
cef_jsdialog_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _JSDIALOGHANDLER_CPPTOC_H
#define _JSDIALOGHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefJSDialogHandlerCppToC
: public CefCppToC<CefJSDialogHandlerCppToC, CefJSDialogHandler,
cef_jsdialog_handler_t>
{
public:
CefJSDialogHandlerCppToC(CefJSDialogHandler* cls);
virtual ~CefJSDialogHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _JSDIALOGHANDLER_CPPTOC_H

View File

@ -0,0 +1,48 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK keyboard_handler_on_key_event(
struct _cef_keyboard_handler_t* self, cef_browser_t* browser,
enum cef_handler_keyevent_type_t type, int code, int modifiers,
int isSystemKey)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return 0;
return CefKeyboardHandlerCppToC::Get(self)->OnKeyEvent(
CefBrowserCToCpp::Wrap(browser), type, code,
modifiers, isSystemKey?true:false);
}
// CONSTRUCTOR - Do not edit by hand.
CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls)
: CefCppToC<CefKeyboardHandlerCppToC, CefKeyboardHandler,
cef_keyboard_handler_t>(cls)
{
struct_.struct_.on_key_event = keyboard_handler_on_key_event;
}
#ifndef NDEBUG
template<> long CefCppToC<CefKeyboardHandlerCppToC, CefKeyboardHandler,
cef_keyboard_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _KEYBOARDHANDLER_CPPTOC_H
#define _KEYBOARDHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefKeyboardHandlerCppToC
: public CefCppToC<CefKeyboardHandlerCppToC, CefKeyboardHandler,
cef_keyboard_handler_t>
{
public:
CefKeyboardHandlerCppToC(CefKeyboardHandler* cls);
virtual ~CefKeyboardHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _KEYBOARDHANDLER_CPPTOC_H

View File

@ -0,0 +1,117 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/client_cpptoc.h"
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK life_span_handler_on_before_popup(
struct _cef_life_span_handler_t* self, cef_browser_t* parentBrowser,
const struct _cef_popup_features_t* popupFeatures,
cef_window_info_t* windowInfo, const cef_string_t* url,
struct _cef_client_t** client, struct _cef_browser_settings_t* settings)
{
DCHECK(self);
DCHECK(parentBrowser);
DCHECK(popupFeatures);
DCHECK(windowInfo);
DCHECK(url);
DCHECK(client);
DCHECK(settings);
if (!self || !parentBrowser || !popupFeatures || !windowInfo || !url ||
!client || !settings)
return 0;
CefWindowInfo wndInfo;
CefBrowserSettings browserSettings;
CefPopupFeatures features;
// Take ownership of the values.
wndInfo.AttachTo(*windowInfo);
browserSettings.AttachTo(*settings);
// Reference the existing values instead of copying.
features.Set(*popupFeatures, false);
// |newHandler| will start off pointing to the current handler.
CefRefPtr<CefClient> clientPtr;
if (*client)
clientPtr = CefClientCppToC::Unwrap(*client);
CefClient* origClient = clientPtr.get();
// |parentBrowser| will be NULL if this is a top-level browser window.
CefRefPtr<CefBrowser> browserPtr(CefBrowserCToCpp::Wrap(parentBrowser));
bool rv = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup(
browserPtr, features, wndInfo, CefString(url), clientPtr,
browserSettings);
if (clientPtr.get()) {
if (clientPtr.get() != origClient) {
// The handler has been changed.
*client = CefClientCppToC::Wrap(clientPtr);
}
} else {
*client = NULL;
}
// Return the values to the structures.
wndInfo.DetachTo(*windowInfo);
browserSettings.DetachTo(*settings);
return rv;
}
void CEF_CALLBACK life_span_handler_on_after_created(
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefLifeSpanHandlerCppToC::Get(self)->OnAfterCreated(
CefBrowserCToCpp::Wrap(browser));
}
void CEF_CALLBACK life_span_handler_on_before_close(
struct _cef_life_span_handler_t* self, cef_browser_t* browser)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefLifeSpanHandlerCppToC::Get(self)->OnBeforeClose(
CefBrowserCToCpp::Wrap(browser));
}
// CONSTRUCTOR - Do not edit by hand.
CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls)
: CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
cef_life_span_handler_t>(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_.on_before_close = life_span_handler_on_before_close;
}
#ifndef NDEBUG
template<> long CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
cef_life_span_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _LIFESPANHANDLER_CPPTOC_H
#define _LIFESPANHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefLifeSpanHandlerCppToC
: public CefCppToC<CefLifeSpanHandlerCppToC, CefLifeSpanHandler,
cef_life_span_handler_t>
{
public:
CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls);
virtual ~CefLifeSpanHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _LIFESPANHANDLER_CPPTOC_H

View File

@ -0,0 +1,81 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/load_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self,
cef_browser_t* browser, cef_frame_t* frame)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
if (!self || !browser || !frame)
return;
CefLoadHandlerCppToC::Get(self)->OnLoadStart(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame));
}
void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self,
cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
if (!self || !browser || !frame)
return;
CefLoadHandlerCppToC::Get(self)->OnLoadEnd(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
httpStatusCode);
}
int CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self,
cef_browser_t* browser, cef_frame_t* frame,
enum cef_handler_errorcode_t errorCode, const cef_string_t* failedUrl,
cef_string_t* errorText)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(failedUrl);
DCHECK(errorText);
if (!self || !browser || !frame || !failedUrl || !errorText)
return 0;
CefString errorTextStr(errorText);
return CefLoadHandlerCppToC::Get(self)->OnLoadError(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), errorCode,
CefString(failedUrl), errorTextStr);
}
// CONSTRUCTOR - Do not edit by hand.
CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls)
: CefCppToC<CefLoadHandlerCppToC, CefLoadHandler, cef_load_handler_t>(cls)
{
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;
}
#ifndef NDEBUG
template<> long CefCppToC<CefLoadHandlerCppToC, CefLoadHandler,
cef_load_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,34 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _LOADHANDLER_CPPTOC_H
#define _LOADHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefLoadHandlerCppToC
: public CefCppToC<CefLoadHandlerCppToC, CefLoadHandler, cef_load_handler_t>
{
public:
CefLoadHandlerCppToC(CefLoadHandler* cls);
virtual ~CefLoadHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _LOADHANDLER_CPPTOC_H

View File

@ -0,0 +1,74 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/menu_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK menu_handler_on_before_menu(struct _cef_menu_handler_t* self,
cef_browser_t* browser, const cef_handler_menuinfo_t* menuInfo)
{
DCHECK(self);
DCHECK(browser);
DCHECK(menuInfo);
if (!self || !browser || !menuInfo)
return 0;
return CefMenuHandlerCppToC::Get(self)->OnBeforeMenu(
CefBrowserCToCpp::Wrap(browser), *menuInfo);
}
void CEF_CALLBACK menu_handler_get_menu_label(struct _cef_menu_handler_t* self,
cef_browser_t* browser, enum cef_handler_menuid_t menuId,
cef_string_t* label)
{
DCHECK(self);
DCHECK(browser);
DCHECK(label);
if (!self || !browser || !label)
return;
CefString labelStr(label);
CefMenuHandlerCppToC::Get(self)->GetMenuLabel(
CefBrowserCToCpp::Wrap(browser), menuId, labelStr);
}
int CEF_CALLBACK menu_handler_on_menu_action(struct _cef_menu_handler_t* self,
cef_browser_t* browser, enum cef_handler_menuid_t menuId)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return 0;
return CefMenuHandlerCppToC::Get(self)->OnMenuAction(
CefBrowserCToCpp::Wrap(browser), menuId);
}
// CONSTRUCTOR - Do not edit by hand.
CefMenuHandlerCppToC::CefMenuHandlerCppToC(CefMenuHandler* cls)
: CefCppToC<CefMenuHandlerCppToC, CefMenuHandler, cef_menu_handler_t>(cls)
{
struct_.struct_.on_before_menu = menu_handler_on_before_menu;
struct_.struct_.get_menu_label = menu_handler_get_menu_label;
struct_.struct_.on_menu_action = menu_handler_on_menu_action;
}
#ifndef NDEBUG
template<> long CefCppToC<CefMenuHandlerCppToC, CefMenuHandler,
cef_menu_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,34 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _MENUHANDLER_CPPTOC_H
#define _MENUHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefMenuHandlerCppToC
: public CefCppToC<CefMenuHandlerCppToC, CefMenuHandler, cef_menu_handler_t>
{
public:
CefMenuHandlerCppToC(CefMenuHandler* cls);
virtual ~CefMenuHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _MENUHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -100,7 +100,7 @@ CefPostDataCppToC::CefPostDataCppToC(CefPostData* cls)
struct_.struct_.remove_elements = post_data_remove_elements;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefPostDataCppToC, CefPostData,
cef_post_data_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -114,7 +114,7 @@ CefPostDataElementCppToC::CefPostDataElementCppToC(CefPostDataElement* cls)
struct_.struct_.get_bytes = post_data_element_get_bytes;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefPostDataElementCppToC, CefPostDataElement,
cef_post_data_element_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -0,0 +1,87 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK print_handler_get_print_options(
struct _cef_print_handler_t* self, cef_browser_t* browser,
struct _cef_print_options_t* printOptions)
{
DCHECK(self);
DCHECK(browser);
DCHECK(printOptions);
if (!self || !browser || !printOptions)
return 0;
return CefPrintHandlerCppToC::Get(self)->GetPrintOptions(
CefBrowserCToCpp::Wrap(browser), *printOptions);
}
int CEF_CALLBACK print_handler_get_print_header_footer(
struct _cef_print_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, const cef_print_info_t* printInfo,
const cef_string_t* url, const cef_string_t* title, int currentPage,
int maxPages, cef_string_t* topLeft, cef_string_t* topCenter,
cef_string_t* topRight, cef_string_t* bottomLeft,
cef_string_t* bottomCenter, cef_string_t* bottomRight)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(printInfo);
DCHECK(url);
DCHECK(title);
DCHECK(topLeft);
DCHECK(topCenter);
DCHECK(topRight);
DCHECK(bottomLeft);
DCHECK(bottomCenter);
DCHECK(bottomRight);
if (!self || !browser || !frame || !printInfo || !url || !title || !topLeft ||
!topCenter || !topRight || !bottomLeft || !bottomCenter || !bottomRight)
return 0;
CefString topLeftStr(topLeft);
CefString topCenterStr(topCenter);
CefString topRightStr(topRight);
CefString bottomLeftStr(bottomLeft);
CefString bottomCenterStr(bottomCenter);
CefString bottomRightStr(bottomRight);
return CefPrintHandlerCppToC::Get(self)->GetPrintHeaderFooter(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame), *printInfo,
CefString(url), CefString(title), currentPage, maxPages, topLeftStr,
topCenterStr, topRightStr, bottomLeftStr, bottomCenterStr,
bottomRightStr);
}
// CONSTRUCTOR - Do not edit by hand.
CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls)
: CefCppToC<CefPrintHandlerCppToC, CefPrintHandler, cef_print_handler_t>(
cls)
{
struct_.struct_.get_print_options = print_handler_get_print_options;
struct_.struct_.get_print_header_footer =
print_handler_get_print_header_footer;
}
#ifndef NDEBUG
template<> long CefCppToC<CefPrintHandlerCppToC, CefPrintHandler,
cef_print_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _PRINTHANDLER_CPPTOC_H
#define _PRINTHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefPrintHandlerCppToC
: public CefCppToC<CefPrintHandlerCppToC, CefPrintHandler,
cef_print_handler_t>
{
public:
CefPrintHandlerCppToC(CefPrintHandler* cls);
virtual ~CefPrintHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _PRINTHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -65,7 +65,7 @@ CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls)
struct_.struct_.eof = read_handler_eof;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefReadHandlerCppToC, CefReadHandler,
cef_read_handler_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -0,0 +1,144 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK render_handler_get_view_rect(
struct _cef_render_handler_t* self, cef_browser_t* browser,
cef_rect_t* rect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(rect);
if (!self || !browser || !rect)
return 0;
CefRect changeRect(*rect);
int rv = CefRenderHandlerCppToC::Get(self)->GetViewRect(
CefBrowserCToCpp::Wrap(browser), changeRect);
*rect = changeRect;
return rv;
}
int CEF_CALLBACK render_handler_get_screen_rect(
struct _cef_render_handler_t* self, cef_browser_t* browser,
cef_rect_t* rect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(rect);
if (!self || !browser || !rect)
return 0;
CefRect changeRect(*rect);
int rv = CefRenderHandlerCppToC::Get(self)->GetScreenRect(
CefBrowserCToCpp::Wrap(browser), changeRect);
*rect = changeRect;
return rv;
}
int CEF_CALLBACK render_handler_get_screen_point(
struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX,
int viewY, int* screenX, int* screenY)
{
DCHECK(self);
DCHECK(browser);
DCHECK(screenX);
DCHECK(screenY);
if (!self || !browser || !screenX || !screenY)
return 0;
return CefRenderHandlerCppToC::Get(self)->GetScreenPoint(
CefBrowserCToCpp::Wrap(browser), viewX, viewY, *screenX, *screenY);
}
void CEF_CALLBACK render_handler_on_popup_show(
struct _cef_render_handler_t* self, cef_browser_t* browser, int show)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
CefRenderHandlerCppToC::Get(self)->OnPopupShow(
CefBrowserCToCpp::Wrap(browser), show?true:false);
}
void CEF_CALLBACK render_handler_on_popup_size(
struct _cef_render_handler_t* self, cef_browser_t* browser,
const cef_rect_t* rect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(rect);
if (!self || !browser || !rect)
return;
CefRect sizeRect(*rect);
return CefRenderHandlerCppToC::Get(self)->OnPopupSize(
CefBrowserCToCpp::Wrap(browser), sizeRect);
}
void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
cef_browser_t* browser, enum cef_paint_element_type_t type,
const cef_rect_t* dirtyRect, const void* buffer)
{
DCHECK(self);
DCHECK(browser);
DCHECK(dirtyRect);
DCHECK(buffer);
if (!self || !browser || !dirtyRect || !buffer)
return;
CefRect rect(*dirtyRect);
return CefRenderHandlerCppToC::Get(self)->OnPaint(
CefBrowserCToCpp::Wrap(browser), type, rect, buffer);
}
void CEF_CALLBACK render_handler_on_cursor_change(
struct _cef_render_handler_t* self, cef_browser_t* browser,
cef_cursor_handle_t cursor)
{
DCHECK(self);
DCHECK(browser);
if (!self || !browser)
return;
return CefRenderHandlerCppToC::Get(self)->OnCursorChange(
CefBrowserCToCpp::Wrap(browser), cursor);
}
// CONSTRUCTOR - Do not edit by hand.
CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls)
: CefCppToC<CefRenderHandlerCppToC, CefRenderHandler, cef_render_handler_t>(
cls)
{
struct_.struct_.get_view_rect = render_handler_get_view_rect;
struct_.struct_.get_screen_rect = render_handler_get_screen_rect;
struct_.struct_.get_screen_point = render_handler_get_screen_point;
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;
}
#ifndef NDEBUG
template<> long CefCppToC<CefRenderHandlerCppToC, CefRenderHandler,
cef_render_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _RENDERHANDLER_CPPTOC_H
#define _RENDERHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefRenderHandlerCppToC
: public CefCppToC<CefRenderHandlerCppToC, CefRenderHandler,
cef_render_handler_t>
{
public:
CefRenderHandlerCppToC(CefRenderHandler* cls);
virtual ~CefRenderHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _RENDERHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -208,7 +208,7 @@ CefRequestCppToC::CefRequestCppToC(CefRequest* cls)
request_set_first_party_for_cookies;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefRequestCppToC, CefRequest,
cef_request_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -0,0 +1,157 @@
// Copyright (c) 2011 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.
//
// ---------------------------------------------------------------------------
//
// A portion of this file was generated by the CEF translator tool. When
// making changes by hand only do so within the body of existing function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
#include "libcef_dll/cpptoc/request_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/response_ctocpp.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
int CEF_CALLBACK request_handler_on_before_browse(
struct _cef_request_handler_t* self, cef_browser_t* browser,
cef_frame_t* frame, struct _cef_request_t* request,
enum cef_handler_navtype_t navType, int isRedirect)
{
DCHECK(self);
DCHECK(browser);
DCHECK(frame);
DCHECK(request);
if (!self || !browser || !frame || !request)
return 0;
return CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse(
CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
CefRequestCToCpp::Wrap(request), navType, (isRedirect ? true : false));
}
int CEF_CALLBACK request_handler_on_before_resource_load(
struct _cef_request_handler_t* self, cef_browser_t* browser,
struct _cef_request_t* request, cef_string_t* redirectUrl,
struct _cef_stream_reader_t** resourceStream,
struct _cef_response_t* response, int loadFlags)
{
DCHECK(self);
DCHECK(browser);
DCHECK(request);
DCHECK(redirectUrl);
DCHECK(resourceStream);
DCHECK(response);
if (!self || !browser || !request || !redirectUrl || !resourceStream ||
!response)
return 0;
CefRefPtr<CefStreamReader> streamPtr;
CefString redirectUrlStr(redirectUrl);
int rv = CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad(
CefBrowserCToCpp::Wrap(browser), CefRequestCToCpp::Wrap(request),
redirectUrlStr, streamPtr, CefResponseCToCpp::Wrap(response), loadFlags);
if(streamPtr.get())
*resourceStream = CefStreamReaderCToCpp::Unwrap(streamPtr);
return rv;
}
int CEF_CALLBACK request_handler_on_protocol_execution(
struct _cef_request_handler_t* self, cef_browser_t* browser,
const cef_string_t* url, int* allowOSExecution)
{
DCHECK(self);
DCHECK(browser);
DCHECK(url);
DCHECK(allowOSExecution);
if (!self || !browser || !url || !allowOSExecution)
return 0;
bool allowExec = *allowOSExecution?true:false;
int rv = CefRequestHandlerCppToC::Get(self)->OnProtocolExecution(
CefBrowserCToCpp::Wrap(browser), CefString(url), allowExec);
*allowOSExecution = allowExec;
return rv;
}
int CEF_CALLBACK request_handler_get_download_handler(
struct _cef_request_handler_t* self, cef_browser_t* browser,
const cef_string_t* mimeType, const cef_string_t* fileName,
int64 contentLength, struct _cef_download_handler_t** handler)
{
DCHECK(self);
DCHECK(browser);
DCHECK(mimeType);
DCHECK(fileName);
DCHECK(handler);
if (!self || !browser || !mimeType || !fileName || !handler)
return 0;
CefRefPtr<CefDownloadHandler> downloadPtr;
int rv = CefRequestHandlerCppToC::Get(self)->GetDownloadHandler(
CefBrowserCToCpp::Wrap(browser), CefString(mimeType), CefString(fileName),
contentLength, downloadPtr);
if(downloadPtr.get())
*handler = CefDownloadHandlerCppToC::Wrap(downloadPtr);
return rv;
}
int CEF_CALLBACK request_handler_get_auth_credentials(
struct _cef_request_handler_t* self, cef_browser_t* browser, int isProxy,
const cef_string_t* host, const cef_string_t* realm,
const cef_string_t* scheme, cef_string_t* username,
cef_string_t* password)
{
DCHECK(self);
DCHECK(browser);
DCHECK(host);
DCHECK(realm);
DCHECK(scheme);
DCHECK(username);
DCHECK(password);
if (!self || !browser || !host || !realm || !scheme || !username || !password)
return 0;
CefString usernameStr(username);
CefString passwordStr(password);
return CefRequestHandlerCppToC::Get(self)->GetAuthCredentials(
CefBrowserCToCpp::Wrap(browser), (isProxy ? true : false),
CefString(host), CefString(realm), CefString(scheme), usernameStr,
passwordStr);
}
// CONSTRUCTOR - Do not edit by hand.
CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls)
: CefCppToC<CefRequestHandlerCppToC, CefRequestHandler,
cef_request_handler_t>(cls)
{
struct_.struct_.on_before_browse = request_handler_on_before_browse;
struct_.struct_.on_before_resource_load =
request_handler_on_before_resource_load;
struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution;
struct_.struct_.get_download_handler = request_handler_get_download_handler;
struct_.struct_.get_auth_credentials = request_handler_get_auth_credentials;
}
#ifndef NDEBUG
template<> long CefCppToC<CefRequestHandlerCppToC, CefRequestHandler,
cef_request_handler_t>::DebugObjCt = 0;
#endif

View File

@ -0,0 +1,35 @@
// Copyright (c) 2011 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 and should not edited
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
#ifndef _REQUESTHANDLER_CPPTOC_H
#define _REQUESTHANDLER_CPPTOC_H
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_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 CefRequestHandlerCppToC
: public CefCppToC<CefRequestHandlerCppToC, CefRequestHandler,
cef_request_handler_t>
{
public:
CefRequestHandlerCppToC(CefRequestHandler* cls);
virtual ~CefRequestHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // _REQUESTHANDLER_CPPTOC_H

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -130,7 +130,7 @@ CefResponseCppToC::CefResponseCppToC(CefResponse* cls)
struct_.struct_.set_header_map = response_set_header_map;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefResponseCppToC, CefResponse,
cef_response_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -72,7 +72,7 @@ CefSchemeHandlerCppToC::CefSchemeHandlerCppToC(CefSchemeHandler* cls)
struct_.struct_.read_response = scheme_handler_read_response;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefSchemeHandlerCppToC, CefSchemeHandler,
cef_scheme_handler_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -36,7 +36,7 @@ CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC(
struct_.struct_.create = scheme_handler_factory_create;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefSchemeHandlerFactoryCppToC,
CefSchemeHandlerFactory, cef_scheme_handler_factory_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -99,7 +99,7 @@ CefStreamReaderCppToC::CefStreamReaderCppToC(CefStreamReader* cls)
struct_.struct_.eof = stream_reader_eof;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefStreamReaderCppToC, CefStreamReader,
cef_stream_reader_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -98,7 +98,7 @@ CefStreamWriterCppToC::CefStreamWriterCppToC(CefStreamWriter* cls)
struct_.struct_.flush = stream_writer_flush;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefStreamWriterCppToC, CefStreamWriter,
cef_stream_writer_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -34,7 +34,7 @@ CefTaskCppToC::CefTaskCppToC(CefTask* cls)
struct_.struct_.execute = task_execute;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefTaskCppToC, CefTask, cef_task_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -70,7 +70,7 @@ CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls)
struct_.struct_.set = v8accessor_set;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefV8AccessorCppToC, CefV8Accessor,
cef_v8accessor_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -112,7 +112,7 @@ CefV8ContextCppToC::CefV8ContextCppToC(CefV8Context* cls)
struct_.struct_.exit = v8context_exit;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefV8ContextCppToC, CefV8Context,
cef_v8context_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -23,7 +23,7 @@ int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self,
{
DCHECK(self);
if(!self)
return RV_CONTINUE;
return 0;
CefRefPtr<CefV8Value> objectPtr;
if(object)
@ -55,7 +55,7 @@ CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls)
struct_.struct_.execute = v8handler_execute;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefV8HandlerCppToC, CefV8Handler,
cef_v8handler_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -507,7 +507,7 @@ CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls)
v8value_execute_function_with_context;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefV8ValueCppToC, CefV8Value,
cef_v8value_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -118,7 +118,7 @@ CefWebURLRequestClientCppToC::CefWebURLRequestClientCppToC(
struct_.struct_.on_error = web_urlrequest_client_on_error;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefWebURLRequestClientCppToC, CefWebURLRequestClient,
cef_web_urlrequest_client_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -66,7 +66,7 @@ CefWebURLRequestCppToC::CefWebURLRequestCppToC(CefWebURLRequest* cls)
struct_.struct_.get_state = web_urlrequest_get_state;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefWebURLRequestCppToC, CefWebURLRequest,
cef_web_urlrequest_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -66,7 +66,7 @@ CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls)
struct_.struct_.flush = write_handler_flush;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefWriteHandlerCppToC, CefWriteHandler,
cef_write_handler_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -377,7 +377,7 @@ CefXmlReaderCppToC::CefXmlReaderCppToC(CefXmlReader* cls)
xml_reader_move_to_carrying_element;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefXmlReaderCppToC, CefXmlReader,
cef_xml_reader_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//
@ -165,7 +165,7 @@ CefZipReaderCppToC::CefZipReaderCppToC(CefZipReader* cls)
struct_.struct_.eof = zip_reader_eof;
}
#ifdef _DEBUG
#ifndef NDEBUG
template<> long CefCppToC<CefZipReaderCppToC, CefZipReader,
cef_zip_reader_t>::DebugObjCt = 0;
#endif

View File

@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
// Copyright (c) 2011 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.
//