Set eol-style property on all files. Future commits will use the subversion auto-props configuration at http://src.chromium.org/viewvc/chrome/trunk/tools/buildbot/slave/config

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@109 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2010-10-03 21:04:50 +00:00
parent 5fc6307a6f
commit 46b831304c
182 changed files with 30470 additions and 30470 deletions

View File

@@ -1,95 +1,95 @@
// Copyright (c) 2009 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.
#ifndef _BASE_CTOCPP_H
#define _BASE_CTOCPP_H
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/cef_logging.h"
// CefCToCpp implementation for CefBase.
class CefBaseCToCpp : public CefThreadSafeBase<CefBase>
{
public:
// Use this method to create a wrapper class instance for a structure
// received from the other side.
static CefRefPtr<CefBase> Wrap(cef_base_t* s)
{
// Wrap their structure with the CefCToCpp object.
CefBaseCToCpp* wrapper = new CefBaseCToCpp(s);
// Put the wrapper object in a smart pointer.
CefRefPtr<CefBase> wrapperPtr(wrapper);
// Release the reference that was added to the CefCppToC wrapper object on
// the other side before their structure was passed to us.
wrapper->UnderlyingRelease();
// Return the smart pointer.
return wrapperPtr;
}
// Use this method to retrieve the underlying structure from a wrapper class
// instance for return back to the other side.
static cef_base_t* Unwrap(CefRefPtr<CefBase> c)
{
// Cast the object to our wrapper class type.
CefBaseCToCpp* wrapper = static_cast<CefBaseCToCpp*>(c.get());
// Add a reference to the CefCppToC wrapper object on the other side that
// will be released once the structure is received.
wrapper->UnderlyingAddRef();
// Return their original structure.
return wrapper->GetStruct();
}
CefBaseCToCpp(cef_base_t* str)
: struct_(str)
{
DCHECK(str);
}
virtual ~CefBaseCToCpp() {}
// If returning the structure across the DLL boundary you should call
// UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of
// the DLL boundary, call Release() on the CefCppToC object.
cef_base_t* GetStruct() { return struct_; }
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapped structure.
virtual int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<CefBase>::AddRef();
}
virtual int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<CefBase>::Release();
}
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef()
{
if(!struct_->add_ref)
return 0;
return struct_->add_ref(struct_);
}
int UnderlyingRelease()
{
if(!struct_->release)
return 0;
return struct_->release(struct_);
}
int UnderlyingGetRefCt()
{
if(!struct_->get_refct)
return 0;
return struct_->get_refct(struct_);
}
protected:
cef_base_t* struct_;
};
#endif // _BASE_CTOCPP_H
// Copyright (c) 2009 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.
#ifndef _BASE_CTOCPP_H
#define _BASE_CTOCPP_H
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/cef_logging.h"
// CefCToCpp implementation for CefBase.
class CefBaseCToCpp : public CefThreadSafeBase<CefBase>
{
public:
// Use this method to create a wrapper class instance for a structure
// received from the other side.
static CefRefPtr<CefBase> Wrap(cef_base_t* s)
{
// Wrap their structure with the CefCToCpp object.
CefBaseCToCpp* wrapper = new CefBaseCToCpp(s);
// Put the wrapper object in a smart pointer.
CefRefPtr<CefBase> wrapperPtr(wrapper);
// Release the reference that was added to the CefCppToC wrapper object on
// the other side before their structure was passed to us.
wrapper->UnderlyingRelease();
// Return the smart pointer.
return wrapperPtr;
}
// Use this method to retrieve the underlying structure from a wrapper class
// instance for return back to the other side.
static cef_base_t* Unwrap(CefRefPtr<CefBase> c)
{
// Cast the object to our wrapper class type.
CefBaseCToCpp* wrapper = static_cast<CefBaseCToCpp*>(c.get());
// Add a reference to the CefCppToC wrapper object on the other side that
// will be released once the structure is received.
wrapper->UnderlyingAddRef();
// Return their original structure.
return wrapper->GetStruct();
}
CefBaseCToCpp(cef_base_t* str)
: struct_(str)
{
DCHECK(str);
}
virtual ~CefBaseCToCpp() {}
// If returning the structure across the DLL boundary you should call
// UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of
// the DLL boundary, call Release() on the CefCppToC object.
cef_base_t* GetStruct() { return struct_; }
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapped structure.
virtual int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<CefBase>::AddRef();
}
virtual int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<CefBase>::Release();
}
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef()
{
if(!struct_->add_ref)
return 0;
return struct_->add_ref(struct_);
}
int UnderlyingRelease()
{
if(!struct_->release)
return 0;
return struct_->release(struct_);
}
int UnderlyingGetRefCt()
{
if(!struct_->get_refct)
return 0;
return struct_->get_refct(struct_);
}
protected:
cef_base_t* struct_;
};
#endif // _BASE_CTOCPP_H

View File

