- Auto-generate all C/C++ translation code (issue #33).

- Change index parameter types from int to size_t to make 0-based range implicit.
- Make CefPrintOptions and CefMenuInfo proper wrapper classes.
- Normalize the naming of menu-related types.
- Remove unused command_line variable from test_suite.cc.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@408 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-12-08 01:38:30 +00:00
parent b4653ce1da
commit 64e08c2918
238 changed files with 14703 additions and 4322 deletions

View File

@@ -4,10 +4,10 @@
//
// ---------------------------------------------------------------------------
//
// 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.
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "include/cef_version.h"
@@ -25,14 +25,18 @@ CefRefPtr<CefCommandLine> CefCommandLine::CreateCommandLine()
DCHECK(false);
return NULL;
}
cef_command_line_t* impl = cef_command_line_create();
if(impl)
return CefCommandLineCToCpp::Wrap(impl);
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_command_line_t* _retval = cef_command_line_create();
// Return type: refptr_same
return CefCommandLineCToCpp::Wrap(_retval);
}
// VIRTUAL METHODS - Body may be edited by hand.
void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv)
@@ -40,139 +44,277 @@ void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv)
if (CEF_MEMBER_MISSING(struct_, init_from_argv))
return;
struct_->init_from_argv(struct_, argc, argv);
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: argv; type: simple_byaddr
DCHECK(argv);
if (!argv)
return;
// Execute
struct_->init_from_argv(struct_,
argc,
argv);
}
void CefCommandLineCToCpp::InitFromString(const CefString& command_line)
{
if (CEF_MEMBER_MISSING(struct_, init_from_string))
return;
struct_->init_from_string(struct_, command_line.GetStruct());
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: command_line; type: string_byref_const
DCHECK(!command_line.empty());
if (command_line.empty())
return;
// Execute
struct_->init_from_string(struct_,
command_line.GetStruct());
}
CefString CefCommandLineCToCpp::GetCommandLineString()
{
CefString str;
if (CEF_MEMBER_MISSING(struct_, get_command_line_string))
return str;
return CefString();
cef_string_userfree_t strPtr = struct_->get_command_line_string(struct_);
str.AttachToUserFree(strPtr);
return str;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_command_line_string(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefCommandLineCToCpp::GetProgram()
{
CefString str;
if (CEF_MEMBER_MISSING(struct_, get_program))
return str;
return CefString();
cef_string_userfree_t strPtr = struct_->get_program(struct_);
str.AttachToUserFree(strPtr);
return str;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_program(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
void CefCommandLineCToCpp::SetProgram(const CefString& program)
{
if (CEF_MEMBER_MISSING(struct_, set_program))
return;
struct_->set_program(struct_, program.GetStruct());
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: program; type: string_byref_const
DCHECK(!program.empty());
if (program.empty())
return;
// Execute
struct_->set_program(struct_,
program.GetStruct());
}
bool CefCommandLineCToCpp::HasSwitches()
{
if (CEF_MEMBER_MISSING(struct_, has_switches))
return false;
return struct_->has_switches(struct_)?true:false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->has_switches(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefCommandLineCToCpp::HasSwitch(const CefString& name)
{
if (CEF_MEMBER_MISSING(struct_, has_switch))
return false;
return struct_->has_switch(struct_, name.GetStruct())?true:false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: name; type: string_byref_const
DCHECK(!name.empty());
if (name.empty())
return false;
// Execute
int _retval = struct_->has_switch(struct_,
name.GetStruct());
// Return type: bool
return _retval?true:false;
}
CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name)
{
CefString str;
if (CEF_MEMBER_MISSING(struct_, get_switch_value))
return str;
return CefString();
cef_string_userfree_t strPtr = struct_->get_switch_value(struct_,
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: name; type: string_byref_const
DCHECK(!name.empty());
if (name.empty())
return CefString();
// Execute
cef_string_userfree_t _retval = struct_->get_switch_value(struct_,
name.GetStruct());
str.AttachToUserFree(strPtr);
return str;
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches)
{
if (CEF_MEMBER_MISSING(struct_, get_switches))
return;
cef_string_map_t map = cef_string_map_alloc();
if(!map)
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
struct_->get_switches(struct_, map);
transfer_string_map_contents(map, switches);
cef_string_map_free(map);
// Translate param: switches; type: string_map_single_byref
cef_string_map_t switchesMap = cef_string_map_alloc();
DCHECK(switchesMap);
if (switchesMap)
transfer_string_map_contents(switches, switchesMap);
// Execute
struct_->get_switches(struct_,
switchesMap);
// Restore param:switches; type: string_map_single_byref
if (switchesMap) {
switches.clear();
transfer_string_map_contents(switchesMap, switches);
cef_string_map_free(switchesMap);
}
}
void CefCommandLineCToCpp::AppendSwitch(const CefString& name)
{
if (CEF_MEMBER_MISSING(struct_, append_switch))
return;
struct_->append_switch(struct_, name.GetStruct());
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: name; type: string_byref_const
DCHECK(!name.empty());
if (name.empty())
return;
// Execute
struct_->append_switch(struct_,
name.GetStruct());
}
void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name,
const CefString& value)
{
if (CEF_MEMBER_MISSING(struct_, append_switch_with_value))
return;
struct_->append_switch_with_value(struct_, name.GetStruct(),
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: name; type: string_byref_const
DCHECK(!name.empty());
if (name.empty())
return;
// Verify param: value; type: string_byref_const
DCHECK(!value.empty());
if (value.empty())
return;
// Execute
struct_->append_switch_with_value(struct_,
name.GetStruct(),
value.GetStruct());
}
bool CefCommandLineCToCpp::HasArguments()
{
if (CEF_MEMBER_MISSING(struct_, has_arguments))
return false;
return struct_->has_arguments(struct_)?true:false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->has_arguments(struct_);
// Return type: bool
return _retval?true:false;
}
void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments)
{
if (CEF_MEMBER_MISSING(struct_, get_arguments))
return;
cef_string_list_t list = cef_string_list_alloc();
if (!list)
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
struct_->get_arguments(struct_, list);
// Translate param: arguments; type: string_vec_byref
cef_string_list_t argumentsList = cef_string_list_alloc();
DCHECK(argumentsList);
if (argumentsList)
transfer_string_list_contents(arguments, argumentsList);
transfer_string_list_contents(list, arguments);
cef_string_list_free(list);
// Execute
struct_->get_arguments(struct_,
argumentsList);
// Restore param:arguments; type: string_vec_byref
if (argumentsList) {
arguments.clear();
transfer_string_list_contents(argumentsList, arguments);
cef_string_list_free(argumentsList);
}
}
void CefCommandLineCToCpp::AppendArgument(const CefString& argument)
{
if (CEF_MEMBER_MISSING(struct_, append_argument))
return;
struct_->append_argument(struct_, argument.GetStruct());
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: argument; type: string_byref_const
DCHECK(!argument.empty());
if (argument.empty())
return;
// Execute
struct_->append_argument(struct_,
argument.GetStruct());
}
#ifndef NDEBUG
template<> long CefCToCpp<CefCommandLineCToCpp, CefCommandLine,
cef_command_line_t>::DebugObjCt = 0;