本文整理汇总了C++中BContainerWindow::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ BContainerWindow::Init方法的具体用法?C++ BContainerWindow::Init怎么用?C++ BContainerWindow::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BContainerWindow
的用法示例。
在下文中一共展示了BContainerWindow::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: entry
void
TTracker::ReadyToRun()
{
gStatusWindow = new BStatusWindow();
InitMimeTypes();
InstallDefaultTemplates();
InstallIndices();
InstallTemporaryBackgroundImages();
fTrashWatcher = new BTrashWatcher();
fTrashWatcher->Run();
fClipboardRefsWatcher = new BClipboardRefsWatcher();
fClipboardRefsWatcher->Run();
fTaskLoop = new StandAloneTaskLoop(true);
// open desktop window
BContainerWindow *deskWindow = NULL;
BDirectory deskDir;
if (FSGetDeskDir(&deskDir) == B_OK) {
// create desktop
BEntry entry;
deskDir.GetEntry(&entry);
Model *model = new Model(&entry, true);
if (model->InitCheck() == B_OK) {
AutoLock<WindowList> lock(&fWindowList);
deskWindow = new BDeskWindow(&fWindowList);
AutoLock<BWindow> windowLock(deskWindow);
deskWindow->CreatePoseView(model);
deskWindow->Init();
if (TrackerSettings().ShowDisksIcon()) {
// create model for root of everything
BEntry entry("/");
Model model(&entry);
if (model.InitCheck() == B_OK) {
// add the root icon to desktop window
BMessage message;
message.what = B_NODE_MONITOR;
message.AddInt32("opcode", B_ENTRY_CREATED);
message.AddInt32("device", model.NodeRef()->device);
message.AddInt64("node", model.NodeRef()->node);
message.AddInt64("directory", model.EntryRef()->directory);
message.AddString("name", model.EntryRef()->name);
deskWindow->PostMessage(&message, deskWindow->PoseView());
}
}
} else
delete model;
}
// kick off building the mime type list for find panels, etc.
fMimeTypeList = new MimeTypeList();
if (!BootedInSafeMode()) {
// kick of transient query killer
DeleteTransientQueriesTask::StartUpTransientQueryCleaner();
// the mount_server will have mounted the previous volumes already.
_OpenPreviouslyOpenedWindows();
}
}
示例2: entry
void
TTracker::ReadyToRun()
{
gStatusWindow = new BStatusWindow();
InitMimeTypes();
InstallDefaultTemplates();
InstallIndices();
HideVarDir();
fTrashWatcher = new BTrashWatcher();
fTrashWatcher->Run();
fClipboardRefsWatcher = new BClipboardRefsWatcher();
fClipboardRefsWatcher->Run();
fAutoMounter = new AutoMounter();
fAutoMounter->Run();
fTaskLoop = new StandAloneTaskLoop(true);
bool openDisksWindow = false;
// open desktop window
BContainerWindow *deskWindow = NULL;
BVolume bootVol;
BVolumeRoster().GetBootVolume(&bootVol);
BDirectory deskDir;
if (FSGetDeskDir(&deskDir, bootVol.Device()) == B_OK) {
// create desktop
BEntry entry;
deskDir.GetEntry(&entry);
Model *model = new Model(&entry);
if (model->InitCheck() == B_OK) {
AutoLock<WindowList> lock(&fWindowList);
deskWindow = new BDeskWindow(&fWindowList);
AutoLock<BWindow> windowLock(deskWindow);
deskWindow->CreatePoseView(model);
deskWindow->Init();
} else
delete model;
// open previously open windows
attr_info attrInfo;
if (!BootedInSafeMode()
&& deskDir.GetAttrInfo(kAttrOpenWindows, &attrInfo) == B_OK) {
char *buffer = (char *)malloc((size_t)attrInfo.size);
BMessage message;
if (deskDir.ReadAttr(kAttrOpenWindows, B_MESSAGE_TYPE, 0, buffer, (size_t)attrInfo.size)
== attrInfo.size
&& message.Unflatten(buffer) == B_OK) {
node_ref nodeRef;
deskDir.GetNodeRef(&nodeRef);
int32 stateMessageCounter = 0;
const char *path;
for (int32 outer = 0;message.FindString("paths", outer, &path) == B_OK;outer++) {
int8 flags = 0;
for (int32 inner = 0;message.FindInt8(path, inner, &flags) == B_OK;inner++) {
BEntry entry(path, true);
if (entry.InitCheck() == B_OK) {
Model *model = new Model(&entry);
if (model->InitCheck() == B_OK && model->IsContainer()) {
BMessage state;
bool restoreStateFromMessage = false;
if ((flags & kOpenWindowHasState) != 0
&& message.FindMessage("window state", stateMessageCounter++, &state) == B_OK)
restoreStateFromMessage = true;
if (restoreStateFromMessage)
OpenContainerWindow(model, 0, kOpen,
kRestoreWorkspace | (flags & kOpenWindowMinimized ? kIsHidden : 0U),
false, &state);
else
OpenContainerWindow(model, 0, kOpen,
kRestoreWorkspace | (flags & kOpenWindowMinimized ? kIsHidden : 0U));
} else
delete model;
}
}
}
if (message.HasBool("open_disks_window"))
openDisksWindow = true;
}
free(buffer);
}
}
// create model for root of everything
if (deskWindow) {
BEntry entry("/");
Model model(&entry);
if (model.InitCheck() == B_OK) {
if (TrackerSettings().ShowDisksIcon()) {
// add the root icon to desktop window
BMessage message;
message.what = B_NODE_MONITOR;
//.........这里部分代码省略.........