@@ -1,209 +1,209 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, bool popup,
CefRefPtr<CefHandler> handler, const std::wstring& url)
{
return cef_browser_create(&windowInfo, popup, CefHandlerCppToC::Wrap(handler),
url.c_str())?true:false;
}
CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
bool popup, CefRefPtr<CefHandler> handler, const std::wstring& url)
{
cef_browser_t* impl = cef_browser_create_sync(&windowInfo, popup,
CefHandlerCppToC::Wrap(handler), url.c_str());
if(impl)
return CefBrowserCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
bool CefBrowserCToCpp::CanGoBack()
{
if(CEF_MEMBER_MISSING(struct_, can_go_back))
return false;
return struct_->can_go_back(struct_) ? true : false;
}
void CefBrowserCToCpp::GoBack()
{
if(CEF_MEMBER_MISSING(struct_, go_back))
return;
struct_->go_back(struct_);
}
bool CefBrowserCToCpp::CanGoForward()
{
if(CEF_MEMBER_MISSING(struct_, can_go_forward))
return false;
return struct_->can_go_forward(struct_)?true:false;
}
void CefBrowserCToCpp::GoForward()
{
if(CEF_MEMBER_MISSING(struct_, go_forward))
return;
struct_->go_forward(struct_);
}
void CefBrowserCToCpp::Reload()
{
if(CEF_MEMBER_MISSING(struct_, reload))
return;
struct_->reload(struct_);
}
void CefBrowserCToCpp::ReloadIgnoreCache()
{
if(CEF_MEMBER_MISSING(struct_, reload))
return;
struct_->reload_ignore_cache(struct_);
}
void CefBrowserCToCpp::StopLoad()
{
if(CEF_MEMBER_MISSING(struct_, stop_load))
return;
struct_->stop_load(struct_);
}
void CefBrowserCToCpp::SetFocus(bool enable)
{
if(CEF_MEMBER_MISSING(struct_, set_focus))
return;
struct_->set_focus(struct_, enable);
}
CefWindowHandle CefBrowserCToCpp::GetWindowHandle()
{
if(CEF_MEMBER_MISSING(struct_, get_window_handle))
return 0;
return struct_->get_window_handle(struct_);
}
bool CefBrowserCToCpp::IsPopup()
{
if(CEF_MEMBER_MISSING(struct_, is_popup))
return false;
return struct_->is_popup(struct_)?true:false;
}
CefRefPtr<CefHandler> CefBrowserCToCpp::GetHandler()
{
if(CEF_MEMBER_MISSING(struct_, get_handler))
return NULL;
cef_handler_t* handlerStruct = struct_->get_handler(struct_);
if(handlerStruct)
return CefHandlerCppToC::Unwrap(handlerStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetMainFrame()
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_main_frame(struct_);
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFocusedFrame()
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_focused_frame(struct_);
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrame(const std::wstring& name)
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_frame(struct_, name.c_str());
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
void CefBrowserCToCpp::GetFrameNames(std::vector<std::wstring>& names)
{
if(CEF_MEMBER_MISSING(struct_, get_frame_names))
return;
cef_string_list_t list = cef_string_list_alloc();
struct_->get_frame_names(struct_, list);
cef_string_t str;
int size = cef_string_list_size(list);
for(int i = 0; i < size; ++i) {
str = cef_string_list_value(list, i);
names.push_back(str);
cef_string_free(str);
}
cef_string_list_free(list);
}
void CefBrowserCToCpp::Find(int identifier, const std::wstring& searchText,
bool forward, bool matchCase, bool findNext)
{
if(CEF_MEMBER_MISSING(struct_, find))
return;
struct_->find(struct_, identifier, searchText.c_str(), forward,
matchCase, findNext);
}
void CefBrowserCToCpp::StopFinding(bool clearSelection)
{
if(CEF_MEMBER_MISSING(struct_, stop_finding))
return;
struct_->stop_finding(struct_, clearSelection);
}
#ifdef _DEBUG
long CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, bool popup,
CefRefPtr<CefHandler> handler, const std::wstring& url)
{
return cef_browser_create(&windowInfo, popup, CefHandlerCppToC::Wrap(handler),
url.c_str())?true:false;
}
CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
bool popup, CefRefPtr<CefHandler> handler, const std::wstring& url)
{
cef_browser_t* impl = cef_browser_create_sync(&windowInfo, popup,
CefHandlerCppToC::Wrap(handler), url.c_str());
if(impl)
return CefBrowserCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
bool CefBrowserCToCpp::CanGoBack()
{
if(CEF_MEMBER_MISSING(struct_, can_go_back))
return false;
return struct_->can_go_back(struct_) ? true : false;
}
void CefBrowserCToCpp::GoBack()
{
if(CEF_MEMBER_MISSING(struct_, go_back))
return;
struct_->go_back(struct_);
}
bool CefBrowserCToCpp::CanGoForward()
{
if(CEF_MEMBER_MISSING(struct_, can_go_forward))
return false;
return struct_->can_go_forward(struct_)?true:false;
}
void CefBrowserCToCpp::GoForward()
{
if(CEF_MEMBER_MISSING(struct_, go_forward))
return;
struct_->go_forward(struct_);
}
void CefBrowserCToCpp::Reload()
{
if(CEF_MEMBER_MISSING(struct_, reload))
return;
struct_->reload(struct_);
}
void CefBrowserCToCpp::ReloadIgnoreCache()
{
if(CEF_MEMBER_MISSING(struct_, reload))
return;
struct_->reload_ignore_cache(struct_);
}
void CefBrowserCToCpp::StopLoad()
{
if(CEF_MEMBER_MISSING(struct_, stop_load))
return;
struct_->stop_load(struct_);
}
void CefBrowserCToCpp::SetFocus(bool enable)
{
if(CEF_MEMBER_MISSING(struct_, set_focus))
return;
struct_->set_focus(struct_, enable);
}
CefWindowHandle CefBrowserCToCpp::GetWindowHandle()
{
if(CEF_MEMBER_MISSING(struct_, get_window_handle))
return 0;
return struct_->get_window_handle(struct_);
}
bool CefBrowserCToCpp::IsPopup()
{
if(CEF_MEMBER_MISSING(struct_, is_popup))
return false;
return struct_->is_popup(struct_)?true:false;
}
CefRefPtr<CefHandler> CefBrowserCToCpp::GetHandler()
{
if(CEF_MEMBER_MISSING(struct_, get_handler))
return NULL;
cef_handler_t* handlerStruct = struct_->get_handler(struct_);
if(handlerStruct)
return CefHandlerCppToC::Unwrap(handlerStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetMainFrame()
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_main_frame(struct_);
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFocusedFrame()
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_focused_frame(struct_);
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrame(const std::wstring& name)
{
if(CEF_MEMBER_MISSING(struct_, get_main_frame))
return NULL;
cef_frame_t* frameStruct = struct_->get_frame(struct_, name.c_str());
if(frameStruct)
return CefFrameCToCpp::Wrap(frameStruct);
return NULL;
}
void CefBrowserCToCpp::GetFrameNames(std::vector<std::wstring>& names)
{
if(CEF_MEMBER_MISSING(struct_, get_frame_names))
return;
cef_string_list_t list = cef_string_list_alloc();
struct_->get_frame_names(struct_, list);
cef_string_t str;
int size = cef_string_list_size(list);
for(int i = 0; i < size; ++i) {
str = cef_string_list_value(list, i);
names.push_back(str);
cef_string_free(str);
}
cef_string_list_free(list);
}
void CefBrowserCToCpp::Find(int identifier, const std::wstring& searchText,
bool forward, bool matchCase, bool findNext)
{
if(CEF_MEMBER_MISSING(struct_, find))
return;
struct_->find(struct_, identifier, searchText.c_str(), forward,
matchCase, findNext);
}
void CefBrowserCToCpp::StopFinding(bool clearSelection)
{
if(CEF_MEMBER_MISSING(struct_, stop_finding))
return;
struct_->stop_finding(struct_, clearSelection);
}
#ifdef _DEBUG
long CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>::DebugObjCt = 0;
#endif

View File

@@ -1,56 +1,56 @@
// Copyright (c) 2009 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 _BROWSER_CTOCPP_H
#define _BROWSER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefBrowserCToCpp
: public CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>
{
public:
CefBrowserCToCpp(cef_browser_t* str)
: CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>(str) {}
virtual ~CefBrowserCToCpp() {}
// CefBrowser methods
virtual bool CanGoBack();
virtual void GoBack();
virtual bool CanGoForward();
virtual void GoForward();
virtual void Reload();
virtual void ReloadIgnoreCache();
virtual void StopLoad();
virtual void SetFocus(bool enable);
virtual CefWindowHandle GetWindowHandle();
virtual bool IsPopup();
virtual CefRefPtr<CefHandler> GetHandler();
virtual CefRefPtr<CefFrame> GetMainFrame();
virtual CefRefPtr<CefFrame> GetFocusedFrame();
virtual CefRefPtr<CefFrame> GetFrame(const std::wstring& name);
virtual void GetFrameNames(std::vector<std::wstring>& names);
virtual void Find(int identifier, const std::wstring& searchText,
bool forward, bool matchCase, bool findNext);
virtual void StopFinding(bool clearSelection);
};
#endif // USING_CEF_SHARED
#endif // _BROWSER_CTOCPP_H
// Copyright (c) 2009 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 _BROWSER_CTOCPP_H
#define _BROWSER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefBrowserCToCpp
: public CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>
{
public:
CefBrowserCToCpp(cef_browser_t* str)
: CefCToCpp<CefBrowserCToCpp, CefBrowser, cef_browser_t>(str) {}
virtual ~CefBrowserCToCpp() {}
// CefBrowser methods
virtual bool CanGoBack();
virtual void GoBack();
virtual bool CanGoForward();
virtual void GoForward();
virtual void Reload();
virtual void ReloadIgnoreCache();
virtual void StopLoad();
virtual void SetFocus(bool enable);
virtual CefWindowHandle GetWindowHandle();
virtual bool IsPopup();
virtual CefRefPtr<CefHandler> GetHandler();
virtual CefRefPtr<CefFrame> GetMainFrame();
virtual CefRefPtr<CefFrame> GetFocusedFrame();
virtual CefRefPtr<CefFrame> GetFrame(const std::wstring& name);
virtual void GetFrameNames(std::vector<std::wstring>& names);
virtual void Find(int identifier, const std::wstring& searchText,
bool forward, bool matchCase, bool findNext);
virtual void StopFinding(bool clearSelection);
};
#endif // USING_CEF_SHARED
#endif // _BROWSER_CTOCPP_H

View File

@@ -1,111 +1,111 @@
// Copyright (c) 2009 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.
#ifndef _CTOCPP_H
#define _CTOCPP_H
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/cef_logging.h"
// Wrap a C structure with a C++ class. This is used when the implementation
// exists on the other side of the DLL boundary but will have methods called on
// this side of the DLL boundary.
template <class ClassName, class BaseName, class StructName>
class CefCToCpp : public CefThreadSafeBase<BaseName>
{
public:
// Use this method to create a wrapper class instance for a structure
// received from the other side.
static CefRefPtr<BaseName> Wrap(StructName* s)
{
// Wrap their structure with the CefCToCpp object.
ClassName* wrapper = new ClassName(s);
// Put the wrapper object in a smart pointer.
CefRefPtr<BaseName> wrapperPtr(wrapper);
// Release the reference that was added to the CefCppToC wrapper object on
// the other side before their structure was passed to us.
wrapper->UnderlyingRelease();
// Return the smart pointer.
return wrapperPtr;
}
// Use this method to retrieve the underlying structure from a wrapper class
// instance for return back to the other side.
static StructName* Unwrap(CefRefPtr<BaseName> c)
{
// Cast the object to our wrapper class type.
ClassName* wrapper = static_cast<ClassName*>(c.get());
// Add a reference to the CefCppToC wrapper object on the other side that
// will be released once the structure is received.
wrapper->UnderlyingAddRef();
// Return their original structure.
return wrapper->GetStruct();
}
CefCToCpp(StructName* str)
: struct_(str)
{
DCHECK(str);
#ifdef _DEBUG
CefAtomicIncrement(&DebugObjCt);
#endif
}
virtual ~CefCToCpp()
{
#ifdef _DEBUG
CefAtomicDecrement(&DebugObjCt);
#endif
}
// If returning the structure across the DLL boundary you should call
// UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of
// the DLL boundary, call Release() on the CefCppToC object.
StructName* GetStruct() { return struct_; }
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapped structure.
virtual int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<BaseName>::AddRef();
}
virtual int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<BaseName>::Release();
}
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef()
{
if(!struct_->base.add_ref)
return 0;
return struct_->base.add_ref(&struct_->base);
}
int UnderlyingRelease()
{
if(!struct_->base.release)
return 0;
return struct_->base.release(&struct_->base);
}
int UnderlyingGetRefCt()
{
if(!struct_->base.get_refct)
return 0;
return struct_->base.get_refct(&struct_->base);
}
#ifdef _DEBUG
// Simple tracking of allocated objects.
static long DebugObjCt;
#endif
protected:
StructName* struct_;
};
#endif // _CTOCPP_H
// Copyright (c) 2009 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.
#ifndef _CTOCPP_H
#define _CTOCPP_H
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/cef_logging.h"
// Wrap a C structure with a C++ class. This is used when the implementation
// exists on the other side of the DLL boundary but will have methods called on
// this side of the DLL boundary.
template <class ClassName, class BaseName, class StructName>
class CefCToCpp : public CefThreadSafeBase<BaseName>
{
public:
// Use this method to create a wrapper class instance for a structure
// received from the other side.
static CefRefPtr<BaseName> Wrap(StructName* s)
{
// Wrap their structure with the CefCToCpp object.
ClassName* wrapper = new ClassName(s);
// Put the wrapper object in a smart pointer.
CefRefPtr<BaseName> wrapperPtr(wrapper);
// Release the reference that was added to the CefCppToC wrapper object on
// the other side before their structure was passed to us.
wrapper->UnderlyingRelease();
// Return the smart pointer.
return wrapperPtr;
}
// Use this method to retrieve the underlying structure from a wrapper class
// instance for return back to the other side.
static StructName* Unwrap(CefRefPtr<BaseName> c)
{
// Cast the object to our wrapper class type.
ClassName* wrapper = static_cast<ClassName*>(c.get());
// Add a reference to the CefCppToC wrapper object on the other side that
// will be released once the structure is received.
wrapper->UnderlyingAddRef();
// Return their original structure.
return wrapper->GetStruct();
}
CefCToCpp(StructName* str)
: struct_(str)
{
DCHECK(str);
#ifdef _DEBUG
CefAtomicIncrement(&DebugObjCt);
#endif
}
virtual ~CefCToCpp()
{
#ifdef _DEBUG
CefAtomicDecrement(&DebugObjCt);
#endif
}
// If returning the structure across the DLL boundary you should call
// UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of
// the DLL boundary, call Release() on the CefCppToC object.
StructName* GetStruct() { return struct_; }
// CefBase methods increment/decrement reference counts on both this object
// and the underlying wrapped structure.
virtual int AddRef()
{
UnderlyingAddRef();
return CefThreadSafeBase<BaseName>::AddRef();
}
virtual int Release()
{
UnderlyingRelease();
return CefThreadSafeBase<BaseName>::Release();
}
// Increment/decrement reference counts on only the underlying class.
int UnderlyingAddRef()
{
if(!struct_->base.add_ref)
return 0;
return struct_->base.add_ref(&struct_->base);
}
int UnderlyingRelease()
{
if(!struct_->base.release)
return 0;
return struct_->base.release(&struct_->base);
}
int UnderlyingGetRefCt()
{
if(!struct_->base.get_refct)
return 0;
return struct_->base.get_refct(&struct_->base);
}
#ifdef _DEBUG
// Simple tracking of allocated objects.
static long DebugObjCt;
#endif
protected:
StructName* struct_;
};
#endif // _CTOCPP_H

View File

@@ -1,213 +1,213 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefFrameCToCpp::Undo()
{
if(CEF_MEMBER_MISSING(struct_, undo))
return;
struct_->undo(struct_);
}
void CefFrameCToCpp::Redo()
{
if(CEF_MEMBER_MISSING(struct_, redo))
return;
struct_->redo(struct_);
}
void CefFrameCToCpp::Cut()
{
if(CEF_MEMBER_MISSING(struct_, cut))
return;
struct_->cut(struct_);
}
void CefFrameCToCpp::Copy()
{
if(CEF_MEMBER_MISSING(struct_, copy))
return;
struct_->copy(struct_);
}
void CefFrameCToCpp::Paste()
{
if(CEF_MEMBER_MISSING(struct_, paste))
return;
struct_->paste(struct_);
}
void CefFrameCToCpp::Delete()
{
if(CEF_MEMBER_MISSING(struct_, del))
return;
struct_->del(struct_);
}
void CefFrameCToCpp::SelectAll()
{
if(CEF_MEMBER_MISSING(struct_, select_all))
return;
struct_->select_all(struct_);
}
void CefFrameCToCpp::Print()
{
if(CEF_MEMBER_MISSING(struct_, print))
return;
struct_->print(struct_);
}
void CefFrameCToCpp::ViewSource()
{
if(CEF_MEMBER_MISSING(struct_, view_source))
return;
struct_->view_source(struct_);
}
std::wstring CefFrameCToCpp::GetSource()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_source))
return str;
cef_string_t cef_str = struct_->get_source(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
std::wstring CefFrameCToCpp::GetText()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_text))
return str;
cef_string_t cef_str = struct_->get_text(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefFrameCToCpp::LoadRequest(CefRefPtr<CefRequest> request)
{
if(CEF_MEMBER_MISSING(struct_, load_request))
return;
struct_->load_request(struct_, CefRequestCToCpp::Unwrap(request));
}
void CefFrameCToCpp::LoadURL(const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_url))
return;
struct_->load_url(struct_, url.c_str());
}
void CefFrameCToCpp::LoadString(const std::wstring& string,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_string))
return;
struct_->load_string(struct_, string.c_str(), url.c_str());
}
void CefFrameCToCpp::LoadStream(CefRefPtr<CefStreamReader> stream,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_stream))
return;
struct_->load_stream(struct_, CefStreamReaderCToCpp::Unwrap(stream),
url.c_str());
}
void CefFrameCToCpp::ExecuteJavaScript(const std::wstring& jsCode,
const std::wstring& scriptUrl, int startLine)
{
if(CEF_MEMBER_MISSING(struct_, execute_java_script))
return;
struct_->execute_java_script(struct_, jsCode.c_str(), scriptUrl.c_str(),
startLine);
}
bool CefFrameCToCpp::IsMain()
{
if(CEF_MEMBER_MISSING(struct_, is_main))
return false;
return struct_->is_main(struct_)?true:false;
}
bool CefFrameCToCpp::IsFocused()
{
if(CEF_MEMBER_MISSING(struct_, is_focused))
return false;
return struct_->is_focused(struct_)?true:false;
}
std::wstring CefFrameCToCpp::GetName()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_name))
return str;
cef_string_t cef_str = struct_->get_name(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
std::wstring CefFrameCToCpp::GetURL()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_url))
return str;
cef_string_t cef_str = struct_->get_url(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
#ifdef _DEBUG
long CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefFrameCToCpp::Undo()
{
if(CEF_MEMBER_MISSING(struct_, undo))
return;
struct_->undo(struct_);
}
void CefFrameCToCpp::Redo()
{
if(CEF_MEMBER_MISSING(struct_, redo))
return;
struct_->redo(struct_);
}
void CefFrameCToCpp::Cut()
{
if(CEF_MEMBER_MISSING(struct_, cut))
return;
struct_->cut(struct_);
}
void CefFrameCToCpp::Copy()
{
if(CEF_MEMBER_MISSING(struct_, copy))
return;
struct_->copy(struct_);
}
void CefFrameCToCpp::Paste()
{
if(CEF_MEMBER_MISSING(struct_, paste))
return;
struct_->paste(struct_);
}
void CefFrameCToCpp::Delete()
{
if(CEF_MEMBER_MISSING(struct_, del))
return;
struct_->del(struct_);
}
void CefFrameCToCpp::SelectAll()
{
if(CEF_MEMBER_MISSING(struct_, select_all))
return;
struct_->select_all(struct_);
}
void CefFrameCToCpp::Print()
{
if(CEF_MEMBER_MISSING(struct_, print))
return;
struct_->print(struct_);
}
void CefFrameCToCpp::ViewSource()
{
if(CEF_MEMBER_MISSING(struct_, view_source))
return;
struct_->view_source(struct_);
}
std::wstring CefFrameCToCpp::GetSource()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_source))
return str;
cef_string_t cef_str = struct_->get_source(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
std::wstring CefFrameCToCpp::GetText()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_text))
return str;
cef_string_t cef_str = struct_->get_text(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefFrameCToCpp::LoadRequest(CefRefPtr<CefRequest> request)
{
if(CEF_MEMBER_MISSING(struct_, load_request))
return;
struct_->load_request(struct_, CefRequestCToCpp::Unwrap(request));
}
void CefFrameCToCpp::LoadURL(const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_url))
return;
struct_->load_url(struct_, url.c_str());
}
void CefFrameCToCpp::LoadString(const std::wstring& string,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_string))
return;
struct_->load_string(struct_, string.c_str(), url.c_str());
}
void CefFrameCToCpp::LoadStream(CefRefPtr<CefStreamReader> stream,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, load_stream))
return;
struct_->load_stream(struct_, CefStreamReaderCToCpp::Unwrap(stream),
url.c_str());
}
void CefFrameCToCpp::ExecuteJavaScript(const std::wstring& jsCode,
const std::wstring& scriptUrl, int startLine)
{
if(CEF_MEMBER_MISSING(struct_, execute_java_script))
return;
struct_->execute_java_script(struct_, jsCode.c_str(), scriptUrl.c_str(),
startLine);
}
bool CefFrameCToCpp::IsMain()
{
if(CEF_MEMBER_MISSING(struct_, is_main))
return false;
return struct_->is_main(struct_)?true:false;
}
bool CefFrameCToCpp::IsFocused()
{
if(CEF_MEMBER_MISSING(struct_, is_focused))
return false;
return struct_->is_focused(struct_)?true:false;
}
std::wstring CefFrameCToCpp::GetName()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_name))
return str;
cef_string_t cef_str = struct_->get_name(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
std::wstring CefFrameCToCpp::GetURL()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_url))
return str;
cef_string_t cef_str = struct_->get_url(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
#ifdef _DEBUG
long CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>::DebugObjCt = 0;
#endif

View File

@@ -1,60 +1,60 @@
// Copyright (c) 2009 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 _FRAME_CTOCPP_H
#define _FRAME_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefFrameCToCpp
: public CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>
{
public:
CefFrameCToCpp(cef_frame_t* str)
: CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>(str) {}
virtual ~CefFrameCToCpp() {}
// CefFrame methods
virtual void Undo();
virtual void Redo();
virtual void Cut();
virtual void Copy();
virtual void Paste();
virtual void Delete();
virtual void SelectAll();
virtual void Print();
virtual void ViewSource();
virtual std::wstring GetSource();
virtual std::wstring GetText();
virtual void LoadRequest(CefRefPtr<CefRequest> request);
virtual void LoadURL(const std::wstring& url);
virtual void LoadString(const std::wstring& string, const std::wstring& url);
virtual void LoadStream(CefRefPtr<CefStreamReader> stream,
const std::wstring& url);
virtual void ExecuteJavaScript(const std::wstring& jsCode,
const std::wstring& scriptUrl, int startLine);
virtual bool IsMain();
virtual bool IsFocused();
virtual std::wstring GetName();
virtual std::wstring GetURL();
};
#endif // USING_CEF_SHARED
#endif // _FRAME_CTOCPP_H
// Copyright (c) 2009 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 _FRAME_CTOCPP_H
#define _FRAME_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefFrameCToCpp
: public CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>
{
public:
CefFrameCToCpp(cef_frame_t* str)
: CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>(str) {}
virtual ~CefFrameCToCpp() {}
// CefFrame methods
virtual void Undo();
virtual void Redo();
virtual void Cut();
virtual void Copy();
virtual void Paste();
virtual void Delete();
virtual void SelectAll();
virtual void Print();
virtual void ViewSource();
virtual std::wstring GetSource();
virtual std::wstring GetText();
virtual void LoadRequest(CefRefPtr<CefRequest> request);
virtual void LoadURL(const std::wstring& url);
virtual void LoadString(const std::wstring& string, const std::wstring& url);
virtual void LoadStream(CefRefPtr<CefStreamReader> stream,
const std::wstring& url);
virtual void ExecuteJavaScript(const std::wstring& jsCode,
const std::wstring& scriptUrl, int startLine);
virtual bool IsMain();
virtual bool IsFocused();
virtual std::wstring GetName();
virtual std::wstring GetURL();
};
#endif // USING_CEF_SHARED
#endif // _FRAME_CTOCPP_H

View File

@@ -1,417 +1,417 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/frame_cpptoc.h"
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
#include "libcef_dll/ctocpp/handler_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeCreated(
CefRefPtr<CefBrowser> parentBrowser, CefWindowInfo& windowInfo, bool popup,
CefRefPtr<CefHandler>& handler, std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_created))
return RV_CONTINUE;
cef_browser_t* browserStruct = NULL;
if(parentBrowser.get())
browserStruct = CefBrowserCppToC::Wrap(parentBrowser);
cef_handler_t* handlerStruct = NULL;
if(handler.get())
handlerStruct = CefHandlerCToCpp::Unwrap(handler);
cef_handler_t *origHandlerStruct = handlerStruct;
cef_string_t urlRet = NULL;
if(!url.empty())
urlRet = cef_string_alloc(url.c_str());
cef_retval_t rv = struct_->handle_before_created(struct_,
browserStruct, &windowInfo, popup, &handlerStruct, &urlRet);
if(handlerStruct && handlerStruct != origHandlerStruct) {
// The handler was changed.
if(handlerStruct)
handler = CefHandlerCToCpp::Wrap(handlerStruct);
else
handler = NULL;
}
transfer_string_contents(urlRet, url, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleAfterCreated(
CefRefPtr<CefBrowser> browser)
{
if(CEF_MEMBER_MISSING(struct_, handle_after_created))
return RV_CONTINUE;
return struct_->handle_after_created(struct_,
CefBrowserCppToC::Wrap(browser));
}
CefHandler::RetVal CefHandlerCToCpp::HandleAddressChange(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, handle_address_change))
return RV_CONTINUE;
return struct_->handle_address_change(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
url.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleTitleChange(
CefRefPtr<CefBrowser> browser, const std::wstring& title)
{
if(CEF_MEMBER_MISSING(struct_, handle_title_change))
return RV_CONTINUE;
return struct_->handle_title_change(struct_, CefBrowserCppToC::Wrap(browser),
title.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeBrowse(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request, NavType navType, bool isRedirect)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_browse))
return RV_CONTINUE;
return struct_->handle_before_browse(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request),
navType, isRedirect);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadStart(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_start))
return RV_CONTINUE;
cef_frame_t* frameStruct = NULL;
if(frame.get())
frameStruct = CefFrameCppToC::Wrap(frame);
return struct_->handle_load_start(struct_, CefBrowserCppToC::Wrap(browser),
frameStruct);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadEnd(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_end))
return RV_CONTINUE;
cef_frame_t* frameStruct = NULL;
if(frame.get())
frameStruct = CefFrameCppToC::Wrap(frame);
return struct_->handle_load_end(struct_, CefBrowserCppToC::Wrap(browser),
frameStruct);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadError(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
ErrorCode errorCode, const std::wstring& failedUrl,
std::wstring& errorText)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_error))
return RV_CONTINUE;
cef_string_t errorTextRet = NULL;
if(!errorText.empty())
errorTextRet = cef_string_alloc(errorText.c_str());
cef_retval_t rv = struct_->handle_load_error(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), errorCode,
failedUrl.c_str(), &errorTextRet);
transfer_string_contents(errorTextRet, errorText, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeResourceLoad(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefRequest> request,
std::wstring& redirectUrl, CefRefPtr<CefStreamReader>& resourceStream,
std::wstring& mimeType, int loadFlags)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_resource_load))
return RV_CONTINUE;
cef_string_t redirectUrlRet = NULL;
cef_string_t mimeTypeRet = NULL;
cef_stream_reader_t* streamRet = NULL;
if(!redirectUrl.empty())
redirectUrlRet = cef_string_alloc(redirectUrl.c_str());
cef_retval_t rv = struct_->handle_before_resource_load(struct_,
CefBrowserCppToC::Wrap(browser), CefRequestCppToC::Wrap(request),
&redirectUrlRet, &streamRet, &mimeTypeRet, loadFlags);
transfer_string_contents(redirectUrlRet, redirectUrl, true);
transfer_string_contents(mimeTypeRet, mimeType, true);
if(streamRet)
resourceStream = CefStreamReaderCppToC::Unwrap(streamRet);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeMenu(
CefRefPtr<CefBrowser> browser, const MenuInfo& menuInfo)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_menu))
return RV_CONTINUE;
return struct_->handle_before_menu(struct_, CefBrowserCppToC::Wrap(browser),
&menuInfo);
}
CefHandler::RetVal CefHandlerCToCpp::HandleGetMenuLabel(
CefRefPtr<CefBrowser> browser, MenuId menuId, std::wstring& label)
{
if(CEF_MEMBER_MISSING(struct_, handle_get_menu_label))
return RV_CONTINUE;
cef_string_t labelRet = NULL;
if(!label.empty())
labelRet = cef_string_alloc(label.c_str());
cef_retval_t rv = struct_->handle_get_menu_label(struct_,
CefBrowserCppToC::Wrap(browser), menuId, &labelRet);
transfer_string_contents(labelRet, label, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleMenuAction(
CefRefPtr<CefBrowser> browser, MenuId menuId)
{
if(CEF_MEMBER_MISSING(struct_, handle_menu_action))
return RV_CONTINUE;
return struct_->handle_menu_action(struct_, CefBrowserCppToC::Wrap(browser),
menuId);
}
CefHandler::RetVal CefHandlerCToCpp::HandlePrintOptions(
CefRefPtr<CefBrowser> browser, CefPrintOptions& printOptions)
{
if (CEF_MEMBER_MISSING(struct_, handle_print_options))
return RV_CONTINUE;
return struct_->handle_print_options(struct_, CefBrowserCppToC::Wrap(browser),
&printOptions);
}
CefHandler::RetVal CefHandlerCToCpp::HandlePrintHeaderFooter(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefPrintInfo& printInfo, const std::wstring& url,
const std::wstring& title, int currentPage, int maxPages,
std::wstring& topLeft, std::wstring& topCenter, std::wstring& topRight,
std::wstring& bottomLeft, std::wstring& bottomCenter,
std::wstring& bottomRight)
{
if(CEF_MEMBER_MISSING(struct_, handle_print_header_footer))
return RV_CONTINUE;
cef_string_t topLeftRet = NULL, topCenterRet = NULL, topRightRet = NULL,
bottomLeftRet = NULL, bottomCenterRet = NULL, bottomRightRet = NULL;
if(!topLeft.empty())
topLeftRet = cef_string_alloc(topLeft.c_str());
if(!topCenter.empty())
topCenterRet = cef_string_alloc(topCenter.c_str());
if(!topRight.empty())
topRightRet = cef_string_alloc(topRight.c_str());
if(!bottomLeft.empty())
bottomLeftRet = cef_string_alloc(bottomLeft.c_str());
if(!bottomCenter.empty())
bottomCenterRet = cef_string_alloc(bottomCenter.c_str());
if(!bottomRight.empty())
bottomRightRet = cef_string_alloc(bottomRight.c_str());
cef_retval_t rv = struct_->handle_print_header_footer(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
&printInfo, url.c_str(), title.c_str(), currentPage, maxPages,
&topLeftRet, &topCenterRet, &topRightRet, &bottomLeftRet,
&bottomCenterRet, &bottomRightRet);
transfer_string_contents(topLeftRet, topLeft, true);
transfer_string_contents(topCenterRet, topCenter, true);
transfer_string_contents(topRightRet, topRight, true);
transfer_string_contents(bottomLeftRet, bottomLeft, true);
transfer_string_contents(bottomCenterRet, bottomCenter, true);
transfer_string_contents(bottomRightRet, bottomRight, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSAlert(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsalert))
return RV_CONTINUE;
return struct_->handle_jsalert(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), message.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSConfirm(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message, bool& retval)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsconfirm))
return RV_CONTINUE;
int ret = 0;
cef_retval_t rv = struct_->handle_jsconfirm(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
message.c_str(), &ret);
retval = (ret ? true : false);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSPrompt(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message, const std::wstring& defaultValue,
bool& retval, std::wstring& result)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsprompt))
return RV_CONTINUE;
cef_string_t resultRet = NULL;
if(!result.empty())
resultRet = cef_string_alloc(result.c_str());
int ret = 0;
cef_retval_t rv = struct_->handle_jsprompt(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
message.c_str(), defaultValue.c_str(), &ret, &resultRet);
retval = (ret ? true : false);
transfer_string_contents(resultRet, result, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSBinding(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsbinding))
return RV_CONTINUE;
return struct_->handle_jsbinding(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), CefV8ValueCppToC::Wrap(object));
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeWindowClose(
CefRefPtr<CefBrowser> browser)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_window_close))
return RV_CONTINUE;
return struct_->handle_before_window_close(struct_,
CefBrowserCppToC::Wrap(browser));
}
CefHandler::RetVal CefHandlerCToCpp::HandleTakeFocus(
CefRefPtr<CefBrowser> browser, bool reverse)
{
if(CEF_MEMBER_MISSING(struct_, handle_take_focus))
return RV_CONTINUE;
return struct_->handle_take_focus(struct_, CefBrowserCppToC::Wrap(browser),
reverse);
}
CefHandler::RetVal CefHandlerCToCpp::HandleSetFocus(
CefRefPtr<CefBrowser> browser, bool isWidget)
{
if(CEF_MEMBER_MISSING(struct_, handle_set_focus))
return RV_CONTINUE;
return struct_->handle_set_focus(struct_, CefBrowserCppToC::Wrap(browser),
isWidget);
}
CefHandler::RetVal CefHandlerCToCpp::HandleKeyEvent(
CefRefPtr<CefBrowser> browser, KeyEventType type, int code, int modifiers,
bool isSystemKey)
{
if(CEF_MEMBER_MISSING(struct_, handle_key_event))
return RV_CONTINUE;
return struct_->handle_key_event(struct_, CefBrowserCppToC::Wrap(browser),
type, code, modifiers, isSystemKey);
}
CefHandler::RetVal CefHandlerCToCpp::HandleTooltip(
CefRefPtr<CefBrowser> browser, std::wstring& text)
{
if(CEF_MEMBER_MISSING(struct_, handle_tooltip))
return RV_CONTINUE;
cef_string_t textRet = NULL;
if(!text.empty())
textRet = cef_string_alloc(text.c_str());
cef_retval_t rv = struct_->handle_tooltip(struct_,
CefBrowserCppToC::Wrap(browser), &textRet);
transfer_string_contents(textRet, text, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleConsoleMessage(
CefRefPtr<CefBrowser> browser, const std::wstring& message,
const std::wstring& source, int line)
{
if(CEF_MEMBER_MISSING(struct_, handle_console_message))
return RV_CONTINUE;
return struct_->handle_console_message(struct_,
CefBrowserCppToC::Wrap(browser), message.c_str(), source.c_str(), line);
}
CefHandler::RetVal CefHandlerCToCpp::HandleFindResult(
CefRefPtr<CefBrowser> browser, int identifier, int count,
const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate)
{
if(CEF_MEMBER_MISSING(struct_, handle_find_result))
return RV_CONTINUE;
return struct_->handle_find_result(struct_,
CefBrowserCppToC::Wrap(browser), identifier, count, &selectionRect,
activeMatchOrdinal, finalUpdate);
}
#ifdef _DEBUG
long CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/frame_cpptoc.h"
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
#include "libcef_dll/ctocpp/handler_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeCreated(
CefRefPtr<CefBrowser> parentBrowser, CefWindowInfo& windowInfo, bool popup,
CefRefPtr<CefHandler>& handler, std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_created))
return RV_CONTINUE;
cef_browser_t* browserStruct = NULL;
if(parentBrowser.get())
browserStruct = CefBrowserCppToC::Wrap(parentBrowser);
cef_handler_t* handlerStruct = NULL;
if(handler.get())
handlerStruct = CefHandlerCToCpp::Unwrap(handler);
cef_handler_t *origHandlerStruct = handlerStruct;
cef_string_t urlRet = NULL;
if(!url.empty())
urlRet = cef_string_alloc(url.c_str());
cef_retval_t rv = struct_->handle_before_created(struct_,
browserStruct, &windowInfo, popup, &handlerStruct, &urlRet);
if(handlerStruct && handlerStruct != origHandlerStruct) {
// The handler was changed.
if(handlerStruct)
handler = CefHandlerCToCpp::Wrap(handlerStruct);
else
handler = NULL;
}
transfer_string_contents(urlRet, url, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleAfterCreated(
CefRefPtr<CefBrowser> browser)
{
if(CEF_MEMBER_MISSING(struct_, handle_after_created))
return RV_CONTINUE;
return struct_->handle_after_created(struct_,
CefBrowserCppToC::Wrap(browser));
}
CefHandler::RetVal CefHandlerCToCpp::HandleAddressChange(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, handle_address_change))
return RV_CONTINUE;
return struct_->handle_address_change(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
url.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleTitleChange(
CefRefPtr<CefBrowser> browser, const std::wstring& title)
{
if(CEF_MEMBER_MISSING(struct_, handle_title_change))
return RV_CONTINUE;
return struct_->handle_title_change(struct_, CefBrowserCppToC::Wrap(browser),
title.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeBrowse(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request, NavType navType, bool isRedirect)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_browse))
return RV_CONTINUE;
return struct_->handle_before_browse(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), CefRequestCppToC::Wrap(request),
navType, isRedirect);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadStart(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_start))
return RV_CONTINUE;
cef_frame_t* frameStruct = NULL;
if(frame.get())
frameStruct = CefFrameCppToC::Wrap(frame);
return struct_->handle_load_start(struct_, CefBrowserCppToC::Wrap(browser),
frameStruct);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadEnd(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_end))
return RV_CONTINUE;
cef_frame_t* frameStruct = NULL;
if(frame.get())
frameStruct = CefFrameCppToC::Wrap(frame);
return struct_->handle_load_end(struct_, CefBrowserCppToC::Wrap(browser),
frameStruct);
}
CefHandler::RetVal CefHandlerCToCpp::HandleLoadError(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
ErrorCode errorCode, const std::wstring& failedUrl,
std::wstring& errorText)
{
if(CEF_MEMBER_MISSING(struct_, handle_load_error))
return RV_CONTINUE;
cef_string_t errorTextRet = NULL;
if(!errorText.empty())
errorTextRet = cef_string_alloc(errorText.c_str());
cef_retval_t rv = struct_->handle_load_error(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame), errorCode,
failedUrl.c_str(), &errorTextRet);
transfer_string_contents(errorTextRet, errorText, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeResourceLoad(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefRequest> request,
std::wstring& redirectUrl, CefRefPtr<CefStreamReader>& resourceStream,
std::wstring& mimeType, int loadFlags)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_resource_load))
return RV_CONTINUE;
cef_string_t redirectUrlRet = NULL;
cef_string_t mimeTypeRet = NULL;
cef_stream_reader_t* streamRet = NULL;
if(!redirectUrl.empty())
redirectUrlRet = cef_string_alloc(redirectUrl.c_str());
cef_retval_t rv = struct_->handle_before_resource_load(struct_,
CefBrowserCppToC::Wrap(browser), CefRequestCppToC::Wrap(request),
&redirectUrlRet, &streamRet, &mimeTypeRet, loadFlags);
transfer_string_contents(redirectUrlRet, redirectUrl, true);
transfer_string_contents(mimeTypeRet, mimeType, true);
if(streamRet)
resourceStream = CefStreamReaderCppToC::Unwrap(streamRet);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeMenu(
CefRefPtr<CefBrowser> browser, const MenuInfo& menuInfo)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_menu))
return RV_CONTINUE;
return struct_->handle_before_menu(struct_, CefBrowserCppToC::Wrap(browser),
&menuInfo);
}
CefHandler::RetVal CefHandlerCToCpp::HandleGetMenuLabel(
CefRefPtr<CefBrowser> browser, MenuId menuId, std::wstring& label)
{
if(CEF_MEMBER_MISSING(struct_, handle_get_menu_label))
return RV_CONTINUE;
cef_string_t labelRet = NULL;
if(!label.empty())
labelRet = cef_string_alloc(label.c_str());
cef_retval_t rv = struct_->handle_get_menu_label(struct_,
CefBrowserCppToC::Wrap(browser), menuId, &labelRet);
transfer_string_contents(labelRet, label, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleMenuAction(
CefRefPtr<CefBrowser> browser, MenuId menuId)
{
if(CEF_MEMBER_MISSING(struct_, handle_menu_action))
return RV_CONTINUE;
return struct_->handle_menu_action(struct_, CefBrowserCppToC::Wrap(browser),
menuId);
}
CefHandler::RetVal CefHandlerCToCpp::HandlePrintOptions(
CefRefPtr<CefBrowser> browser, CefPrintOptions& printOptions)
{
if (CEF_MEMBER_MISSING(struct_, handle_print_options))
return RV_CONTINUE;
return struct_->handle_print_options(struct_, CefBrowserCppToC::Wrap(browser),
&printOptions);
}
CefHandler::RetVal CefHandlerCToCpp::HandlePrintHeaderFooter(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefPrintInfo& printInfo, const std::wstring& url,
const std::wstring& title, int currentPage, int maxPages,
std::wstring& topLeft, std::wstring& topCenter, std::wstring& topRight,
std::wstring& bottomLeft, std::wstring& bottomCenter,
std::wstring& bottomRight)
{
if(CEF_MEMBER_MISSING(struct_, handle_print_header_footer))
return RV_CONTINUE;
cef_string_t topLeftRet = NULL, topCenterRet = NULL, topRightRet = NULL,
bottomLeftRet = NULL, bottomCenterRet = NULL, bottomRightRet = NULL;
if(!topLeft.empty())
topLeftRet = cef_string_alloc(topLeft.c_str());
if(!topCenter.empty())
topCenterRet = cef_string_alloc(topCenter.c_str());
if(!topRight.empty())
topRightRet = cef_string_alloc(topRight.c_str());
if(!bottomLeft.empty())
bottomLeftRet = cef_string_alloc(bottomLeft.c_str());
if(!bottomCenter.empty())
bottomCenterRet = cef_string_alloc(bottomCenter.c_str());
if(!bottomRight.empty())
bottomRightRet = cef_string_alloc(bottomRight.c_str());
cef_retval_t rv = struct_->handle_print_header_footer(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
&printInfo, url.c_str(), title.c_str(), currentPage, maxPages,
&topLeftRet, &topCenterRet, &topRightRet, &bottomLeftRet,
&bottomCenterRet, &bottomRightRet);
transfer_string_contents(topLeftRet, topLeft, true);
transfer_string_contents(topCenterRet, topCenter, true);
transfer_string_contents(topRightRet, topRight, true);
transfer_string_contents(bottomLeftRet, bottomLeft, true);
transfer_string_contents(bottomCenterRet, bottomCenter, true);
transfer_string_contents(bottomRightRet, bottomRight, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSAlert(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsalert))
return RV_CONTINUE;
return struct_->handle_jsalert(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), message.c_str());
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSConfirm(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message, bool& retval)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsconfirm))
return RV_CONTINUE;
int ret = 0;
cef_retval_t rv = struct_->handle_jsconfirm(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
message.c_str(), &ret);
retval = (ret ? true : false);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSPrompt(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
const std::wstring& message, const std::wstring& defaultValue,
bool& retval, std::wstring& result)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsprompt))
return RV_CONTINUE;
cef_string_t resultRet = NULL;
if(!result.empty())
resultRet = cef_string_alloc(result.c_str());
int ret = 0;
cef_retval_t rv = struct_->handle_jsprompt(struct_,
CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
message.c_str(), defaultValue.c_str(), &ret, &resultRet);
retval = (ret ? true : false);
transfer_string_contents(resultRet, result, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleJSBinding(
CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object)
{
if(CEF_MEMBER_MISSING(struct_, handle_jsbinding))
return RV_CONTINUE;
return struct_->handle_jsbinding(struct_, CefBrowserCppToC::Wrap(browser),
CefFrameCppToC::Wrap(frame), CefV8ValueCppToC::Wrap(object));
}
CefHandler::RetVal CefHandlerCToCpp::HandleBeforeWindowClose(
CefRefPtr<CefBrowser> browser)
{
if(CEF_MEMBER_MISSING(struct_, handle_before_window_close))
return RV_CONTINUE;
return struct_->handle_before_window_close(struct_,
CefBrowserCppToC::Wrap(browser));
}
CefHandler::RetVal CefHandlerCToCpp::HandleTakeFocus(
CefRefPtr<CefBrowser> browser, bool reverse)
{
if(CEF_MEMBER_MISSING(struct_, handle_take_focus))
return RV_CONTINUE;
return struct_->handle_take_focus(struct_, CefBrowserCppToC::Wrap(browser),
reverse);
}
CefHandler::RetVal CefHandlerCToCpp::HandleSetFocus(
CefRefPtr<CefBrowser> browser, bool isWidget)
{
if(CEF_MEMBER_MISSING(struct_, handle_set_focus))
return RV_CONTINUE;
return struct_->handle_set_focus(struct_, CefBrowserCppToC::Wrap(browser),
isWidget);
}
CefHandler::RetVal CefHandlerCToCpp::HandleKeyEvent(
CefRefPtr<CefBrowser> browser, KeyEventType type, int code, int modifiers,
bool isSystemKey)
{
if(CEF_MEMBER_MISSING(struct_, handle_key_event))
return RV_CONTINUE;
return struct_->handle_key_event(struct_, CefBrowserCppToC::Wrap(browser),
type, code, modifiers, isSystemKey);
}
CefHandler::RetVal CefHandlerCToCpp::HandleTooltip(
CefRefPtr<CefBrowser> browser, std::wstring& text)
{
if(CEF_MEMBER_MISSING(struct_, handle_tooltip))
return RV_CONTINUE;
cef_string_t textRet = NULL;
if(!text.empty())
textRet = cef_string_alloc(text.c_str());
cef_retval_t rv = struct_->handle_tooltip(struct_,
CefBrowserCppToC::Wrap(browser), &textRet);
transfer_string_contents(textRet, text, true);
return rv;
}
CefHandler::RetVal CefHandlerCToCpp::HandleConsoleMessage(
CefRefPtr<CefBrowser> browser, const std::wstring& message,
const std::wstring& source, int line)
{
if(CEF_MEMBER_MISSING(struct_, handle_console_message))
return RV_CONTINUE;
return struct_->handle_console_message(struct_,
CefBrowserCppToC::Wrap(browser), message.c_str(), source.c_str(), line);
}
CefHandler::RetVal CefHandlerCToCpp::HandleFindResult(
CefRefPtr<CefBrowser> browser, int identifier, int count,
const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate)
{
if(CEF_MEMBER_MISSING(struct_, handle_find_result))
return RV_CONTINUE;
return struct_->handle_find_result(struct_,
CefBrowserCppToC::Wrap(browser), identifier, count, &selectionRect,
activeMatchOrdinal, finalUpdate);
}
#ifdef _DEBUG
long CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>::DebugObjCt = 0;
#endif

View File

@@ -1,94 +1,94 @@
// Copyright (c) 2009 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 _HANDLER_CTOCPP_H
#define _HANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefHandlerCToCpp
: public CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>
{
public:
CefHandlerCToCpp(cef_handler_t* str)
: CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>(str) {}
virtual ~CefHandlerCToCpp() {}
// CefHandler methods
virtual RetVal HandleBeforeCreated(CefRefPtr<CefBrowser> parentBrowser,
CefWindowInfo& windowInfo, bool popup, CefRefPtr<CefHandler>& handler,
std::wstring& url);
virtual RetVal HandleAfterCreated(CefRefPtr<CefBrowser> browser);
virtual RetVal HandleAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& url);
virtual RetVal HandleTitleChange(CefRefPtr<CefBrowser> browser,
const std::wstring& title);
virtual RetVal HandleBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request,
NavType navType, bool isRedirect);
virtual RetVal HandleLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame);
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame);
virtual RetVal HandleLoadError(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, ErrorCode errorCode,
const std::wstring& failedUrl, std::wstring& errorText);
virtual RetVal HandleBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefRequest> request, std::wstring& redirectUrl,
CefRefPtr<CefStreamReader>& resourceStream, std::wstring& mimeType,
int loadFlags);
virtual RetVal HandleBeforeMenu(CefRefPtr<CefBrowser> browser,
const MenuInfo& menuInfo);
virtual RetVal HandleGetMenuLabel(CefRefPtr<CefBrowser> browser,
MenuId menuId, std::wstring& label);
virtual RetVal HandleMenuAction(CefRefPtr<CefBrowser> browser, MenuId menuId);
virtual RetVal HandlePrintOptions(CefRefPtr<CefBrowser> browser,
CefPrintOptions& printOptions);
virtual RetVal HandlePrintHeaderFooter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefPrintInfo& printInfo,
const std::wstring& url, const std::wstring& title, int currentPage,
int maxPages, std::wstring& topLeft, std::wstring& topCenter,
std::wstring& topRight, std::wstring& bottomLeft,
std::wstring& bottomCenter, std::wstring& bottomRight);
virtual RetVal HandleJSAlert(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message);
virtual RetVal HandleJSConfirm(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message, bool& retval);
virtual RetVal HandleJSPrompt(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message,
const std::wstring& defaultValue, bool& retval, std::wstring& result);
virtual RetVal HandleJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Value> object);
virtual RetVal HandleBeforeWindowClose(CefRefPtr<CefBrowser> browser);
virtual RetVal HandleTakeFocus(CefRefPtr<CefBrowser> browser, bool reverse);
virtual RetVal HandleSetFocus(CefRefPtr<CefBrowser> browser, bool isWidget);
virtual RetVal HandleKeyEvent(CefRefPtr<CefBrowser> browser,
KeyEventType type, int code, int modifiers, bool isSystemKey);
virtual RetVal HandleTooltip(CefRefPtr<CefBrowser> browser,
std::wstring& text);
virtual RetVal HandleConsoleMessage(CefRefPtr<CefBrowser> browser,
const std::wstring& message, const std::wstring& source, int line);
virtual RetVal HandleFindResult(CefRefPtr<CefBrowser> browser, int identifier,
int count, const CefRect& selectionRect, int activeMatchOrdinal,
bool finalUpdate);
};
#endif // BUILDING_CEF_SHARED
#endif // _HANDLER_CTOCPP_H
// Copyright (c) 2009 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 _HANDLER_CTOCPP_H
#define _HANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefHandlerCToCpp
: public CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>
{
public:
CefHandlerCToCpp(cef_handler_t* str)
: CefCToCpp<CefHandlerCToCpp, CefHandler, cef_handler_t>(str) {}
virtual ~CefHandlerCToCpp() {}
// CefHandler methods
virtual RetVal HandleBeforeCreated(CefRefPtr<CefBrowser> parentBrowser,
CefWindowInfo& windowInfo, bool popup, CefRefPtr<CefHandler>& handler,
std::wstring& url);
virtual RetVal HandleAfterCreated(CefRefPtr<CefBrowser> browser);
virtual RetVal HandleAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& url);
virtual RetVal HandleTitleChange(CefRefPtr<CefBrowser> browser,
const std::wstring& title);
virtual RetVal HandleBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request,
NavType navType, bool isRedirect);
virtual RetVal HandleLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame);
virtual RetVal HandleLoadEnd(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame);
virtual RetVal HandleLoadError(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, ErrorCode errorCode,
const std::wstring& failedUrl, std::wstring& errorText);
virtual RetVal HandleBeforeResourceLoad(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefRequest> request, std::wstring& redirectUrl,
CefRefPtr<CefStreamReader>& resourceStream, std::wstring& mimeType,
int loadFlags);
virtual RetVal HandleBeforeMenu(CefRefPtr<CefBrowser> browser,
const MenuInfo& menuInfo);
virtual RetVal HandleGetMenuLabel(CefRefPtr<CefBrowser> browser,
MenuId menuId, std::wstring& label);
virtual RetVal HandleMenuAction(CefRefPtr<CefBrowser> browser, MenuId menuId);
virtual RetVal HandlePrintOptions(CefRefPtr<CefBrowser> browser,
CefPrintOptions& printOptions);
virtual RetVal HandlePrintHeaderFooter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefPrintInfo& printInfo,
const std::wstring& url, const std::wstring& title, int currentPage,
int maxPages, std::wstring& topLeft, std::wstring& topCenter,
std::wstring& topRight, std::wstring& bottomLeft,
std::wstring& bottomCenter, std::wstring& bottomRight);
virtual RetVal HandleJSAlert(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message);
virtual RetVal HandleJSConfirm(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message, bool& retval);
virtual RetVal HandleJSPrompt(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, const std::wstring& message,
const std::wstring& defaultValue, bool& retval, std::wstring& result);
virtual RetVal HandleJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Value> object);
virtual RetVal HandleBeforeWindowClose(CefRefPtr<CefBrowser> browser);
virtual RetVal HandleTakeFocus(CefRefPtr<CefBrowser> browser, bool reverse);
virtual RetVal HandleSetFocus(CefRefPtr<CefBrowser> browser, bool isWidget);
virtual RetVal HandleKeyEvent(CefRefPtr<CefBrowser> browser,
KeyEventType type, int code, int modifiers, bool isSystemKey);
virtual RetVal HandleTooltip(CefRefPtr<CefBrowser> browser,
std::wstring& text);
virtual RetVal HandleConsoleMessage(CefRefPtr<CefBrowser> browser,
const std::wstring& message, const std::wstring& source, int line);
virtual RetVal HandleFindResult(CefRefPtr<CefBrowser> browser, int identifier,
int count, const CefRect& selectionRect, int activeMatchOrdinal,
bool finalUpdate);
};
#endif // BUILDING_CEF_SHARED
#endif // _HANDLER_CTOCPP_H

