2010-10-16 21:10:11 +02:00
|
|
|
// Copyright (c) 2010 The Chromium Embedded Framework Authors. All rights
|
2010-10-03 23:04:50 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// A portion of this file was generated by the CEF translator tool. When
|
|
|
|
// making changes by hand only do so within the body of existing function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2011-02-21 23:44:06 +01:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/stream_reader_cpptoc.h"
|
2011-02-23 04:45:13 +01:00
|
|
|
#include "libcef_dll/ctocpp/domvisitor_ctocpp.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_undo(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Undo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_redo(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Redo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_cut(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Cut();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_copy(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Copy();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_paste(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Paste();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_del(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_select_all(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->SelectAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_print(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->Print();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_view_source(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->ViewSource();
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t CEF_CALLBACK frame_get_source(struct _cef_frame_t* self)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return NULL;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString sourceStr = CefFrameCppToC::Get(self)->GetSource();
|
|
|
|
return sourceStr.DetachToUserFree();
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t CEF_CALLBACK frame_get_text(struct _cef_frame_t* self)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return NULL;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString textStr = CefFrameCppToC::Get(self)->GetText();
|
|
|
|
return textStr.DetachToUserFree();
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_load_request(struct _cef_frame_t* self,
|
|
|
|
struct _cef_request_t* request)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(request);
|
|
|
|
if(!self || !request)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefRefPtr<CefRequest> requestPtr = CefRequestCppToC::Unwrap(request);
|
|
|
|
CefFrameCppToC::Get(self)->LoadRequest(requestPtr);
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
void CEF_CALLBACK frame_load_url(struct _cef_frame_t* self,
|
|
|
|
const cef_string_t* url)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefFrameCppToC::Get(self)->LoadURL(CefString(url));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_load_string(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* string, const cef_string_t* url)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefFrameCppToC::Get(self)->LoadString(CefString(string), CefString(url));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_load_stream(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
struct _cef_stream_reader_t* stream, const cef_string_t* url)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(stream);
|
|
|
|
if(!self || !stream)
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefFrameCppToC::Get(self)->LoadStream(CefStreamReaderCppToC::Unwrap(stream),
|
|
|
|
CefString(url));
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK frame_execute_java_script(struct _cef_frame_t* self,
|
2010-11-22 18:49:46 +01:00
|
|
|
const cef_string_t* jsCode, const cef_string_t* scriptUrl, int startLine)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefFrameCppToC::Get(self)->ExecuteJavaScript(CefString(jsCode),
|
|
|
|
CefString(scriptUrl), startLine);
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK frame_is_main(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return CefFrameCppToC::Get(self)->IsMain();
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK frame_is_focused(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return CefFrameCppToC::Get(self)->IsFocused();
|
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return 0;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString nameStr = CefFrameCppToC::Get(self)->GetName();
|
|
|
|
return nameStr.DetachToUserFree();
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
cef_string_userfree_t CEF_CALLBACK frame_get_url(struct _cef_frame_t* self)
|
2010-10-03 23:04:50 +02:00
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return NULL;
|
|
|
|
|
2010-11-22 18:49:46 +01:00
|
|
|
CefString urlStr = CefFrameCppToC::Get(self)->GetURL();
|
|
|
|
return urlStr.DetachToUserFree();
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
2011-02-21 23:44:06 +01:00
|
|
|
cef_browser_t* CEF_CALLBACK frame_get_browser(struct _cef_frame_t* self)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
if(!self)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowser> browserPtr =
|
|
|
|
CefFrameCppToC::Get(self)->GetBrowser();
|
|
|
|
if(browserPtr.get())
|
|
|
|
return CefBrowserCppToC::Wrap(browserPtr);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-23 04:45:13 +01:00
|
|
|
void CEF_CALLBACK frame_visit_dom(struct _cef_frame_t* self,
|
|
|
|
struct _cef_domvisitor_t* visitor)
|
|
|
|
{
|
|
|
|
DCHECK(self);
|
|
|
|
DCHECK(visitor);
|
|
|
|
if(!self || !visitor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CefFrameCppToC::Get(self)->VisitDOM(CefDOMVisitorCToCpp::Wrap(visitor));
|
|
|
|
}
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefFrameCppToC::CefFrameCppToC(CefFrame* cls)
|
|
|
|
: CefCppToC<CefFrameCppToC, CefFrame, cef_frame_t>(cls)
|
|
|
|
{
|
|
|
|
struct_.struct_.undo = frame_undo;
|
|
|
|
struct_.struct_.redo = frame_redo;
|
|
|
|
struct_.struct_.cut = frame_cut;
|
|
|
|
struct_.struct_.copy = frame_copy;
|
|
|
|
struct_.struct_.paste = frame_paste;
|
|
|
|
struct_.struct_.del = frame_del;
|
|
|
|
struct_.struct_.select_all = frame_select_all;
|
|
|
|
struct_.struct_.print = frame_print;
|
|
|
|
struct_.struct_.view_source = frame_view_source;
|
|
|
|
struct_.struct_.get_source = frame_get_source;
|
|
|
|
struct_.struct_.get_text = frame_get_text;
|
|
|
|
struct_.struct_.load_request = frame_load_request;
|
|
|
|
struct_.struct_.load_url = frame_load_url;
|
|
|
|
struct_.struct_.load_string = frame_load_string;
|
|
|
|
struct_.struct_.load_stream = frame_load_stream;
|
|
|
|
struct_.struct_.execute_java_script = frame_execute_java_script;
|
|
|
|
struct_.struct_.is_main = frame_is_main;
|
|
|
|
struct_.struct_.is_focused = frame_is_focused;
|
|
|
|
struct_.struct_.get_name = frame_get_name;
|
|
|
|
struct_.struct_.get_url = frame_get_url;
|
2011-02-21 23:44:06 +01:00
|
|
|
struct_.struct_.get_browser = frame_get_browser;
|
2011-02-23 04:45:13 +01:00
|
|
|
struct_.struct_.visit_dom = frame_visit_dom;
|
2010-10-03 23:04:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
2010-12-07 02:30:26 +01:00
|
|
|
template<> long CefCppToC<CefFrameCppToC, CefFrame, cef_frame_t>::DebugObjCt =
|
|
|
|
0;
|
2010-10-03 23:04:50 +02:00
|
|
|
#endif
|
|
|
|
|