當前位置: 首頁>>代碼示例>>C++>>正文


C++ TRESPASS函數代碼示例

本文整理匯總了C++中TRESPASS函數的典型用法代碼示例。如果您正苦於以下問題:C++ TRESPASS函數的具體用法?C++ TRESPASS怎麽用?C++ TRESPASS使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了TRESPASS函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: mix_bitmaps

static void mix_bitmaps(BBitmap* out, BBitmap* b1, BBitmap* b2, uint8 amount)
{
	if( out->BitsLength() != b1->BitsLength() ||
		out->BitsLength() != b2->BitsLength() ||
		out->ColorSpace() != b1->ColorSpace() ||
		out->ColorSpace() != b2->ColorSpace() ) {
		TRESPASS();
		return;
	}
	
	switch( out->ColorSpace() ) {
		case B_RGB32:
		case B_RGBA32:
		case B_RGB32_BIG:
		case B_RGBA32_BIG:
		{
			uint8* sOut = (uint8*)out->Bits();
			uint8* eOut = sOut + out->BitsLength();
			uint8* sB1 = (uint8*)b1->Bits();
			uint8* sB2 = (uint8*)b2->Bits();
			
			while( sOut < eOut ) {
				*sOut = (uint8)( ( ((uint16)*sB1)*(255-amount)
								 + ((uint16)*sB2)*(amount)
								 ) / 255 );
				sOut++;
				sB1++;
				sB2++;
			}
		} break;
		
		default:
			TRESPASS();
	}
}
開發者ID:HaikuArchives,項目名稱:Sequitur,代碼行數:35,代碼來源:Main.cpp

示例2: GetTrackerResources

void
BTrashWatcher::UpdateTrashIcons()
{
	BVolume	boot;
	if (BVolumeRoster().GetBootVolume(&boot) != B_OK)
		return;

	BDirectory trashDir;
	if (FSGetTrashDir(&trashDir, boot.Device()) == B_OK) {
		// pull out the icons for the current trash state from resources and
		// apply them onto the trash directory node
		size_t largeSize = 0;
		size_t smallSize = 0;
		const void *largeData = GetTrackerResources()->LoadResource('ICON',
			fTrashFull ? kResTrashFullIcon : kResTrashIcon, &largeSize);

		const void *smallData = GetTrackerResources()->LoadResource('MICN',
			fTrashFull ? kResTrashFullIcon : kResTrashIcon,  &smallSize);

		if (largeData) 
			trashDir.WriteAttr(kAttrLargeIcon, 'ICON', 0,
				largeData, largeSize);
		else
			TRESPASS();

		if (smallData)
			trashDir.WriteAttr(kAttrMiniIcon, 'MICN', 0,
				smallData, smallSize);
		else
			TRESPASS();
	}
}
開發者ID:HaikuArchives,項目名稱:OpenTracker,代碼行數:32,代碼來源:TrashWatcher.cpp

示例3: while

void
BTrashWatcher::UpdateTrashIcons()
{
	BVolumeRoster roster;
	BVolume volume;
	roster.Rewind();

	BDirectory trashDir;
	while (roster.GetNextVolume(&volume) == B_OK) {
		if (FSGetTrashDir(&trashDir, volume.Device()) == B_OK) {
			// pull out the icons for the current trash state from resources
			// and apply them onto the trash directory node
			size_t largeSize = 0;
			size_t smallSize = 0;
			const void* largeData
				= GetTrackerResources()->LoadResource('ICON',
					fTrashFull ? R_TrashFullIcon : R_TrashIcon, &largeSize);

			const void* smallData
				= GetTrackerResources()->LoadResource('MICN',
					fTrashFull ? R_TrashFullIcon : R_TrashIcon,  &smallSize);

#ifdef HAIKU_TARGET_PLATFORM_HAIKU
			size_t vectorSize = 0;
			const void* vectorData = GetTrackerResources()->LoadResource(
				B_VECTOR_ICON_TYPE,
				fTrashFull ? R_TrashFullIcon : R_TrashIcon, &vectorSize);

			if (vectorData) {
				trashDir.WriteAttr(kAttrIcon, B_VECTOR_ICON_TYPE, 0,
					vectorData, vectorSize);
			} else
				TRESPASS();
#endif

			if (largeData) {
				trashDir.WriteAttr(kAttrLargeIcon, 'ICON', 0,
					largeData, largeSize);
			} else
				TRESPASS();

			if (smallData) {
				trashDir.WriteAttr(kAttrMiniIcon, 'MICN', 0,
					smallData, smallSize);
			} else
				TRESPASS();
		}
	}
}
開發者ID:Barrett17,項目名稱:haiku-contacts-kit-old,代碼行數:49,代碼來源:TrashWatcher.cpp

