本文整理汇总了C++中SkEvent::isType方法的典型用法代码示例。如果您正苦于以下问题:C++ SkEvent::isType方法的具体用法?C++ SkEvent::isType怎么用?C++ SkEvent::isType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkEvent
的用法示例。
在下文中一共展示了SkEvent::isType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*virtual*/ bool SkBorderView::onEvent(const SkEvent& evt)
{
if (evt.isType(SK_EventType_Inval))
{
this->inval(NULL);
return true;
}
if (evt.isType("recommendDim"))
{
evt.findScalar("leftMargin", &fLeft);
evt.findScalar("rightMargin", &fRight);
evt.findScalar("topMargin", &fTop);
evt.findScalar("bottomMargin", &fBottom);
//setup_views.cpp uses SkView::Layout instead of SkStackViewLayout
//but that gives me an error
SkStackViewLayout* layout;
fMargin.set(fLeft, fTop, fRight, fBottom);
if (this->getLayout())
{
layout = (SkStackViewLayout*)this->getLayout();
layout->setMargin(fMargin);
}
else
{
layout = new SkStackViewLayout;
layout->setMargin(fMargin);
this->setLayout(layout)->unref();
}
this->invokeLayout();
}
return this->INHERITED::onEvent(evt);
}
示例2: onEvent
virtual bool onEvent(const SkEvent& evt) {
if (evt.isType(gReplaceTransitionEvt)) {
SkView* prev = fPrev;
prev->ref();
fPrev->detachFromParent();
fPrev = (SkView*)SkEventSink::FindSink(evt.getFast32());
(void)SampleView::SetUsePipe(fPrev, SkOSMenu::kOffState);
//attach the new fPrev and call unref to balance the ref in onDraw
this->attachChildToBack(fPrev)->unref();
this->inval(NULL);
SkASSERT(1 == prev->getRefCnt());
prev->unref();
return true;
}
if (evt.isType("transition-done")) {
fNext->setLoc(0, 0);
fNext->setClipToBounds(false);
SkEvent* evt = new SkEvent(gReplaceTransitionEvt,
this->getParent()->getSinkID());
evt->setFast32(fNext->getSinkID());
//increate ref count of fNext so it survives detachAllChildren
fNext->ref();
this->detachAllChildren();
evt->post();
return true;
}
return this->INHERITED::onEvent(evt);
}
示例3: onEvent
bool SampleWindow::onEvent(const SkEvent& evt) {
if (evt.isType(ANIMATING_EVENTTYPE)) {
if (fAnimating) {
this->nextSample();
this->postAnimatingEvent();
}
return true;
}
if (evt.isType("set-curr-index")) {
fCurrIndex = evt.getFast32() % fSamples.count();
this->loadView(fSamples[fCurrIndex]());
return true;
}
return this->INHERITED::onEvent(evt);
}
示例4: onEvent
bool onEvent(const SkEvent& evt) override {
if (evt.isType(INVAL_ALL_TYPE)) {
this->inval(NULL);
return true;
}
return this->INHERITED::onEvent(evt);
}
示例5: onEvent
bool GMSampleView::onEvent(const SkEvent& evt) {
if (evt.isType("GMSampleView::showSize")) {
fShowSize = SkToBool(evt.getFast32());
return true;
}
return this->INHERITED::onEvent(evt);
}
示例6: onEvent
bool SkGridView::onEvent(const SkEvent& evt)
{
if (evt.isType(SK_EventType_Key))
{
switch (evt.getFast32()) {
case kUp_SkKey:
this->moveSelectionUp();
return true;
case kDown_SkKey:
this->moveSelectionDown();
return true;
case kRight_SkKey:
case kOK_SkKey:
if (fSource && fCurrIndex >= 0)
{
SkEvent* evt = fSource->getEvent(fCurrIndex);
if (evt)
{
// augment the event with our local rect
(void)this->getCellRect(fCurrIndex, (SkRect*)evt->setScalars("local-rect", 4, NULL));
SkView* view = this->sendEventToParents(*evt);
delete evt;
return view != NULL;
}
}
break;
}
}
return this->INHERITED::onEvent(evt);
}
示例7:
/*virtual*/ bool SkProgressBarView::onEvent(const SkEvent& evt)
{
if (evt.isType(SK_EventType_Inval))
{
this->inval(NULL);
return true;
}
if (evt.isType("recommendDim"))
{
SkScalar height;
if (evt.findScalar("y", &height))
this->setHeight(height);
return true;
}
return this->INHERITED::onEvent(evt);
}
示例8:
/*virtual*/ bool SkScrollBarView::onEvent(const SkEvent& evt)
{
if (evt.isType(SK_EventType_Inval))
{
this->inval(NULL);
return true;
}
if (evt.isType("recommendDim"))
{
SkScalar width;
if (evt.findScalar("x", &width))
this->setWidth(width);
return true;
}
return this->INHERITED::onEvent(evt);
}
示例9: onEvent
bool SkOSWindow::onEvent(const SkEvent& evt) {
if (evt.isType("inval-imageview")) {
update(NULL);
if (NULL == fUnixWindow.fGLContext)
this->doPaint();
return true;
}
return INHERITED::onEvent(evt);
}
示例10: onEvent
bool SkWindow::onEvent(const SkEvent& evt) {
if (evt.isType(SK_EventDelayInval)) {
for (SkRegion::Iterator iter(fDirtyRgn); !iter.done(); iter.next())
this->onHandleInval(iter.rect());
fWaitingOnInval = false;
return true;
}
return this->INHERITED::onEvent(evt);
}
示例11: KeyQ
bool SampleCode::KeyQ(const SkEvent& evt, SkKey* outKey) {
if (evt.isType(gKeyEvtName, sizeof(gKeyEvtName) - 1)) {
if (outKey) {
*outKey = (SkKey)evt.getFast32();
}
return true;
}
return false;
}
示例12: CharQ
bool SampleCode::CharQ(const SkEvent& evt, SkUnichar* outUni) {
if (evt.isType(gCharEvtName, sizeof(gCharEvtName) - 1)) {
if (outUni) {
*outUni = evt.getFast32();
}
return true;
}
return false;
}
示例13: onEvent
bool SkOSWindow::onEvent(const SkEvent& evt)
{
if (evt.isType("inval-imageview")) {
update(NULL);
doPaint();
return true;
}
return INHERITED::onEvent(evt);
}
示例14: 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;
}
示例15: onEvent
bool SkOSWindow::onEvent(const SkEvent& evt) {
if (evt.isType("inval-imageview")) {
this->update(NULL);
const SkBitmap& bm = this->getBitmap();
CGImageRef img = SkCreateCGImageRef(bm);
HIImageViewSetImage((HIViewRef)getHVIEW(), img);
CGImageRelease(img);
return true;
}
return INHERITED::onEvent(evt);
}