本文整理汇总了C++中SkEvent::setS32方法的典型用法代码示例。如果您正苦于以下问题:C++ SkEvent::setS32方法的具体用法?C++ SkEvent::setS32怎么用?C++ SkEvent::setS32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkEvent
的用法示例。
在下文中一共展示了SkEvent::setS32方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postOnEnd
void SkAnimateMaker::postOnEnd(SkAnimateBase* animate, SkMSec end) {
SkEvent evt;
evt.setS32("time", animate->getStart() + end);
evt.setPtr("anim", animate);
evt.setType(SK_EventType_OnEnd);
SkEventSinkID sinkID = fAnimator->getSinkID();
fAnimator->onEventPost(new SkEvent(evt), sinkID);
}
示例2: appendList
int SkOSMenu::appendList(const char label[], const char slotName[],
SkEventSinkID target, int index, const char option[], ...) {
SkEvent* evt = new SkEvent(gMenuEventType, target);
va_list args;
if (option) {
SkString str(option);
va_start(args, option);
int count = 1;
for (const char* arg = va_arg(args, const char*); arg != NULL; arg = va_arg(args, const char*)) {
str += gDelimiter;
str += arg;
++count;
}
va_end(args);
evt->setString(gList_Items_Str, str);
evt->setS32(gList_ItemCount_S32, count);
evt->setS32(slotName, index);
}
return appendItem(label, SkOSMenu::kList_Type, slotName, evt);
}
示例3: getEvent
virtual SkEvent* getEvent(int index)
{
SkASSERT((unsigned)index < (unsigned)fCount);
SkEvent* evt = new SkEvent();
SkString label;
this->getRow(index, &label, NULL);
evt->setString("name", label.c_str());
int c = fPath.c_str()[fPath.size() - 1];
if (c != '/' && c != '\\')
label.prepend("/");
label.prepend(fPath);
label.append(fSuffix);
evt->setString("path", label.c_str());
evt->setS32("index", index);
evt->setS32("duration", 22);
evt->setType(fTarget);
return evt;
}
示例4: UnitTest
void SkAnimatorScript::UnitTest() {
#if defined(SK_SUPPORT_UNITTEST)
SkAnimator animator;
SkASSERT(animator.decodeMemory(scriptTestSetup, sizeof(scriptTestSetup)-1));
SkEvent evt;
evt.setString("id", "evt");
evt.setS32("x", 3);
animator.doUserEvent(evt);
// set up animator with memory script above, then run value tests
for (unsigned index = 0; index < SkScriptNAnswer_testCount; index++) {
SkAnimatorScript engine(*animator.fMaker, NULL, scriptTests[index].fType);
SkScriptValue value;
const char* script = scriptTests[index].fScript;
bool success = engine.evaluateScript(&script, &value);
if (success == false) {
SkDebugf("script failed: %s\n", scriptTests[index].fScript);
SkASSERT(scriptTests[index].fType == SkType_Unknown);
continue;
}
SkASSERT(value.fType == scriptTests[index].fType);
SkScalar error;
switch (value.fType) {
case SkType_Int:
SkASSERT(value.fOperand.fS32 == scriptTests[index].fIntAnswer);
break;
case SkType_Float:
error = SkScalarAbs(value.fOperand.fScalar - scriptTests[index].fScalarAnswer);
SkASSERT(error < SK_Scalar1 / 10000);
break;
case SkType_String:
SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[index].fStringAnswer) == 0);
break;
default:
SkASSERT(0);
}
}
#endif
}
示例5: setValue
void SkSliderView::setValue(U16CPU value)
{
if (fValue != value)
{
U16 prev = actual_value(fValue, fMax);
U16 next = actual_value(value, fMax);
fValue = SkToU16(value);
if (prev != next)
{
this->inval(nil);
if (this->hasListeners())
{
SkEvent evt;
evt.setType(SkWidgetView::GetEventType());
evt.setFast32(this->getSinkID());
evt.setS32("sliderValue", next);
this->postToListeners(evt);
}
}
}
}
示例6: appendTriState
int SkOSMenu::appendTriState(const char label[], const char slotName[],
SkEventSinkID target, SkOSMenu::TriState defaultState) {
SkEvent* evt = new SkEvent(gMenuEventType, target);
evt->setS32(slotName, defaultState);
return appendItem(label, SkOSMenu::kTriState_Type, slotName, evt);
}