Merge branch 'master' of ssh://git.haiku-os.org/haiku

This commit is contained in:
Stefano Ceccherini
2013-01-04 00:07:38 +01:00
62 changed files with 257 additions and 241 deletions
+3 -1
View File
@@ -751,10 +751,12 @@ CopyDirectoryToHaikuImage develop sample-code
: [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ] : [ FDirName $(HAIKU_TOP) src libs pdflib bind pdflib ]
: pdflib ; : pdflib ;
# Copy Mesa3D GL headers into image # Copy OpenGL kit headers into image
if $(TARGET_ARCH) = x86 { if $(TARGET_ARCH) = x86 {
CopyDirectoryToHaikuImage develop headers os opengl CopyDirectoryToHaikuImage develop headers os opengl
: [ FDirName $(HAIKU_MESA_HEADERS) GL ] ; : [ FDirName $(HAIKU_MESA_HEADERS) GL ] ;
CopyDirectoryToHaikuImage develop headers os opengl
: [ FDirName $(HAIKU_GLU_HEADERS) GL ] ;
} }
#pragma mark - Optional Packages #pragma mark - Optional Packages
+4 -4
View File
@@ -297,8 +297,8 @@ if [ IsOptionalHaikuImagePackageAdded BePDF ] {
: $(baseURL)/bepdf-1.1.1b4-x86-gcc4-2012-08-11.zip ; : $(baseURL)/bepdf-1.1.1b4-x86-gcc4-2012-08-11.zip ;
} else { } else {
InstallOptionalHaikuImagePackage InstallOptionalHaikuImagePackage
bepdf-1.1.1b4-r1a4-x86-gcc2-2012-08-30.zip bepdf-1.1.1b4-r1a4-x86-gcc2-2013-01-02.zip
: $(baseURL)/bepdf-1.1.1b4-r1a4-x86-gcc2-2012-08-30.zip ; : $(baseURL)/bepdf-1.1.1b4-r1a4-x86-gcc2-2013-01-02.zip ;
} }
AddSymlinkToHaikuImage home config settings deskbar Applications AddSymlinkToHaikuImage home config settings deskbar Applications
: /boot/apps/BePDF/BePDF ; : /boot/apps/BePDF/BePDF ;
@@ -2282,8 +2282,8 @@ if [ IsOptionalHaikuImagePackageAdded WonderBrush ] {
} else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) {
Echo "No optional package WonderBrush available for gcc4" ; Echo "No optional package WonderBrush available for gcc4" ;
} else { } else {
InstallOptionalHaikuImagePackage WonderBrush-2.1.2.zip InstallOptionalHaikuImagePackage WonderBrush-2.1.2-a.zip
: $(baseURL)/WonderBrush-2.1.2-x86-gcc2-2008-11-08.zip : $(baseURL)/WonderBrush-2.1.2-x86-gcc2-2013-01-02.zip
: apps ; : apps ;
AddSymlinkToHaikuImage home config settings deskbar Applications AddSymlinkToHaikuImage home config settings deskbar Applications
: /boot/apps/WonderBrush/WonderBrush ; : /boot/apps/WonderBrush/WonderBrush ;
@@ -673,10 +673,14 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
instructionPointer, functionInstance->Address() - fRelocationDelta, instructionPointer, functionInstance->Address() - fRelocationDelta,
subprogramEntry->Variables(), subprogramEntry->Blocks()); subprogramEntry->Variables(), subprogramEntry->Blocks());
// TODO: re-enable once PIC and false positive issues
// are properly dealt with
#if 0
if (returnFunctionAddress != 0) { if (returnFunctionAddress != 0) {
_CreateReturnValue(returnFunctionAddress, image, frame, _CreateReturnValue(returnFunctionAddress, image, frame,
*stackFrameDebugInfo); *stackFrameDebugInfo);
} }
#endif
} }
_frame = frameReference.Detach(); _frame = frameReference.Detach();
+9 -3
View File
@@ -10,9 +10,12 @@
#include <Button.h> #include <Button.h>
#include <LayoutBuilder.h> #include <LayoutBuilder.h>
#include <Locale.h> #include <Locale.h>
#include <Roster.h>
#include <ScrollView.h> #include <ScrollView.h>
#include <TextView.h> #include <TextView.h>
#include "tracker_private.h"
static const uint32 kMsgAgree = 'agre'; static const uint32 kMsgAgree = 'agre';
@@ -183,7 +186,7 @@ InstallerApp::ReadyToRun()
infoText << B_TRANSLATE( infoText << B_TRANSLATE(
"NOTE: While the naming strategy for hard disks is still as described " "NOTE: While the naming strategy for hard disks is still as described "
"under 2.1) the naming scheme for partitions has changed.\n\n"); "under 2.1) the naming scheme for partitions has changed.\n\n");
infoText << B_TRANSLATE( infoText << B_TRANSLATE(
"GRUB's naming scheme is still: (hdN,n)\n\n"); "GRUB's naming scheme is still: (hdN,n)\n\n");
infoText << B_TRANSLATE( infoText << B_TRANSLATE(
"All hard disks start with \"hd\".\n"); "All hard disks start with \"hd\".\n");
@@ -250,8 +253,11 @@ InstallerApp::ReadyToRun()
BRect eulaFrame = BRect(0, 0, 600, 450); BRect eulaFrame = BRect(0, 0, 600, 450);
fEULAWindow = new BWindow(eulaFrame, B_TRANSLATE("README"), fEULAWindow = new BWindow(eulaFrame, B_TRANSLATE("README"),
B_MODAL_WINDOW, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE B_MODAL_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS); | B_NOT_MINIMIZABLE | B_AUTO_UPDATE_SIZE_LIMITS);
if (!be_roster->IsRunning(kTrackerSignature))
fEULAWindow->SetWorkspaces(B_ALL_WORKSPACES);
BLayoutBuilder::Group<>(fEULAWindow, B_VERTICAL, 10) BLayoutBuilder::Group<>(fEULAWindow, B_VERTICAL, 10)
.SetInsets(10) .SetInsets(10)
+3
View File
@@ -165,6 +165,9 @@ InstallerWindow::InstallerWindow()
fWorkerThread(new WorkerThread(this)), fWorkerThread(new WorkerThread(this)),
fCopyEngineCancelSemaphore(-1) fCopyEngineCancelSemaphore(-1)
{ {
if (!be_roster->IsRunning(kTrackerSignature))
SetWorkspaces(B_ALL_WORKSPACES);
LogoView* logoView = new LogoView(); LogoView* logoView = new LogoView();
fStatusView = new BTextView("statusView", be_plain_font, NULL, fStatusView = new BTextView("statusView", be_plain_font, NULL,
@@ -137,7 +137,8 @@ compare_void_list_items(const void* _a, const void* _b)
BootPromptWindow::BootPromptWindow() BootPromptWindow::BootPromptWindow()
: :
BWindow(BRect(0, 0, 530, 400), "", BWindow(BRect(0, 0, 530, 400), "",
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_CLOSABLE), B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_CLOSABLE,
B_ALL_WORKSPACES),
fDefaultKeymapItem(NULL) fDefaultKeymapItem(NULL)
{ {
SetSizeLimits(450, 16384, 350, 16384); SetSizeLimits(450, 16384, 350, 16384);
+3 -3
View File
@@ -2139,13 +2139,13 @@ BWindow::DecoratorFrame() const
// else use fall-back values from above // else use fall-back values from above
} }
if (fLook & kLeftTitledWindowLook) { if (fLook == kLeftTitledWindowLook) {
decoratorFrame.top -= borderWidth; decoratorFrame.top -= borderWidth;
decoratorFrame.left -= tabRect.Width(); decoratorFrame.left -= borderWidth + tabRect.Width();
decoratorFrame.right += borderWidth; decoratorFrame.right += borderWidth;
decoratorFrame.bottom += borderWidth; decoratorFrame.bottom += borderWidth;
} else { } else {
decoratorFrame.top -= tabRect.Height(); decoratorFrame.top -= borderWidth + tabRect.Height();
decoratorFrame.left -= borderWidth; decoratorFrame.left -= borderWidth;
decoratorFrame.right += borderWidth; decoratorFrame.right += borderWidth;
decoratorFrame.bottom += borderWidth; decoratorFrame.bottom += borderWidth;
+1 -1
View File
@@ -7,4 +7,4 @@ Jeff Bush,
Robert Chinn, Robert Chinn,
Doug Fulton, Doug Fulton,
Kenny Carruthers, Kenny Carruthers,
Dianne Hackborn Dianne Hackborn
+3 -3
View File
@@ -79,7 +79,7 @@ public:
AttributeInfo(const AttributeInfo &); AttributeInfo(const AttributeInfo &);
AttributeInfo(const char*, attr_info); AttributeInfo(const char*, attr_info);
AttributeInfo(const char*, uint32, off_t); AttributeInfo(const char*, uint32, off_t);
void SetTo(const AttributeInfo &); void SetTo(const AttributeInfo &);
void SetTo(const char*, attr_info); void SetTo(const char*, attr_info);
void SetTo(const char*, uint32, off_t); void SetTo(const char*, uint32, off_t);
@@ -186,7 +186,7 @@ protected:
private: private:
AttributeInfo fCurrentAttr; AttributeInfo fCurrentAttr;
BNode* fNode; BNode* fNode;
typedef AttributeStreamNode _inherited; typedef AttributeStreamNode _inherited;
}; };
@@ -224,7 +224,7 @@ protected:
{ {
delete [] fData; delete [] fData;
} }
AttributeInfo fAttr; AttributeInfo fAttr;
char* fData; char* fData;
}; };
+1 -1
View File
@@ -87,7 +87,7 @@ public:
private: private:
image_id find_image(void* memAddr) const; image_id find_image(void* memAddr) const;
mutable BLocker fLock; mutable BLocker fLock;
BResources fResources; BResources fResources;
}; };
+4 -4
View File
@@ -67,9 +67,9 @@ public:
void UpdateDesktopBackgroundImages(); void UpdateDesktopBackgroundImages();
// Desktop window has special background image handling // Desktop window has special background image handling
void SaveDesktopPoseLocations(); void SaveDesktopPoseLocations();
protected: protected:
virtual void AddWindowContextMenus(BMenu*); virtual void AddWindowContextMenus(BMenu*);
virtual BPoseView* NewPoseView(Model*, BRect, uint32); virtual BPoseView* NewPoseView(Model*, BRect, uint32);
@@ -84,7 +84,7 @@ private:
BPopUpMenu* fTrashContextMenu; BPopUpMenu* fTrashContextMenu;
BRect fOldFrame; BRect fOldFrame;
// in the desktop window addon shortcuts have to be added by AddShortcut // in the desktop window addon shortcuts have to be added by AddShortcut
// and we don't always get the MenusBeginning call to check for new // and we don't always get the MenusBeginning call to check for new
// addons/update the shortcuts -- instead we need to node monitor the // addons/update the shortcuts -- instead we need to node monitor the
@@ -93,7 +93,7 @@ private:
bool fShouldUpdateAddonShortcuts; bool fShouldUpdateAddonShortcuts;
std::set<uint32> fCurrentAddonShortcuts; std::set<uint32> fCurrentAddonShortcuts;
// keeps track of which shortcuts are installed for Tracker addons // keeps track of which shortcuts are installed for Tracker addons
typedef BContainerWindow _inherited; typedef BContainerWindow _inherited;
}; };
+2 -2
View File
@@ -271,11 +271,11 @@ DesktopPoseView::AdaptToDesktopIntegrationChange(BMessage* message)
{ {
bool mountVolumesOnDesktop = true; bool mountVolumesOnDesktop = true;
bool mountSharedVolumesOntoDesktop = true; bool mountSharedVolumesOntoDesktop = true;
message->FindBool("MountVolumesOntoDesktop", &mountVolumesOnDesktop); message->FindBool("MountVolumesOntoDesktop", &mountVolumesOnDesktop);
message->FindBool("MountSharedVolumesOntoDesktop", message->FindBool("MountSharedVolumesOntoDesktop",
&mountSharedVolumesOntoDesktop); &mountSharedVolumesOntoDesktop);
ShowVolumes(false, mountSharedVolumesOntoDesktop); ShowVolumes(false, mountSharedVolumesOntoDesktop);
ShowVolumes(mountVolumesOnDesktop, mountSharedVolumesOntoDesktop); ShowVolumes(mountVolumesOnDesktop, mountSharedVolumesOntoDesktop);
} }
+1 -1
View File
@@ -31,7 +31,7 @@ of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders. names are registered trademarks or trademarks of their respective holders.
All rights reserved. All rights reserved.
*/ */
// DesktopPoseView adds support for displaying integrated desktops // DesktopPoseView adds support for displaying integrated desktops
// from multiple volumes to BPoseView // from multiple volumes to BPoseView
#ifndef _DESKTOP_POSE_VIEW_H #ifndef _DESKTOP_POSE_VIEW_H
+1 -1
View File
@@ -505,7 +505,7 @@ PaneSwitch::DrawInState(PaneSwitch::State state)
switch (state) { switch (state) {
case kCollapsed: case kCollapsed:
BeginLineArray(6); BeginLineArray(6);
if (fLeftAligned) { if (fLeftAligned) {
AddLine(BPoint(rect.left + 3, rect.top + 1), AddLine(BPoint(rect.left + 3, rect.top + 1),
BPoint(rect.left + 3, rect.bottom - 1), outlineColor); BPoint(rect.left + 3, rect.bottom - 1), outlineColor);
+7 -7
View File
@@ -68,15 +68,15 @@ public:
uint32 flags = B_WILL_DRAW); uint32 flags = B_WILL_DRAW);
virtual ~DialogPane(); virtual ~DialogPane();
BRect FrameForMode(int32); BRect FrameForMode(int32);
BRect BoundsForMode(int32); BRect BoundsForMode(int32);
int32 Mode() const; int32 Mode() const;
virtual void SetMode(int32, bool initialSetup = false); virtual void SetMode(int32, bool initialSetup = false);
void AddItem(BView*, int32 toMode); void AddItem(BView*, int32 toMode);
void SetSwitch(BControl*); void SetSwitch(BControl*);
virtual void AttachedToWindow(); virtual void AttachedToWindow();
@@ -87,18 +87,18 @@ protected:
// called only by the constructor // called only by the constructor
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
private: private:
int32 fMode; int32 fMode;
BRect fMode1Frame; BRect fMode1Frame;
BRect fMode2Frame; BRect fMode2Frame;
BRect fMode3Frame; BRect fMode3Frame;
ViewList fMode2Items; ViewList fMode2Items;
ViewList fMode3Items; ViewList fMode3Items;
BControl* fLatch; BControl* fLatch;
typedef BView _inherited; typedef BView _inherited;
}; };
+1 -1
View File
@@ -145,6 +145,6 @@ SetPanelDirectory__10BFilePanelFP9entry_ref
{ {
self->SetPanelDirectory(r); self->SetPanelDirectory(r);
} }
} }
#endif #endif
+5 -5
View File
@@ -266,7 +266,7 @@ FSClipboardAddPoses(const node_ref* directory, PoseList* list,
refsAdded++; refsAdded++;
} else { } else {
clip->RemoveName(modeName); clip->RemoveName(modeName);
clipNode.node = *node; clipNode.node = *node;
clipNode.moveMode = kDelete; // note removing node clipNode.moveMode = kDelete; // note removing node
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, updateMessage.AddData("tcnode", T_CLIPBOARD_NODE,
@@ -280,7 +280,7 @@ FSClipboardAddPoses(const node_ref* directory, PoseList* list,
if (clip->AddRef(refName, model->EntryRef()) == B_OK if (clip->AddRef(refName, model->EntryRef()) == B_OK
&& clip->AddInt32(modeName, (int32)moveMode) == B_OK) { && clip->AddInt32(modeName, (int32)moveMode) == B_OK) {
pose->SetClipboardMode(moveMode); pose->SetClipboardMode(moveMode);
clipNode.node = *node; clipNode.node = *node;
updateMessage.AddData("tcnode", T_CLIPBOARD_NODE, updateMessage.AddData("tcnode", T_CLIPBOARD_NODE,
&clipNode, sizeof(TClipboardNodeRef), true, &clipNode, sizeof(TClipboardNodeRef), true,
@@ -422,7 +422,7 @@ FSClipboardPaste(Model* model, uint32 linksMode)
uint32 newMoveMode = 0; uint32 newMoveMode = 0;
bool sameDirectory = destNodeRef->device == ref.device bool sameDirectory = destNodeRef->device == ref.device
&& destNodeRef->node == ref.directory; && destNodeRef->node == ref.directory;
if (!entry.Exists()) { if (!entry.Exists()) {
// The entry doesn't exist anymore, so we'll remove // The entry doesn't exist anymore, so we'll remove
// that entry from the clipboard as well // that entry from the clipboard as well
@@ -567,7 +567,7 @@ FSClipboardFindNodeMode(Model* model, bool autoLock, bool updateRefIfNeeded)
} }
if (change) if (change)
be_clipboard->Commit(); be_clipboard->Commit();
if (autoLock) if (autoLock)
be_clipboard->Unlock(); be_clipboard->Unlock();
@@ -744,7 +744,7 @@ BClipboardRefsWatcher::UpdateNode(node_ref* node, entry_ref* ref)
clip->RemoveName(name); clip->RemoveName(name);
MakeModeName(name); MakeModeName(name);
clip->RemoveName(name); clip->RemoveName(name);
RemoveNode(node); RemoveNode(node);
} }
be_clipboard->Commit(); be_clipboard->Commit();
+2 -2
View File
@@ -166,7 +166,7 @@ FavoritesMenu::AddNextItem()
BMenuItem* item = BNavMenu::NewModelItem(&model, BMenuItem* item = BNavMenu::NewModelItem(&model,
model.IsDirectory() ? fOpenFolderMessage : fOpenFileMessage, model.IsDirectory() ? fOpenFolderMessage : fOpenFileMessage,
fTarget); fTarget);
if (item == NULL) if (item == NULL)
return true; return true;
@@ -314,7 +314,7 @@ FavoritesMenu::ShouldShowModel(const Model* model)
if (!fRefFilter || model->Node() == NULL) if (!fRefFilter || model->Node() == NULL)
return true; return true;
struct stat_beos statBeOS; struct stat_beos statBeOS;
convert_to_stat_beos(model->StatBuf(), &statBeOS); convert_to_stat_beos(model->StatBuf(), &statBeOS);
+3 -3
View File
@@ -58,7 +58,7 @@ class FavoritesMenu : public BSlowMenu {
BMessage* openFileMessage, const BMessenger &, BMessage* openFileMessage, const BMessenger &,
bool isSavePanel, BRefFilter* filter = NULL); bool isSavePanel, BRefFilter* filter = NULL);
virtual ~FavoritesMenu(); virtual ~FavoritesMenu();
void SetRefFilter(BRefFilter* filter); void SetRefFilter(BRefFilter* filter);
private: private:
@@ -67,9 +67,9 @@ class FavoritesMenu : public BSlowMenu {
virtual bool AddNextItem(); virtual bool AddNextItem();
virtual void DoneBuildingItemList(); virtual void DoneBuildingItemList();
virtual void ClearMenuBuildingState(); virtual void ClearMenuBuildingState();
bool ShouldShowModel(const Model* model); bool ShouldShowModel(const Model* model);
BMessage* fOpenFolderMessage; BMessage* fOpenFolderMessage;
BMessage* fOpenFileMessage; BMessage* fOpenFileMessage;
BMessenger fTarget; BMessenger fTarget;
+1 -1
View File
@@ -219,7 +219,7 @@ FindWindow::FindWindow(const entry_ref* newRef, bool editIfTemplateOnly)
fFromTemplate = IsQueryTemplate(fFile); fFromTemplate = IsQueryTemplate(fFile);
fBackground = new FindPanel(Bounds(), fFile, this, fFromTemplate, fBackground = new FindPanel(Bounds(), fFile, this, fFromTemplate,
fEditTemplateOnly); fEditTemplateOnly);
AddChild(fBackground); AddChild(fBackground);
} }
+1 -1
View File
@@ -240,7 +240,7 @@ public:
p3(p3) p3(p3)
{ {
} }
virtual void operator()() { (function)(p1.Pass(), p2.Pass(), p3.Pass()); } virtual void operator()() { (function)(p1.Pass(), p2.Pass(), p3.Pass()); }
private: private:
+1 -1
View File
@@ -24,7 +24,7 @@ TMenuItemGroup::TMenuItemGroup(const char* name)
TMenuItemGroup::~TMenuItemGroup() TMenuItemGroup::~TMenuItemGroup()
{ {
free((char*)fName); free((char*)fName);
if (fMenu == NULL) { if (fMenu == NULL) {
BMenuItem* item; BMenuItem* item;
while ((item = RemoveItem((int32)0)) != NULL) while ((item = RemoveItem((int32)0)) != NULL)
+1 -1
View File
@@ -526,7 +526,7 @@ IconCache::GetIconFromFileTypes(ModelNodeLazyOpener* modelOpener,
(SharedCacheEntry*)entry); (SharedCacheEntry*)entry);
// OK to cast here, have a runtime check // OK to cast here, have a runtime check
source = kPreferredAppForNode; source = kPreferredAppForNode;
// set source as preferred for node, so that next time we // set source as preferred for node, so that next time we
// get a hit in the initial find that uses // get a hit in the initial find that uses
// GetIconForPreferredApp // GetIconForPreferredApp
} else } else
+14 -14
View File
@@ -126,15 +126,15 @@ class IconCacheEntry {
public: public:
IconCacheEntry(); IconCacheEntry();
~IconCacheEntry(); ~IconCacheEntry();
void SetAliasFor(const SharedIconCache*, const SharedCacheEntry*); void SetAliasFor(const SharedIconCache*, const SharedCacheEntry*);
static IconCacheEntry* ResolveIfAlias(const SharedIconCache*, static IconCacheEntry* ResolveIfAlias(const SharedIconCache*,
IconCacheEntry*); IconCacheEntry*);
IconCacheEntry* ResolveIfAlias(const SharedIconCache*); IconCacheEntry* ResolveIfAlias(const SharedIconCache*);
void SetIcon(BBitmap* bitmap, IconDrawMode mode, icon_size size, void SetIcon(BBitmap* bitmap, IconDrawMode mode, icon_size size,
bool create = false); bool create = false);
bool HaveIconBitmap(IconDrawMode mode, icon_size size) const; bool HaveIconBitmap(IconDrawMode mode, icon_size size) const;
bool CanConstructBitmap(IconDrawMode mode, icon_size size) const; bool CanConstructBitmap(IconDrawMode mode, icon_size size) const;
static bool AlternateModeForIconConstructing(IconDrawMode requestedMode, static bool AlternateModeForIconConstructing(IconDrawMode requestedMode,
@@ -169,9 +169,9 @@ protected:
BBitmap* fHilitedLargeIcon; BBitmap* fHilitedLargeIcon;
BBitmap* fHilitedMiniIcon; BBitmap* fHilitedMiniIcon;
int32 fAliasForIndex; int32 fAliasForIndex;
// list of other icon kinds would be added here // list of other icon kinds would be added here
friend class SharedIconCache; friend class SharedIconCache;
friend class NodeIconCache; friend class NodeIconCache;
}; };
@@ -191,7 +191,7 @@ public:
bool Lock(); bool Lock();
void Unlock(); void Unlock();
bool IsLocked() const; bool IsLocked() const;
private: private:
Benaphore fLock; Benaphore fLock;
}; };
@@ -210,7 +210,7 @@ public:
const char* FileType() const; const char* FileType() const;
const char* AppSignature() const; const char* AppSignature() const;
// hash table support // hash table support
uint32 Hash() const; uint32 Hash() const;
static uint32 Hash(const char* fileType, const char* appSignature = 0); static uint32 Hash(const char* fileType, const char* appSignature = 0);
@@ -277,19 +277,19 @@ public:
NodeCacheEntry(const node_ref*, bool permanent = false); NodeCacheEntry(const node_ref*, bool permanent = false);
void Draw(BView*, BPoint, IconDrawMode mode, icon_size size, void Draw(BView*, BPoint, IconDrawMode mode, icon_size size,
bool async = false); bool async = false);
void Draw(BView*, BPoint, IconDrawMode, icon_size, void Draw(BView*, BPoint, IconDrawMode, icon_size,
void (*)(BView*, BPoint, BBitmap*, void*), void* = NULL); void (*)(BView*, BPoint, BBitmap*, void*), void* = NULL);
const node_ref* Node() const; const node_ref* Node() const;
uint32 Hash() const; uint32 Hash() const;
static uint32 Hash(const node_ref*); static uint32 Hash(const node_ref*);
bool operator==(const NodeCacheEntry&) const; bool operator==(const NodeCacheEntry&) const;
void SetTo(const node_ref*); void SetTo(const node_ref*);
void MakePermanent(); void MakePermanent();
bool Permanent() const; bool Permanent() const;
int32 fNext; int32 fNext;
private: private:
node_ref fRef; node_ref fRef;
@@ -348,7 +348,7 @@ const int32 kColorTransformTableSize = 256;
class IconCache { class IconCache {
public: public:
IconCache(); IconCache();
void Draw(Model*, BView*, BPoint where, IconDrawMode mode, void Draw(Model*, BView*, BPoint where, IconDrawMode mode,
icon_size size, bool async = false); icon_size size, bool async = false);
// draw an icon for a model, load the icon from the appropriate // draw an icon for a model, load the icon from the appropriate
@@ -376,13 +376,13 @@ public:
void Deleting(const BView*); void Deleting(const BView*);
// hook to manage deleting draw view caches for views that are // hook to manage deleting draw view caches for views that are
// going away // going away
// icon changed calls, used when a node or a file type has an icon changed // icon changed calls, used when a node or a file type has an icon changed
// the icons for the node/file type will be flushed and re-cached during // the icons for the node/file type will be flushed and re-cached during
// the next draw // the next draw
void IconChanged(Model*); void IconChanged(Model*);
void IconChanged(const char* mimeType, const char* appSignature); void IconChanged(const char* mimeType, const char* appSignature);
bool IsIconFrom(const Model*, const char* mimeType, bool IsIconFrom(const Model*, const char* mimeType,
const char* appSignature) const; const char* appSignature) const;
// called when metamime database changed to figure out which models // called when metamime database changed to figure out which models
@@ -510,7 +510,7 @@ SharedIconCache::ResolveIfAlias(IconCacheEntry* entry) const
{ {
if (entry->fAliasForIndex < 0) if (entry->fAliasForIndex < 0)
return entry; return entry;
return fHashTable.ElementAt(entry->fAliasForIndex); return fHashTable.ElementAt(entry->fAliasForIndex);
} }
+1 -1
View File
@@ -2129,7 +2129,7 @@ AttributeView::BuildContextMenu(BMenu* parent)
parent->AddItem(new BMenuItem(B_TRANSLATE("Edit name"), parent->AddItem(new BMenuItem(B_TRANSLATE("Edit name"),
new BMessage(kEditItem), 'E')); new BMessage(kEditItem), 'E'));
parent->AddSeparatorItem(); parent->AddSeparatorItem();
if (fModel->IsVolume()) { if (fModel->IsVolume()) {
BMenuItem* item = new BMenuItem(B_TRANSLATE("Unmount"), BMenuItem* item = new BMenuItem(B_TRANSLATE("Unmount"),
new BMessage(kUnmountVolume), 'U'); new BMessage(kUnmountVolume), 'U');
+4 -4
View File
@@ -100,14 +100,14 @@ MiniMenuField::Draw(BRect)
BRect rect(bounds); BRect rect(bounds);
rect.right--; rect.right--;
rect.bottom--; rect.bottom--;
rgb_color darkest = tint_color(kBlack, 0.6f); rgb_color darkest = tint_color(kBlack, 0.6f);
rgb_color dark = tint_color(kBlack, 0.4f); rgb_color dark = tint_color(kBlack, 0.4f);
rgb_color medium = dark; rgb_color medium = dark;
rgb_color light = tint_color(kBlack, 0.03f); rgb_color light = tint_color(kBlack, 0.03f);
SetHighColor(medium); SetHighColor(medium);
// draw frame and shadow // draw frame and shadow
BeginLineArray(10); BeginLineArray(10);
AddLine(rect.RightTop(), rect.RightBottom(), darkest); AddLine(rect.RightTop(), rect.RightBottom(), darkest);
@@ -123,7 +123,7 @@ MiniMenuField::Draw(BRect)
AddLine(rect.LeftTop(), rect.RightTop(), light); AddLine(rect.LeftTop(), rect.RightTop(), light);
EndLineArray(); EndLineArray();
// draw triangle // draw triangle
rect = BRect(5, 5, 15, 15); rect = BRect(5, 5, 15, 15);
const rgb_color outlineColor = kBlack; const rgb_color outlineColor = kBlack;
+5 -5
View File
@@ -85,7 +85,7 @@ BNavigatorButton::AttachedToWindow()
&bmpOn); &bmpOn);
SetPicture(bmpOn, true, true); SetPicture(bmpOn, true, true);
delete bmpOn; delete bmpOn;
BBitmap* bmpOff = 0; BBitmap* bmpOff = 0;
GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, fResIDOff, GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, fResIDOff,
&bmpOff); &bmpOff);
@@ -139,7 +139,7 @@ BNavigator::BNavigator(const Model* model, BRect rect, uint32 resizeMask)
{ {
// Get initial path // Get initial path
model->GetPath(&fPath); model->GetPath(&fPath);
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
float top = 2 + (be_plain_font->Size() - 8) / 2; float top = 2 + (be_plain_font->Size() - 8) / 2;
@@ -298,14 +298,14 @@ BNavigator::SendNavigationMessage(NavigationAction action, BEntry* entry,
BMessage message; BMessage message;
message.AddRef("refs", &ref); message.AddRef("refs", &ref);
message.AddInt32("action", action); message.AddInt32("action", action);
// get the node of this folder for selecting it in the new location // get the node of this folder for selecting it in the new location
const node_ref* nodeRef; const node_ref* nodeRef;
if (Window() && Window()->TargetModel()) if (Window() && Window()->TargetModel())
nodeRef = Window()->TargetModel()->NodeRef(); nodeRef = Window()->TargetModel()->NodeRef();
else else
nodeRef = NULL; nodeRef = NULL;
// if the option key was held down, open in new window (send message // if the option key was held down, open in new window (send message
// to be_app) otherwise send message to this window. TTracker // to be_app) otherwise send message to this window. TTracker
// (be_app) understands nodeRefToSlection, BContainerWindow doesn't, // (be_app) understands nodeRefToSlection, BContainerWindow doesn't,
@@ -361,7 +361,7 @@ BNavigator::GoTo()
Window()->PostMessage(&message); Window()->PostMessage(&message);
} else { } else {
BPath path; BPath path;
if (Window() && Window()->TargetModel()) { if (Window() && Window()->TargetModel()) {
Window()->TargetModel()->GetPath(&path); Window()->TargetModel()->GetPath(&path);
fLocation->SetText(path.Path()); fLocation->SetText(path.Path());
+2 -2
View File
@@ -68,9 +68,9 @@ class BNavigatorButton : public BPictureButton {
public: public:
BNavigatorButton(BRect rect, const char* name, BMessage* message, int32 resIDon, BNavigatorButton(BRect rect, const char* name, BMessage* message, int32 resIDon,
int32 resIDoff, int32 resIDdisabled); int32 resIDoff, int32 resIDdisabled);
~BNavigatorButton(); ~BNavigatorButton();
virtual void AttachedToWindow(); virtual void AttachedToWindow();
void SetPicture(BBitmap*, bool enabled, bool on); void SetPicture(BBitmap*, bool enabled, bool on);
+2 -2
View File
@@ -106,7 +106,7 @@ void
NodePreloader::MessageReceived(BMessage* message) NodePreloader::MessageReceived(BMessage* message)
{ {
// respond to node monitor notifications // respond to node monitor notifications
node_ref itemNode; node_ref itemNode;
switch (message->what) { switch (message->what) {
case B_NODE_MONITOR: case B_NODE_MONITOR:
@@ -173,7 +173,7 @@ NodePreloader::PreloadOne(const char* dirPath)
entry_ref ref; entry_ref ref;
if (dir.GetNextRef(&ref) != B_OK) if (dir.GetNextRef(&ref) != B_OK)
break; break;
BEntry entry(&ref); BEntry entry(&ref);
if (!entry.IsFile()) if (!entry.IsFile())
// only interrested in files // only interrested in files
+5 -5
View File
@@ -258,7 +258,7 @@ status_t
TNodeWalker::PopDirCommon() TNodeWalker::PopDirCommon()
{ {
ASSERT(fTopIndex >= 0); ASSERT(fTopIndex >= 0);
// done with the old dir, pop it // done with the old dir, pop it
fDirs.RemoveItemAt(fTopIndex); fDirs.RemoveItemAt(fTopIndex);
fTopIndex--; fTopIndex--;
@@ -303,7 +303,7 @@ TNodeWalker::GetNextEntry(BEntry* entry, bool traverse)
fIncludeTopDir = false; fIncludeTopDir = false;
return fTopDir->GetEntry(entry); return fTopDir->GetEntry(entry);
} }
// Get the next entry. // Get the next entry.
status_t err = fTopDir->GetNextEntry(entry, traverse); status_t err = fTopDir->GetNextEntry(entry, traverse);
@@ -346,7 +346,7 @@ TNodeWalker::GetNextRef(entry_ref* ref)
err = entry.GetRef(ref); err = entry.GetRef(ref);
return err; return err;
} }
// Get the next entry. // Get the next entry.
status_t err = fTopDir->GetNextRef(ref); status_t err = fTopDir->GetNextRef(ref);
if (err != B_OK) { if (err != B_OK) {
@@ -370,7 +370,7 @@ build_dirent(const BEntry* source, struct dirent* ent,
{ {
entry_ref ref; entry_ref ref;
source->GetRef(&ref); source->GetRef(&ref);
size_t recordLength = strlen(ref.name) + sizeof(dirent); size_t recordLength = strlen(ref.name) + sizeof(dirent);
if (recordLength > size || count <= 0) if (recordLength > size || count <= 0)
// can't fit in buffer, bail // can't fit in buffer, bail
@@ -424,7 +424,7 @@ TNodeWalker::GetNextDirents(struct dirent* ent, size_t size, int32 count)
return build_dirent(fJustFile, ent, size, count); return build_dirent(fJustFile, ent, size, count);
} }
// Get the next entry. // Get the next entry.
int32 result = fTopDir->GetNextDirents(ent, size, count); int32 result = fTopDir->GetNextDirents(ent, size, count);
+6 -6
View File
@@ -57,7 +57,7 @@ class TWalker : public BEntryList {
public: public:
virtual ~TWalker(); virtual ~TWalker();
virtual status_t GetNextEntry(BEntry*, bool traverse = false) = 0; virtual status_t GetNextEntry(BEntry*, bool traverse = false) = 0;
virtual status_t GetNextRef(entry_ref*) = 0; virtual status_t GetNextRef(entry_ref*) = 0;
virtual int32 GetNextDirents(struct dirent*, size_t, virtual int32 GetNextDirents(struct dirent*, size_t,
@@ -83,7 +83,7 @@ public:
TNodeWalker(const char* path); TNodeWalker(const char* path);
TNodeWalker(const entry_ref* ref); TNodeWalker(const entry_ref* ref);
TNodeWalker(const BDirectory* dir); TNodeWalker(const BDirectory* dir);
virtual status_t GetNextEntry(BEntry*, bool traverse = false); virtual status_t GetNextEntry(BEntry*, bool traverse = false);
virtual status_t GetNextRef(entry_ref*); virtual status_t GetNextRef(entry_ref*);
virtual int32 GetNextDirents(struct dirent*, size_t, virtual int32 GetNextDirents(struct dirent*, size_t,
@@ -126,7 +126,7 @@ public:
virtual int32 GetNextDirents(struct dirent*, size_t, virtual int32 GetNextDirents(struct dirent*, size_t,
int32 count = INT_MAX); int32 count = INT_MAX);
virtual status_t Rewind(); virtual status_t Rewind();
virtual status_t NextVolume(); virtual status_t NextVolume();
// skips to the next volume // skips to the next volume
// Note: it would be cool to return const BVolume* // Note: it would be cool to return const BVolume*
@@ -150,13 +150,13 @@ class TQueryWalker : public TWalker {
public: public:
TQueryWalker(const char* predicate); TQueryWalker(const char* predicate);
virtual ~TQueryWalker(); virtual ~TQueryWalker();
// Does an in-fix walk of all entries // Does an in-fix walk of all entries
virtual status_t GetNextEntry(BEntry*, bool traverse = false); virtual status_t GetNextEntry(BEntry*, bool traverse = false);
virtual status_t GetNextRef(entry_ref*); virtual status_t GetNextRef(entry_ref*);
virtual int32 GetNextDirents(struct dirent*, size_t, virtual int32 GetNextDirents(struct dirent*, size_t,
int32 count = INT_MAX); int32 count = INT_MAX);
virtual status_t NextVolume(); virtual status_t NextVolume();
// skips to the next volume // skips to the next volume
virtual status_t Rewind(); virtual status_t Rewind();
@@ -164,7 +164,7 @@ public:
private: private:
virtual int32 CountEntries(); virtual int32 CountEntries();
// can't count // can't count
BQuery fQuery; BQuery fQuery;
BVolumeRoster fVolRoster; BVolumeRoster fVolRoster;
BVolume fVol; BVolume fVol;
+11 -11
View File
@@ -53,7 +53,7 @@ OverrideAlert::OverrideAlert(const char* title, const char* text,
fButtonModifiers[1] = modifiers2; fButtonModifiers[1] = modifiers2;
fButtonModifiers[2] = modifiers3; fButtonModifiers[2] = modifiers3;
UpdateButtons(modifiers(), true); UpdateButtons(modifiers(), true);
BPoint where = OverPosition(Frame().Width(), Frame().Height()); BPoint where = OverPosition(Frame().Width(), Frame().Height());
MoveTo(where.x, where.y); MoveTo(where.x, where.y);
} }
@@ -71,7 +71,7 @@ OverrideAlert::OverrideAlert(const char* title, const char* text,
fButtonModifiers[1] = modifiers2; fButtonModifiers[1] = modifiers2;
fButtonModifiers[2] = modifiers3; fButtonModifiers[2] = modifiers3;
UpdateButtons(modifiers(), true); UpdateButtons(modifiers(), true);
BPoint where = OverPosition(Frame().Width(), Frame().Height()); BPoint where = OverPosition(Frame().Width(), Frame().Height());
MoveTo(where.x, where.y); MoveTo(where.x, where.y);
} }
@@ -89,7 +89,7 @@ OverrideAlert::DispatchMessage(BMessage* message, BHandler* handler)
|| message->what == B_UNMAPPED_KEY_DOWN || message->what == B_UNMAPPED_KEY_DOWN
|| message->what == B_UNMAPPED_KEY_UP) { || message->what == B_UNMAPPED_KEY_UP) {
uint32 modifiers; uint32 modifiers;
if (message->FindInt32("modifiers", (int32*)&modifiers) == B_OK) if (message->FindInt32("modifiers", (int32*)&modifiers) == B_OK)
UpdateButtons(modifiers); UpdateButtons(modifiers);
} }
BAlert::DispatchMessage(message, handler); BAlert::DispatchMessage(message, handler);
@@ -107,36 +107,36 @@ OverrideAlert::OverPosition(float width, float height)
BRect screenFrame; BRect screenFrame;
BRect desirableRect; BRect desirableRect;
screenFrame = BScreen(window).Frame(); screenFrame = BScreen(window).Frame();
if (window) { if (window) {
// If we found a window associated with this calling thread, // If we found a window associated with this calling thread,
// place alert over that window so that the first button is // place alert over that window so that the first button is
// on top of it. This allows name editing confirmations to // on top of it. This allows name editing confirmations to
// work with focus follows mouse -- when the alert goes away, // work with focus follows mouse -- when the alert goes away,
// the underlying window will still have focus. // the underlying window will still have focus.
desirableRect = window->Frame(); desirableRect = window->Frame();
float midX = (desirableRect.left + desirableRect.right) / 2.0f; float midX = (desirableRect.left + desirableRect.right) / 2.0f;
float midY = (desirableRect.top * 3.0f + desirableRect.bottom) / 4.0f; float midY = (desirableRect.top * 3.0f + desirableRect.bottom) / 4.0f;
desirableRect.left = midX - ceilf(width / 2.0f); desirableRect.left = midX - ceilf(width / 2.0f);
desirableRect.right = desirableRect.left+width; desirableRect.right = desirableRect.left+width;
desirableRect.top = midY - ceilf(height / 3.0f); desirableRect.top = midY - ceilf(height / 3.0f);
desirableRect.bottom = desirableRect.top + height; desirableRect.bottom = desirableRect.top + height;
} else { } else {
// Otherwise, just place alert in center of screen. // Otherwise, just place alert in center of screen.
desirableRect = screenFrame; desirableRect = screenFrame;
float midX = (desirableRect.left + desirableRect.right) / 2.0f; float midX = (desirableRect.left + desirableRect.right) / 2.0f;
float midY = (desirableRect.top * 3.0f + desirableRect.bottom) / 4.0f; float midY = (desirableRect.top * 3.0f + desirableRect.bottom) / 4.0f;
desirableRect.left = midX - ceilf(width / 2.0f); desirableRect.left = midX - ceilf(width / 2.0f);
desirableRect.right = desirableRect.left + width; desirableRect.right = desirableRect.left + width;
desirableRect.top = midY - ceilf(height / 3.0f); desirableRect.top = midY - ceilf(height / 3.0f);
desirableRect.bottom = desirableRect.top + height; desirableRect.bottom = desirableRect.top + height;
} }
return desirableRect.LeftTop(); return desirableRect.LeftTop();
} }
@@ -146,7 +146,7 @@ OverrideAlert::UpdateButtons(uint32 modifiers, bool force)
{ {
if (modifiers == fCurModifiers && !force) if (modifiers == fCurModifiers && !force)
return; return;
fCurModifiers = modifiers; fCurModifiers = modifiers;
for (int32 i = 0; i < 3; i++) { for (int32 i = 0; i < 3; i++) {
BButton* button = ButtonAt(i); BButton* button = ButtonAt(i);
+20 -20
View File
@@ -143,7 +143,7 @@ BPose::AddWidget(BPoseView* poseView, BColumn* column)
BModelOpener opener(fModel); BModelOpener opener(fModel);
if (fModel->InitCheck() != B_OK) if (fModel->InitCheck() != B_OK)
return NULL; return NULL;
BTextWidget* widget = new BTextWidget(fModel, column, poseView); BTextWidget* widget = new BTextWidget(fModel, column, poseView);
fWidgetList.AddItem(widget); fWidgetList.AddItem(widget);
return widget; return widget;
@@ -157,7 +157,7 @@ BPose::AddWidget(BPoseView* poseView, BColumn* column,
opener.OpenNode(); opener.OpenNode();
if (fModel->InitCheck() != B_OK) if (fModel->InitCheck() != B_OK)
return NULL; return NULL;
BTextWidget* widget = new BTextWidget(fModel, column, poseView); BTextWidget* widget = new BTextWidget(fModel, column, poseView);
fWidgetList.AddItem(widget); fWidgetList.AddItem(widget);
return widget; return widget;
@@ -494,7 +494,7 @@ BPose::PointInPose(const BPoseView* poseView, BPoint where) const
return rect.Contains(where); return rect.Contains(where);
} }
// MINI_ICON_MODE rect calc // MINI_ICON_MODE rect calc
BRect rect(location, location); BRect rect(location, location);
rect.right += B_MINI_ICON + kMiniIconSeparator; rect.right += B_MINI_ICON + kMiniIconSeparator;
@@ -502,7 +502,7 @@ BPose::PointInPose(const BPoseView* poseView, BPoint where) const
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash()); BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
if (widget) if (widget)
rect.right += ceil(widget->TextWidth(poseView) + 1); rect.right += ceil(widget->TextWidth(poseView) + 1);
return rect.Contains(where); return rect.Contains(where);
} }
@@ -552,14 +552,14 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
return; return;
} else } else
fBackgroundClean = false; fBackgroundClean = false;
bool directDraw = (drawView == poseView); bool directDraw = (drawView == poseView);
bool windowActive = poseView->Window()->IsActive(); bool windowActive = poseView->Window()->IsActive();
bool showSelectionWhenInactive = poseView->fShowSelectionWhenInactive; bool showSelectionWhenInactive = poseView->fShowSelectionWhenInactive;
bool isDrawingSelectionRect = poseView->fIsDrawingSelectionRect; bool isDrawingSelectionRect = poseView->fIsDrawingSelectionRect;
ModelNodeLazyOpener modelOpener(fModel); ModelNodeLazyOpener modelOpener(fModel);
if (poseView->ViewMode() == kListMode) { if (poseView->ViewMode() == kListMode) {
uint32 size = poseView->IconSizeInt(); uint32 size = poseView->IconSizeInt();
BRect iconRect(rect); BRect iconRect(rect);
@@ -571,37 +571,37 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
DrawIcon(iconRect.LeftTop(), drawView, poseView->IconSize(), DrawIcon(iconRect.LeftTop(), drawView, poseView->IconSize(),
directDraw, !windowActive && !showSelectionWhenInactive); directDraw, !windowActive && !showSelectionWhenInactive);
} }
// draw text // draw text
int32 columnsToDraw = 1; int32 columnsToDraw = 1;
if (fullDraw) if (fullDraw)
columnsToDraw = poseView->CountColumns(); columnsToDraw = poseView->CountColumns();
for (int32 index = 0; index < columnsToDraw; index++) { for (int32 index = 0; index < columnsToDraw; index++) {
BColumn* column = poseView->ColumnAt(index); BColumn* column = poseView->ColumnAt(index);
if (!column) if (!column)
break; break;
// if widget doesn't exist, create it // if widget doesn't exist, create it
BTextWidget* widget = WidgetFor(column, poseView, modelOpener); BTextWidget* widget = WidgetFor(column, poseView, modelOpener);
if (widget && widget->IsVisible()) { if (widget && widget->IsVisible()) {
BRect widgetRect(widget->ColumnRect(rect.LeftTop(), column, BRect widgetRect(widget->ColumnRect(rect.LeftTop(), column,
poseView)); poseView));
if (updateRect.Intersects(widgetRect)) { if (updateRect.Intersects(widgetRect)) {
BRect widgetTextRect(widget->CalcRect(rect.LeftTop(), BRect widgetTextRect(widget->CalcRect(rect.LeftTop(),
column, poseView)); column, poseView));
bool selectDuringDraw = directDraw && selected bool selectDuringDraw = directDraw && selected
&& windowActive; && windowActive;
if (index == 0 && selectDuringDraw) { if (index == 0 && selectDuringDraw) {
//draw with dark background to select text //draw with dark background to select text
drawView->PushState(); drawView->PushState();
drawView->SetLowColor(0, 0, 0); drawView->SetLowColor(0, 0, 0);
} }
if (index == 0) { if (index == 0) {
widget->Draw(widgetRect, widgetTextRect, widget->Draw(widgetRect, widgetTextRect,
column->Width(), poseView, drawView, selected, column->Width(), poseView, drawView, selected,
@@ -611,7 +611,7 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
poseView, drawView, false, fClipboardMode, poseView, drawView, false, fClipboardMode,
offset, directDraw); offset, directDraw);
} }
if (index == 0 && selectDuringDraw) if (index == 0 && selectDuringDraw)
drawView->PopState(); drawView->PopState();
else if (index == 0 && selected) { else if (index == 0 && selected) {
@@ -640,11 +640,11 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
DrawIcon(iconOrigin, drawView, poseView->IconSize(), directDraw, DrawIcon(iconOrigin, drawView, poseView->IconSize(), directDraw,
!windowActive && !showSelectionWhenInactive); !windowActive && !showSelectionWhenInactive);
BColumn* column = poseView->FirstColumn(); BColumn* column = poseView->FirstColumn();
if (!column) if (!column)
return; return;
BTextWidget* widget = WidgetFor(column, poseView, modelOpener); BTextWidget* widget = WidgetFor(column, poseView, modelOpener);
if (!widget || !widget->IsVisible()) if (!widget || !widget->IsVisible())
return; return;
@@ -653,7 +653,7 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
bool selectDuringDraw = directDraw && selected bool selectDuringDraw = directDraw && selected
&& (poseView->IsDesktopWindow() || windowActive); && (poseView->IsDesktopWindow() || windowActive);
if (selectDuringDraw) { if (selectDuringDraw) {
// draw with dark background to select text // draw with dark background to select text
drawView->PushState(); drawView->PushState();
@@ -698,7 +698,7 @@ BPose::DeselectWithoutErasingBackground(BRect, BPoseView* poseView)
BColumn* column = poseView->FirstColumn(); BColumn* column = poseView->FirstColumn();
if (!column) if (!column)
return; return;
BTextWidget* widget = WidgetFor(column->AttrHash()); BTextWidget* widget = WidgetFor(column->AttrHash());
if (!widget || !widget->IsVisible()) if (!widget || !widget->IsVisible())
return; return;
+2 -2
View File
@@ -126,7 +126,7 @@ PoseList::FindAllPoses(const node_ref* node) const
result->AddItem(pose, 0); result->AddItem(pose, 0);
continue; continue;
} }
if (!model->IsSymLink()) if (!model->IsSymLink())
continue; continue;
@@ -135,7 +135,7 @@ PoseList::FindAllPoses(const node_ref* node) const
result->AddItem(pose); result->AddItem(pose);
continue; continue;
} }
if (model == NULL) { if (model == NULL) {
Model model(pose->TargetModel()->EntryRef(), true); Model model(pose->TargetModel()->EntryRef(), true);
if (*model.NodeRef() == *node) if (*model.NodeRef() == *node)
+1 -1
View File
@@ -8366,7 +8366,7 @@ BPoseView::OpenParent()
void void
BPoseView::IdentifySelection(bool force) BPoseView::IdentifySelection(bool force)
{ {
int32 count = fSelectionList->CountItems(); int32 count = fSelectionList->CountItems();
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
BPose* pose = fSelectionList->ItemAt(index); BPose* pose = fSelectionList->ItemAt(index);
+16 -16
View File
@@ -214,7 +214,7 @@ BPoseView::GetSupportedSuites(BMessage* _SCRIPTING_ONLY(data))
BPropertyInfo propertyInfo( BPropertyInfo propertyInfo(
const_cast<property_info*>(kPosesPropertyList)); const_cast<property_info*>(kPosesPropertyList));
data->AddFlat("messages", &propertyInfo); data->AddFlat("messages", &propertyInfo);
return _inherited::GetSupportedSuites(data); return _inherited::GetSupportedSuites(data);
#else #else
return B_UNSUPPORTED; return B_UNSUPPORTED;
@@ -247,9 +247,9 @@ BPoseView::HandleScriptingMessage(BMessage* _SCRIPTING_ONLY(message))
if (result != B_OK || index == -1) if (result != B_OK || index == -1)
return false; return false;
ASSERT(property); ASSERT(property);
switch (message->what) { switch (message->what) {
case B_CREATE_PROPERTY: case B_CREATE_PROPERTY:
handled = CreateProperty(message, &specifier, form, property, handled = CreateProperty(message, &specifier, form, property,
@@ -259,12 +259,12 @@ BPoseView::HandleScriptingMessage(BMessage* _SCRIPTING_ONLY(message))
case B_GET_PROPERTY: case B_GET_PROPERTY:
handled = GetProperty(&specifier, form, property, &reply); handled = GetProperty(&specifier, form, property, &reply);
break; break;
case B_SET_PROPERTY: case B_SET_PROPERTY:
handled = SetProperty(message, &specifier, form, property, handled = SetProperty(message, &specifier, form, property,
&reply); &reply);
break; break;
case B_COUNT_PROPERTIES: case B_COUNT_PROPERTIES:
handled = CountProperty(&specifier, form, property, &reply); handled = CountProperty(&specifier, form, property, &reply);
break; break;
@@ -272,7 +272,7 @@ BPoseView::HandleScriptingMessage(BMessage* _SCRIPTING_ONLY(message))
case B_DELETE_PROPERTY: case B_DELETE_PROPERTY:
handled = DeleteProperty(&specifier, form, property, &reply); handled = DeleteProperty(&specifier, form, property, &reply);
break; break;
case B_EXECUTE_PROPERTY: case B_EXECUTE_PROPERTY:
handled = ExecuteProperty(&specifier, form, property, &reply); handled = ExecuteProperty(&specifier, form, property, &reply);
break; break;
@@ -300,7 +300,7 @@ BPoseView::ExecuteProperty(BMessage* _SCRIPTING_ONLY(specifier),
bool handled = false; bool handled = false;
if (strcmp(property, kPropertyEntry) == 0) { if (strcmp(property, kPropertyEntry) == 0) {
BMessage launchMessage(B_REFS_RECEIVED); BMessage launchMessage(B_REFS_RECEIVED);
if (form == (int32)B_ENTRY_SPECIFIER) { if (form == (int32)B_ENTRY_SPECIFIER) {
// move all poses specified by entry_ref to Trash // move all poses specified by entry_ref to Trash
entry_ref ref; entry_ref ref;
@@ -574,21 +574,21 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
entry_ref ref; entry_ref ref;
if (specifier->FindRef("data", &ref) != B_OK) if (specifier->FindRef("data", &ref) != B_OK)
break; break;
int32 poseIndex; int32 poseIndex;
BPose* pose = FindPose(&ref, &poseIndex); BPose* pose = FindPose(&ref, &poseIndex);
for (;;) { for (;;) {
if (form == (int32)kPreviousSpecifier) if (form == (int32)kPreviousSpecifier)
pose = PoseAtIndex(--poseIndex); pose = PoseAtIndex(--poseIndex);
else if (form == (int32)kNextSpecifier) else if (form == (int32)kNextSpecifier)
pose = PoseAtIndex(++poseIndex); pose = PoseAtIndex(++poseIndex);
if (!pose) { if (!pose) {
error = B_ENTRY_NOT_FOUND; error = B_ENTRY_NOT_FOUND;
break; break;
} }
if (pose->IsSelected()) { if (pose->IsSelected()) {
reply->AddRef("result", reply->AddRef("result",
pose->TargetModel()->EntryRef()); pose->TargetModel()->EntryRef());
@@ -596,7 +596,7 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
break; break;
} }
} }
handled = true; handled = true;
break; break;
} }
@@ -622,7 +622,7 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
int32 index; int32 index;
if (specifier->FindInt32("index", &index) != B_OK) if (specifier->FindInt32("index", &index) != B_OK)
break; break;
if (!PoseAtIndex(index)) { if (!PoseAtIndex(index)) {
error = B_BAD_INDEX; error = B_BAD_INDEX;
handled = true; handled = true;
@@ -643,7 +643,7 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
entry_ref ref; entry_ref ref;
if (specifier->FindRef("data", &ref) != B_OK) if (specifier->FindRef("data", &ref) != B_OK)
break; break;
int32 tmp; int32 tmp;
BPose* pose = FindPose(&ref, form, &tmp); BPose* pose = FindPose(&ref, form, &tmp);
@@ -652,7 +652,7 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
handled = true; handled = true;
break; break;
} }
reply->AddRef("result", pose->TargetModel()->EntryRef()); reply->AddRef("result", pose->TargetModel()->EntryRef());
reply->AddInt32("index", IndexOfPose(pose)); reply->AddInt32("index", IndexOfPose(pose));
@@ -661,7 +661,7 @@ BPoseView::GetProperty(BMessage* _SCRIPTING_ONLY(specifier),
} }
} }
} }
if (error != B_OK) if (error != B_OK)
reply->AddInt32("error", error); reply->AddInt32("error", error);
+8 -8
View File
@@ -264,20 +264,20 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref)
fQueryListContainer = new QueryEntryListCollection(&sourceModel, this, fQueryListContainer = new QueryEntryListCollection(&sourceModel, this,
oldPoseList); oldPoseList);
fCreateOldPoseList = false; fCreateOldPoseList = false;
if (fQueryListContainer->InitCheck() != B_OK) { if (fQueryListContainer->InitCheck() != B_OK) {
delete fQueryListContainer; delete fQueryListContainer;
fQueryListContainer = NULL; fQueryListContainer = NULL;
return NULL; return NULL;
} }
fShowResultsFromTrash = fQueryListContainer->ShowResultsFromTrash(); fShowResultsFromTrash = fQueryListContainer->ShowResultsFromTrash();
TTracker::WatchNode(sourceModel.NodeRef(), B_WATCH_NAME | B_WATCH_STAT TTracker::WatchNode(sourceModel.NodeRef(), B_WATCH_NAME | B_WATCH_STAT
| B_WATCH_ATTR, this); | B_WATCH_ATTR, this);
fQueryList = fQueryListContainer->QueryList(); fQueryList = fQueryListContainer->QueryList();
if (fQueryListContainer->DynamicDateQuery()) { if (fQueryListContainer->DynamicDateQuery()) {
// calculate the time to trigger the query refresh - next midnight // calculate the time to trigger the query refresh - next midnight
@@ -328,7 +328,7 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref)
PRINT(("%" B_PRId32 " hours, %" B_PRId32 " minutes, %" B_PRId32 PRINT(("%" B_PRId32 " hours, %" B_PRId32 " minutes, %" B_PRId32
" seconds till midnight\n", hoursTillMidnight, minutesTillMidnight, " seconds till midnight\n", hoursTillMidnight, minutesTillMidnight,
secondsTillMidnight)); secondsTillMidnight));
int32 refreshInSeconds = delta % 60; int32 refreshInSeconds = delta % 60;
int32 refreshInMinutes = delta / 60; int32 refreshInMinutes = delta / 60;
int32 refreshInHours = refreshInMinutes / 60; int32 refreshInHours = refreshInMinutes / 60;
@@ -348,7 +348,7 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref)
NewLockingMemberFunctionObject(&BQueryPoseView::Refresh, this), NewLockingMemberFunctionObject(&BQueryPoseView::Refresh, this),
delta); delta);
} }
return fQueryListContainer->Clone(); return fQueryListContainer->Clone();
} }
@@ -603,7 +603,7 @@ status_t
QueryEntryListCollection::GetNextEntry(BEntry* entry, bool traverse) QueryEntryListCollection::GetNextEntry(BEntry* entry, bool traverse)
{ {
status_t result = B_ERROR; status_t result = B_ERROR;
for (int32 count = fQueryListRep->fQueryList->CountItems(); for (int32 count = fQueryListRep->fQueryList->CountItems();
fQueryListRep->fQueryListIndex < count; fQueryListRep->fQueryListIndex < count;
fQueryListRep->fQueryListIndex++) { fQueryListRep->fQueryListIndex++) {
@@ -641,7 +641,7 @@ status_t
QueryEntryListCollection::GetNextRef(entry_ref* ref) QueryEntryListCollection::GetNextRef(entry_ref* ref)
{ {
status_t result = B_ERROR; status_t result = B_ERROR;
for (int32 count = fQueryListRep->fQueryList->CountItems(); for (int32 count = fQueryListRep->fQueryList->CountItems();
fQueryListRep->fQueryListIndex < count; fQueryListRep->fQueryListIndex < count;
fQueryListRep->fQueryListIndex++) { fQueryListRep->fQueryListIndex++) {
@@ -660,7 +660,7 @@ status_t
QueryEntryListCollection::Rewind() QueryEntryListCollection::Rewind()
{ {
fQueryListRep->fQueryListIndex = 0; fQueryListRep->fQueryListIndex = 0;
return B_OK; return B_OK;
} }
+1 -1
View File
@@ -103,7 +103,7 @@ public:
const char* ofType = NULL, const char* openedByAppSig = NULL); const char* ofType = NULL, const char* openedByAppSig = NULL);
BRecentFilesList(int32 maxItems, bool navMenuFolders, BRecentFilesList(int32 maxItems, bool navMenuFolders,
const char* ofTypeList[], int32 ofTypeListCount, const char* ofTypeList[], int32 ofTypeListCount,
const char* openedByAppSig = NULL); const char* openedByAppSig = NULL);
virtual ~BRecentFilesList(); virtual ~BRecentFilesList();
// use one of the two NewFileListMenu calls to get an entire menu // use one of the two NewFileListMenu calls to get an entire menu
+1 -1
View File
@@ -108,7 +108,7 @@ const uint8 kRegExpMagic = 0234;
// of node is a literal string; for others, it is a node leading into a // of node is a literal string; for others, it is a node leading into a
// sub-FSM. In particular, the operand of a kRegExpBranch node is the first // sub-FSM. In particular, the operand of a kRegExpBranch node is the first
// node of the branch. (NB this is* not* a tree structure: the tail of the // node of the branch. (NB this is* not* a tree structure: the tail of the
// branch connects to the thing following the set of kRegExpBranches). // branch connects to the thing following the set of kRegExpBranches).
// The opcodes are: // The opcodes are:
// //
+3 -3
View File
@@ -108,12 +108,12 @@ public:
RegExp(const char*); RegExp(const char*);
RegExp(const BString&); RegExp(const BString&);
~RegExp(); ~RegExp();
status_t InitCheck() const; status_t InitCheck() const;
status_t SetTo(const char*); status_t SetTo(const char*);
status_t SetTo(const BString &); status_t SetTo(const BString &);
bool Matches(const char* string) const; bool Matches(const char* string) const;
bool Matches(const BString &) const; bool Matches(const BString &) const;
+1 -1
View File
@@ -97,7 +97,7 @@ StringValueSetting::Handle(const char* const* argv)
{ {
if (!*++argv) if (!*++argv)
return fValueExpectedErrorString; return fValueExpectedErrorString;
ValueChanged(*argv); ValueChanged(*argv);
return 0; return 0;
} }
+3 -3
View File
@@ -91,7 +91,7 @@ ArgvParser::MakeArgvEmpty()
// done with current argv, free it up // done with current argv, free it up
for (int32 index = 0; index < fArgc; index++) for (int32 index = 0; index < fArgc; index++)
delete[] fCurrentArgv[index]; delete[] fCurrentArgv[index];
fArgc = 0; fArgc = 0;
} }
@@ -125,7 +125,7 @@ ArgvParser::NextArgv()
} }
fCurrentArgs[++fCurrentArgsPos] = '\0'; fCurrentArgs[++fCurrentArgsPos] = '\0';
// terminate current arg pos // terminate current arg pos
// copy it as a string to the current argv slot // copy it as a string to the current argv slot
fCurrentArgv[fArgc] = new char [strlen(fCurrentArgs) + 1]; fCurrentArgv[fArgc] = new char [strlen(fCurrentArgs) + 1];
strcpy(fCurrentArgv[fArgc], fCurrentArgs); strcpy(fCurrentArgv[fArgc], fCurrentArgs);
@@ -409,7 +409,7 @@ Settings::MakeSettingsDirectory(BDirectory* resultingSettingsDir)
BPath path; BPath path;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, true) != B_OK) if (find_directory(B_USER_SETTINGS_DIRECTORY, &path, true) != B_OK)
return; return;
// make sure there is a directory // make sure there is a directory
// mkdir() will only make one leaf at a time, unfortunately // mkdir() will only make one leaf at a time, unfortunately
path.Append(fSettingsDir); path.Append(fSettingsDir);
+2 -2
View File
@@ -85,7 +85,7 @@ private:
FILE* fFile; FILE* fFile;
char* fBuffer; char* fBuffer;
int32 fPos; int32 fPos;
int fArgc; int fArgc;
char** fCurrentArgv; char** fCurrentArgv;
@@ -108,7 +108,7 @@ public:
virtual ~SettingsArgvDispatcher() {}; virtual ~SettingsArgvDispatcher() {};
void SaveSettings(Settings* settings, bool onlyIfNonDefault); void SaveSettings(Settings* settings, bool onlyIfNonDefault);
const char* Name() const { return name; } const char* Name() const { return name; }
// name as it appears in the settings file // name as it appears in the settings file
+14 -14
View File
@@ -134,7 +134,7 @@ BSlowContextMenu::SetNavDir(const entry_ref* ref)
{ {
ForceRebuild(); ForceRebuild();
// reset the slow menu building mechanism so we can add more stuff // reset the slow menu building mechanism so we can add more stuff
fNavDir = *ref; fNavDir = *ref;
} }
@@ -188,7 +188,7 @@ BSlowContextMenu::AddDynamicItem(add_state state)
{ {
if (fMenuBuilt) if (fMenuBuilt)
return false; return false;
if (state == B_ABORT) { if (state == B_ABORT) {
ClearMenuBuildingState(); ClearMenuBuildingState();
return false; return false;
@@ -229,7 +229,7 @@ BSlowContextMenu::StartBuildingItemList()
} }
fIteratingDesktop = false; fIteratingDesktop = false;
BDirectory parent; BDirectory parent;
status_t err = entry.GetParent(&parent); status_t err = entry.GetParent(&parent);
fItemList = new BObjectList<BMenuItem>(50); fItemList = new BObjectList<BMenuItem>(50);
@@ -308,7 +308,7 @@ BSlowContextMenu::AddNextItem()
BuildVolumeMenu(); BuildVolumeMenu();
return false; return false;
} }
// limit nav menus to 500 items only // limit nav menus to 500 items only
if (fItemList->CountItems() > 500) if (fItemList->CountItems() > 500)
return false; return false;
@@ -332,7 +332,7 @@ BSlowContextMenu::AddNextItem()
} }
model.CloseNode(); model.CloseNode();
if (!BPoseView::PoseVisible(&model, &poseInfo)) { if (!BPoseView::PoseVisible(&model, &poseInfo)) {
return true; return true;
} }
@@ -367,7 +367,7 @@ BSlowContextMenu::NewModelItem(Model* model, const BMessage* invokeMessage,
entry_ref ref; entry_ref ref;
bool container = false; bool container = false;
if (model->IsSymLink()) { if (model->IsSymLink()) {
Model* newResolvedModel = NULL; Model* newResolvedModel = NULL;
Model* result = model->LinkTo(); Model* result = model->LinkTo();
@@ -379,21 +379,21 @@ BSlowContextMenu::NewModelItem(Model* model, const BMessage* invokeMessage,
delete newResolvedModel; delete newResolvedModel;
newResolvedModel = NULL; newResolvedModel = NULL;
} }
result = newResolvedModel; result = newResolvedModel;
} }
if (result) { if (result) {
BModelOpener opener(result); BModelOpener opener(result);
// open the model, if it ain't open already // open the model, if it ain't open already
PoseInfo poseInfo; PoseInfo poseInfo;
if (result->Node()) { if (result->Node()) {
result->Node()->ReadAttr(kAttrPoseInfo, B_RAW_TYPE, 0, result->Node()->ReadAttr(kAttrPoseInfo, B_RAW_TYPE, 0,
&poseInfo, sizeof(poseInfo)); &poseInfo, sizeof(poseInfo));
} }
result->CloseNode(); result->CloseNode();
ref = *result->EntryRef(); ref = *result->EntryRef();
@@ -421,7 +421,7 @@ BSlowContextMenu::NewModelItem(Model* model, const BMessage* invokeMessage,
} else { } else {
BNavMenu* menu = new BNavMenu(truncatedString.String(), BNavMenu* menu = new BNavMenu(truncatedString.String(),
invokeMessage->what, target, parentWindow, typeslist); invokeMessage->what, target, parentWindow, typeslist);
menu->SetNavDir(&ref); menu->SetNavDir(&ref);
if (hook) if (hook)
menu->InitTrackingHook(hook->fTrackingHook, &(hook->fTarget), menu->InitTrackingHook(hook->fTrackingHook, &(hook->fTarget),
@@ -443,10 +443,10 @@ BSlowContextMenu::BuildVolumeMenu()
roster.Rewind(); roster.Rewind();
while (roster.GetNextVolume(&volume) == B_OK) { while (roster.GetNextVolume(&volume) == B_OK) {
if (!volume.IsPersistent()) if (!volume.IsPersistent())
continue; continue;
BDirectory startDir; BDirectory startDir;
if (volume.GetRootDirectory(&startDir) == B_OK) { if (volume.GetRootDirectory(&startDir) == B_OK) {
BEntry entry; BEntry entry;
@@ -457,7 +457,7 @@ BSlowContextMenu::BuildVolumeMenu()
delete model; delete model;
continue; continue;
} }
BNavMenu* menu = new BNavMenu(model->Name(), fMessage.what, BNavMenu* menu = new BNavMenu(model->Name(), fMessage.what,
fMessenger, fParentWindow, fTypesList); fMessenger, fParentWindow, fTypesList);
+2 -2
View File
@@ -50,9 +50,9 @@ public:
virtual void DetachedFromWindow(); virtual void DetachedFromWindow();
void SetNavDir(const entry_ref*); void SetNavDir(const entry_ref*);
void ClearMenu(); void ClearMenu();
void ForceRebuild(); void ForceRebuild();
bool NeedsToRebuild() const; bool NeedsToRebuild() const;
// will cause menu to get rebuilt next time it is shown // will cause menu to get rebuilt next time it is shown
+1 -1
View File
@@ -52,7 +52,7 @@ BSlowMenu::AddDynamicItem(add_state state)
{ {
if (fMenuBuilt) if (fMenuBuilt)
return false; return false;
if (state == B_ABORT) { if (state == B_ABORT) {
ClearMenuBuildingState(); ClearMenuBuildingState();
return false; return false;
+4 -4
View File
@@ -69,7 +69,7 @@ class OneShotDelayedTask : public DelayedTask {
public: public:
OneShotDelayedTask(FunctionObject* functor, bigtime_t delay); OneShotDelayedTask(FunctionObject* functor, bigtime_t delay);
virtual ~OneShotDelayedTask(); virtual ~OneShotDelayedTask();
virtual bool RunIfNeeded(bigtime_t currentTime); virtual bool RunIfNeeded(bigtime_t currentTime);
protected: protected:
@@ -196,7 +196,7 @@ protected:
bool Pulse(); bool Pulse();
// return true if quitting // return true if quitting
bigtime_t LatestRunTime() const; bigtime_t LatestRunTime() const;
virtual bool KeepPulsingWhenEmpty() const = 0; virtual bool KeepPulsingWhenEmpty() const = 0;
virtual void StartPulsingIfNeeded() = 0; virtual void StartPulsingIfNeeded() = 0;
@@ -226,7 +226,7 @@ private:
volatile bool fNeedToQuit; volatile bool fNeedToQuit;
volatile thread_id fScanThread; volatile thread_id fScanThread;
bool fKeepThread; bool fKeepThread;
typedef TaskLoop _inherited; typedef TaskLoop _inherited;
}; };
@@ -243,7 +243,7 @@ public:
private: private:
virtual bool KeepPulsingWhenEmpty() const; virtual bool KeepPulsingWhenEmpty() const;
virtual void StartPulsingIfNeeded(); virtual void StartPulsingIfNeeded();
bigtime_t fNextHeartBeatTime; bigtime_t fNextHeartBeatTime;
bool fPulseMe; bool fPulseMe;
}; };
+1 -1
View File
@@ -164,7 +164,7 @@ TemplatesMenu::BuildMenu(bool addItems)
entry_ref ref; entry_ref ref;
entry.GetRef(&ref); entry.GetRef(&ref);
BMessage* message = new BMessage(kNewEntryFromTemplate); BMessage* message = new BMessage(kNewEntryFromTemplate);
message->AddRef("refs_template", &ref); message->AddRef("refs_template", &ref);
message->AddString("name", fileName); message->AddString("name", fileName);
+2 -2
View File
@@ -229,7 +229,7 @@ BTextWidget::CheckExpiration()
get_click_speed(&doubleClickSpeed); get_click_speed(&doubleClickSpeed);
bigtime_t delta = system_time() - fLastClickedTime; bigtime_t delta = system_time() - fLastClickedTime;
if (delta > doubleClickSpeed) { if (delta > doubleClickSpeed) {
// at least 'doubleClickSpeed' microseconds ellapsed and no click // at least 'doubleClickSpeed' microseconds ellapsed and no click
// was registered since. // was registered since.
@@ -278,7 +278,7 @@ BTextWidget::MouseUp(BRect bounds, BPoseView* view, BPose* pose, BPoint)
fParams.pose = pose; fParams.pose = pose;
fParams.bounds = bounds; fParams.bounds = bounds;
fParams.poseView = view; fParams.poseView = view;
} else } else
fLastClickedTime = 0; fLastClickedTime = 0;
} }
+4 -4
View File
@@ -66,7 +66,7 @@ public:
// and current drawing view are different // and current drawing view are different
void MouseUp(BRect bounds, BPoseView*, BPose*, BPoint mouseLoc); void MouseUp(BRect bounds, BPoseView*, BPose*, BPoint mouseLoc);
BRect CalcRect(BPoint poseLoc, const BColumn*, const BPoseView*); BRect CalcRect(BPoint poseLoc, const BColumn*, const BPoseView*);
// returns the rect derived from the formatted string width // returns the rect derived from the formatted string width
// may force WidgetAttributeText recalculation // may force WidgetAttributeText recalculation
@@ -79,7 +79,7 @@ public:
BRect CalcOldRect(BPoint poseLoc, const BColumn*, const BPoseView*); BRect CalcOldRect(BPoint poseLoc, const BColumn*, const BPoseView*);
// after an update call this to determine the old rect so that // after an update call this to determine the old rect so that
// we can invalidate properly // we can invalidate properly
void StartEdit(BRect bounds, BPoseView*, BPose*); void StartEdit(BRect bounds, BPoseView*, BPose*);
void StopEdit(bool saveChanges, BPoint loc, BPoseView*, BPose*, void StopEdit(bool saveChanges, BPoint loc, BPoseView*, BPose*,
int32 index); int32 index);
@@ -104,7 +104,7 @@ public:
void CheckExpiration(); void CheckExpiration();
void CancelWait(); void CancelWait();
private: private:
BRect CalcRectCommon(BPoint poseLoc, const BColumn*, const BPoseView*, BRect CalcRectCommon(BPoint poseLoc, const BColumn*, const BPoseView*,
float width); float width);
@@ -118,7 +118,7 @@ private:
bool fVisible : 1; bool fVisible : 1;
bool fActive : 1; bool fActive : 1;
bool fSymLink : 1; bool fSymLink : 1;
bigtime_t fLastClickedTime; bigtime_t fLastClickedTime;
struct MouseUpParams fParams; struct MouseUpParams fParams;
}; };
+8 -8
View File
@@ -235,7 +235,7 @@ BTitleView::Draw(BRect /*updateRect*/, bool useOffscreen, bool updateOnly,
// fill background with light gray background // fill background with light gray background
if (!updateOnly) if (!updateOnly)
view->FillRect(bounds, B_SOLID_LOW); view->FillRect(bounds, B_SOLID_LOW);
view->BeginLineArray(4); view->BeginLineArray(4);
view->AddLine(bounds.LeftTop(), bounds.RightTop(), sShadowColor); view->AddLine(bounds.LeftTop(), bounds.RightTop(), sShadowColor);
view->AddLine(bounds.LeftBottom(), bounds.RightBottom(), view->AddLine(bounds.LeftBottom(), bounds.RightBottom(),
@@ -399,7 +399,7 @@ BTitleView::MouseMoved(BPoint where, uint32 code, const BMessage* message)
else else
SetViewCursor(B_CURSOR_SYSTEM_DEFAULT); SetViewCursor(B_CURSOR_SYSTEM_DEFAULT);
break; break;
case B_EXITED_VIEW: case B_EXITED_VIEW:
SetViewCursor(B_CURSOR_SYSTEM_DEFAULT); SetViewCursor(B_CURSOR_SYSTEM_DEFAULT);
break; break;
@@ -546,10 +546,10 @@ BColumnTitle::Draw(BView* view, bool pressed)
triangle[1] = center + BPoint(3.5, -1.5); triangle[1] = center + BPoint(3.5, -1.5);
triangle[2] = center + BPoint(0.0, 2.0); triangle[2] = center + BPoint(0.0, 2.0);
} }
uint32 flags = view->Flags(); uint32 flags = view->Flags();
view->SetFlags(flags | B_SUBPIXEL_PRECISE); view->SetFlags(flags | B_SUBPIXEL_PRECISE);
if (secondary) { if (secondary) {
view->SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), view->SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
1.3)); 1.3));
@@ -559,7 +559,7 @@ BColumnTitle::Draw(BView* view, bool pressed)
1.6)); 1.6));
view->FillTriangle(triangle[0], triangle[1], triangle[2]); view->FillTriangle(triangle[0], triangle[1], triangle[2]);
} }
view->SetFlags(flags); view->SetFlags(flags);
} }
@@ -579,7 +579,7 @@ BColumnTitle::Draw(BView* view, bool pressed)
pressed ? sLightShadowColor : sLightShadowColor); pressed ? sLightShadowColor : sLightShadowColor);
view->AddLine(rect.LeftTop(), rect.RightTop(), view->AddLine(rect.LeftTop(), rect.RightTop(),
pressed ? sDarkShadowColor : sShineColor); pressed ? sDarkShadowColor : sShineColor);
view->AddLine(rect.LeftTop(), rect.LeftBottom(), view->AddLine(rect.LeftTop(), rect.LeftBottom(),
pressed ? sDarkShadowColor : sShineColor); pressed ? sDarkShadowColor : sShineColor);
view->AddLine(rect.RightTop(), rect.RightBottom(), view->AddLine(rect.RightTop(), rect.RightBottom(),
@@ -820,7 +820,7 @@ ColumnDragState::Moved(BPoint where, uint32)
} else } else
drawOutline = true; drawOutline = true;
} }
if (drawOutline) if (drawOutline)
DrawOutline(where.x - fInitialMouseTrackOffset); DrawOutline(where.x - fInitialMouseTrackOffset);
else if (undrawOutline) else if (undrawOutline)
@@ -845,7 +845,7 @@ ColumnDragState::Clicked(BPoint /*where*/)
uint32 primarySort = poseView->PrimarySort(); uint32 primarySort = poseView->PrimarySort();
uint32 secondarySort = poseView->SecondarySort(); uint32 secondarySort = poseView->SecondarySort();
bool shift = (modifiers() & B_SHIFT_KEY) != 0; bool shift = (modifiers() & B_SHIFT_KEY) != 0;
// For now: // For now:
// if we hit the primary sort field again // if we hit the primary sort field again
// then if shift key was down, switch primary and secondary // then if shift key was down, switch primary and secondary
+3 -3
View File
@@ -85,7 +85,7 @@ public:
protected: protected:
void MouseMoved(BPoint, uint32, const BMessage*); void MouseMoved(BPoint, uint32, const BMessage*);
private: private:
BColumnTitle* FindColumnTitle(BPoint) const; BColumnTitle* FindColumnTitle(BPoint) const;
BColumnTitle* InColumnResizeArea(BPoint) const; BColumnTitle* InColumnResizeArea(BPoint) const;
@@ -100,7 +100,7 @@ private:
ColumnTrackState* fTrackingState; ColumnTrackState* fTrackingState;
static OffscreenBitmap* sOffscreen; static OffscreenBitmap* sOffscreen;
typedef BView _inherited; typedef BView _inherited;
friend class ColumnTrackState; friend class ColumnTrackState;
@@ -112,7 +112,7 @@ class BColumnTitle {
public: public:
BColumnTitle(BTitleView*, BColumn*); BColumnTitle(BTitleView*, BColumn*);
virtual ~BColumnTitle() {} virtual ~BColumnTitle() {}
virtual void Draw(BView*, bool pressed = false); virtual void Draw(BView*, bool pressed = false);
BColumn* Column() const; BColumn* Column() const;
+1 -1
View File
@@ -233,7 +233,7 @@ TTracker::TTracker()
setrlimit(RLIMIT_NOFILE, &rl); setrlimit(RLIMIT_NOFILE, &rl);
fNodeMonitorCount = DEFAULT_MON_NUM; fNodeMonitorCount = DEFAULT_MON_NUM;
gLocalizedNamePreferred gLocalizedNamePreferred
= BLocaleRoster::Default()->IsFilesystemTranslationPreferred(); = BLocaleRoster::Default()->IsFilesystemTranslationPreferred();
+3 -3
View File
@@ -237,7 +237,7 @@ TTracker::DeleteProperty(BMessage* /*specifier*/, int32 form,
if (form != B_DIRECT_SPECIFIER) if (form != B_DIRECT_SPECIFIER)
// only support direct specifier // only support direct specifier
return false; return false;
// empty the trash // empty the trash
FSEmptyTrash(); FSEmptyTrash();
return true; return true;
@@ -293,11 +293,11 @@ bool
TTracker::ExecuteProperty(BMessage*, int32 form, const char* property, BMessage*) TTracker::ExecuteProperty(BMessage*, int32 form, const char* property, BMessage*)
{ {
if (strcmp(property, kPropertyPreferences) == 0) { if (strcmp(property, kPropertyPreferences) == 0) {
if (form != B_DIRECT_SPECIFIER) if (form != B_DIRECT_SPECIFIER)
// only support direct specifier // only support direct specifier
return false; return false;
ShowSettingsWindow(); ShowSettingsWindow();
return true; return true;
+2 -2
View File
@@ -76,7 +76,7 @@ class TrackerSettings {
void SetMountSharedVolumesOntoDesktop(bool); void SetMountSharedVolumesOntoDesktop(bool);
bool EjectWhenUnmounting(); bool EjectWhenUnmounting();
void SetEjectWhenUnmounting(bool); void SetEjectWhenUnmounting(bool);
bool ShowVolumeSpaceBar(); bool ShowVolumeSpaceBar();
void SetShowVolumeSpaceBar(bool); void SetShowVolumeSpaceBar(bool);
rgb_color UsedSpaceColor(); rgb_color UsedSpaceColor();
@@ -85,7 +85,7 @@ class TrackerSettings {
void SetFreeSpaceColor(rgb_color color); void SetFreeSpaceColor(rgb_color color);
rgb_color WarningSpaceColor(); rgb_color WarningSpaceColor();
void SetWarningSpaceColor(rgb_color color); void SetWarningSpaceColor(rgb_color color);
bool ShowFullPathInTitleBar(); bool ShowFullPathInTitleBar();
void SetShowFullPathInTitleBar(bool); void SetShowFullPathInTitleBar(bool);
bool SortFolderNamesFirst(); bool SortFolderNamesFirst();
+5 -5
View File
@@ -195,12 +195,12 @@ TrackerSettingsWindow::_ViewAt(int32 i)
{ {
if (!Lock()) if (!Lock())
return NULL; return NULL;
SettingsItem* item = dynamic_cast<SettingsItem*> SettingsItem* item = dynamic_cast<SettingsItem*>
(fSettingsTypeListView->ItemAt(i)); (fSettingsTypeListView->ItemAt(i));
Unlock(); Unlock();
return item->View(); return item->View();
} }
@@ -227,7 +227,7 @@ TrackerSettingsWindow::_UpdateButtons()
defaultable |= _ViewAt(i)->IsDefaultable(); defaultable |= _ViewAt(i)->IsDefaultable();
revertable |= _ViewAt(i)->IsRevertable(); revertable |= _ViewAt(i)->IsRevertable();
} }
fDefaultsButton->SetEnabled(defaultable); fDefaultsButton->SetEnabled(defaultable);
fRevertButton->SetEnabled(revertable); fRevertButton->SetEnabled(revertable);
} }
@@ -237,7 +237,7 @@ void
TrackerSettingsWindow::_HandlePressedDefaultsButton() TrackerSettingsWindow::_HandlePressedDefaultsButton()
{ {
int32 itemCount = fSettingsTypeListView->CountItems(); int32 itemCount = fSettingsTypeListView->CountItems();
for (int32 i = 0; i < itemCount; i++) { for (int32 i = 0; i < itemCount; i++) {
if (_ViewAt(i)->IsDefaultable()) if (_ViewAt(i)->IsDefaultable())
_ViewAt(i)->SetDefaults(); _ViewAt(i)->SetDefaults();
+11 -11
View File
@@ -73,13 +73,13 @@ TrackerString::Matches(const char* string, bool caseSensitivity,
default: default:
case kNone: case kNone:
return false; return false;
case kStartsWith: case kStartsWith:
return StartsWith(string, caseSensitivity); return StartsWith(string, caseSensitivity);
case kEndsWith: case kEndsWith:
return EndsWith(string, caseSensitivity); return EndsWith(string, caseSensitivity);
case kContains: case kContains:
return Contains(string, caseSensitivity); return Contains(string, caseSensitivity);
@@ -97,14 +97,14 @@ TrackerString::MatchesRegExp(const char* pattern, bool caseSensitivity) const
{ {
BString patternString(pattern); BString patternString(pattern);
BString textString(String()); BString textString(String());
if (caseSensitivity == false) { if (caseSensitivity == false) {
patternString.ToLower(); patternString.ToLower();
textString.ToLower(); textString.ToLower();
} }
RegExp expression(patternString); RegExp expression(patternString);
if (expression.InitCheck() != B_OK) if (expression.InitCheck() != B_OK)
return false; return false;
@@ -127,7 +127,7 @@ TrackerString::EndsWith(const char* string, bool caseSensitivity) const
int32 position = Length() - (int32)strlen(string); int32 position = Length() - (int32)strlen(string);
if (position < 0) if (position < 0)
return false; return false;
if (caseSensitivity) if (caseSensitivity)
return FindLast(string) == position; return FindLast(string) == position;
else else
@@ -442,7 +442,7 @@ TrackerString::MatchesBracketExpression(const char* string,
bool inverse = *pattern == '^' || *pattern == '!'; bool inverse = *pattern == '^' || *pattern == '!';
// We allow both ^ and ! as a initial inverting character. // We allow both ^ and ! as a initial inverting character.
if (inverse) if (inverse)
pattern++; pattern++;
@@ -533,7 +533,7 @@ TrackerString::StringMatchesPattern(const char* string, const char* pattern,
string = MoveToEndOfGlyph(string); string = MoveToEndOfGlyph(string);
} }
} }
if (*pattern == '\0') { if (*pattern == '\0') {
// An ending * matches all strings. // An ending * matches all strings.
return true; return true;
@@ -588,7 +588,7 @@ TrackerString::StringMatchesPattern(const char* string, const char* pattern,
} }
break; break;
} }
case '[': case '[':
pattern++; pattern++;
@@ -603,7 +603,7 @@ TrackerString::StringMatchesPattern(const char* string, const char* pattern,
// Skip the rest of the bracket: // Skip the rest of the bracket:
while (*pattern != ']' && *pattern != '\0') while (*pattern != ']' && *pattern != '\0')
pattern++; pattern++;
// Failure if no closing bracket; // Failure if no closing bracket;
if (*pattern == '\0') if (*pattern == '\0')
return false; return false;
+5 -5
View File
@@ -70,7 +70,7 @@ public:
bool MatchesRegExp(const char*, bool caseSensitivity = true) const; bool MatchesRegExp(const char*, bool caseSensitivity = true) const;
bool MatchesRegExp(const RegExp&) const; bool MatchesRegExp(const RegExp&) const;
bool MatchesRegExp(const RegExp*) const; bool MatchesRegExp(const RegExp*) const;
bool MatchesGlob(const char*, bool caseSensitivity = false) const; bool MatchesGlob(const char*, bool caseSensitivity = false) const;
bool EndsWith(const char*, bool caseSensitivity = false) const; bool EndsWith(const char*, bool caseSensitivity = false) const;
bool StartsWith(const char*, bool caseSensitivity = false) const; bool StartsWith(const char*, bool caseSensitivity = false) const;
@@ -106,13 +106,13 @@ private:
// Not counting start! // Not counting start!
bool IsStartOfGlyph(char) const; bool IsStartOfGlyph(char) const;
const char* MoveToEndOfGlyph(const char*) const; const char* MoveToEndOfGlyph(const char*) const;
// Functions for Glob matching: // Functions for Glob matching:
bool MatchesBracketExpression(const char* string, const char* pattern, bool MatchesBracketExpression(const char* string, const char* pattern,
bool caseSensitivity) const; bool caseSensitivity) const;
bool StringMatchesPattern(const char* string, const char* pattern, bool StringMatchesPattern(const char* string, const char* pattern,
bool caseSensitivity) const; bool caseSensitivity) const;
char ConditionalToLower(char c, bool toLower) const; char ConditionalToLower(char c, bool toLower) const;
bool CharsAreEqual(char char1, char char2, bool toLower) const; bool CharsAreEqual(char char1, char char2, bool toLower) const;
bool UTF8CharsAreEqual(const char* string1, const char* string2) const; bool UTF8CharsAreEqual(const char* string1, const char* string2) const;
@@ -124,7 +124,7 @@ TrackerString::MatchesRegExp(const RegExp* expression) const
{ {
if (expression == NULL || expression->InitCheck() != B_OK) if (expression == NULL || expression->InitCheck() != B_OK)
return false; return false;
return expression->Matches(*this); return expression->Matches(*this);
} }
@@ -134,7 +134,7 @@ TrackerString::MatchesRegExp(const RegExp &expression) const
{ {
if (expression.InitCheck() != B_OK) if (expression.InitCheck() != B_OK)
return false; return false;
return expression.Matches(*this); return expression.Matches(*this);
} }
+2 -2
View File
@@ -172,7 +172,7 @@ BTrashWatcher::UpdateTrashIcons()
const void* vectorData = GetTrackerResources()->LoadResource( const void* vectorData = GetTrackerResources()->LoadResource(
B_VECTOR_ICON_TYPE, B_VECTOR_ICON_TYPE,
fTrashFull ? R_TrashFullIcon : R_TrashIcon, &vectorSize); fTrashFull ? R_TrashFullIcon : R_TrashIcon, &vectorSize);
if (vectorData) { if (vectorData) {
trashDir.WriteAttr(kAttrIcon, B_VECTOR_ICON_TYPE, 0, trashDir.WriteAttr(kAttrIcon, B_VECTOR_ICON_TYPE, 0,
vectorData, vectorSize); vectorData, vectorSize);
@@ -185,7 +185,7 @@ BTrashWatcher::UpdateTrashIcons()
largeData, largeSize); largeData, largeSize);
} else } else
TRESPASS(); TRESPASS();
if (smallData) { if (smallData) {
trashDir.WriteAttr(kAttrMiniIcon, 'MICN', 0, trashDir.WriteAttr(kAttrMiniIcon, 'MICN', 0,
smallData, smallSize); smallData, smallSize);
+1 -1
View File
@@ -53,7 +53,7 @@ public:
protected: protected:
virtual void MessageReceived(BMessage*); virtual void MessageReceived(BMessage*);
private: private:
void WatchTrashDirs(); void WatchTrashDirs();
void UpdateTrashIcons(); void UpdateTrashIcons();
+2 -2
View File
@@ -151,10 +151,10 @@ class BViewState {
uint32 fPrimarySortType; uint32 fPrimarySortType;
uint32 fSecondarySortType; uint32 fSecondarySortType;
bool fReverseSort; bool fReverseSort;
void _Init(); void _Init();
void _StorePreviousState(); void _StorePreviousState();
uint32 fPreviousViewMode; uint32 fPreviousViewMode;
uint32 fPreviousLastIconMode; uint32 fPreviousLastIconMode;
uint32 fPreviousIconSize; uint32 fPreviousIconSize;
+15 -15
View File
@@ -21,9 +21,9 @@
#include "AntialiasingSettingsView.h" #include "AntialiasingSettingsView.h"
#include "APRView.h" #include "APRView.h"
#include "LookAndFeelSettingsView.h"
#include "defs.h" #include "defs.h"
#include "FontView.h" #include "FontView.h"
#include "LookAndFeelSettingsView.h"
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
@@ -50,19 +50,19 @@ APRWindow::APRWindow(BRect frame)
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL); BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_LABEL);
fLookAndFeelSettings = new LookAndFeelSettingsView(
B_TRANSLATE("Look and feel"));
fFontSettings = new FontView(B_TRANSLATE("Fonts")); fFontSettings = new FontView(B_TRANSLATE("Fonts"));
fColorsView = new APRView(B_TRANSLATE("Colors")); fColorsView = new APRView(B_TRANSLATE("Colors"));
fLookAndFeelSettings = new LookAndFeelSettingsView(
B_TRANSLATE("Look and feel"));
fAntialiasingSettings = new AntialiasingSettingsView( fAntialiasingSettings = new AntialiasingSettingsView(
B_TRANSLATE("Antialiasing")); B_TRANSLATE("Antialiasing"));
tabView->AddTab(fLookAndFeelSettings);
tabView->AddTab(fFontSettings); tabView->AddTab(fFontSettings);
tabView->AddTab(fColorsView); tabView->AddTab(fColorsView);
tabView->AddTab(fLookAndFeelSettings);
tabView->AddTab(fAntialiasingSettings); tabView->AddTab(fAntialiasingSettings);
_UpdateButtons(); _UpdateButtons();
@@ -91,8 +91,8 @@ APRWindow::MessageReceived(BMessage *message)
case kMsgSetDefaults: case kMsgSetDefaults:
fFontSettings->SetDefaults(); fFontSettings->SetDefaults();
fColorsView->SetDefaults(); fColorsView->SetDefaults();
fAntialiasingSettings->SetDefaults();
fLookAndFeelSettings->SetDefaults(); fLookAndFeelSettings->SetDefaults();
fAntialiasingSettings->SetDefaults();
_UpdateButtons(); _UpdateButtons();
break; break;
@@ -100,8 +100,8 @@ APRWindow::MessageReceived(BMessage *message)
case kMsgRevert: case kMsgRevert:
fColorsView->Revert(); fColorsView->Revert();
fAntialiasingSettings->Revert(); fAntialiasingSettings->Revert();
fFontSettings->Revert();
fLookAndFeelSettings->Revert(); fLookAndFeelSettings->Revert();
fFontSettings->Revert();
_UpdateButtons(); _UpdateButtons();
break; break;
@@ -128,10 +128,10 @@ APRWindow::_IsDefaultable() const
// printf("colors defaultable: %d\n", fColorsView->IsDefaultable()); // printf("colors defaultable: %d\n", fColorsView->IsDefaultable());
// printf("AA defaultable: %d\n", fAntialiasingSettings->IsDefaultable()); // printf("AA defaultable: %d\n", fAntialiasingSettings->IsDefaultable());
// printf("decor defaultable: %d\n", fLookAndFeelSettings->IsDefaultable()); // printf("decor defaultable: %d\n", fLookAndFeelSettings->IsDefaultable());
return fColorsView->IsDefaultable() return fFontSettings->IsDefaultable()
|| fFontSettings->IsDefaultable() || fColorsView->IsDefaultable()
|| fAntialiasingSettings->IsDefaultable() || fLookAndFeelSettings->IsDefaultable()
|| fLookAndFeelSettings->IsDefaultable(); || fAntialiasingSettings->IsDefaultable();
} }
@@ -142,8 +142,8 @@ APRWindow::_IsRevertable() const
// printf("colors revertable: %d\n", fColorsView->IsRevertable()); // printf("colors revertable: %d\n", fColorsView->IsRevertable());
// printf("AA revertable: %d\n", fAntialiasingSettings->IsRevertable()); // printf("AA revertable: %d\n", fAntialiasingSettings->IsRevertable());
// printf("decor revertable: %d\n", fLookAndFeelSettings->IsRevertable()); // printf("decor revertable: %d\n", fLookAndFeelSettings->IsRevertable());
return fColorsView->IsRevertable() return fFontSettings->IsRevertable()
|| fFontSettings->IsRevertable() || fColorsView->IsRevertable()
|| fAntialiasingSettings->IsRevertable() || fLookAndFeelSettings->IsRevertable()
|| fLookAndFeelSettings->IsRevertable(); || fAntialiasingSettings->IsRevertable();
} }