mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add the CEF translator tool for generating the C API header and cpptoc/ctocpp wrapper files.
- Update to files generated by the CEF translator tool. This introduces minor changes in cef.h and cef_capi.h for naming and translation consistency. - C API global function names that were previously in the cef_create_classname*() format are now in the cef_classname_create*() format. - cef_frame_t::get_frame_names() now returns void instead of size_t. - cef_frame_t::execute_javascript() has been renamed to cef_frame_t::execute_java_script(). - The 'arguments' attribute of CefV8Handler::Execute() and CefV8Value::ExecuteFunction() is now const. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@30 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -10,8 +10,11 @@
|
||||
#include "../cpptoc/handler_cpptoc.h"
|
||||
#include "../cpptoc/v8handler_cpptoc.h"
|
||||
#include "../ctocpp/browser_ctocpp.h"
|
||||
#include "../ctocpp/post_data_ctocpp.h"
|
||||
#include "../ctocpp/post_data_element_ctocpp.h"
|
||||
#include "../ctocpp/request_ctocpp.h"
|
||||
#include "../ctocpp/stream_ctocpp.h"
|
||||
#include "../ctocpp/stream_reader_ctocpp.h"
|
||||
#include "../ctocpp/stream_writer_ctocpp.h"
|
||||
#include "../ctocpp/v8value_ctocpp.h"
|
||||
|
||||
|
||||
@@ -52,149 +55,6 @@ bool CefRegisterExtension(const std::wstring& extension_name,
|
||||
CefV8HandlerCppToC::Wrap(handler));
|
||||
}
|
||||
|
||||
bool CefBrowser::CreateBrowser(CefWindowInfo& windowInfo, bool popup,
|
||||
CefRefPtr<CefHandler> handler,
|
||||
const std::wstring& url)
|
||||
{
|
||||
return cef_create_browser(&windowInfo, popup, CefHandlerCppToC::Wrap(handler),
|
||||
url.c_str());
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowser> CefBrowser::CreateBrowserSync(CefWindowInfo& windowInfo,
|
||||
bool popup,
|
||||
CefRefPtr<CefHandler> handler,
|
||||
const std::wstring& url)
|
||||
{
|
||||
cef_browser_t* impl = cef_create_browser_sync(&windowInfo, popup,
|
||||
CefHandlerCppToC::Wrap(handler), url.c_str());
|
||||
if(impl)
|
||||
return CefBrowserCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefRequest> CreateRequest()
|
||||
{
|
||||
cef_request_t* impl = cef_create_request();
|
||||
if(impl)
|
||||
return CefRequestCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefPostData> CreatePostData()
|
||||
{
|
||||
cef_post_data_t* impl = cef_create_post_data();
|
||||
if(impl)
|
||||
return CefPostDataCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefPostDataElement> CreatePostDataElement()
|
||||
{
|
||||
cef_post_data_element_t* impl = cef_create_post_data_element();
|
||||
if(impl)
|
||||
return CefPostDataElementCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefStreamReader> CefStreamReader::CreateForFile(const std::wstring& fileName)
|
||||
{
|
||||
cef_stream_reader_t* impl =
|
||||
cef_create_stream_reader_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_create_stream_reader_for_data(data, size);
|
||||
if(impl)
|
||||
return CefStreamReaderCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateUndefined()
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_undefined();
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateNull()
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_null();
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateBool(bool value)
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_bool(value);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateInt(int value)
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_int(value);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateDouble(double value)
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_double(value);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateString(const std::wstring& value)
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_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_create_v8value_object(baseStruct);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> CefV8Value::CreateArray()
|
||||
{
|
||||
cef_v8value_t* impl = cef_create_v8value_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_create_v8value_function(name.c_str(),
|
||||
handlerStruct);
|
||||
if(impl)
|
||||
return CefV8ValueCToCpp::Wrap(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CefRegisterPlugin(const struct CefPluginInfo& plugin_info)
|
||||
{
|
||||
cef_plugin_info_t pluginInfo;
|
||||
|
Reference in New Issue
Block a user