本文整理汇总了C++中CppArgumentList类的典型用法代码示例。如果您正苦于以下问题:C++ CppArgumentList类的具体用法?C++ CppArgumentList怎么用?C++ CppArgumentList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CppArgumentList类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCustomPolicyDelegate
void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
bool enable = arguments[0].value.boolValue;
bool permissive = false;
if (arguments.size() > 1 && arguments[1].isBool())
permissive = arguments[1].value.boolValue;
m_shell->webViewHost()->setCustomPolicyDelegate(enable, permissive);
}
result->setNull();
}
示例2: queueLoad
void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
// FIXME: Implement WebURL::resolve() and avoid GURL.
GURL currentURL = m_shell->webView()->mainFrame()->url();
GURL fullURL = currentURL.Resolve(arguments[0].toString());
string target = "";
if (arguments.size() > 1 && arguments[1].isString())
target = arguments[1].toString();
m_workQueue.addWork(new WorkItemLoad(fullURL, WebString::fromUTF8(target)));
}
result->setNull();
}
示例3: initFromCppArgumentList
void initFromCppArgumentList(const CppArgumentList& args, Awesomium::JSArguments& result)
{
for(CppArgumentList::const_iterator i = args.begin(); i != args.end(); i++)
{
if(i->isInt32())
result.push_back(i->ToInt32());
else if(i->isDouble())
result.push_back(i->ToDouble());
else if(i->isBool())
result.push_back(i->ToBoolean());
else if(i->isString())
result.push_back(i->ToString());
else
result.push_back(Awesomium::JSValue());
}
}
示例4: pathToLocalResource
void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() <= 0 || !arguments[0].isString())
return;
string url = arguments[0].toString();
#if OS(WINDOWS)
if (StartsWithASCII(url, "/tmp/", true)) {
// We want a temp file.
const unsigned tempPrefixLength = 5;
size_t bufferSize = MAX_PATH;
OwnArrayPtr<WCHAR> tempPath(new WCHAR[bufferSize]);
DWORD tempLength = ::GetTempPathW(bufferSize, tempPath.get());
if (tempLength + url.length() - tempPrefixLength + 1 > bufferSize) {
bufferSize = tempLength + url.length() - tempPrefixLength + 1;
tempPath.set(new WCHAR[bufferSize]);
tempLength = GetTempPathW(bufferSize, tempPath.get());
ASSERT(tempLength < bufferSize);
}
std::string resultPath(WebString(tempPath.get(), tempLength).utf8());
resultPath.append(url.substr(tempPrefixLength));
result->set(resultPath);
return;
}
#endif
// Some layout tests use file://// which we resolve as a UNC path. Normalize
// them to just file:///.
while (StartsWithASCII(url, "file:////", false))
url = url.substr(0, 8) + url.substr(9);
result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
}
示例5: addUserStyleSheet
void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isString())
return;
m_shell->webView()->addUserStyleSheet(WebString::fromUTF8(arguments[0].toString()));
}
示例6: mouseUp
void EventSender::mouseUp(const CppArgumentList& arguments, CppVariant* result)
{
if (result) // Could be 0 if invoked asynchronously.
result->setNull();
webview()->layout();
int buttonNumber = getButtonNumberFromSingleArg(arguments);
ASSERT(buttonNumber != -1);
WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
if (isDragMode() && !replayingSavedEvents) {
SavedEvent savedEvent;
savedEvent.type = SavedEvent::MouseUp;
savedEvent.buttonType = buttonType;
mouseEventQueue.append(savedEvent);
replaySavedEvents();
} else {
WebMouseEvent event;
initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event);
if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
applyKeyModifiers(&(arguments[1]), &event);
doMouseUp(event);
}
}
示例7: setTimelineProfilingEnabled
void LayoutTestController::setTimelineProfilingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
return;
// FIXME: Should call TestShellDevToolsAgent::setTimelineProfilingEnabled().
}
示例8: getButtonNumberFromSingleArg
int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments)
{
int buttonCode = 0;
if (arguments.size() > 0 && arguments[0].isNumber())
buttonCode = arguments[0].toInt32();
return buttonCode;
}
示例9: setMarkedText
void TextInputController::setMarkedText(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 3 || !arguments[0].isString()
|| !arguments[1].isNumber() || !arguments[2].isNumber())
return;
WebString text(WebString::fromUTF8(arguments[0].toString()));
int start = arguments[1].toInt32();
int length = arguments[2].toInt32();
// Split underline into up to 3 elements (before, selection, and after).
vector<WebCompositionUnderline> underlines;
WebCompositionUnderline underline;
if (!start) {
underline.endOffset = length;
} else {
underline.endOffset = start;
underlines.push_back(underline);
underline.startOffset = start;
underline.endOffset = start + length;
}
underline.thick = true;
underlines.push_back(underline);
if (start + length < static_cast<int>(text.length())) {
underline.startOffset = underline.endOffset;
underline.endOffset = text.length();
underline.thick = false;
underlines.push_back(underline);
}
m_webView->setComposition(text, underlines, start, start + length);
}
示例10: firstRectForCharacterRange
void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
WebFrame* frame = m_webView->focusedFrame();
if (!frame)
return;
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
return;
WebRect rect;
if (!frame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
return;
vector<int> intArray(4);
intArray[0] = rect.x;
intArray[1] = rect.y;
intArray[2] = rect.width;
intArray[3] = rect.height;
NPObject* resultArray = WebBindings::makeIntArray(intArray);
result->set(resultArray);
WebBindings::releaseObject(resultArray);
}
示例11: evaluateInWebInspector
void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString())
return;
// FIXME: Should call TestShellDevToolsAgent::evaluateInWebInspector().
}
示例12: setPopupBlockingEnabled
void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
bool blockPopups = arguments[0].toBoolean();
m_shell->webView()->settings()->setJavaScriptCanOpenWindowsAutomatically(!blockPopups);
}
result->setNull();
}
示例13: setUserStyleSheetLocation
void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isString()) {
m_userStyleSheetLocation = webkit_support::RewriteLayoutTestsURL(arguments[0].toString());
m_shell->webView()->settings()->setUserStyleSheetLocation(m_userStyleSheetLocation);
}
result->setNull();
}