当前位置: 首页>>代码示例>>C++>>正文


C++ BRoster::Launch方法代码示例

本文整理汇总了C++中BRoster::Launch方法的典型用法代码示例。如果您正苦于以下问题:C++ BRoster::Launch方法的具体用法?C++ BRoster::Launch怎么用?C++ BRoster::Launch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BRoster的用法示例。


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

示例1: LgiExecute

bool LgiExecute(const char *File, const char *Args, const char *Dir, GAutoString *ErrorMsg)
{
	if (File)
	{
		char f[256];
		
		if (ValidStr(Dir))
		{
			sprintf(f, "%s/%s", Dir, File);
		}
		else
		{
			strcpy(f, File);
		}
	
		BRoster Roster;
		BEntry Entry(f);
		entry_ref Ref;
		if (Entry.GetRef(&Ref) == B_OK)
		{
			status_t s = B_ERROR;
			
			if (stricmp(f, "/BeOS") == 0 ||
				stricmp(f, "/") == 0 ||
				Entry.IsDirectory())
			{
				char *DirMimeType = "application/x-vnd.Be-directory";
				if (Roster.FindApp(DirMimeType, &Ref) == B_OK)
				{
					char *Arg[1] = {File};
					s = Roster.Launch(&Ref, 1, Arg);
				}
			}
			else
			{
				s = Roster.Launch(&Ref);
			}
			
			return s == B_OK || s == B_ALREADY_RUNNING;
		}
		else
		{
			if (strnicmp(File, "http://", 7) == 0)
			{
				if (Roster.FindApp("text/html", &Ref) == B_OK)
				{
					/*
					char *Arg[2] = {Ref.name, File};
					return Roster.Launch(&Ref, 2, Arg) == B_OK;
					*/
					char *Arg[1] = {File};
					status_t s = Roster.Launch(&Ref, 1, Arg);
					return s == B_OK || s == B_ALREADY_RUNNING;
				}
			}
		}
	}
	return false;
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:59,代码来源:GGeneral.cpp

示例2: mess

status_t
TBarView::SendDragMessage(const char* signature, entry_ref* ref)
{
	status_t err = B_ERROR;
	if (fDragMessage) {
		if (fRefsRcvdOnly) {
			// current message sent to apps is only B_REFS_RECEIVED
			fDragMessage->what = B_REFS_RECEIVED;
		}

		BRoster roster;
		if (signature && strlen(signature) > 0 && roster.IsRunning(signature)) {
			BMessenger mess(signature);
			// drag message is still owned by DB, copy is sent
			// can toss it after send
			err = mess.SendMessage(fDragMessage);
		} else if (ref) {
			FSLaunchItem((const entry_ref*)ref, (const BMessage*)fDragMessage,
				true, true);
		} else if (signature && strlen(signature) > 0) {
			roster.Launch(signature, fDragMessage);
		}
	}
	return err;
}
开发者ID:Barrett17,项目名称:haiku-contacts-kit-old,代码行数:25,代码来源:BarView.cpp

示例3: if


//.........这里部分代码省略.........
			int32 oldIconSize = fSettings.iconSize;
			int32 iconSize;
			if (message->FindInt32("be:value", &iconSize) != B_OK)
				break;

			fSettings.iconSize = iconSize * kIconSizeInterval;

			// pin icon size between min and max values
			if (fSettings.iconSize < kMinimumIconSize)
				fSettings.iconSize = kMinimumIconSize;
			else if (fSettings.iconSize > kMaximumIconSize)
				fSettings.iconSize = kMaximumIconSize;

			// don't resize if icon size hasn't changed
			if (fSettings.iconSize == oldIconSize)
				break;

			ResizeTeamIcons();

			if (fPreferencesWindow != NULL)
				fPreferencesWindow->PostMessage(kUpdatePreferences);

			// if mini mode we don't need to update the view
			if (fBarView->MiniState())
				break;

			fBarWindow->Lock();
			fBarView->SaveExpandedItems();
			if (!fBarView->Vertical()) {
				// Must also resize the Deskbar menu and replicant tray in
				// horizontal mode
				fBarView->PlaceDeskbarMenu();
				fBarView->PlaceTray(false, false);
			}
			fBarView->PlaceApplicationBar();
			fBarWindow->Unlock();
			break;
		}

		case 'TASK':
			fSwitcherMessenger.SendMessage(message);
			break;

		case kSuspendSystem:
			// TODO: Call BRoster?
			break;

		case kRebootSystem:
		case kShutdownSystem:
		{
			bool reboot = (message->what == kRebootSystem);
			bool confirm;
			message->FindBool("confirm", &confirm);

			BRoster roster;
			BRoster::Private rosterPrivate(roster);
			status_t error = rosterPrivate.ShutDown(reboot, confirm, false);
			if (error != B_OK)
				fprintf(stderr, "Shutdown failed: %s\n", strerror(error));

			break;
		}

		case kShowSplash:
			run_be_about();
			break;

		case kRestartTracker:
		{
			BRoster roster;
			roster.Launch(kTrackerSignature);
			break;
		}

		case B_LOCALE_CHANGED:
		{
			BLocaleRoster::Default()->Refresh();

			bool localize;
			if (message->FindBool("filesys", &localize) == B_OK)
				gLocalizedNamePreferred = localize;
		}
		// fall-through

		case kShowHideTime:
		case kShowSeconds:
		case kShowDayOfWeek:
		case kShowTimeZone:
		case kGetClockSettings:
			fStatusViewMessenger.SendMessage(message);
				// Notify the replicant tray (through BarView) that the time
				// interval has changed and it should update the time view
				// and reflow the tray icons.
			break;

		default:
			BApplication::MessageReceived(message);
			break;
	}
}
开发者ID:kbjava,项目名称:haiku,代码行数:101,代码来源:BarApp.cpp


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