• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Looper函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Looper函数的典型用法代码示例。如果您正苦于以下问题:C++ Looper函数的具体用法?C++ Looper怎么用?C++ Looper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Looper函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Looper

status_t TVideoEditorText::Archive(BMessage* data, bool deep) const
{

	status_t myErr;

	Looper()->Lock();

	// Start by calling inherited archive
	myErr = BView::Archive(data, deep);

	if (myErr == B_OK) {
		// Add our class name to the archive
		data->AddString("class", "TVideoEditorText");

		// Add our member variables to the BMessage
		data->AddInt32("MessageID", fMessageID);
		data->AddFloat("TextSize", fTextSize);
		data->AddData("Font", B_ANY_TYPE, &fFont, sizeof(BFont) );
		data->AddData("Color", B_RGB_COLOR_TYPE, &fColor, sizeof(rgb_color) );
	}

	Looper()->Unlock();

	return myErr;
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:25,代码来源:TVideoEditorText.cpp


示例2: Looper

status_t TStageWindow::Archive(BMessage *data, bool deep) const
{		
	status_t myErr;
	
	Looper()->Lock();
	
	// Start by calling inherited archive
	myErr = BWindow::Archive(data, deep);
						
	if (myErr == B_OK)
	{					
		// Add our class name to the archive
		data->AddString("class", "TStageWindow");
		
		// Add our member variables to the archive		
				
		// Add attached views
		if (deep)
		{					
			//	StageView			
			if (m_StageView)
			{		
				BMessage childArchive;				
				if ( m_StageView->Archive(&childArchive, deep) == B_OK )
					data->AddMessage("StageView", &childArchive);
			}			
		}		
	}
	
	Looper()->Unlock();
	
	return myErr;
	
}	
开发者ID:ModeenF,项目名称:UltraDV,代码行数:34,代码来源:TStageWindow.cpp


示例3: Looper

void
BTitleView::MouseMoved(BPoint where, uint32 code, const BMessage *message)
{
	if (fTrackingState != NULL) {
		int32 buttons = 0;
		if (Looper() != NULL && Looper()->CurrentMessage() != NULL)
			Looper()->CurrentMessage()->FindInt32("buttons", &buttons);
		fTrackingState->MouseMoved(where, buttons);
		return;
	}

	switch (code) {
		default:
			if (InColumnResizeArea(where) && Window()->IsActive())
				SetViewCursor(&fHorizontalResizeCursor);
			else
				SetViewCursor(B_CURSOR_SYSTEM_DEFAULT);
			break;
			
		case B_EXITED_VIEW:
			SetViewCursor(B_CURSOR_SYSTEM_DEFAULT);
			break;
	}
	_inherited::MouseMoved(where, code, message);
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:25,代码来源:TitleView.cpp


示例4: Looper

/*!	Since we have set a mouse event mask, we don't want to forward all
	mouse downs to the slider - instead, we only invoke it, which causes a
	message to our target. Within the VolumeWindow, this will actually
	cause the window to close.
	Also, we need to mask out the dragger in this case, or else dragging
	us will also cause a volume update.
*/
void
VolumeControl::MouseDown(BPoint where)
{
	// Ignore clicks on the dragger
	int32 viewToken;
	if (Bounds().Contains(where) && Looper()->CurrentMessage() != NULL
		&& Looper()->CurrentMessage()->FindInt32("_view_token",
				&viewToken) == B_OK
		&& viewToken != _get_object_token_(this))
		return;

	// TODO: investigate why this does not work as expected (the dragger
	// frame seems to be off)
#if 0
	if (BView* dragger = ChildAt(0)) {
		if (!dragger->IsHidden() && dragger->Frame().Contains(where))
			return;
	}
#endif

	if (!IsEnabled() || !Bounds().Contains(where)) {
		Invoke();
		return;
	}

	BSlider::MouseDown(where);
}
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:34,代码来源:VolumeControl.cpp


示例5: Looper

status_t TCueSheetTimeView::Archive(BMessage *data, bool deep) const
{
		
	status_t myErr;
	
	Looper()->Lock();
	
	// Start by calling inherited archive
	myErr = BView::Archive(data, deep);
						
	if (myErr == B_OK)
	{					
		// Add our class name to the archive
		data->AddString("class", "TCueSheetTimeView");
		
		// Add our member variables to the archive		
				
		// Add attached views
		if (deep)
		{		
		
		}		
	}
	
	Looper()->Unlock();	
	
	return myErr;
}
开发者ID:ModeenF,项目名称:UltraDV,代码行数:28,代码来源:TCueSheetTimeView.cpp


示例6: BEntry

status_t TaskFS::Load(void)
{
	status_t err = B_OK;
	BEntry *tmpEntry = new BEntry();
	TaskList	*newTaskList	= NULL;
	Task		*newTask		= NULL;
	tasks->MakeEmpty();
	taskLists->MakeEmpty();
	while (tasksDir.GetNextEntry(tmpEntry, false) == B_OK) {
		if (tmpEntry->IsDirectory()){
			newTaskList = DirectoryToList(tmpEntry);
			if (newTaskList != NULL){
				BMessage *msg = new BMessage();
				msg->AddPointer("tasklist",newTaskList);
				Looper()->SendNotices(ADD_TASK_LIST,msg);
				taskLists->AddItem(newTaskList);
			}
		}
	}
	while (tasksDir.GetNextEntry(tmpEntry, false) == B_OK) {
		if (tmpEntry->IsDirectory()){
			newTaskList = DirectoryToList(tmpEntry);
			if (newTaskList != NULL){
				BMessage *msg = new BMessage();
				msg->AddPointer("tasklist",newTaskList);
				Looper()->SendNotices(ADD_TASK_LIST,msg);
				taskLists->AddItem(newTaskList);
			}
		}
	}
	tasksDir.Rewind();
	return err;
}
开发者ID:Paradoxianer,项目名称:Tasks,代码行数:33,代码来源:TaskFS.cpp


示例7: Looper

status_t TExportZone::Archive(BMessage *data, bool deep) const
{
		
	status_t myErr;
	
	Looper()->Lock();
	
	// Start by calling inherited archive
	myErr = BView::Archive(data, deep);
						
	if (myErr == B_OK)
	{					
		// Add our class name to the archive
		data->AddString("class", "TExportZone");
		
		// Add our member variables to the archive		
		data->AddRect("ExportChannel", m_ExportChannel);
		data->AddRect("InRect", m_InRect);
		data->AddRect("OutRect", m_OutRect);

		// Add attached views
		if (deep)
		{		
		
		}		
	}
	
	Looper()->Unlock();	
	
	return myErr;
}
开发者ID:ModeenF,项目名称:UltraDV,代码行数:31,代码来源:TExportZone.cpp


示例8: sprintf

void TVideoEditorText::SetText(char* theText)
{
	sprintf(fText, theText);
	Looper()->Lock();
	Invalidate();
	Looper()->Unlock();
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:7,代码来源:TVideoEditorText.cpp


示例9: looper

void NetPrefsServerView::SetNetworkData(BMessage* msg)
{
	// this shouldn't theoretically be able to happen but better safe than sorry
	BLooper* looper(Looper());
	if (looper == NULL) return;

	BAutolock lock(Looper());
	if (!lock.IsLocked()) return;
	// clear previous servers (if any)
	while (fServerList->CountRows() > 0) {
		BRow* row(fServerList->RowAt(0));
		fServerList->RemoveRow(row);
		delete row;
	}

	BString netString(S_PREFSERVER_SEL_STRING);
	netString += msg->FindString("name");
	netString += ":";
	type_code type;
	int32 count;
	ssize_t size;
	const ServerData* data;
	msg->GetInfo("server", &type, &count);
	for (int32 i = 0; i < count; i++) {
		msg->FindData("server", B_ANY_TYPE, i, reinterpret_cast<const void**>(&data), &size);
		AddServer(data);
	}
	fActiveNetwork = msg;
	fSelectTitleString->SetText(netString.String());
	fSelectTitleString->ResizeToPreferred();
}
开发者ID:carriercomm,项目名称:Vision,代码行数:31,代码来源:NetPrefsServerView.cpp


示例10: Looper

status_t TCueSheetWindow::Archive(BMessage* data, bool deep) const
{

	status_t myErr;

	Looper()->Lock();

	// Start by calling inherited archive
	myErr = BWindow::Archive(data, deep);

	if (myErr == B_OK) {
		// Add our class name to the archive
		data->AddString("class", "TCueSheetWindow");

		// Add our member variables to the archive

		// Add attached views
		if (deep) {
			//	Archive StageWindow
			BMessage stageArchive;
			fStageWindow->Archive(&stageArchive, true);
			data->AddMessage("StageWindow", &stageArchive);

		}
	}


	Looper()->Unlock();

	return myErr;
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:31,代码来源:TCueSheetWindow.cpp


示例11: Looper

void FSPanel::CheckCB()
{
	F83_RB->SetEnabled(GetISO9660());
	F31_RB->SetEnabled(GetISO9660());
	F37_RB->SetEnabled(GetISO9660());

	Joliet_CB->SetEnabled(GetISO9660());
	RockRidge_CB->SetEnabled(GetISO9660());
	HFS_CB->SetEnabled(GetISO9660());
	mappingCB->SetEnabled((HFS_CB->Value() == B_CONTROL_ON) && (HFS_CB->IsEnabled()));

	Looper()->PostMessage(JOLIET_CB_MSG, this);
	Looper()->PostMessage(ROCKRIDGE_CB_MSG, this);
	Looper()->PostMessage(MAPPING_CB_MSG, this);

	if (UDF_CB->IsEnabled()) {
		UDFDef_RB->SetEnabled(GetUDF());
		UDFDVD_RB->SetEnabled(GetUDF());
	} else {
		UDFDef_RB->SetEnabled(false);
		UDFDVD_RB->SetEnabled(false);
	}

	if (ISO9660_CB->Value() == B_CONTROL_OFF && UDF_CB->Value() == B_CONTROL_OFF &&
		BFS_CB->Value() == B_CONTROL_OFF) {

		BFS_CB->SetValue(B_CONTROL_ON);
		CheckCB();
	}
}
开发者ID:HaikuArchives,项目名称:Helios,代码行数:30,代码来源:FSPanel.cpp


示例12: switch

void
ClipView::KeyDown(const char* bytes, int32 numBytes)
{
	switch (bytes[0]) {
		case B_DELETE:
		{
			ClipItem* currentClip
				= dynamic_cast<ClipItem *>(ItemAt(CurrentSelection()));
			BMessage message(DELETE);
			message.AddPointer("clip", currentClip);
			Looper()->PostMessage(&message);
			break;
		}
		case B_LEFT_ARROW:
		case B_RIGHT_ARROW:
		{
			BMessage message(SWITCHLIST);
			message.AddInt32("listview", (int32)0);
			Looper()->PostMessage(&message);
			break;
		}
		default:
		{
			BListView::KeyDown(bytes, numBytes);
			break;
		}
	}
}
开发者ID:humdingerb,项目名称:clipdinger,代码行数:28,代码来源:ClipView.cpp


示例13: printf

status_t VBoxClipboardService::_ServiceThread()
{
    printf("VBoxClipboardService::%s()\n", __FUNCTION__);

    /* The thread waits for incoming messages from the host. */
    for (;;)
    {
        uint32_t u32Msg;
        uint32_t u32Formats;
        int rc = VbglR3ClipboardGetHostMsg(fClientId, &u32Msg, &u32Formats);
        if (RT_SUCCESS(rc))
        {
            switch (u32Msg)
            {
                case VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS:
                {
                    /*
                     * The host has announced available clipboard formats. Forward
                     * the information to the handler.
                     */
                    LogRelFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS u32Formats=%x\n", u32Formats));
                    BMessage msg(VBOX_GUEST_CLIPBOARD_HOST_MSG_FORMATS);
                    msg.AddInt32("Formats", (uint32)u32Formats);
                    Looper()->PostMessage(&msg, this);
                    break;
                }

                case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA:
                {
                    /* The host needs data in the specified format. */
                    LogRelFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA u32Formats=%x\n", u32Formats));
                    BMessage msg(VBOX_GUEST_CLIPBOARD_HOST_MSG_READ_DATA);
                    msg.AddInt32("Formats", (uint32)u32Formats);
                    Looper()->PostMessage(&msg, this);
                    break;
                }

                case VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT:
                {
                    /* The host is terminating. */
                    LogRelFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT\n"));
                    fExiting = true;
                    return VERR_INTERRUPTED;
                }

                default:
                    Log(("VBoxClipboardService::%s: Unsupported message from host! Message = %u\n", __FUNCTION__, u32Msg));
            }
        }
        else
            fExiting = true;

        LogRelFlow(("processed host event rc = %d\n", rc));

        if (fExiting)
            break;
    }
    return 0;
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:59,代码来源:VBoxClipboard.cpp


示例14: MouseDownComponent

void TTextControlComponent::MouseDown(BPoint point)
{
	if (Looper()->Lock())
	{
		MouseDownComponent("Component",DRAG_COMPONENT,this,point);
		Looper()->Unlock();
	}
}
开发者ID:HaikuArchives,项目名称:BeBuilder,代码行数:8,代码来源:TextControlComponent.cpp


示例15: MouseDownComponent

void TRadioButtonComponent::MouseDown(BPoint point)
{
	if (Looper()->Lock())
	{
		MouseDownComponent("Component",DRAG_COMPONENT,this,point);
		Looper()->Unlock();
	}
}
开发者ID:HaikuArchives,项目名称:BeBuilder,代码行数:8,代码来源:RadioButtonComponent.cpp


示例16: switch

void TMediaTabView::MessageReceived(BMessage* message)
{
	// Check for messages to switch the view
	bool buttonMsg = false;
	EChildID newView;
	switch (message->what)
	{
	case MEDIA_TAB_LIST_VIEW_MSG:
		newView = kElementsView;
		buttonMsg = true;
		break;
	case MEDIA_TAB_THUMBNAIL_VIEW_MSG:
		newView = kThumbnailView;
		buttonMsg = true;
		break;
	case MEDIA_TAB_ICON_VIEW_MSG:
		newView = kIconView;
		buttonMsg = true;
		break;
	}
	if (buttonMsg) {
		if (newView != fCurrentView) {
			// Protect this section of code.
			Looper()->Lock();

			DeactivateView(fCurrentView);
			fCurrentView = newView;
			ActivateView(fCurrentView);

			Looper()->Unlock();
		}

		return;
	}

	// Accept messages from the sorter object
	switch (message->what)
	{
	case SORTER_SELECT_MSG:
	case SORTER_INVOKE_MSG:
		if (fCurrentView == kElementsView)
			ChildAt(fCurrentView)->MessageReceived(message);
		return;

	// Some cue is adding an entry_ref to our browser
	// TODO: include the other two views in this. They can
	// have a new REF as well.
	case ADD_REF_MSG:
		if (fCurrentView == kElementsView)
			ChildAt(fCurrentView)->MessageReceived(message);
		return;
	}

	// Default handler
	BView::MessageReceived(message);
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:56,代码来源:TMediaTabView.cpp


示例17: ArpD

status_t ArpConfigureFile::StopWatcher(void)
{
    ArpD(cdb << ADH << "Stopping watcher..." << endl);
    status_t err = B_NO_ERROR;
    if( mNode != node_ref() ) {
        err = watch_node(&mNode, B_STOP_WATCHING, this);
    }
    if( Looper() ) Looper()->RemoveHandler(this);

    return err;
}
开发者ID:dtbinh,项目名称:Sequitur,代码行数:11,代码来源:ArpConfigureFile.cpp


示例18: Looper

void
MediaReplicant::MouseDown(BPoint point)
{
	int32 buttons = B_PRIMARY_MOUSE_BUTTON;
	if (Looper() != NULL && Looper()->CurrentMessage() != NULL)
		Looper()->CurrentMessage()->FindInt32("buttons", &buttons);

	BPoint where = ConvertToScreen(point);

	if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0) {
		BPopUpMenu* menu = new BPopUpMenu("", false, false);
		menu->SetFont(be_plain_font);

		menu->AddItem(new BMenuItem(
			B_TRANSLATE("Media preferences" B_UTF8_ELLIPSIS),
			new BMessage(kMsgOpenMediaSettings)));
		menu->AddItem(new BMenuItem(
			B_TRANSLATE("Sound preferences" B_UTF8_ELLIPSIS),
			new BMessage(kMsgOpenSoundSettings)));

		menu->AddSeparatorItem();

		menu->AddItem(new BMenuItem(B_TRANSLATE("Open MediaPlayer"),
			new BMessage(kMsgOpenMediaPlayer)));

		menu->AddSeparatorItem();

		BMenu* subMenu = new BMenu(B_TRANSLATE("Options"));
		menu->AddItem(subMenu);

		BMenuItem* item = new BMenuItem(B_TRANSLATE("Control physical output"),
			new BMessage(kMsgVolumeWhich));
		item->SetMarked(fVolumeWhich == VOLUME_USE_PHYS_OUTPUT);
		subMenu->AddItem(item);

		item = new BMenuItem(B_TRANSLATE("Beep"),
			new BMessage(kMsgToggleBeep));
		item->SetMarked(!fDontBeep);
		subMenu->AddItem(item);

		menu->SetTargetForItems(this);
		subMenu->SetTargetForItems(this);

		menu->Go(where, true, true, BRect(where - BPoint(4, 4),
			where + BPoint(4, 4)));
	} else {
		// Show VolumeWindow
		fVolumeSlider = new VolumeWindow(BRect(where.x, where.y,
			where.x + 207, where.y + 19), fDontBeep, fVolumeWhich);
		fVolumeSlider->Show();
	}
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:52,代码来源:MediaReplicant.cpp


示例19: printf

void TScrollViewComponent::MouseDown(BPoint point)
{
	printf("TScrollViewComponent::MouseDown X: %f Y: %f\n",point.x,point.y);

	if (Looper()->Lock())
	{
		MouseDownComponent("Component",DRAG_COMPONENT,this,point);	
		Looper()->Unlock();
	}
	//BPoint truc(0,0);
	FrameMoved(point);		
	
}
开发者ID:HaikuArchives,项目名称:BeBuilder,代码行数:13,代码来源:ScrollViewComponent.cpp


示例20: _KeyAt

void
KeyboardLayoutView::MouseDown(BPoint point)
{
	fClickPoint = point;
	fDragKey = NULL;
	fDropPoint.x = -1;

	Key* key = _KeyAt(point);
	if (key == NULL)
		return;

	int32 buttons = 0;
	if (Looper() != NULL && Looper()->CurrentMessage() != NULL)
		Looper()->CurrentMessage()->FindInt32("buttons", &buttons);

	if ((buttons & B_TERTIARY_MOUSE_BUTTON) != 0
		&& (fButtons & B_TERTIARY_MOUSE_BUTTON) == 0) {
		// toggle the "deadness" of dead keys via middle mouse button
		if (fKeymap != NULL) {
			bool isEnabled = false;
			uint8 deadKey
				= fKeymap->DeadKey(key->code, fModifiers, &isEnabled);
			if (deadKey > 0) {
				fKeymap->SetDeadKeyEnabled(key->code, fModifiers, !isEnabled);
				_InvalidateKey(key);
			}
		}
	} else {
		if (fKeymap != NULL && fKeymap->IsModifierKey(key->code)) {
			if (_KeyState(key->code)) {
				uint32 modifier = fKeymap->Modifier(key->code);
				if ((modifier & modifiers()) == 0) {
					_SetKeyState(key->code, false);
					fModifiers &= ~modifier;
					Invalidate();
				}
			} else {
				_SetKeyState(key->code, true);
				fModifiers |= fKeymap->Modifier(key->code);
				Invalidate();
			}

			// TODO: if possible, we could handle the lock keys for real
		} else {
			_SetKeyState(key->code, true);
			_InvalidateKey(key);
		}
	}

	fButtons = buttons;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:51,代码来源:KeyboardLayoutView.cpp



注:本文中的Looper函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Lt函数代码示例发布时间:2022-05-30
下一篇:
C++ Loop函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap