本文整理汇总了C++中SkEvent::findString方法的典型用法代码示例。如果您正苦于以下问题:C++ SkEvent::findString方法的具体用法?C++ SkEvent::findString怎么用?C++ SkEvent::findString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkEvent
的用法示例。
在下文中一共展示了SkEvent::findString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEvent
bool SkInfoPanelView::onEvent(const SkEvent& evt) {
if (evt.isType(SkDebugger_StateType)) {
fMatrix = evt.findString(SkDebugger_Matrix);
fClip = evt.findString(SkDebugger_Clip);
SkPaint* ptr;
if (evt.getMetaData().findPtr(SkDebugger_Paint, (void**)&ptr)) {
fPaint = *ptr;
fPaintInfo = evt.findString(SkDebugger_PaintInfo);
}
this->inval(NULL);
return true;
}
return this->INHERITED::onEvent(evt);
}
示例2: onDraw
void SkGridView::onDraw(SkCanvas* canvas)
{
this->INHERITED::onDraw(canvas);
canvas->drawPaint(fPaint[kBG_Attr]);
if (fSource == NULL)
return;
#if 0
int visibleCount = SkMin32(fVisibleRowCount, fSource->countRows() - fScrollIndex);
if (visibleCount == 0)
return;
this->ensureStrCache(visibleCount);
int currIndex = this->logicalToVisualIndex(fCurrIndex);
#endif
SkPaint p;
for (int i = 0; i < fSource->countRows(); i++)
{
bool forced = false;
SkEvent* evt = fSource->getEvent(i);
SkASSERT(evt);
SkString path(evt->findString("path"));
delete evt;
SkBitmapRef* bmr = SkBitmapRef::Decode(path.c_str(), false);
if (bmr == NULL)
{
bmr = SkBitmapRef::Decode(path.c_str(), true);
if (bmr)
forced = true;
}
if (bmr)
{
SkAutoTDelete<SkBitmapRef> autoRef(bmr);
SkRect r;
if (!this->getCellRect(i, &r))
break;
copybits(canvas, bmr->bitmap(), r, p);
}
// only draw one forced bitmap at a time
if (forced)
{
this->inval(NULL); // could inval only the remaining visible cells...
break;
}
}
// draw the hilite
{
SkRect r;
if (fCurrIndex >= 0 && this->getCellRect(fCurrIndex, &r))
canvas->drawRect(r, fPaint[kHiliteCell_Attr]);
}
}
示例3: FindText
bool SkOSMenu::FindText(const SkEvent& evt, const char slotName[], SkString* value) {
if (evt.isType(gMenuEventType)) {
const char* text = evt.findString(slotName);
if (!text || !*text)
return false;
else {
value->set(text);
return true;
}
}
return false;
}
示例4: FindListItems
bool SkOSMenu::FindListItems(const SkEvent& evt, SkString items[]) {
if (evt.isType(gMenuEventType) && items) {
const char* text = evt.findString(gList_Items_Str);
if (text != NULL) {
SkString temp(text);
char* token = strtok((char*)temp.c_str(), gDelimiter);
int index = 0;
while (token != NULL) {
items[index].set(token, strlen(token));
token = strtok (NULL, gDelimiter);
++index;
}
}
return true;
}
return false;
}
示例5: onEvent
bool SkAnimator::onEvent(const SkEvent& evt) {
#ifdef SK_DEBUG
SkAnimator* root = fMaker->getRoot();
if (root == NULL)
root = this;
if (root->isTrackingEvents())
root->eventDone(evt);
#endif
if (evt.isType(SK_EventType_OnEnd)) {
SkEventState eventState;
bool success = evt.findPtr("anim", (void**) &eventState.fDisplayable);
SkASSERT(success);
success = evt.findS32("time", (int32_t*) &fMaker->fEnableTime);
SkASSERT(success);
fMaker->fAdjustedStart = fMaker->getAppTime() - fMaker->fEnableTime;
fMaker->fEvents.doEvent(*fMaker, SkDisplayEvent::kOnEnd, &eventState);
fMaker->fAdjustedStart = 0;
goto inval;
}
if (evt.isType(SK_EventType_Delay)) {
fMaker->doDelayedEvent();
goto inval;
}
{
const char* id = evt.findString("id");
if (id == NULL)
return false;
SkDisplayable** firstMovie = fMaker->fMovies.begin();
SkDisplayable** endMovie = fMaker->fMovies.end();
for (SkDisplayable** ptr = firstMovie; ptr < endMovie; ptr++) {
SkDisplayMovie* movie = (SkDisplayMovie*) *ptr;
movie->doEvent(evt);
}
{
SkDisplayable* event;
if (fMaker->find(id, &event) == false)
return false;
#if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
SkString debugOut;
SkMSec realTime = fMaker->getAppTime();
debugOut.appendS32(realTime - fMaker->fDebugTimeBase);
debugOut.append(" onEvent id=");
debugOut.append(id);
#endif
SkMSec time = evt.getFast32();
if (time != 0) {
SkMSec app = fMaker->getAppTime();
fMaker->setEnableTime(app, time);
#if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
debugOut.append(" time=");
debugOut.appendS32(time - fMaker->fDebugTimeBase);
debugOut.append(" adjust=");
debugOut.appendS32(fMaker->fAdjustedStart);
#endif
}
#if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
SkDebugf("%s\n", debugOut.c_str());
#endif
SkASSERT(event->isEvent());
SkDisplayEvent* displayEvent = (SkDisplayEvent*) event;
displayEvent->populateInput(*fMaker, evt);
displayEvent->enableEvent(*fMaker);
}
}
inval:
fMaker->notifyInval();
return true;
}
示例6: FindAction
bool SkOSMenu::FindAction(const SkEvent& evt, const char label[]) {
return evt.isType(gMenuEventType) && evt.findString(label);
}