本文整理汇总了C++中BContainerWindow::Workspaces方法的典型用法代码示例。如果您正苦于以下问题:C++ BContainerWindow::Workspaces方法的具体用法?C++ BContainerWindow::Workspaces怎么用?C++ BContainerWindow::Workspaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BContainerWindow
的用法示例。
在下文中一共展示了BContainerWindow::Workspaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreStateMessage
void
TTracker::OpenContainerWindow(Model *model, BMessage *originalRefsList,
OpenSelector openSelector, uint32 openFlags, bool checkAlreadyOpen,
const BMessage *stateMessage)
{
AutoLock<WindowList> lock(&fWindowList);
BContainerWindow *window = NULL;
if (checkAlreadyOpen && openSelector != kRunOpenWithWindow)
// find out if window already open
window = FindContainerWindow(model->NodeRef());
bool someWindowActivated = false;
uint32 workspace = (uint32)(1 << current_workspace());
int32 windowCount = 0;
while (window) {
// At least one window open, just pull to front
// make sure we don't jerk workspaces around
uint32 windowWorkspaces = window->Workspaces();
if (windowWorkspaces & workspace) {
window->Activate();
someWindowActivated = true;
}
window = FindContainerWindow(model->NodeRef(), ++windowCount);
}
if (someWindowActivated) {
delete model;
return;
} // If no window was actiated, (none in the current workspace
// we open a new one.
if (openSelector == kRunOpenWithWindow) {
BMessage *refList = NULL;
if (!originalRefsList) {
// when passing just a single model, stuff it's entry in a single
// element list anyway
ASSERT(model);
refList = new BMessage;
refList->AddRef("refs", model->EntryRef());
delete model;
model = NULL;
} else
// clone the message, window adopts it for it's own use
refList = new BMessage(*originalRefsList);
window = new OpenWithContainerWindow(refList, &fWindowList);
} else if (model->IsRoot()) {
// window will adopt the model
window = new BVolumeWindow(&fWindowList, openFlags);
} else if (model->IsQuery()) {
// window will adopt the model
window = new BQueryContainerWindow(&fWindowList, openFlags);
} else
// window will adopt the model
window = new BContainerWindow(&fWindowList, openFlags);
if (model)
window->CreatePoseView(model);
BMessage restoreStateMessage(kRestoreState);
if (stateMessage)
restoreStateMessage.AddMessage("state", stateMessage);
window->PostMessage(&restoreStateMessage);
}
示例2: restoreStateMessage
void
TTracker::OpenContainerWindow(Model* model, BMessage* originalRefsList,
OpenSelector openSelector, uint32 openFlags, bool checkAlreadyOpen,
const BMessage* stateMessage)
{
AutoLock<WindowList> lock(&fWindowList);
BContainerWindow* window = NULL;
const node_ref* modelNodeRef = model->NodeRef();
if (checkAlreadyOpen && openSelector != kRunOpenWithWindow) {
// find out if window already open
window = FindContainerWindow(modelNodeRef);
}
bool someWindowActivated = false;
uint32 workspace = (uint32)(1 << current_workspace());
int32 windowCount = 0;
while (window != NULL) {
if ((window->Workspaces() & workspace) != 0
&& (dynamic_cast<BDeskWindow*>(window) == NULL
|| !TrackerSettings().SingleWindowBrowse())) {
// We found at least one window that is open and is not Desktop
// or we're in spatial mode, activate it and make sure we don't
// jerk the workspaces around.
window->Activate();
someWindowActivated = true;
}
window = FindContainerWindow(model->NodeRef(), ++windowCount);
}
if (someWindowActivated) {
delete model;
return;
}
// If no window was activated (none in the current workspace),
// we open a new one.
if (openSelector == kRunOpenWithWindow) {
BMessage* refList = NULL;
if (originalRefsList == NULL) {
// when passing just a single model, stuff it's entry in a single
// element list anyway
ASSERT(model != NULL);
refList = new BMessage;
refList->AddRef("refs", model->EntryRef());
delete model;
model = NULL;
} else {
// clone the message, window adopts it for it's own use
refList = new BMessage(*originalRefsList);
}
window = new OpenWithContainerWindow(refList, &fWindowList);
} else if (model->IsQuery()) {
// window will adopt the model
window = new BQueryContainerWindow(&fWindowList, openFlags);
} else if (model->IsVirtualDirectory()) {
// window will adopt the model
window = new VirtualDirectoryWindow(&fWindowList, openFlags);
} else {
// window will adopt the model
window = new BContainerWindow(&fWindowList, openFlags);
}
if (model != NULL)
window->CreatePoseView(model);
BMessage restoreStateMessage(kRestoreState);
if (stateMessage != NULL)
restoreStateMessage.AddMessage("state", stateMessage);
window->PostMessage(&restoreStateMessage);
}