示例4: copyTrespass

static void copyTrespass(
        short * /* dst */,
        const int *const * /* src */,
        unsigned /* nSamples */,
        unsigned /* nChannels */) {
    TRESPASS();
}
開發者ID:Hazy-legacy-zf2,項目名稱:platform_frameworks_av,代碼行數:7,代碼來源:FLACExtractor.cpp

示例5: switch

void TunnelRenderer::onMessageReceived(const sp<AMessage> &msg) {
    switch (msg->what()) {
        case kWhatQueueBuffer:
        {
            sp<ABuffer> buffer;
            CHECK(msg->findBuffer("buffer", &buffer));

            queueBuffer(buffer);

            if (mStreamSource == NULL) {
                if (mTotalBytesQueued > 0ll) {
                    initPlayer();
                } else {
                    ALOGI("Have %lld bytes queued...", mTotalBytesQueued);
                }
            } else {
                mStreamSource->doSomeWork();
            }
            break;
        }

        default:
            TRESPASS();
    }
}
開發者ID:3dsfr3ak,項目名稱:android_frameworks_av,代碼行數:25,代碼來源:TunnelRenderer.cpp

示例6: TRESPASS

int32
TQueryWalker::CountEntries()
{
	// should not be calling this
	TRESPASS();
	return -1;
}
開發者ID:mylegacy,項目名稱:haiku,代碼行數:7,代碼來源:NodeWalker.cpp

示例7: switch

void ARTSPConnection::onMessageReceived(const sp<AMessage> &msg) {
    switch (msg->what()) {
        case kWhatConnect:
            onConnect(msg);
            break;

        case kWhatDisconnect:
            onDisconnect(msg);
            break;

        case kWhatCompleteConnection:
            onCompleteConnection(msg);
            break;

        case kWhatSendRequest:
            onSendRequest(msg);
            break;

        case kWhatReceiveResponse:
            onReceiveResponse();
            break;

        case kWhatObserveBinaryData:
        {
            CHECK(msg->findMessage("reply", &mObserveBinaryMessage));
            break;
        }

        default:
            TRESPASS();
            break;
    }
}
開發者ID:ConicalRom,項目名稱:platform_frameworks_base,代碼行數:33,代碼來源:ARTSPConnection.cpp

示例8: switch

status_t DashPlayerDriver::seekTo(int msec) {
    int64_t seekTimeUs = msec * 1000ll;

    switch (mState) {
        case UNINITIALIZED:
            return INVALID_OPERATION;
        case STOPPED:
        {
            mStartupSeekTimeUs = seekTimeUs;
            break;
        }
        case PLAYING:
        case PAUSED:
        {
            mAtEOS = false;
            mPlayer->seekToAsync(seekTimeUs);
            break;
        }

        default:
            TRESPASS();
            break;
    }

    return OK;
}
開發者ID:GiggleKatDevs,項目名稱:GiggleKat_moto_msm8960jbbl,代碼行數:26,代碼來源:DashPlayerDriver.cpp

示例9: TRESPASS

bool
WidgetAttributeText::CommitEditedText(BTextView*)
{
	// can't do anything here at this point
	TRESPASS();
	return false;
}
開發者ID:looncraz,項目名稱:haiku,代碼行數:7,代碼來源:WidgetAttributeText.cpp

示例10: ALOGD

status_t TimedTextDriver::seekToAsync(int64_t timeUs) {
#ifdef MTK_AOSP_ENHANCEMENT
    ALOGD("%s() is called", __FUNCTION__);
#endif
    Mutex::Autolock autoLock(mLock);
    ALOGV("%s() is called", __FUNCTION__);
    switch (mState) {
        case UNINITIALIZED:
            return INVALID_OPERATION;
        case PREPARED:
            mPlayer->seekToAsync(timeUs);
            mPlayer->pause();
            mState = PAUSED;
            return OK;
        case PAUSED:
            mPlayer->seekToAsync(timeUs);
            mPlayer->pause();
            return OK;
        case PLAYING:
            mPlayer->seekToAsync(timeUs);
            return OK;
        defaut:
            TRESPASS();
    }
    return UNKNOWN_ERROR;
}
開發者ID:aurorarom,項目名稱:JsonUtil,代碼行數:26,代碼來源:TimedTextDriver.cpp

示例11: switch

