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