View File

@@ -1,85 +1,85 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefPostData> CefPostData::CreatePostData()
{
cef_post_data_t* impl = cef_post_data_create();
if(impl)
return CefPostDataCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefPostDataCToCpp::GetElementCount()
{
if(CEF_MEMBER_MISSING(struct_, get_element_count))
return 0;
return struct_->get_element_count(struct_);
}
void CefPostDataCToCpp::GetElements(ElementVector& elements)
{
if(CEF_MEMBER_MISSING(struct_, get_elements))
return;
int count = (int)GetElementCount();
cef_post_data_element_t* structPtr;
for(int i = 0; i < count; ++i) {
structPtr = struct_->get_elements(struct_, i);
if(structPtr)
elements.push_back(CefPostDataElementCToCpp::Wrap(structPtr));
}
}
bool CefPostDataCToCpp::RemoveElement(CefRefPtr<CefPostDataElement> element)
{
DCHECK(element.get());
if(CEF_MEMBER_MISSING(struct_, remove_element) || !element.get())
return false;
return struct_->remove_element(struct_,
CefPostDataElementCToCpp::Unwrap(element))?true:false;
}
bool CefPostDataCToCpp::AddElement(CefRefPtr<CefPostDataElement> element)
{
DCHECK(element.get());
if(CEF_MEMBER_MISSING(struct_, add_element) || !element.get())
return false;
return struct_->add_element(struct_,
CefPostDataElementCToCpp::Unwrap(element))?true:false;
}
void CefPostDataCToCpp::RemoveElements()
{
if(CEF_MEMBER_MISSING(struct_, remove_elements))
return;
return struct_->remove_elements(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefPostData> CefPostData::CreatePostData()
{
cef_post_data_t* impl = cef_post_data_create();
if(impl)
return CefPostDataCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefPostDataCToCpp::GetElementCount()
{
if(CEF_MEMBER_MISSING(struct_, get_element_count))
return 0;
return struct_->get_element_count(struct_);
}
void CefPostDataCToCpp::GetElements(ElementVector& elements)
{
if(CEF_MEMBER_MISSING(struct_, get_elements))
return;
int count = (int)GetElementCount();
cef_post_data_element_t* structPtr;
for(int i = 0; i < count; ++i) {
structPtr = struct_->get_elements(struct_, i);
if(structPtr)
elements.push_back(CefPostDataElementCToCpp::Wrap(structPtr));
}
}
bool CefPostDataCToCpp::RemoveElement(CefRefPtr<CefPostDataElement> element)
{
DCHECK(element.get());
if(CEF_MEMBER_MISSING(struct_, remove_element) || !element.get())
return false;
return struct_->remove_element(struct_,
CefPostDataElementCToCpp::Unwrap(element))?true:false;
}
bool CefPostDataCToCpp::AddElement(CefRefPtr<CefPostDataElement> element)
{
DCHECK(element.get());
if(CEF_MEMBER_MISSING(struct_, add_element) || !element.get())
return false;
return struct_->add_element(struct_,
CefPostDataElementCToCpp::Unwrap(element))?true:false;
}
void CefPostDataCToCpp::RemoveElements()
{
if(CEF_MEMBER_MISSING(struct_, remove_elements))
return;
return struct_->remove_elements(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>::DebugObjCt = 0;
#endif

View File

@@ -1,43 +1,43 @@
// Copyright (c) 2009 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 _POSTDATA_CTOCPP_H
#define _POSTDATA_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefPostDataCToCpp
: public CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>
{
public:
CefPostDataCToCpp(cef_post_data_t* str)
: CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>(str) {}
virtual ~CefPostDataCToCpp() {}
// CefPostData methods
virtual size_t GetElementCount();
virtual void GetElements(ElementVector& elements);
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element);
virtual bool AddElement(CefRefPtr<CefPostDataElement> element);
virtual void RemoveElements();
};
#endif // USING_CEF_SHARED
#endif // _POSTDATA_CTOCPP_H
// Copyright (c) 2009 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 _POSTDATA_CTOCPP_H
#define _POSTDATA_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefPostDataCToCpp
: public CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>
{
public:
CefPostDataCToCpp(cef_post_data_t* str)
: CefCToCpp<CefPostDataCToCpp, CefPostData, cef_post_data_t>(str) {}
virtual ~CefPostDataCToCpp() {}
// CefPostData methods
virtual size_t GetElementCount();
virtual void GetElements(ElementVector& elements);
virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element);
virtual bool AddElement(CefRefPtr<CefPostDataElement> element);
virtual void RemoveElements();
};
#endif // USING_CEF_SHARED
#endif // _POSTDATA_CTOCPP_H

View File

@@ -1,97 +1,97 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefPostDataElement> CefPostDataElement::CreatePostDataElement()
{
cef_post_data_element_t* impl = cef_post_data_element_create();
if(impl)
return CefPostDataElementCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
void CefPostDataElementCToCpp::SetToEmpty()
{
if(CEF_MEMBER_MISSING(struct_, set_to_empty))
return;
return struct_->set_to_empty(struct_);
}
void CefPostDataElementCToCpp::SetToFile(const std::wstring& fileName)
{
if(CEF_MEMBER_MISSING(struct_, set_to_file))
return;
return struct_->set_to_file(struct_, fileName.c_str());
}
void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes)
{
if(CEF_MEMBER_MISSING(struct_, set_to_bytes))
return;
return struct_->set_to_bytes(struct_, size, bytes);
}
CefPostDataElement::Type CefPostDataElementCToCpp::GetType()
{
if(CEF_MEMBER_MISSING(struct_, get_type))
return PDE_TYPE_EMPTY;
return struct_->get_type(struct_);
}
std::wstring CefPostDataElementCToCpp::GetFile()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_file))
return str;
cef_string_t cef_str = struct_->get_file(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
size_t CefPostDataElementCToCpp::GetBytesCount()
{
if(CEF_MEMBER_MISSING(struct_, get_bytes_count))
return 0;
return struct_->get_bytes_count(struct_);
}
size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes)
{
if(CEF_MEMBER_MISSING(struct_, get_bytes))
return 0;
return struct_->get_bytes(struct_, size, bytes);
}
#ifdef _DEBUG
long CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_element_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefPostDataElement> CefPostDataElement::CreatePostDataElement()
{
cef_post_data_element_t* impl = cef_post_data_element_create();
if(impl)
return CefPostDataElementCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
void CefPostDataElementCToCpp::SetToEmpty()
{
if(CEF_MEMBER_MISSING(struct_, set_to_empty))
return;
return struct_->set_to_empty(struct_);
}
void CefPostDataElementCToCpp::SetToFile(const std::wstring& fileName)
{
if(CEF_MEMBER_MISSING(struct_, set_to_file))
return;
return struct_->set_to_file(struct_, fileName.c_str());
}
void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes)
{
if(CEF_MEMBER_MISSING(struct_, set_to_bytes))
return;
return struct_->set_to_bytes(struct_, size, bytes);
}
CefPostDataElement::Type CefPostDataElementCToCpp::GetType()
{
if(CEF_MEMBER_MISSING(struct_, get_type))
return PDE_TYPE_EMPTY;
return struct_->get_type(struct_);
}
std::wstring CefPostDataElementCToCpp::GetFile()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_file))
return str;
cef_string_t cef_str = struct_->get_file(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
size_t CefPostDataElementCToCpp::GetBytesCount()
{
if(CEF_MEMBER_MISSING(struct_, get_bytes_count))
return 0;
return struct_->get_bytes_count(struct_);
}
size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes)
{
if(CEF_MEMBER_MISSING(struct_, get_bytes))
return 0;
return struct_->get_bytes(struct_, size, bytes);
}
#ifdef _DEBUG
long CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>::DebugObjCt = 0;
#endif