// Called on GonkVideoDecoderManager::mManagerLooper thread.
void
GonkVideoDecoderManager::onMessageReceived(const sp<AMessage> &aMessage)
{
  switch (aMessage->what()) {
    case kNotifyCodecReserved:
    {
      // Our decode may have acquired the hardware resource that it needs
      // to start. Notify the state machine to resume loading metadata.
      GVDM_LOG("CodecReserved!");
      mReaderCallback->NotifyResourcesStatusChanged();
      break;
    }

    case kNotifyCodecCanceled:
    {
      mReaderCallback->ReleaseMediaResources();
      break;
    }

    case kNotifyPostReleaseBuffer:
    {
      ReleaseAllPendingVideoBuffers();
      break;
    }

    default:
      TRESPASS();
      break;
  }
}
開發者ID:Acidburn0zzz,項目名稱:tor-browser,代碼行數:31,代碼來源:GonkVideoDecoderManager.cpp

示例12: switch

void SimpleSoftOMXComponent::onSendCommand(
    OMX_COMMANDTYPE cmd, OMX_U32 param) {
    switch (cmd) {
    case OMX_CommandStateSet:
    {
        onChangeState((OMX_STATETYPE)param);
        break;
    }

    case OMX_CommandPortEnable:
    case OMX_CommandPortDisable:
    {
        onPortEnable(param, cmd == OMX_CommandPortEnable);
        break;
    }

    case OMX_CommandFlush:
    {
        onPortFlush(param, true /* sendFlushComplete */);
        break;
    }

    default:
        TRESPASS();
        break;
    }
}
開發者ID:google-aosp,項目名稱:frameworks_av,代碼行數:27,代碼來源:SimpleSoftOMXComponent.cpp

示例13: TRESPASS

bool ARTSPConnection::notifyResponseListener(
        const sp<ARTSPResponse> &response) {
    ssize_t i = response->mHeaders.indexOfKey("cseq");

    if (i < 0) {
        return true;
    }

    AString value = response->mHeaders.valueAt(i);

    unsigned long cseq;
    if (!ParseSingleUnsignedLong(value.c_str(), &cseq)) {
        return false;
    }

    i = mPendingRequests.indexOfKey(cseq);

    if (i < 0) {
        // Unsolicited response?
        TRESPASS();
    }

    sp<AMessage> reply = mPendingRequests.valueAt(i);
    mPendingRequests.removeItemsAt(i);

    reply->setInt32("result", OK);
    reply->setObject("response", response);
    reply->post();

    return true;
}
開發者ID:ConicalRom,項目名稱:platform_frameworks_base,代碼行數:31,代碼來源:ARTSPConnection.cpp

示例14: if

void
TBarWindow::MenusBeginning()
{
	BPath path;
	entry_ref ref;
	BEntry entry;

	if (GetDeskbarSettingsDirectory(path) == B_OK
		&& path.Append(kDeskbarMenuEntriesFileName) == B_OK
		&& entry.SetTo(path.Path(), true) == B_OK
		&& entry.Exists()
		&& entry.GetRef(&ref) == B_OK) {
		sDeskbarMenu->SetNavDir(&ref);
	} else if (GetDeskbarDataDirectory(path) == B_OK
		&& path.Append(kDeskbarMenuEntriesFileName) == B_OK
		&& entry.SetTo(path.Path(), true) == B_OK
		&& entry.Exists()
		&& entry.GetRef(&ref) == B_OK) {
		sDeskbarMenu->SetNavDir(&ref);
	} else {
		//	this really should never happen
		TRESPASS();
		return;
	}

	sDeskbarMenu->ResetTargets();

	fShowingMenu = true;
	BWindow::MenusBeginning();
}
開發者ID:looncraz,項目名稱:haiku,代碼行數:30,代碼來源:BarWindow.cpp

示例15: CHECK_EQ

void SimpleSoftOMXComponent::onChangeState(OMX_STATETYPE state) {
    // We shouldn't be in a state transition already.
    CHECK_EQ((int)mState, (int)mTargetState);

    switch (mState) {
    case OMX_StateLoaded:
        CHECK_EQ((int)state, (int)OMX_StateIdle);
        break;
    case OMX_StateIdle:
        CHECK(state == OMX_StateLoaded || state == OMX_StateExecuting);
        break;
    case OMX_StateExecuting:
    {
        CHECK_EQ((int)state, (int)OMX_StateIdle);

        for (size_t i = 0; i < mPorts.size(); ++i) {
            onPortFlush(i, false /* sendFlushComplete */);
        }

        mState = OMX_StateIdle;
        notify(OMX_EventCmdComplete, OMX_CommandStateSet, state, NULL);
        break;
    }

    default:
        TRESPASS();
    }

    mTargetState = state;

    checkTransitions();
}
開發者ID:google-aosp,項目名稱:frameworks_av,代碼行數:32,代碼來源:SimpleSoftOMXComponent.cpp


注:本文中的TRESPASS函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。