本文整理汇总了C++中CppArgumentList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CppArgumentList::size方法的具体用法?C++ CppArgumentList::size怎么用?C++ CppArgumentList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CppArgumentList
的用法示例。
在下文中一共展示了CppArgumentList::size方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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()));
}
示例2: getButtonNumberFromSingleArg
int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments)
{
int buttonCode = 0;
if (arguments.size() > 0 && arguments[0].isNumber())
buttonCode = arguments[0].toInt32();
return buttonCode;
}
示例3: setTimelineProfilingEnabled
void LayoutTestController::setTimelineProfilingEnabled(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isBool())
return;
// FIXME: Should call TestShellDevToolsAgent::setTimelineProfilingEnabled().
}
示例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: 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);
}
示例6: 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().
}
示例7: handleMouseWheel
void EventSender::handleMouseWheel(const CppArgumentList& arguments, CppVariant* result, bool continuous)
{
result->setNull();
if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
return;
// Force a layout here just to make sure every position has been
// determined before we send events (as well as all the other methods
// that send an event do).
webview()->layout();
int horizontal = arguments[0].toInt32();
int vertical = arguments[1].toInt32();
WebMouseWheelEvent event;
initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event);
event.wheelTicksX = static_cast<float>(horizontal);
event.wheelTicksY = static_cast<float>(vertical);
event.deltaX = event.wheelTicksX;
event.deltaY = event.wheelTicksY;
if (continuous) {
event.wheelTicksX /= scrollbarPixelsPerTick;
event.wheelTicksY /= scrollbarPixelsPerTick;
} else {
event.deltaX *= scrollbarPixelsPerTick;
event.deltaY *= scrollbarPixelsPerTick;
}
webview()->handleInputEvent(event);
}
示例8: 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);
}
示例9: 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();
}
示例10: 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();
}
示例11: insertText
void TextInputController::insertText(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
if (arguments.size() < 1 || !arguments[0].isString())
return;
m_webView->confirmComposition(WebString::fromUTF8(arguments[0].toString()));
}