View File

@@ -1,47 +1,47 @@
// Copyright (c) 2009 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 _POSTDATAELEMENT_CTOCPP_H
#define _POSTDATAELEMENT_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefPostDataElementCToCpp
: public CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>
{
public:
CefPostDataElementCToCpp(cef_post_data_element_t* str)
: CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>(str) {}
virtual ~CefPostDataElementCToCpp() {}
// CefPostDataElement methods
virtual void SetToEmpty();
virtual void SetToFile(const std::wstring& fileName);
virtual void SetToBytes(size_t size, const void* bytes);
virtual Type GetType();
virtual std::wstring GetFile();
virtual size_t GetBytesCount();
virtual size_t GetBytes(size_t size, void* bytes);
};
#endif // USING_CEF_SHARED
#endif // _POSTDATAELEMENT_CTOCPP_H
// Copyright (c) 2009 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 _POSTDATAELEMENT_CTOCPP_H
#define _POSTDATAELEMENT_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefPostDataElementCToCpp
: public CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>
{
public:
CefPostDataElementCToCpp(cef_post_data_element_t* str)
: CefCToCpp<CefPostDataElementCToCpp, CefPostDataElement,
cef_post_data_element_t>(str) {}
virtual ~CefPostDataElementCToCpp() {}
// CefPostDataElement methods
virtual void SetToEmpty();
virtual void SetToFile(const std::wstring& fileName);
virtual void SetToBytes(size_t size, const void* bytes);
virtual Type GetType();
virtual std::wstring GetFile();
virtual size_t GetBytesCount();
virtual size_t GetBytes(size_t size, void* bytes);
};
#endif // USING_CEF_SHARED
#endif // _POSTDATAELEMENT_CTOCPP_H

