Tracker: style fixes to ContainerWindow
This commit is contained in:
@@ -167,7 +167,7 @@ ActivateWindowFilter(BMessage*, BHandler** target, BMessageFilter*)
|
||||
|
||||
// activate the window if no PoseView or DraggableContainerIcon had been
|
||||
// pressed (those will activate the window themselves, if necessary)
|
||||
if (view
|
||||
if (view != NULL
|
||||
&& !dynamic_cast<BPoseView*>(view)
|
||||
&& !dynamic_cast<DraggableContainerIcon*>(view)
|
||||
&& view->Window())
|
||||
@@ -310,7 +310,7 @@ AddMimeTypeString(BObjectList<BString> &list, Model* model)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - DraggableContainerIcon
|
||||
|
||||
|
||||
DraggableContainerIcon::DraggableContainerIcon(BRect rect, const char* name,
|
||||
@@ -519,7 +519,7 @@ DraggableContainerIcon::Draw(BRect updateRect)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BContainerWindow
|
||||
|
||||
|
||||
BContainerWindow::BContainerWindow(LockingList<BWindow>* list,
|
||||
@@ -1064,7 +1064,7 @@ BContainerWindow::RestoreStateCommon()
|
||||
WindowStateNodeOpener opener(this, false);
|
||||
|
||||
bool isDesktop = dynamic_cast<BDeskWindow*>(this) != NULL;
|
||||
if (!TargetModel()->IsRoot() && opener.Node()) {
|
||||
if (!TargetModel()->IsRoot() && opener.Node() != NULL) {
|
||||
// don't pick up background image for root disks
|
||||
// to do this, would have to have a unique attribute for the
|
||||
// disks window that doesn't collide with the desktop
|
||||
@@ -1115,7 +1115,7 @@ BContainerWindow::UpdateBackgroundImage()
|
||||
bool isDesktop = dynamic_cast<BDeskWindow*>(this) != NULL;
|
||||
WindowStateNodeOpener opener(this, false);
|
||||
|
||||
if (!TargetModel()->IsRoot() && opener.Node()) {
|
||||
if (!TargetModel()->IsRoot() && opener.Node() != NULL) {
|
||||
fBackgroundImage = BackgroundImage::Refresh(fBackgroundImage,
|
||||
opener.Node(), isDesktop, PoseView());
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ BContainerWindow::SaveState(bool hide)
|
||||
{
|
||||
if (SaveStateIsEnabled()) {
|
||||
WindowStateNodeOpener opener(this, true);
|
||||
if (opener.StreamNode())
|
||||
if (opener.StreamNode() != NULL)
|
||||
SaveWindowState(opener.StreamNode());
|
||||
|
||||
if (hide)
|
||||
@@ -1729,6 +1729,7 @@ BContainerWindow::MessageReceived(BMessage* message)
|
||||
|
||||
default:
|
||||
_inherited::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1742,13 +1743,15 @@ BContainerWindow::MessageReceived(BMessage* message)
|
||||
FSUndo();
|
||||
break;
|
||||
|
||||
//case B_REDO: // only defined in Dano/Zeta/OpenBeOS
|
||||
//case B_REDO:
|
||||
// only defined in Dano/Zeta/OpenBeOS
|
||||
case kRedo:
|
||||
FSRedo();
|
||||
break;
|
||||
|
||||
default:
|
||||
_inherited::MessageReceived(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3185,10 +3188,10 @@ BContainerWindow::UpdateMenu(BMenu* menu, UpdateMenuContext context)
|
||||
EnableNamedMenuItem(menu, B_SELECT_ALL, count > 0);
|
||||
|
||||
BMenuItem* item = menu->FindItem(B_TRANSLATE("New"));
|
||||
if (item) {
|
||||
if (item != NULL) {
|
||||
TemplatesMenu* templateMenu = dynamic_cast<TemplatesMenu*>
|
||||
(item->Submenu());
|
||||
if (templateMenu)
|
||||
if (templateMenu != NULL)
|
||||
templateMenu->UpdateMenuState();
|
||||
}
|
||||
}
|
||||
@@ -3661,9 +3664,10 @@ BContainerWindow::NeedsDefaultStateSetup()
|
||||
return false;
|
||||
|
||||
WindowStateNodeOpener opener(this, false);
|
||||
if (!opener.StreamNode())
|
||||
if (opener.StreamNode() == NULL) {
|
||||
// can't read state, give up
|
||||
return false;
|
||||
}
|
||||
|
||||
return !NodeHasSavedState(opener.Node());
|
||||
}
|
||||
@@ -3736,7 +3740,7 @@ BContainerWindow::SetUpDefaultState()
|
||||
|
||||
WindowStateNodeOpener opener(this, true);
|
||||
// this is our destination node, whatever it is for this window
|
||||
if (!opener.StreamNode())
|
||||
if (opener.StreamNode() == NULL)
|
||||
return;
|
||||
|
||||
if (!TargetModel()->IsRoot()) {
|
||||
@@ -3806,7 +3810,7 @@ BContainerWindow::SetUpDefaultState()
|
||||
void
|
||||
BContainerWindow::RestoreWindowState(AttributeStreamNode* node)
|
||||
{
|
||||
if (node == NULL || dynamic_cast<BDeskWindow*>(this)) {
|
||||
if (node == NULL || dynamic_cast<BDeskWindow*>(this) != NULL) {
|
||||
// don't restore any window state if we are a desktop window
|
||||
return;
|
||||
}
|
||||
@@ -4218,14 +4222,15 @@ BContainerWindow::PopulateArrangeByMenu(BMenu* menu)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - WindowStateNodeOpener
|
||||
|
||||
|
||||
WindowStateNodeOpener::WindowStateNodeOpener(BContainerWindow* window,
|
||||
bool forWriting)
|
||||
: fModelOpener(NULL),
|
||||
fNode(NULL),
|
||||
fStreamNode(NULL)
|
||||
:
|
||||
fModelOpener(NULL),
|
||||
fNode(NULL),
|
||||
fStreamNode(NULL)
|
||||
{
|
||||
if (window->TargetModel() && window->TargetModel()->IsRoot()) {
|
||||
BDirectory dir;
|
||||
@@ -4314,12 +4319,13 @@ WindowStateNodeOpener::Node() const
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BackgroundView
|
||||
|
||||
|
||||
BackgroundView::BackgroundView(BRect frame)
|
||||
: BView(frame, "", B_FOLLOW_ALL,
|
||||
B_FRAME_EVENTS | B_WILL_DRAW | B_PULSE_NEEDED)
|
||||
:
|
||||
BView(frame, "", B_FOLLOW_ALL,
|
||||
B_FRAME_EVENTS | B_WILL_DRAW | B_PULSE_NEEDED)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -4431,4 +4437,3 @@ BackgroundView::Pulse()
|
||||
if (window)
|
||||
window->PulseTaskLoop();
|
||||
}
|
||||
|
||||
|
||||
+247
-227
@@ -56,14 +56,17 @@ class Model;
|
||||
class ModelNodeLazyOpener;
|
||||
class SelectionWindow;
|
||||
|
||||
|
||||
#define kDefaultFolderTemplate "DefaultFolderTemplate"
|
||||
|
||||
|
||||
extern const char* kAddOnsMenuName;
|
||||
|
||||
const window_feel kPrivateDesktopWindowFeel = window_feel(1024);
|
||||
const window_look kPrivateDesktopWindowLook = window_look(4);
|
||||
// this is a mirror of an app server private values
|
||||
|
||||
|
||||
enum {
|
||||
// flags that describe opening of the window
|
||||
kRestoreWorkspace = 0x1,
|
||||
@@ -72,302 +75,308 @@ enum {
|
||||
kRestoreDecor = 0x4
|
||||
};
|
||||
|
||||
|
||||
struct AddonShortcut {
|
||||
Model* model;
|
||||
char key;
|
||||
char defaultKey;
|
||||
uint32 modifiers;
|
||||
Model* model;
|
||||
char key;
|
||||
char defaultKey;
|
||||
uint32 modifiers;
|
||||
};
|
||||
|
||||
|
||||
class BContainerWindow : public BWindow {
|
||||
public:
|
||||
BContainerWindow(LockingList<BWindow>* windowList,
|
||||
uint32 containerWindowFlags,
|
||||
window_look look = B_DOCUMENT_WINDOW_LOOK,
|
||||
window_feel feel = B_NORMAL_WINDOW_FEEL,
|
||||
uint32 flags = B_WILL_ACCEPT_FIRST_CLICK
|
||||
| B_NO_WORKSPACE_ACTIVATION,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
public:
|
||||
BContainerWindow(LockingList<BWindow>* windowList,
|
||||
uint32 containerWindowFlags,
|
||||
window_look look = B_DOCUMENT_WINDOW_LOOK,
|
||||
window_feel feel = B_NORMAL_WINDOW_FEEL,
|
||||
uint32 flags = B_WILL_ACCEPT_FIRST_CLICK
|
||||
| B_NO_WORKSPACE_ACTIVATION,
|
||||
uint32 workspace = B_CURRENT_WORKSPACE);
|
||||
|
||||
virtual ~BContainerWindow();
|
||||
virtual ~BContainerWindow();
|
||||
|
||||
virtual void Init(const BMessage* message = NULL);
|
||||
virtual void Init(const BMessage* message = NULL);
|
||||
|
||||
static BRect InitialWindowRect(window_feel);
|
||||
static BRect InitialWindowRect(window_feel);
|
||||
|
||||
virtual void Minimize(bool minimize);
|
||||
virtual void Quit();
|
||||
virtual bool QuitRequested();
|
||||
virtual void Minimize(bool minimize);
|
||||
virtual void Quit();
|
||||
virtual bool QuitRequested();
|
||||
|
||||
virtual void UpdateIfTrash(Model*);
|
||||
virtual void UpdateIfTrash(Model*);
|
||||
|
||||
virtual void CreatePoseView(Model*);
|
||||
virtual void CreatePoseView(Model*);
|
||||
|
||||
virtual void ShowContextMenu(BPoint, const entry_ref*, BView*);
|
||||
virtual uint32 ShowDropContextMenu(BPoint);
|
||||
virtual void MenusBeginning();
|
||||
virtual void MenusEnded();
|
||||
virtual void MessageReceived(BMessage*);
|
||||
virtual void FrameResized(float, float);
|
||||
virtual void FrameMoved(BPoint);
|
||||
virtual void Zoom(BPoint, float, float);
|
||||
virtual void WorkspacesChanged(uint32, uint32);
|
||||
virtual void ShowContextMenu(BPoint, const entry_ref*, BView*);
|
||||
virtual uint32 ShowDropContextMenu(BPoint);
|
||||
virtual void MenusBeginning();
|
||||
virtual void MenusEnded();
|
||||
virtual void MessageReceived(BMessage*);
|
||||
virtual void FrameResized(float, float);
|
||||
virtual void FrameMoved(BPoint);
|
||||
virtual void Zoom(BPoint, float, float);
|
||||
virtual void WorkspacesChanged(uint32, uint32);
|
||||
|
||||
// virtuals that control setup of window
|
||||
virtual bool ShouldAddMenus() const;
|
||||
virtual bool ShouldAddScrollBars() const;
|
||||
virtual bool ShouldAddCountView() const;
|
||||
// virtuals that control setup of window
|
||||
virtual bool ShouldAddMenus() const;
|
||||
virtual bool ShouldAddScrollBars() const;
|
||||
virtual bool ShouldAddCountView() const;
|
||||
|
||||
virtual void CheckScreenIntersect();
|
||||
virtual void CheckScreenIntersect();
|
||||
|
||||
bool IsTrash() const;
|
||||
bool InTrash() const;
|
||||
bool IsPrintersDir() const;
|
||||
bool IsTrash() const;
|
||||
bool InTrash() const;
|
||||
bool IsPrintersDir() const;
|
||||
|
||||
virtual bool IsShowing(const node_ref*) const;
|
||||
virtual bool IsShowing(const entry_ref*) const;
|
||||
virtual bool IsShowing(const node_ref*) const;
|
||||
virtual bool IsShowing(const entry_ref*) const;
|
||||
|
||||
void ResizeToFit();
|
||||
void ResizeToFit();
|
||||
|
||||
Model* TargetModel() const;
|
||||
BPoseView* PoseView() const;
|
||||
BNavigator* Navigator() const;
|
||||
Model* TargetModel() const;
|
||||
BPoseView* PoseView() const;
|
||||
BNavigator* Navigator() const;
|
||||
|
||||
virtual void SelectionChanged();
|
||||
virtual void ViewModeChanged(uint32 oldMode, uint32 newMode);
|
||||
virtual void SelectionChanged();
|
||||
virtual void ViewModeChanged(uint32 oldMode, uint32 newMode);
|
||||
|
||||
virtual void RestoreState();
|
||||
virtual void RestoreState(const BMessage &);
|
||||
void RestoreStateCommon();
|
||||
virtual void SaveState(bool hide = true);
|
||||
virtual void SaveState(BMessage &) const;
|
||||
void UpdateTitle();
|
||||
virtual void RestoreState();
|
||||
virtual void RestoreState(const BMessage &);
|
||||
void RestoreStateCommon();
|
||||
virtual void SaveState(bool hide = true);
|
||||
virtual void SaveState(BMessage &) const;
|
||||
void UpdateTitle();
|
||||
|
||||
bool StateNeedsSaving() const;
|
||||
bool SaveStateIsEnabled() const;
|
||||
void SetSaveStateEnabled(bool);
|
||||
bool StateNeedsSaving() const;
|
||||
bool SaveStateIsEnabled() const;
|
||||
void SetSaveStateEnabled(bool);
|
||||
|
||||
void UpdateBackgroundImage();
|
||||
void UpdateBackgroundImage();
|
||||
|
||||
static status_t GetLayoutState(BNode*, BMessage*);
|
||||
static status_t SetLayoutState(BNode*, const BMessage*);
|
||||
// calls for inheriting window size, attribute layout, etc.
|
||||
// deprecated
|
||||
static status_t GetLayoutState(BNode*, BMessage*);
|
||||
static status_t SetLayoutState(BNode*, const BMessage*);
|
||||
// calls for inheriting window size, attribute layout, etc.
|
||||
// deprecated
|
||||
|
||||
virtual void AddMimeTypesToMenu(BMenu*);
|
||||
void AddMimeTypesToMenu();
|
||||
virtual void MarkAttributeMenu(BMenu*);
|
||||
void MarkAttributeMenu();
|
||||
void MarkArrangeByMenu(BMenu*);
|
||||
BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
|
||||
int32 type, float width, int32 align, bool editable,
|
||||
bool statField);
|
||||
BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
|
||||
int32 type, const char* displayAs, float width, int32 align,
|
||||
bool editable, bool statField);
|
||||
virtual void NewAttributeMenu(BMenu*);
|
||||
virtual void AddMimeTypesToMenu(BMenu*);
|
||||
void AddMimeTypesToMenu();
|
||||
virtual void MarkAttributeMenu(BMenu*);
|
||||
void MarkAttributeMenu();
|
||||
void MarkArrangeByMenu(BMenu*);
|
||||
BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
|
||||
int32 type, float width, int32 align, bool editable,
|
||||
bool statField);
|
||||
BMenuItem* NewAttributeMenuItem(const char* label, const char* name,
|
||||
int32 type, const char* displayAs, float width, int32 align,
|
||||
bool editable, bool statField);
|
||||
virtual void NewAttributeMenu(BMenu*);
|
||||
|
||||
void HideAttributeMenu();
|
||||
void ShowAttributeMenu();
|
||||
PiggybackTaskLoop* DelayedTaskLoop();
|
||||
// use for RunLater queueing
|
||||
void PulseTaskLoop();
|
||||
// called by some view that has pulse, either BackgroundView
|
||||
// or BPoseView
|
||||
void HideAttributeMenu();
|
||||
void ShowAttributeMenu();
|
||||
PiggybackTaskLoop* DelayedTaskLoop();
|
||||
// use for RunLater queueing
|
||||
void PulseTaskLoop();
|
||||
// called by some view that has pulse, either BackgroundView
|
||||
// or BPoseView
|
||||
|
||||
static bool DefaultStateSourceNode(const char* name, BNode* result,
|
||||
bool createNew = false, bool createFolder = true);
|
||||
static bool DefaultStateSourceNode(const char* name, BNode* result,
|
||||
bool createNew = false, bool createFolder = true);
|
||||
|
||||
// add-on iteration
|
||||
void EachAddon(bool (*)(const Model*, const char*, uint32 shortcut,
|
||||
uint32 modifiers, bool primary, void*), void*,
|
||||
BObjectList<BString> &);
|
||||
// add-on iteration
|
||||
void EachAddon(bool (*)(const Model*, const char*, uint32 shortcut,
|
||||
uint32 modifiers, bool primary, void*), void*,
|
||||
BObjectList<BString> &);
|
||||
|
||||
BPopUpMenu* ContextMenu();
|
||||
BPopUpMenu* ContextMenu();
|
||||
|
||||
// drag&drop support
|
||||
status_t DragStart(const BMessage*);
|
||||
void DragStop();
|
||||
bool Dragging() const;
|
||||
BMessage* DragMessage() const;
|
||||
// drag&drop support
|
||||
status_t DragStart(const BMessage*);
|
||||
void DragStop();
|
||||
bool Dragging() const;
|
||||
BMessage* DragMessage() const;
|
||||
|
||||
void ShowSelectionWindow();
|
||||
void ShowSelectionWindow();
|
||||
|
||||
void ShowNavigator(bool);
|
||||
void SetSingleWindowBrowseShortcuts(bool);
|
||||
void ShowNavigator(bool);
|
||||
void SetSingleWindowBrowseShortcuts(bool);
|
||||
|
||||
void SetPathWatchingEnabled(bool);
|
||||
bool IsPathWatchingEnabled(void) const;
|
||||
void SetPathWatchingEnabled(bool);
|
||||
bool IsPathWatchingEnabled(void) const;
|
||||
|
||||
protected:
|
||||
virtual BPoseView* NewPoseView(Model*, BRect, uint32);
|
||||
// instantiate a different flavor of BPoseView for different
|
||||
// ContainerWindows
|
||||
protected:
|
||||
virtual BPoseView* NewPoseView(Model*, BRect, uint32);
|
||||
// instantiate a different flavor of BPoseView for different
|
||||
// ContainerWindows
|
||||
|
||||
virtual void RestoreWindowState(AttributeStreamNode*);
|
||||
virtual void RestoreWindowState(const BMessage &);
|
||||
virtual void SaveWindowState(AttributeStreamNode*);
|
||||
virtual void SaveWindowState(BMessage&) const;
|
||||
virtual void RestoreWindowState(AttributeStreamNode*);
|
||||
virtual void RestoreWindowState(const BMessage &);
|
||||
virtual void SaveWindowState(AttributeStreamNode*);
|
||||
virtual void SaveWindowState(BMessage&) const;
|
||||
|
||||
virtual bool NeedsDefaultStateSetup();
|
||||
virtual void SetUpDefaultState();
|
||||
// these two virtuals control setting up a new folder that
|
||||
// does not have any state settings yet with the default
|
||||
virtual bool NeedsDefaultStateSetup();
|
||||
virtual void SetUpDefaultState();
|
||||
// these two virtuals control setting up a new folder that
|
||||
// does not have any state settings yet with the default
|
||||
|
||||
virtual void AddMenus();
|
||||
virtual void AddShortcuts();
|
||||
// add equivalents of the menu shortcuts to the menuless
|
||||
// desktop window
|
||||
virtual void AddFileMenu(BMenu* menu);
|
||||
virtual void AddWindowMenu(BMenu* menu);
|
||||
virtual void AddMenus();
|
||||
virtual void AddShortcuts();
|
||||
// add equivalents of the menu shortcuts to the menuless
|
||||
// desktop window
|
||||
virtual void AddFileMenu(BMenu* menu);
|
||||
virtual void AddWindowMenu(BMenu* menu);
|
||||
|
||||
virtual void AddContextMenus();
|
||||
virtual void AddContextMenus();
|
||||
|
||||
virtual void AddFileContextMenus(BMenu*);
|
||||
virtual void AddWindowContextMenus(BMenu*);
|
||||
virtual void AddVolumeContextMenus(BMenu*);
|
||||
virtual void AddDropContextMenus(BMenu*);
|
||||
virtual void AddTrashContextMenus(BMenu*);
|
||||
virtual void AddFileContextMenus(BMenu*);
|
||||
virtual void AddWindowContextMenus(BMenu*);
|
||||
virtual void AddVolumeContextMenus(BMenu*);
|
||||
virtual void AddDropContextMenus(BMenu*);
|
||||
virtual void AddTrashContextMenus(BMenu*);
|
||||
|
||||
virtual void RepopulateMenus();
|
||||
void PopulateArrangeByMenu(BMenu*);
|
||||
virtual void RepopulateMenus();
|
||||
void PopulateArrangeByMenu(BMenu*);
|
||||
|
||||
virtual void SetCutItem(BMenu*);
|
||||
virtual void SetCopyItem(BMenu*);
|
||||
virtual void SetPasteItem(BMenu*);
|
||||
virtual void SetArrangeMenu(BMenu*);
|
||||
virtual void SetCloseItem(BMenu*);
|
||||
virtual void SetupNavigationMenu(const entry_ref*, BMenu*);
|
||||
virtual void SetupMoveCopyMenus(const entry_ref*, BMenu*);
|
||||
virtual void PopulateMoveCopyNavMenu(BNavMenu*, uint32,
|
||||
const entry_ref*, bool);
|
||||
virtual void SetCutItem(BMenu*);
|
||||
virtual void SetCopyItem(BMenu*);
|
||||
virtual void SetPasteItem(BMenu*);
|
||||
virtual void SetArrangeMenu(BMenu*);
|
||||
virtual void SetCloseItem(BMenu*);
|
||||
virtual void SetupNavigationMenu(const entry_ref*, BMenu*);
|
||||
virtual void SetupMoveCopyMenus(const entry_ref*, BMenu*);
|
||||
virtual void PopulateMoveCopyNavMenu(BNavMenu*, uint32,
|
||||
const entry_ref*, bool);
|
||||
|
||||
virtual void SetupOpenWithMenu(BMenu*);
|
||||
virtual void SetUpEditQueryItem(BMenu*);
|
||||
virtual void SetUpDiskMenu(BMenu*);
|
||||
virtual void SetupOpenWithMenu(BMenu*);
|
||||
virtual void SetUpEditQueryItem(BMenu*);
|
||||
virtual void SetUpDiskMenu(BMenu*);
|
||||
|
||||
virtual void BuildAddOnMenu(BMenu*);
|
||||
void BuildMimeTypeList(BObjectList<BString>& mimeTypes);
|
||||
virtual void BuildAddOnMenu(BMenu*);
|
||||
void BuildMimeTypeList(BObjectList<BString>& mimeTypes);
|
||||
|
||||
enum UpdateMenuContext {
|
||||
kMenuBarContext,
|
||||
kPosePopUpContext,
|
||||
kWindowPopUpContext
|
||||
};
|
||||
enum UpdateMenuContext {
|
||||
kMenuBarContext,
|
||||
kPosePopUpContext,
|
||||
kWindowPopUpContext
|
||||
};
|
||||
|
||||
virtual void UpdateMenu(BMenu* menu, UpdateMenuContext context);
|
||||
virtual void UpdateMenu(BMenu* menu, UpdateMenuContext context);
|
||||
|
||||
BMenu* AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
|
||||
BMenu* menu, int32 start);
|
||||
BMenu* AddMimeMenu(const BMimeType& mimeType, bool isSuperType,
|
||||
BMenu* menu, int32 start);
|
||||
|
||||
BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, int32,
|
||||
const char*);
|
||||
BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, int32,
|
||||
const char*);
|
||||
|
||||
bool EachAddon(BPath &path,
|
||||
bool (*)(const Model*, const char*, uint32, bool, void*),
|
||||
BObjectList<Model>*, void*, BObjectList<BString> &);
|
||||
void LoadAddOn(BMessage*);
|
||||
bool EachAddon(BPath &path,
|
||||
bool (*)(const Model*, const char*, uint32, bool, void*),
|
||||
BObjectList<Model>*, void*, BObjectList<BString> &);
|
||||
void LoadAddOn(BMessage*);
|
||||
|
||||
BPopUpMenu* fFileContextMenu;
|
||||
BPopUpMenu* fWindowContextMenu;
|
||||
BPopUpMenu* fDropContextMenu;
|
||||
BPopUpMenu* fVolumeContextMenu;
|
||||
BPopUpMenu* fTrashContextMenu;
|
||||
BSlowContextMenu* fDragContextMenu;
|
||||
BMenuItem* fMoveToItem;
|
||||
BMenuItem* fCopyToItem;
|
||||
BMenuItem* fCreateLinkItem;
|
||||
BMenuItem* fOpenWithItem;
|
||||
ModelMenuItem* fNavigationItem;
|
||||
BMenuBar* fMenuBar;
|
||||
BNavigator* fNavigator;
|
||||
BPoseView* fPoseView;
|
||||
LockingList<BWindow>* fWindowList;
|
||||
BMenu* fAttrMenu;
|
||||
BMenu* fWindowMenu;
|
||||
BMenu* fFileMenu;
|
||||
BMenu* fArrangeByMenu;
|
||||
BPopUpMenu* fFileContextMenu;
|
||||
BPopUpMenu* fWindowContextMenu;
|
||||
BPopUpMenu* fDropContextMenu;
|
||||
BPopUpMenu* fVolumeContextMenu;
|
||||
BPopUpMenu* fTrashContextMenu;
|
||||
BSlowContextMenu* fDragContextMenu;
|
||||
BMenuItem* fMoveToItem;
|
||||
BMenuItem* fCopyToItem;
|
||||
BMenuItem* fCreateLinkItem;
|
||||
BMenuItem* fOpenWithItem;
|
||||
ModelMenuItem* fNavigationItem;
|
||||
BMenuBar* fMenuBar;
|
||||
BNavigator* fNavigator;
|
||||
BPoseView* fPoseView;
|
||||
LockingList<BWindow>* fWindowList;
|
||||
BMenu* fAttrMenu;
|
||||
BMenu* fWindowMenu;
|
||||
BMenu* fFileMenu;
|
||||
BMenu* fArrangeByMenu;
|
||||
|
||||
SelectionWindow* fSelectionWindow;
|
||||
SelectionWindow* fSelectionWindow;
|
||||
|
||||
PiggybackTaskLoop* fTaskLoop;
|
||||
PiggybackTaskLoop* fTaskLoop;
|
||||
|
||||
bool fIsTrash;
|
||||
bool fInTrash;
|
||||
bool fIsPrinters;
|
||||
bool fIsTrash;
|
||||
bool fInTrash;
|
||||
bool fIsPrinters;
|
||||
|
||||
uint32 fContainerWindowFlags;
|
||||
BackgroundImage* fBackgroundImage;
|
||||
uint32 fContainerWindowFlags;
|
||||
BackgroundImage* fBackgroundImage;
|
||||
|
||||
static LockingList<struct AddonShortcut>* fAddonsList;
|
||||
static LockingList<struct AddonShortcut>* fAddonsList;
|
||||
|
||||
private:
|
||||
BRect fSavedZoomRect;
|
||||
BRect fPreviousBounds;
|
||||
private:
|
||||
BRect fSavedZoomRect;
|
||||
BRect fPreviousBounds;
|
||||
|
||||
static BRect sNewWindRect;
|
||||
static BRect sNewWindRect;
|
||||
|
||||
BPopUpMenu* fContextMenu;
|
||||
BMessage* fDragMessage;
|
||||
BObjectList<BString>* fCachedTypesList;
|
||||
bool fWaitingForRefs;
|
||||
BPopUpMenu* fContextMenu;
|
||||
BMessage* fDragMessage;
|
||||
BObjectList<BString>* fCachedTypesList;
|
||||
bool fWaitingForRefs;
|
||||
|
||||
bool fStateNeedsSaving;
|
||||
bool fSaveStateIsEnabled;
|
||||
bool fStateNeedsSaving;
|
||||
bool fSaveStateIsEnabled;
|
||||
|
||||
bool fIsWatchingPath;
|
||||
bool fIsWatchingPath;
|
||||
|
||||
typedef BWindow _inherited;
|
||||
typedef BWindow _inherited;
|
||||
|
||||
friend int32 show_context_menu(void*);
|
||||
friend class BackgroundView;
|
||||
friend int32 show_context_menu(void*);
|
||||
friend class BackgroundView;
|
||||
|
||||
void _UpdateSelectionMIMEInfo();
|
||||
void _UpdateSelectionMIMEInfo();
|
||||
};
|
||||
|
||||
|
||||
class WindowStateNodeOpener {
|
||||
// this class manages opening and closing the proper node for
|
||||
// state restoring / saving; the constructor knows how to decide whether
|
||||
// to use a special directory for root, etc.
|
||||
// setter calls used when no attributes can be read from a node and
|
||||
// defaults are to be substituted
|
||||
public:
|
||||
WindowStateNodeOpener(BContainerWindow* window, bool forWriting);
|
||||
virtual ~WindowStateNodeOpener();
|
||||
// this class manages opening and closing the proper node for
|
||||
// state restoring / saving; the constructor knows how to decide whether
|
||||
// to use a special directory for root, etc.
|
||||
// setter calls used when no attributes can be read from a node and
|
||||
// defaults are to be substituted
|
||||
public:
|
||||
WindowStateNodeOpener(BContainerWindow* window, bool forWriting);
|
||||
virtual ~WindowStateNodeOpener();
|
||||
|
||||
void SetTo(const BDirectory*);
|
||||
void SetTo(const BEntry* entry, bool forWriting);
|
||||
void SetTo(Model*, bool forWriting);
|
||||
void SetTo(const BDirectory*);
|
||||
void SetTo(const BEntry* entry, bool forWriting);
|
||||
void SetTo(Model*, bool forWriting);
|
||||
|
||||
AttributeStreamNode* StreamNode() const;
|
||||
BNode* Node() const;
|
||||
AttributeStreamNode* StreamNode() const;
|
||||
BNode* Node() const;
|
||||
|
||||
private:
|
||||
ModelNodeLazyOpener* fModelOpener;
|
||||
BNode* fNode;
|
||||
AttributeStreamNode* fStreamNode;
|
||||
private:
|
||||
ModelNodeLazyOpener* fModelOpener;
|
||||
BNode* fNode;
|
||||
AttributeStreamNode* fStreamNode;
|
||||
};
|
||||
|
||||
|
||||
class BackgroundView : public BView {
|
||||
// background view placed in a BContainerWindow, under the pose view
|
||||
public:
|
||||
BackgroundView(BRect);
|
||||
virtual void AttachedToWindow();
|
||||
virtual void FrameResized(float, float);
|
||||
virtual void Draw(BRect);
|
||||
// background view placed in a BContainerWindow, under the pose view
|
||||
public:
|
||||
BackgroundView(BRect);
|
||||
virtual void AttachedToWindow();
|
||||
virtual void FrameResized(float, float);
|
||||
virtual void Draw(BRect);
|
||||
|
||||
void PoseViewFocused(bool);
|
||||
virtual void Pulse();
|
||||
void PoseViewFocused(bool);
|
||||
virtual void Pulse();
|
||||
|
||||
protected:
|
||||
virtual void WindowActivated(bool);
|
||||
protected:
|
||||
virtual void WindowActivated(bool);
|
||||
|
||||
private:
|
||||
typedef BView _inherited;
|
||||
private:
|
||||
typedef BView _inherited;
|
||||
};
|
||||
|
||||
|
||||
int CompareLabels(const BMenuItem*, const BMenuItem*);
|
||||
|
||||
|
||||
// inlines ---------
|
||||
|
||||
inline BNavigator*
|
||||
@@ -376,74 +385,84 @@ BContainerWindow::Navigator() const
|
||||
return fNavigator;
|
||||
}
|
||||
|
||||
|
||||
inline BPoseView*
|
||||
BContainerWindow::PoseView() const
|
||||
{
|
||||
return fPoseView;
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
BContainerWindow::IsTrash() const
|
||||
{
|
||||
return fIsTrash;
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
BContainerWindow::InTrash() const
|
||||
{
|
||||
return fInTrash;
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
BContainerWindow::IsPrintersDir() const
|
||||
{
|
||||
return fIsPrinters;
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
BContainerWindow::SetUpDiskMenu(BMenu*)
|
||||
{
|
||||
// nothing at this level
|
||||
}
|
||||
|
||||
|
||||
inline BPopUpMenu*
|
||||
BContainerWindow::ContextMenu()
|
||||
{
|
||||
return fContextMenu;
|
||||
}
|
||||
|
||||
|
||||
inline bool
|
||||
BContainerWindow::Dragging() const
|
||||
{
|
||||
return fDragMessage && fCachedTypesList;
|
||||
}
|
||||
|
||||
|
||||
inline BMessage*
|
||||
BContainerWindow::DragMessage() const
|
||||
{
|
||||
return fDragMessage;
|
||||
}
|
||||
inline
|
||||
bool
|
||||
|
||||
|
||||
inline bool
|
||||
BContainerWindow::SaveStateIsEnabled() const
|
||||
{
|
||||
return fSaveStateIsEnabled;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
|
||||
inline void
|
||||
BContainerWindow::SetSaveStateEnabled(bool value)
|
||||
{
|
||||
fSaveStateIsEnabled = value;
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
|
||||
inline bool
|
||||
BContainerWindow::IsPathWatchingEnabled() const
|
||||
{
|
||||
return fIsWatchingPath;
|
||||
}
|
||||
|
||||
|
||||
filter_result ActivateWindowFilter(BMessage* message, BHandler** target,
|
||||
BMessageFilter* messageFilter);
|
||||
|
||||
@@ -451,4 +470,5 @@ filter_result ActivateWindowFilter(BMessage* message, BHandler** target,
|
||||
|
||||
using namespace BPrivate;
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _CONTAINER_WINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user