View File

@@ -1,55 +1,55 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/read_handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, read))
return 0;
return struct_->read(struct_, ptr, size, n);
}
int CefReadHandlerCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefReadHandlerCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefReadHandlerCToCpp::Eof()
{
if(CEF_MEMBER_MISSING(struct_, eof))
return 0;
return struct_->eof(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefReadHandlerCToCpp, CefReadHandler,
cef_read_handler_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/read_handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefReadHandlerCToCpp::Read(void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, read))
return 0;
return struct_->read(struct_, ptr, size, n);
}
int CefReadHandlerCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefReadHandlerCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefReadHandlerCToCpp::Eof()
{
if(CEF_MEMBER_MISSING(struct_, eof))
return 0;
return struct_->eof(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefReadHandlerCToCpp, CefReadHandler,
cef_read_handler_t>::DebugObjCt = 0;
#endif

View File

@@ -1,43 +1,43 @@
// Copyright (c) 2009 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 _READHANDLER_CTOCPP_H
#define _READHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefReadHandlerCToCpp
: public CefCToCpp<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>
{
public:
CefReadHandlerCToCpp(cef_read_handler_t* str)
: CefCToCpp<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>(
str) {}
virtual ~CefReadHandlerCToCpp() {}
// CefReadHandler methods
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Eof();
};
#endif // BUILDING_CEF_SHARED
#endif // _READHANDLER_CTOCPP_H
// Copyright (c) 2009 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 _READHANDLER_CTOCPP_H
#define _READHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefReadHandlerCToCpp
: public CefCToCpp<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>
{
public:
CefReadHandlerCToCpp(cef_read_handler_t* str)
: CefCToCpp<CefReadHandlerCToCpp, CefReadHandler, cef_read_handler_t>(
str) {}
virtual ~CefReadHandlerCToCpp() {}
// CefReadHandler methods
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Eof();
};
#endif // BUILDING_CEF_SHARED
#endif // _READHANDLER_CTOCPP_H

View File

@@ -1,159 +1,159 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefRequest> CefRequest::CreateRequest()
{
cef_request_t* impl = cef_request_create();
if(impl)
return CefRequestCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
std::wstring CefRequestCToCpp::GetURL()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_url))
return str;
cef_string_t cef_str = struct_->get_url(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefRequestCToCpp::SetURL(const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, set_url))
return;
struct_->set_url(struct_, url.c_str());
}
std::wstring CefRequestCToCpp::GetMethod()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_method))
return str;
cef_string_t cef_str = struct_->get_method(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefRequestCToCpp::SetMethod(const std::wstring& method)
{
if(CEF_MEMBER_MISSING(struct_, set_method))
return;
struct_->set_method(struct_, method.c_str());
}
CefRefPtr<CefPostData> CefRequestCToCpp::GetPostData()
{
if(CEF_MEMBER_MISSING(struct_, get_post_data))
return NULL;
cef_post_data_t* postDataStruct = struct_->get_post_data(struct_);
if(postDataStruct)
return CefPostDataCToCpp::Wrap(postDataStruct);
return NULL;
}
void CefRequestCToCpp::SetPostData(CefRefPtr<CefPostData> postData)
{
if(CEF_MEMBER_MISSING(struct_, set_post_data))
return;
cef_post_data_t* postDataStruct = NULL;
if(postData.get())
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
struct_->set_post_data(struct_, postDataStruct);
}
void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, get_header_map))
return;
cef_string_map_t map = cef_string_map_alloc();
if(!map)
return;
struct_->get_header_map(struct_, map);
transfer_string_map_contents(map, headerMap);
cef_string_map_free(map);
}
void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, set_header_map))
return;
cef_string_map_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
}
struct_->set_header_map(struct_, map);
if(map)
cef_string_map_free(map);
}
void CefRequestCToCpp::Set(const std::wstring& url, const std::wstring& method,
CefRefPtr<CefPostData> postData, const HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, set))
return;
cef_post_data_t* postDataStruct = NULL;
if(postData.get())
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
cef_string_map_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
}
struct_->set(struct_, url.c_str(), method.c_str(), postDataStruct, map);
if(map)
cef_string_map_free(map);
}
#ifdef _DEBUG
long CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/post_data_ctocpp.h"
#include "libcef_dll/ctocpp/request_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefRequest> CefRequest::CreateRequest()
{
cef_request_t* impl = cef_request_create();
if(impl)
return CefRequestCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
std::wstring CefRequestCToCpp::GetURL()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_url))
return str;
cef_string_t cef_str = struct_->get_url(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefRequestCToCpp::SetURL(const std::wstring& url)
{
if(CEF_MEMBER_MISSING(struct_, set_url))
return;
struct_->set_url(struct_, url.c_str());
}
std::wstring CefRequestCToCpp::GetMethod()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_method))
return str;
cef_string_t cef_str = struct_->get_method(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
void CefRequestCToCpp::SetMethod(const std::wstring& method)
{
if(CEF_MEMBER_MISSING(struct_, set_method))
return;
struct_->set_method(struct_, method.c_str());
}
CefRefPtr<CefPostData> CefRequestCToCpp::GetPostData()
{
if(CEF_MEMBER_MISSING(struct_, get_post_data))
return NULL;
cef_post_data_t* postDataStruct = struct_->get_post_data(struct_);
if(postDataStruct)
return CefPostDataCToCpp::Wrap(postDataStruct);
return NULL;
}
void CefRequestCToCpp::SetPostData(CefRefPtr<CefPostData> postData)
{
if(CEF_MEMBER_MISSING(struct_, set_post_data))
return;
cef_post_data_t* postDataStruct = NULL;
if(postData.get())
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
struct_->set_post_data(struct_, postDataStruct);
}
void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, get_header_map))
return;
cef_string_map_t map = cef_string_map_alloc();
if(!map)
return;
struct_->get_header_map(struct_, map);
transfer_string_map_contents(map, headerMap);
cef_string_map_free(map);
}
void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, set_header_map))
return;
cef_string_map_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
}
struct_->set_header_map(struct_, map);
if(map)
cef_string_map_free(map);
}
void CefRequestCToCpp::Set(const std::wstring& url, const std::wstring& method,
CefRefPtr<CefPostData> postData, const HeaderMap& headerMap)
{
if(CEF_MEMBER_MISSING(struct_, set))
return;
cef_post_data_t* postDataStruct = NULL;
if(postData.get())
postDataStruct = CefPostDataCToCpp::Unwrap(postData);
cef_string_map_t map = NULL;
if(!headerMap.empty()) {
map = cef_string_map_alloc();
if(!map)
return;
transfer_string_map_contents(headerMap, map);
}
struct_->set(struct_, url.c_str(), method.c_str(), postDataStruct, map);
if(map)
cef_string_map_free(map);
}
#ifdef _DEBUG
long CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>::DebugObjCt = 0;
#endif

View File

@@ -1,48 +1,48 @@
// Copyright (c) 2009 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 _REQUEST_CTOCPP_H
#define _REQUEST_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefRequestCToCpp
: public CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>
{
public:
CefRequestCToCpp(cef_request_t* str)
: CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>(str) {}
virtual ~CefRequestCToCpp() {}
// CefRequest methods
virtual std::wstring GetURL();
virtual void SetURL(const std::wstring& url);
virtual std::wstring GetMethod();
virtual void SetMethod(const std::wstring& method);
virtual CefRefPtr<CefPostData> GetPostData();
virtual void SetPostData(CefRefPtr<CefPostData> postData);
virtual void GetHeaderMap(HeaderMap& headerMap);
virtual void SetHeaderMap(const HeaderMap& headerMap);
virtual void Set(const std::wstring& url, const std::wstring& method,
CefRefPtr<CefPostData> postData, const HeaderMap& headerMap);
};
#endif // USING_CEF_SHARED
#endif // _REQUEST_CTOCPP_H
// Copyright (c) 2009 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 _REQUEST_CTOCPP_H
#define _REQUEST_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefRequestCToCpp
: public CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>
{
public:
CefRequestCToCpp(cef_request_t* str)
: CefCToCpp<CefRequestCToCpp, CefRequest, cef_request_t>(str) {}
virtual ~CefRequestCToCpp() {}
// CefRequest methods
virtual std::wstring GetURL();
virtual void SetURL(const std::wstring& url);
virtual std::wstring GetMethod();
virtual void SetMethod(const std::wstring& method);
virtual CefRefPtr<CefPostData> GetPostData();
virtual void SetPostData(CefRefPtr<CefPostData> postData);
virtual void GetHeaderMap(HeaderMap& headerMap);
virtual void SetHeaderMap(const HeaderMap& headerMap);
virtual void Set(const std::wstring& url, const std::wstring& method,
CefRefPtr<CefPostData> postData, const HeaderMap& headerMap);
};
#endif // USING_CEF_SHARED
#endif // _REQUEST_CTOCPP_H

View File

@@ -1,61 +1,61 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/ctocpp/scheme_handler_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr<CefRequest> request,
std::wstring& mime_type, int* response_length)
{
if(CEF_MEMBER_MISSING(struct_, process_request))
return false;
cef_string_t mimeTypeRet = NULL;
if(!mime_type.empty())
mimeTypeRet = cef_string_alloc(mime_type.c_str());
int rv = struct_->process_request(struct_, CefRequestCppToC::Wrap(request),
&mimeTypeRet, response_length);
transfer_string_contents(mimeTypeRet, mime_type, true);
return rv ? true : false;
}
void CefSchemeHandlerCToCpp::Cancel()
{
if(CEF_MEMBER_MISSING(struct_, cancel))
return;
struct_->cancel(struct_);
}
bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read,
int* bytes_read)
{
if(CEF_MEMBER_MISSING(struct_, read_response))
return false;
return struct_->read_response(struct_, data_out, bytes_to_read, bytes_read)
? true : false;
}
#ifdef _DEBUG
long CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/request_cpptoc.h"
#include "libcef_dll/ctocpp/scheme_handler_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
bool CefSchemeHandlerCToCpp::ProcessRequest(CefRefPtr<CefRequest> request,
std::wstring& mime_type, int* response_length)
{
if(CEF_MEMBER_MISSING(struct_, process_request))
return false;
cef_string_t mimeTypeRet = NULL;
if(!mime_type.empty())
mimeTypeRet = cef_string_alloc(mime_type.c_str());
int rv = struct_->process_request(struct_, CefRequestCppToC::Wrap(request),
&mimeTypeRet, response_length);
transfer_string_contents(mimeTypeRet, mime_type, true);
return rv ? true : false;
}
void CefSchemeHandlerCToCpp::Cancel()
{
if(CEF_MEMBER_MISSING(struct_, cancel))
return;
struct_->cancel(struct_);
}
bool CefSchemeHandlerCToCpp::ReadResponse(void* data_out, int bytes_to_read,
int* bytes_read)
{
if(CEF_MEMBER_MISSING(struct_, read_response))
return false;
return struct_->read_response(struct_, data_out, bytes_to_read, bytes_read)
? true : false;
}
#ifdef _DEBUG
long CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>::DebugObjCt = 0;
#endif

View File

@@ -1,44 +1,44 @@
// Copyright (c) 2009 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 _SCHEMEHANDLER_CTOCPP_H
#define _SCHEMEHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefSchemeHandlerCToCpp
: public CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>
{
public:
CefSchemeHandlerCToCpp(cef_scheme_handler_t* str)
: CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>(str) {}
virtual ~CefSchemeHandlerCToCpp() {}
// CefSchemeHandler methods
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
std::wstring& mime_type, int* response_length);
virtual void Cancel();
virtual bool ReadResponse(void* data_out, int bytes_to_read, int* bytes_read);
};
#endif // BUILDING_CEF_SHARED
#endif // _SCHEMEHANDLER_CTOCPP_H
// Copyright (c) 2009 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 _SCHEMEHANDLER_CTOCPP_H
#define _SCHEMEHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefSchemeHandlerCToCpp
: public CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>
{
public:
CefSchemeHandlerCToCpp(cef_scheme_handler_t* str)
: CefCToCpp<CefSchemeHandlerCToCpp, CefSchemeHandler,
cef_scheme_handler_t>(str) {}
virtual ~CefSchemeHandlerCToCpp() {}
// CefSchemeHandler methods
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
std::wstring& mime_type, int* response_length);
virtual void Cancel();
virtual bool ReadResponse(void* data_out, int bytes_to_read, int* bytes_read);
};
#endif // BUILDING_CEF_SHARED
#endif // _SCHEMEHANDLER_CTOCPP_H

View File

@@ -1,34 +1,34 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/scheme_handler_ctocpp.h"
#include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefRefPtr<CefSchemeHandler> CefSchemeHandlerFactoryCToCpp::Create()
{
if(CEF_MEMBER_MISSING(struct_, create))
return NULL;
_cef_scheme_handler_t* rv = struct_->create(struct_);
return CefSchemeHandlerCToCpp::Wrap(rv);
}
#ifdef _DEBUG
long CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/scheme_handler_ctocpp.h"
#include "libcef_dll/ctocpp/scheme_handler_factory_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefRefPtr<CefSchemeHandler> CefSchemeHandlerFactoryCToCpp::Create()
{
if(CEF_MEMBER_MISSING(struct_, create))
return NULL;
_cef_scheme_handler_t* rv = struct_->create(struct_);
return CefSchemeHandlerCToCpp::Wrap(rv);
}
#ifdef _DEBUG
long CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>::DebugObjCt = 0;
#endif

View File

@@ -1,41 +1,41 @@
// Copyright (c) 2009 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 _SCHEMEHANDLERFACTORY_CTOCPP_H
#define _SCHEMEHANDLERFACTORY_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefSchemeHandlerFactoryCToCpp
: public CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>
{
public:
CefSchemeHandlerFactoryCToCpp(cef_scheme_handler_factory_t* str)
: CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>(str) {}
virtual ~CefSchemeHandlerFactoryCToCpp() {}
// CefSchemeHandlerFactory methods
virtual CefRefPtr<CefSchemeHandler> Create();
};
#endif // BUILDING_CEF_SHARED
#endif // _SCHEMEHANDLERFACTORY_CTOCPP_H
// Copyright (c) 2009 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 _SCHEMEHANDLERFACTORY_CTOCPP_H
#define _SCHEMEHANDLERFACTORY_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefSchemeHandlerFactoryCToCpp
: public CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>
{
public:
CefSchemeHandlerFactoryCToCpp(cef_scheme_handler_factory_t* str)
: CefCToCpp<CefSchemeHandlerFactoryCToCpp, CefSchemeHandlerFactory,
cef_scheme_handler_factory_t>(str) {}
virtual ~CefSchemeHandlerFactoryCToCpp() {}
// CefSchemeHandlerFactory methods
virtual CefRefPtr<CefSchemeHandler> Create();
};
#endif // BUILDING_CEF_SHARED
#endif // _SCHEMEHANDLERFACTORY_CTOCPP_H

View File

@@ -1,88 +1,88 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/read_handler_cpptoc.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefStreamReader> CefStreamReader::CreateForFile(
const std::wstring& fileName)
{
cef_stream_reader_t* impl =
cef_stream_reader_create_for_file(fileName.c_str());
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamReader> CefStreamReader::CreateForData(void* data,
size_t size)
{
cef_stream_reader_t* impl = cef_stream_reader_create_for_data(data, size);
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamReader> CefStreamReader::CreateForHandler(
CefRefPtr<CefReadHandler> handler)
{
cef_stream_reader_t* impl =
cef_stream_reader_create_for_handler(CefReadHandlerCppToC::Wrap(handler));
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, read))
return 0;
return struct_->read(struct_, ptr, size, n);
}
int CefStreamReaderCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefStreamReaderCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefStreamReaderCToCpp::Eof()
{
if(CEF_MEMBER_MISSING(struct_, eof))
return 0;
return struct_->eof(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefStreamReaderCToCpp, CefStreamReader,
cef_stream_reader_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/read_handler_cpptoc.h"
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefStreamReader> CefStreamReader::CreateForFile(
const std::wstring& fileName)
{
cef_stream_reader_t* impl =
cef_stream_reader_create_for_file(fileName.c_str());
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamReader> CefStreamReader::CreateForData(void* data,
size_t size)
{
cef_stream_reader_t* impl = cef_stream_reader_create_for_data(data, size);
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamReader> CefStreamReader::CreateForHandler(
CefRefPtr<CefReadHandler> handler)
{
cef_stream_reader_t* impl =
cef_stream_reader_create_for_handler(CefReadHandlerCppToC::Wrap(handler));
if(impl)
return CefStreamReaderCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, read))
return 0;
return struct_->read(struct_, ptr, size, n);
}
int CefStreamReaderCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefStreamReaderCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefStreamReaderCToCpp::Eof()
{
if(CEF_MEMBER_MISSING(struct_, eof))
return 0;
return struct_->eof(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefStreamReaderCToCpp, CefStreamReader,
cef_stream_reader_t>::DebugObjCt = 0;
#endif

View File

@@ -1,44 +1,44 @@
// Copyright (c) 2009 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 _STREAMREADER_CTOCPP_H
#define _STREAMREADER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefStreamReaderCToCpp
: public CefCToCpp<CefStreamReaderCToCpp, CefStreamReader,
cef_stream_reader_t>
{
public:
CefStreamReaderCToCpp(cef_stream_reader_t* str)
: CefCToCpp<CefStreamReaderCToCpp, CefStreamReader, cef_stream_reader_t>(
str) {}
virtual ~CefStreamReaderCToCpp() {}
// CefStreamReader methods
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Eof();
};
#endif // USING_CEF_SHARED
#endif // _STREAMREADER_CTOCPP_H
// Copyright (c) 2009 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 _STREAMREADER_CTOCPP_H
#define _STREAMREADER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefStreamReaderCToCpp
: public CefCToCpp<CefStreamReaderCToCpp, CefStreamReader,
cef_stream_reader_t>
{
public:
CefStreamReaderCToCpp(cef_stream_reader_t* str)
: CefCToCpp<CefStreamReaderCToCpp, CefStreamReader, cef_stream_reader_t>(
str) {}
virtual ~CefStreamReaderCToCpp() {}
// CefStreamReader methods
virtual size_t Read(void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Eof();
};
#endif // USING_CEF_SHARED
#endif // _STREAMREADER_CTOCPP_H

View File

@@ -1,88 +1,88 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/write_handler_cpptoc.h"
#include "libcef_dll/ctocpp/stream_writer_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForFile(
const std::wstring& fileName)
{
DCHECK(!fileName.empty());
if(fileName.empty())
return NULL;
cef_stream_writer_t* impl =
cef_stream_writer_create_for_file(fileName.c_str());
if(impl)
return CefStreamWriterCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForHandler(
CefRefPtr<CefWriteHandler> handler)
{
DCHECK(handler.get());
if(!handler.get())
return NULL;
cef_stream_writer_t* impl =
cef_stream_writer_create_for_handler(
CefWriteHandlerCppToC::Wrap(handler));
if(impl)
return CefStreamWriterCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, write))
return 0;
return struct_->write(struct_, ptr, size, n);
}
int CefStreamWriterCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefStreamWriterCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefStreamWriterCToCpp::Flush()
{
if(CEF_MEMBER_MISSING(struct_, flush))
return 0;
return struct_->flush(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter,
cef_stream_writer_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/write_handler_cpptoc.h"
#include "libcef_dll/ctocpp/stream_writer_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForFile(
const std::wstring& fileName)
{
DCHECK(!fileName.empty());
if(fileName.empty())
return NULL;
cef_stream_writer_t* impl =
cef_stream_writer_create_for_file(fileName.c_str());
if(impl)
return CefStreamWriterCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefStreamWriter> CefStreamWriter::CreateForHandler(
CefRefPtr<CefWriteHandler> handler)
{
DCHECK(handler.get());
if(!handler.get())
return NULL;
cef_stream_writer_t* impl =
cef_stream_writer_create_for_handler(
CefWriteHandlerCppToC::Wrap(handler));
if(impl)
return CefStreamWriterCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, write))
return 0;
return struct_->write(struct_, ptr, size, n);
}
int CefStreamWriterCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefStreamWriterCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefStreamWriterCToCpp::Flush()
{
if(CEF_MEMBER_MISSING(struct_, flush))
return 0;
return struct_->flush(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter,
cef_stream_writer_t>::DebugObjCt = 0;
#endif

View File

@@ -1,44 +1,44 @@
// Copyright (c) 2009 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 _STREAMWRITER_CTOCPP_H
#define _STREAMWRITER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefStreamWriterCToCpp
: public CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter,
cef_stream_writer_t>
{
public:
CefStreamWriterCToCpp(cef_stream_writer_t* str)
: CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter, cef_stream_writer_t>(
str) {}
virtual ~CefStreamWriterCToCpp() {}
// CefStreamWriter methods
virtual size_t Write(const void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Flush();
};
#endif // USING_CEF_SHARED
#endif // _STREAMWRITER_CTOCPP_H
// Copyright (c) 2009 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 _STREAMWRITER_CTOCPP_H
#define _STREAMWRITER_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefStreamWriterCToCpp
: public CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter,
cef_stream_writer_t>
{
public:
CefStreamWriterCToCpp(cef_stream_writer_t* str)
: CefCToCpp<CefStreamWriterCToCpp, CefStreamWriter, cef_stream_writer_t>(
str) {}
virtual ~CefStreamWriterCToCpp() {}
// CefStreamWriter methods
virtual size_t Write(const void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Flush();
};
#endif // USING_CEF_SHARED
#endif // _STREAMWRITER_CTOCPP_H

View File

@@ -1,30 +1,30 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/task_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefTaskCToCpp::Execute(CefThreadId threadId)
{
if(CEF_MEMBER_MISSING(struct_, execute))
return;
struct_->execute(struct_, threadId);
}
#ifdef _DEBUG
long CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/task_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefTaskCToCpp::Execute(CefThreadId threadId)
{
if(CEF_MEMBER_MISSING(struct_, execute))
return;
struct_->execute(struct_, threadId);
}
#ifdef _DEBUG
long CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>::DebugObjCt = 0;
#endif

View File

@@ -1,39 +1,39 @@
// Copyright (c) 2009 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 _TASK_CTOCPP_H
#define _TASK_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefTaskCToCpp
: public CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>
{
public:
CefTaskCToCpp(cef_task_t* str)
: CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>(str) {}
virtual ~CefTaskCToCpp() {}
// CefTask methods
virtual void Execute(CefThreadId threadId);
};
#endif // BUILDING_CEF_SHARED
#endif // _TASK_CTOCPP_H
// Copyright (c) 2009 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 _TASK_CTOCPP_H
#define _TASK_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefTaskCToCpp
: public CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>
{
public:
CefTaskCToCpp(cef_task_t* str)
: CefCToCpp<CefTaskCToCpp, CefTask, cef_task_t>(str) {}
virtual ~CefTaskCToCpp() {}
// CefTask methods
virtual void Execute(CefThreadId threadId);
};
#endif // BUILDING_CEF_SHARED
#endif // _TASK_CTOCPP_H

View File

@@ -1,58 +1,58 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
bool CefV8HandlerCToCpp::Execute(const std::wstring& name,
CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval, std::wstring& exception)
{
if(CEF_MEMBER_MISSING(struct_, execute))
return RV_CONTINUE;
cef_v8value_t** argsStructPtr = NULL;
int argsSize = arguments.size();
if(argsSize > 0) {
argsStructPtr = new cef_v8value_t*[argsSize];
for(int i = 0; i < argsSize; ++i)
argsStructPtr[i] = CefV8ValueCppToC::Wrap(arguments[i]);
}
cef_v8value_t* retvalStruct = NULL;
cef_string_t exceptionStr = NULL;
int rv = struct_->execute(struct_, name.c_str(),
CefV8ValueCppToC::Wrap(object), argsSize, argsStructPtr, &retvalStruct,
&exceptionStr);
if(retvalStruct)
retval = CefV8ValueCppToC::Unwrap(retvalStruct);
if(exceptionStr) {
exception = exceptionStr;
cef_string_free(exceptionStr);
}
if(argsStructPtr)
delete [] argsStructPtr;
return rv ? true : false;
}
#ifdef _DEBUG
long CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>::DebugObjCt =
0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
#include "libcef_dll/ctocpp/v8handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
bool CefV8HandlerCToCpp::Execute(const std::wstring& name,
CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval, std::wstring& exception)
{
if(CEF_MEMBER_MISSING(struct_, execute))
return RV_CONTINUE;
cef_v8value_t** argsStructPtr = NULL;
int argsSize = arguments.size();
if(argsSize > 0) {
argsStructPtr = new cef_v8value_t*[argsSize];
for(int i = 0; i < argsSize; ++i)
argsStructPtr[i] = CefV8ValueCppToC::Wrap(arguments[i]);
}
cef_v8value_t* retvalStruct = NULL;
cef_string_t exceptionStr = NULL;
int rv = struct_->execute(struct_, name.c_str(),
CefV8ValueCppToC::Wrap(object), argsSize, argsStructPtr, &retvalStruct,
&exceptionStr);
if(retvalStruct)
retval = CefV8ValueCppToC::Unwrap(retvalStruct);
if(exceptionStr) {
exception = exceptionStr;
cef_string_free(exceptionStr);
}
if(argsStructPtr)
delete [] argsStructPtr;
return rv ? true : false;
}
#ifdef _DEBUG
long CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>::DebugObjCt =
0;
#endif

View File

@@ -1,41 +1,41 @@
// Copyright (c) 2009 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 _V8HANDLER_CTOCPP_H
#define _V8HANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefV8HandlerCToCpp
: public CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>
{
public:
CefV8HandlerCToCpp(cef_v8handler_t* str)
: CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>(str) {}
virtual ~CefV8HandlerCToCpp() {}
// CefV8Handler methods
virtual bool Execute(const std::wstring& name, CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception);
};
#endif // BUILDING_CEF_SHARED
#endif // _V8HANDLER_CTOCPP_H
// Copyright (c) 2009 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 _V8HANDLER_CTOCPP_H
#define _V8HANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefV8HandlerCToCpp
: public CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>
{
public:
CefV8HandlerCToCpp(cef_v8handler_t* str)
: CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>(str) {}
virtual ~CefV8HandlerCToCpp() {}
// CefV8Handler methods
virtual bool Execute(const std::wstring& name, CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception);
};
#endif // BUILDING_CEF_SHARED
#endif // _V8HANDLER_CTOCPP_H

View File

@@ -1,389 +1,389 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/base_cpptoc.h"
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefV8Value> CefV8Value::CreateUndefined()
{
cef_v8value_t* impl = cef_v8value_create_undefined();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateNull()
{
cef_v8value_t* impl = cef_v8value_create_null();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value)
{
cef_v8value_t* impl = cef_v8value_create_bool(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int value)
{
cef_v8value_t* impl = cef_v8value_create_int(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value)
{
cef_v8value_t* impl = cef_v8value_create_double(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateString(const std::wstring& value)
{
cef_v8value_t* impl = cef_v8value_create_string(value.c_str());
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateObject(CefRefPtr<CefBase> user_data)
{
cef_base_t* baseStruct = NULL;
if(user_data)
baseStruct = CefBaseCppToC::Wrap(user_data);
cef_v8value_t* impl = cef_v8value_create_object(baseStruct);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateArray()
{
cef_v8value_t* impl = cef_v8value_create_array();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateFunction(const std::wstring& name,
CefRefPtr<CefV8Handler> handler)
{
cef_v8handler_t* handlerStruct = NULL;
if(handler.get())
handlerStruct = CefV8HandlerCppToC::Wrap(handler);
cef_v8value_t* impl = cef_v8value_create_function(name.c_str(),
handlerStruct);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
bool CefV8ValueCToCpp::IsUndefined()
{
if(CEF_MEMBER_MISSING(struct_, is_undefined))
return false;
return struct_->is_undefined(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsNull()
{
if(CEF_MEMBER_MISSING(struct_, is_null))
return false;
return struct_->is_null(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsBool()
{
if(CEF_MEMBER_MISSING(struct_, is_bool))
return false;
return struct_->is_bool(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsInt()
{
if(CEF_MEMBER_MISSING(struct_, is_int))
return false;
return struct_->is_int(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsDouble()
{
if(CEF_MEMBER_MISSING(struct_, is_double))
return false;
return struct_->is_double(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsString()
{
if(CEF_MEMBER_MISSING(struct_, is_string))
return false;
return struct_->is_string(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsObject()
{
if(CEF_MEMBER_MISSING(struct_, is_object))
return false;
return struct_->is_object(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsArray()
{
if(CEF_MEMBER_MISSING(struct_, is_array))
return false;
return struct_->is_array(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsFunction()
{
if(CEF_MEMBER_MISSING(struct_, is_function))
return false;
return struct_->is_function(struct_)?true:false;
}
bool CefV8ValueCToCpp::GetBoolValue()
{
if(CEF_MEMBER_MISSING(struct_, get_bool_value))
return false;
return struct_->get_bool_value(struct_)?true:false;
}
int CefV8ValueCToCpp::GetIntValue()
{
if(CEF_MEMBER_MISSING(struct_, get_int_value))
return 0;
return struct_->get_int_value(struct_);
}
double CefV8ValueCToCpp::GetDoubleValue()
{
if(CEF_MEMBER_MISSING(struct_, get_double_value))
return 0.;
return struct_->get_double_value(struct_);
}
std::wstring CefV8ValueCToCpp::GetStringValue()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_string_value))
return str;
cef_string_t cef_str = struct_->get_string_value(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
bool CefV8ValueCToCpp::HasValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, has_value_bykey))
return false;
return struct_->has_value_bykey(struct_, key.c_str())?true:false;
}
bool CefV8ValueCToCpp::HasValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, has_value_byindex))
return false;
return struct_->has_value_byindex(struct_, index)?true:false;
}
bool CefV8ValueCToCpp::DeleteValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, delete_value_bykey))
return false;
return struct_->delete_value_bykey(struct_, key.c_str())?true:false;
}
bool CefV8ValueCToCpp::DeleteValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, delete_value_byindex))
return false;
return struct_->delete_value_byindex(struct_, index)?true:false;
}
CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, get_value_bykey))
return false;
cef_v8value_t* valueStruct = struct_->get_value_bykey(struct_, key.c_str());
if(valueStruct)
return CefV8ValueCToCpp::Wrap(valueStruct);
return NULL;
}
CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, get_value_byindex))
return false;
cef_v8value_t* valueStruct = struct_->get_value_byindex(struct_, index);
if(valueStruct)
return CefV8ValueCToCpp::Wrap(valueStruct);
return NULL;
}
bool CefV8ValueCToCpp::SetValue(const std::wstring& key,
CefRefPtr<CefV8Value> value)
{
if(CEF_MEMBER_MISSING(struct_, set_value_bykey))
return false;
return struct_->set_value_bykey(struct_, key.c_str(),
CefV8ValueCToCpp::Unwrap(value))?true:false;
}
bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr<CefV8Value> value)
{
if(CEF_MEMBER_MISSING(struct_, set_value_byindex))
return false;
return struct_->set_value_byindex(struct_, index,
CefV8ValueCToCpp::Unwrap(value))?true:false;
}
bool CefV8ValueCToCpp::GetKeys(std::vector<std::wstring>& keys)
{
if(CEF_MEMBER_MISSING(struct_, get_keys))
return false;
cef_string_list_t list = cef_string_list_alloc();
if(struct_->get_keys(struct_, list)) {
cef_string_t str;
int size = cef_string_list_size(list);
for(int i = 0; i < size; ++i) {
str = cef_string_list_value(list, i);
keys.push_back(str);
cef_string_free(str);
}
cef_string_list_free(list);
return true;
}
return false;
}
CefRefPtr<CefBase> CefV8ValueCToCpp::GetUserData()
{
if(CEF_MEMBER_MISSING(struct_, get_user_data))
return false;
cef_base_t* baseStruct = struct_->get_user_data(struct_);
if(baseStruct)
return CefBaseCppToC::Unwrap(baseStruct);
return NULL;
}
int CefV8ValueCToCpp::GetArrayLength()
{
if(CEF_MEMBER_MISSING(struct_, get_array_length))
return 0;
return struct_->get_array_length(struct_);
}
std::wstring CefV8ValueCToCpp::GetFunctionName()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_function_name))
return str;
cef_string_t cef_str = struct_->get_function_name(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
CefRefPtr<CefV8Handler> CefV8ValueCToCpp::GetFunctionHandler()
{
if(CEF_MEMBER_MISSING(struct_, get_function_handler))
return false;
cef_v8handler_t* handlerStruct = struct_->get_function_handler(struct_);
if(handlerStruct)
return CefV8HandlerCppToC::Unwrap(handlerStruct);
return NULL;
}
bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception)
{
if(CEF_MEMBER_MISSING(struct_, execute_function))
return RV_CONTINUE;
cef_v8value_t** argsStructPtr = NULL;
int argsSize = arguments.size();
if(argsSize > 0) {
argsStructPtr = new cef_v8value_t*[argsSize];
for(int i = 0; i < argsSize; ++i)
argsStructPtr[i] = CefV8ValueCToCpp::Unwrap(arguments[i]);
}
cef_v8value_t* retvalStruct = NULL;
cef_string_t exceptionStr = NULL;
int rv = struct_->execute_function(struct_, CefV8ValueCToCpp::Unwrap(object),
argsSize, argsStructPtr, &retvalStruct, &exceptionStr);
if(retvalStruct)
retval = CefV8ValueCToCpp::Wrap(retvalStruct);
if(exceptionStr) {
exception = exceptionStr;
cef_string_free(exceptionStr);
}
if(argsStructPtr)
delete [] argsStructPtr;
return rv?true:false;
}
#ifdef _DEBUG
long CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/cpptoc/base_cpptoc.h"
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
// STATIC METHODS - Body may be edited by hand.
CefRefPtr<CefV8Value> CefV8Value::CreateUndefined()
{
cef_v8value_t* impl = cef_v8value_create_undefined();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateNull()
{
cef_v8value_t* impl = cef_v8value_create_null();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value)
{
cef_v8value_t* impl = cef_v8value_create_bool(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int value)
{
cef_v8value_t* impl = cef_v8value_create_int(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value)
{
cef_v8value_t* impl = cef_v8value_create_double(value);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateString(const std::wstring& value)
{
cef_v8value_t* impl = cef_v8value_create_string(value.c_str());
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateObject(CefRefPtr<CefBase> user_data)
{
cef_base_t* baseStruct = NULL;
if(user_data)
baseStruct = CefBaseCppToC::Wrap(user_data);
cef_v8value_t* impl = cef_v8value_create_object(baseStruct);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateArray()
{
cef_v8value_t* impl = cef_v8value_create_array();
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateFunction(const std::wstring& name,
CefRefPtr<CefV8Handler> handler)
{
cef_v8handler_t* handlerStruct = NULL;
if(handler.get())
handlerStruct = CefV8HandlerCppToC::Wrap(handler);
cef_v8value_t* impl = cef_v8value_create_function(name.c_str(),
handlerStruct);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
// VIRTUAL METHODS - Body may be edited by hand.
bool CefV8ValueCToCpp::IsUndefined()
{
if(CEF_MEMBER_MISSING(struct_, is_undefined))
return false;
return struct_->is_undefined(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsNull()
{
if(CEF_MEMBER_MISSING(struct_, is_null))
return false;
return struct_->is_null(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsBool()
{
if(CEF_MEMBER_MISSING(struct_, is_bool))
return false;
return struct_->is_bool(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsInt()
{
if(CEF_MEMBER_MISSING(struct_, is_int))
return false;
return struct_->is_int(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsDouble()
{
if(CEF_MEMBER_MISSING(struct_, is_double))
return false;
return struct_->is_double(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsString()
{
if(CEF_MEMBER_MISSING(struct_, is_string))
return false;
return struct_->is_string(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsObject()
{
if(CEF_MEMBER_MISSING(struct_, is_object))
return false;
return struct_->is_object(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsArray()
{
if(CEF_MEMBER_MISSING(struct_, is_array))
return false;
return struct_->is_array(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsFunction()
{
if(CEF_MEMBER_MISSING(struct_, is_function))
return false;
return struct_->is_function(struct_)?true:false;
}
bool CefV8ValueCToCpp::GetBoolValue()
{
if(CEF_MEMBER_MISSING(struct_, get_bool_value))
return false;
return struct_->get_bool_value(struct_)?true:false;
}
int CefV8ValueCToCpp::GetIntValue()
{
if(CEF_MEMBER_MISSING(struct_, get_int_value))
return 0;
return struct_->get_int_value(struct_);
}
double CefV8ValueCToCpp::GetDoubleValue()
{
if(CEF_MEMBER_MISSING(struct_, get_double_value))
return 0.;
return struct_->get_double_value(struct_);
}
std::wstring CefV8ValueCToCpp::GetStringValue()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_string_value))
return str;
cef_string_t cef_str = struct_->get_string_value(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
bool CefV8ValueCToCpp::HasValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, has_value_bykey))
return false;
return struct_->has_value_bykey(struct_, key.c_str())?true:false;
}
bool CefV8ValueCToCpp::HasValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, has_value_byindex))
return false;
return struct_->has_value_byindex(struct_, index)?true:false;
}
bool CefV8ValueCToCpp::DeleteValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, delete_value_bykey))
return false;
return struct_->delete_value_bykey(struct_, key.c_str())?true:false;
}
bool CefV8ValueCToCpp::DeleteValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, delete_value_byindex))
return false;
return struct_->delete_value_byindex(struct_, index)?true:false;
}
CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(const std::wstring& key)
{
if(CEF_MEMBER_MISSING(struct_, get_value_bykey))
return false;
cef_v8value_t* valueStruct = struct_->get_value_bykey(struct_, key.c_str());
if(valueStruct)
return CefV8ValueCToCpp::Wrap(valueStruct);
return NULL;
}
CefRefPtr<CefV8Value> CefV8ValueCToCpp::GetValue(int index)
{
if(CEF_MEMBER_MISSING(struct_, get_value_byindex))
return false;
cef_v8value_t* valueStruct = struct_->get_value_byindex(struct_, index);
if(valueStruct)
return CefV8ValueCToCpp::Wrap(valueStruct);
return NULL;
}
bool CefV8ValueCToCpp::SetValue(const std::wstring& key,
CefRefPtr<CefV8Value> value)
{
if(CEF_MEMBER_MISSING(struct_, set_value_bykey))
return false;
return struct_->set_value_bykey(struct_, key.c_str(),
CefV8ValueCToCpp::Unwrap(value))?true:false;
}
bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr<CefV8Value> value)
{
if(CEF_MEMBER_MISSING(struct_, set_value_byindex))
return false;
return struct_->set_value_byindex(struct_, index,
CefV8ValueCToCpp::Unwrap(value))?true:false;
}
bool CefV8ValueCToCpp::GetKeys(std::vector<std::wstring>& keys)
{
if(CEF_MEMBER_MISSING(struct_, get_keys))
return false;
cef_string_list_t list = cef_string_list_alloc();
if(struct_->get_keys(struct_, list)) {
cef_string_t str;
int size = cef_string_list_size(list);
for(int i = 0; i < size; ++i) {
str = cef_string_list_value(list, i);
keys.push_back(str);
cef_string_free(str);
}
cef_string_list_free(list);
return true;
}
return false;
}
CefRefPtr<CefBase> CefV8ValueCToCpp::GetUserData()
{
if(CEF_MEMBER_MISSING(struct_, get_user_data))
return false;
cef_base_t* baseStruct = struct_->get_user_data(struct_);
if(baseStruct)
return CefBaseCppToC::Unwrap(baseStruct);
return NULL;
}
int CefV8ValueCToCpp::GetArrayLength()
{
if(CEF_MEMBER_MISSING(struct_, get_array_length))
return 0;
return struct_->get_array_length(struct_);
}
std::wstring CefV8ValueCToCpp::GetFunctionName()
{
std::wstring str;
if(CEF_MEMBER_MISSING(struct_, get_function_name))
return str;
cef_string_t cef_str = struct_->get_function_name(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
return str;
}
CefRefPtr<CefV8Handler> CefV8ValueCToCpp::GetFunctionHandler()
{
if(CEF_MEMBER_MISSING(struct_, get_function_handler))
return false;
cef_v8handler_t* handlerStruct = struct_->get_function_handler(struct_);
if(handlerStruct)
return CefV8HandlerCppToC::Unwrap(handlerStruct);
return NULL;
}
bool CefV8ValueCToCpp::ExecuteFunction(CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception)
{
if(CEF_MEMBER_MISSING(struct_, execute_function))
return RV_CONTINUE;
cef_v8value_t** argsStructPtr = NULL;
int argsSize = arguments.size();
if(argsSize > 0) {
argsStructPtr = new cef_v8value_t*[argsSize];
for(int i = 0; i < argsSize; ++i)
argsStructPtr[i] = CefV8ValueCToCpp::Unwrap(arguments[i]);
}
cef_v8value_t* retvalStruct = NULL;
cef_string_t exceptionStr = NULL;
int rv = struct_->execute_function(struct_, CefV8ValueCToCpp::Unwrap(object),
argsSize, argsStructPtr, &retvalStruct, &exceptionStr);
if(retvalStruct)
retval = CefV8ValueCToCpp::Wrap(retvalStruct);
if(exceptionStr) {
exception = exceptionStr;
cef_string_free(exceptionStr);
}
if(argsStructPtr)
delete [] argsStructPtr;
return rv?true:false;
}
#ifdef _DEBUG
long CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>::DebugObjCt = 0;
#endif

View File

@@ -1,67 +1,67 @@
// Copyright (c) 2009 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 _V8VALUE_CTOCPP_H
#define _V8VALUE_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefV8ValueCToCpp
: public CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>
{
public:
CefV8ValueCToCpp(cef_v8value_t* str)
: CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>(str) {}
virtual ~CefV8ValueCToCpp() {}
// CefV8Value methods
virtual bool IsUndefined();
virtual bool IsNull();
virtual bool IsBool();
virtual bool IsInt();
virtual bool IsDouble();
virtual bool IsString();
virtual bool IsObject();
virtual bool IsArray();
virtual bool IsFunction();
virtual bool GetBoolValue();
virtual int GetIntValue();
virtual double GetDoubleValue();
virtual std::wstring GetStringValue();
virtual bool HasValue(const std::wstring& key);
virtual bool HasValue(int index);
virtual bool DeleteValue(const std::wstring& key);
virtual bool DeleteValue(int index);
virtual CefRefPtr<CefV8Value> GetValue(const std::wstring& key);
virtual CefRefPtr<CefV8Value> GetValue(int index);
virtual bool SetValue(const std::wstring& key, CefRefPtr<CefV8Value> value);
virtual bool SetValue(int index, CefRefPtr<CefV8Value> value);
virtual bool GetKeys(std::vector<std::wstring>& keys);
virtual CefRefPtr<CefBase> GetUserData();
virtual int GetArrayLength();
virtual std::wstring GetFunctionName();
virtual CefRefPtr<CefV8Handler> GetFunctionHandler();
virtual bool ExecuteFunction(CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception);
};
#endif // USING_CEF_SHARED
#endif // _V8VALUE_CTOCPP_H
// Copyright (c) 2009 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 _V8VALUE_CTOCPP_H
#define _V8VALUE_CTOCPP_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/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefV8ValueCToCpp
: public CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>
{
public:
CefV8ValueCToCpp(cef_v8value_t* str)
: CefCToCpp<CefV8ValueCToCpp, CefV8Value, cef_v8value_t>(str) {}
virtual ~CefV8ValueCToCpp() {}
// CefV8Value methods
virtual bool IsUndefined();
virtual bool IsNull();
virtual bool IsBool();
virtual bool IsInt();
virtual bool IsDouble();
virtual bool IsString();
virtual bool IsObject();
virtual bool IsArray();
virtual bool IsFunction();
virtual bool GetBoolValue();
virtual int GetIntValue();
virtual double GetDoubleValue();
virtual std::wstring GetStringValue();
virtual bool HasValue(const std::wstring& key);
virtual bool HasValue(int index);
virtual bool DeleteValue(const std::wstring& key);
virtual bool DeleteValue(int index);
virtual CefRefPtr<CefV8Value> GetValue(const std::wstring& key);
virtual CefRefPtr<CefV8Value> GetValue(int index);
virtual bool SetValue(const std::wstring& key, CefRefPtr<CefV8Value> value);
virtual bool SetValue(int index, CefRefPtr<CefV8Value> value);
virtual bool GetKeys(std::vector<std::wstring>& keys);
virtual CefRefPtr<CefBase> GetUserData();
virtual int GetArrayLength();
virtual std::wstring GetFunctionName();
virtual CefRefPtr<CefV8Handler> GetFunctionHandler();
virtual bool ExecuteFunction(CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval,
std::wstring& exception);
};
#endif // USING_CEF_SHARED
#endif // _V8VALUE_CTOCPP_H

View File

@@ -1,55 +1,55 @@
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/write_handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, write))
return 0;
return struct_->write(struct_, ptr, size, n);
}
int CefWriteHandlerCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefWriteHandlerCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefWriteHandlerCToCpp::Flush()
{
if(CEF_MEMBER_MISSING(struct_, flush))
return 0;
return struct_->flush(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler,
cef_write_handler_t>::DebugObjCt = 0;
#endif
// Copyright (c) 2009 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 static and
// virtual method implementations. See the translator.README.txt file in the
// tools directory for more information.
//
#include "libcef_dll/ctocpp/write_handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
size_t CefWriteHandlerCToCpp::Write(const void* ptr, size_t size, size_t n)
{
if(CEF_MEMBER_MISSING(struct_, write))
return 0;
return struct_->write(struct_, ptr, size, n);
}
int CefWriteHandlerCToCpp::Seek(long offset, int whence)
{
if(CEF_MEMBER_MISSING(struct_, seek))
return 0;
return struct_->seek(struct_, offset, whence);
}
long CefWriteHandlerCToCpp::Tell()
{
if(CEF_MEMBER_MISSING(struct_, tell))
return 0;
return struct_->tell(struct_);
}
int CefWriteHandlerCToCpp::Flush()
{
if(CEF_MEMBER_MISSING(struct_, flush))
return 0;
return struct_->flush(struct_);
}
#ifdef _DEBUG
long CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler,
cef_write_handler_t>::DebugObjCt = 0;
#endif

View File

@@ -1,44 +1,44 @@
// Copyright (c) 2009 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 _WRITEHANDLER_CTOCPP_H
#define _WRITEHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefWriteHandlerCToCpp
: public CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler,
cef_write_handler_t>
{
public:
CefWriteHandlerCToCpp(cef_write_handler_t* str)
: CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler, cef_write_handler_t>(
str) {}
virtual ~CefWriteHandlerCToCpp() {}
// CefWriteHandler methods
virtual size_t Write(const void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Flush();
};
#endif // BUILDING_CEF_SHARED
#endif // _WRITEHANDLER_CTOCPP_H
// Copyright (c) 2009 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 _WRITEHANDLER_CTOCPP_H
#define _WRITEHANDLER_CTOCPP_H
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef.h"
#include "include/cef_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefWriteHandlerCToCpp
: public CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler,
cef_write_handler_t>
{
public:
CefWriteHandlerCToCpp(cef_write_handler_t* str)
: CefCToCpp<CefWriteHandlerCToCpp, CefWriteHandler, cef_write_handler_t>(
str) {}
virtual ~CefWriteHandlerCToCpp() {}
// CefWriteHandler methods
virtual size_t Write(const void* ptr, size_t size, size_t n);
virtual int Seek(long offset, int whence);
virtual long Tell();
virtual int Flush();
};
#endif // BUILDING_CEF_SHARED
#endif // _WRITEHANDLER_CTOCPP_H