Tracker: style fixes to Pose class
This commit is contained in:
+58
-50
@@ -73,18 +73,19 @@ CalcFreeSpace(BVolume* volume)
|
|||||||
// symlink itself
|
// symlink itself
|
||||||
BPose::BPose(Model* model, BPoseView* view, uint32 clipboardMode,
|
BPose::BPose(Model* model, BPoseView* view, uint32 clipboardMode,
|
||||||
bool selected)
|
bool selected)
|
||||||
: fModel(model),
|
:
|
||||||
fWidgetList(4, true),
|
fModel(model),
|
||||||
fClipboardMode(clipboardMode),
|
fWidgetList(4, true),
|
||||||
fPercent(-1),
|
fClipboardMode(clipboardMode),
|
||||||
fSelectionTime(0),
|
fPercent(-1),
|
||||||
fIsSelected(selected),
|
fSelectionTime(0),
|
||||||
fHasLocation(false),
|
fIsSelected(selected),
|
||||||
fNeedsSaveLocation(false),
|
fHasLocation(false),
|
||||||
fListModeInited(false),
|
fNeedsSaveLocation(false),
|
||||||
fWasAutoPlaced(false),
|
fListModeInited(false),
|
||||||
fBrokenSymLink(false),
|
fWasAutoPlaced(false),
|
||||||
fBackgroundClean(false)
|
fBrokenSymLink(false),
|
||||||
|
fBackgroundClean(false)
|
||||||
{
|
{
|
||||||
CreateWidgets(view);
|
CreateWidgets(view);
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ BPose::CreateWidgets(BPoseView* poseView)
|
|||||||
{
|
{
|
||||||
for (int32 index = 0; ; index++) {
|
for (int32 index = 0; ; index++) {
|
||||||
BColumn* column = poseView->ColumnAt(index);
|
BColumn* column = poseView->ColumnAt(index);
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
break;
|
break;
|
||||||
fWidgetList.AddItem(new BTextWidget(fModel, column, poseView));
|
fWidgetList.AddItem(new BTextWidget(fModel, column, poseView));
|
||||||
}
|
}
|
||||||
@@ -160,6 +161,7 @@ BPose::AddWidget(BPoseView* poseView, BColumn* column,
|
|||||||
|
|
||||||
BTextWidget* widget = new BTextWidget(fModel, column, poseView);
|
BTextWidget* widget = new BTextWidget(fModel, column, poseView);
|
||||||
fWidgetList.AddItem(widget);
|
fWidgetList.AddItem(widget);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,6 +205,7 @@ OneMouseUp(BTextWidget* widget, BPose* pose, BPoseView* poseView,
|
|||||||
widget->MouseUp(rect, poseView, pose, where);
|
widget->MouseUp(rect, poseView, pose, where);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,9 +243,9 @@ BPose::UpdateWidgetAndModel(Model* resolvedModel, const char* attrName,
|
|||||||
if (poseView->ViewMode() != kListMode)
|
if (poseView->ViewMode() != kListMode)
|
||||||
poseLoc = Location(poseView);
|
poseLoc = Location(poseView);
|
||||||
|
|
||||||
ASSERT(!resolvedModel || resolvedModel->IsNodeOpen());
|
ASSERT(resolvedModel == NULL || resolvedModel->IsNodeOpen());
|
||||||
|
|
||||||
if (attrName) {
|
if (attrName != NULL) {
|
||||||
// pick up new attributes and find out if icon needs updating
|
// pick up new attributes and find out if icon needs updating
|
||||||
if (resolvedModel->AttrChanged(attrName) && visible)
|
if (resolvedModel->AttrChanged(attrName) && visible)
|
||||||
UpdateIcon(poseLoc, poseView);
|
UpdateIcon(poseLoc, poseView);
|
||||||
@@ -284,7 +287,7 @@ BPose::UpdateWidgetAndModel(Model* resolvedModel, const char* attrName,
|
|||||||
// distribute stat changes
|
// distribute stat changes
|
||||||
for (int32 index = 0; ; index++) {
|
for (int32 index = 0; ; index++) {
|
||||||
BColumn* column = poseView->ColumnAt(index);
|
BColumn* column = poseView->ColumnAt(index);
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (column->StatField()) {
|
if (column->StatField()) {
|
||||||
@@ -327,6 +330,7 @@ BPose::UpdateVolumeSpaceBar(BVolume* volume)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,11 +427,11 @@ BPose::EditPreviousNextWidgetCommon(BPoseView* poseView, bool next)
|
|||||||
for (int32 index = next ? 0 : poseView->CountColumns() - 1; ;
|
for (int32 index = next ? 0 : poseView->CountColumns() - 1; ;
|
||||||
index += delta) {
|
index += delta) {
|
||||||
BColumn* column = poseView->ColumnAt(index);
|
BColumn* column = poseView->ColumnAt(index);
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
BTextWidget* widget = WidgetFor(column->AttrHash());
|
BTextWidget* widget = WidgetFor(column->AttrHash());
|
||||||
if (widget && widget->IsActive()) {
|
if (widget != NULL && widget->IsActive()) {
|
||||||
poseView->CommitActivePose();
|
poseView->CommitActivePose();
|
||||||
found = true;
|
found = true;
|
||||||
continue;
|
continue;
|
||||||
@@ -476,11 +480,10 @@ BPose::PointInPose(const BPoseView* poseView, BPoint where) const
|
|||||||
rect.right += poseView->IconSizeInt() - 1;
|
rect.right += poseView->IconSizeInt() - 1;
|
||||||
rect.bottom += poseView->IconSizeInt() - 1;
|
rect.bottom += poseView->IconSizeInt() - 1;
|
||||||
|
|
||||||
if (rect.Contains(where))
|
if (rect.Contains(where)) {
|
||||||
return IconCache::sIconCache->IconHitTest(where - location,
|
return IconCache::sIconCache->IconHitTest(where - location,
|
||||||
ResolvedModel(),
|
ResolvedModel(), kNormalIcon, poseView->IconSize());
|
||||||
kNormalIcon,
|
}
|
||||||
poseView->IconSize());
|
|
||||||
|
|
||||||
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
||||||
if (widget) {
|
if (widget) {
|
||||||
@@ -500,7 +503,7 @@ BPose::PointInPose(const BPoseView* poseView, BPoint where) const
|
|||||||
rect.right += B_MINI_ICON + kMiniIconSeparator;
|
rect.right += B_MINI_ICON + kMiniIconSeparator;
|
||||||
rect.bottom += poseView->IconPoseHeight();
|
rect.bottom += poseView->IconPoseHeight();
|
||||||
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
||||||
if (widget)
|
if (widget != NULL)
|
||||||
rect.right += ceil(widget->TextWidth(poseView) + 1);
|
rect.right += ceil(widget->TextWidth(poseView) + 1);
|
||||||
|
|
||||||
return rect.Contains(where);
|
return rect.Contains(where);
|
||||||
@@ -525,7 +528,7 @@ BPose::PointInPose(BPoint loc, const BPoseView* poseView, BPoint where,
|
|||||||
|
|
||||||
for (int32 index = 0; ; index++) {
|
for (int32 index = 0; ; index++) {
|
||||||
BColumn* column = poseView->ColumnAt(index);
|
BColumn* column = poseView->ColumnAt(index);
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
break;
|
break;
|
||||||
BTextWidget* widget = WidgetFor(column->AttrHash());
|
BTextWidget* widget = WidgetFor(column->AttrHash());
|
||||||
if (widget
|
if (widget
|
||||||
@@ -579,7 +582,7 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
|
|||||||
|
|
||||||
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 == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// if widget doesn't exist, create it
|
// if widget doesn't exist, create it
|
||||||
@@ -607,9 +610,9 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
|
|||||||
column->Width(), poseView, drawView, selected,
|
column->Width(), poseView, drawView, selected,
|
||||||
fClipboardMode, offset, directDraw);
|
fClipboardMode, offset, directDraw);
|
||||||
} else {
|
} else {
|
||||||
widget->Draw(widgetTextRect, widgetTextRect, column->Width(),
|
widget->Draw(widgetTextRect, widgetTextRect,
|
||||||
poseView, drawView, false, fClipboardMode,
|
column->Width(), poseView, drawView, false,
|
||||||
offset, directDraw);
|
fClipboardMode, offset, directDraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == 0 && selectDuringDraw)
|
if (index == 0 && selectDuringDraw)
|
||||||
@@ -632,7 +635,6 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// draw in icon mode
|
// draw in icon mode
|
||||||
BPoint location(Location(poseView));
|
BPoint location(Location(poseView));
|
||||||
BPoint iconOrigin(location);
|
BPoint iconOrigin(location);
|
||||||
@@ -642,11 +644,11 @@ BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
|
|||||||
!windowActive && !showSelectionWhenInactive);
|
!windowActive && !showSelectionWhenInactive);
|
||||||
|
|
||||||
BColumn* column = poseView->FirstColumn();
|
BColumn* column = poseView->FirstColumn();
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BTextWidget* widget = WidgetFor(column, poseView, modelOpener);
|
BTextWidget* widget = WidgetFor(column, poseView, modelOpener);
|
||||||
if (!widget || !widget->IsVisible())
|
if (widget == NULL || !widget->IsVisible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rect = widget->CalcRect(location, 0, poseView);
|
rect = widget->CalcRect(location, 0, poseView);
|
||||||
@@ -696,11 +698,11 @@ BPose::DeselectWithoutErasingBackground(BRect, BPoseView* poseView)
|
|||||||
UpdateIcon(location, poseView);
|
UpdateIcon(location, poseView);
|
||||||
|
|
||||||
BColumn* column = poseView->FirstColumn();
|
BColumn* column = poseView->FirstColumn();
|
||||||
if (!column)
|
if (column == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BTextWidget* widget = WidgetFor(column->AttrHash());
|
BTextWidget* widget = WidgetFor(column->AttrHash());
|
||||||
if (!widget || !widget->IsVisible())
|
if (widget == NULL || !widget->IsVisible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// just invalidate the background, don't draw anything
|
// just invalidate the background, don't draw anything
|
||||||
@@ -709,7 +711,7 @@ BPose::DeselectWithoutErasingBackground(BRect, BPoseView* poseView)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BPose::MoveTo(BPoint point, BPoseView* poseView, bool inval)
|
BPose::MoveTo(BPoint point, BPoseView* poseView, bool invalidate)
|
||||||
{
|
{
|
||||||
point.x = floorf(point.x);
|
point.x = floorf(point.x);
|
||||||
point.y = floorf(point.y);
|
point.y = floorf(point.y);
|
||||||
@@ -722,7 +724,7 @@ BPose::MoveTo(BPoint point, BPoseView* poseView, bool inval)
|
|||||||
if (point == oldLocation || poseView->ViewMode() == kListMode)
|
if (point == oldLocation || poseView->ViewMode() == kListMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inval)
|
if (invalidate)
|
||||||
oldBounds = CalcRect(poseView);
|
oldBounds = CalcRect(poseView);
|
||||||
|
|
||||||
// might need to move a text view if we're active
|
// might need to move a text view if we're active
|
||||||
@@ -744,7 +746,7 @@ BPose::MoveTo(BPoint point, BPoseView* poseView, bool inval)
|
|||||||
fHasLocation = true;
|
fHasLocation = true;
|
||||||
fNeedsSaveLocation = true;
|
fNeedsSaveLocation = true;
|
||||||
|
|
||||||
if (inval) {
|
if (invalidate) {
|
||||||
poseView->Invalidate(oldBounds);
|
poseView->Invalidate(oldBounds);
|
||||||
poseView->Invalidate(CalcRect(poseView));
|
poseView->Invalidate(CalcRect(poseView));
|
||||||
}
|
}
|
||||||
@@ -759,6 +761,7 @@ BPose::ActiveWidget() const
|
|||||||
if (widget->IsActive())
|
if (widget->IsActive())
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,8 +773,9 @@ BPose::WidgetFor(uint32 attr, int32* index) const
|
|||||||
for (int32 i = 0; i < count; i++) {
|
for (int32 i = 0; i < count; i++) {
|
||||||
BTextWidget* widget = fWidgetList.ItemAt(i);
|
BTextWidget* widget = fWidgetList.ItemAt(i);
|
||||||
if (widget->AttrHash() == attr) {
|
if (widget->AttrHash() == attr) {
|
||||||
if (index)
|
if (index != NULL)
|
||||||
*index = i;
|
*index = i;
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -785,7 +789,7 @@ BPose::WidgetFor(BColumn* column, BPoseView* poseView,
|
|||||||
ModelNodeLazyOpener &opener, int32* index)
|
ModelNodeLazyOpener &opener, int32* index)
|
||||||
{
|
{
|
||||||
BTextWidget* widget = WidgetFor(column->AttrHash(), index);
|
BTextWidget* widget = WidgetFor(column->AttrHash(), index);
|
||||||
if (!widget)
|
if (widget == NULL)
|
||||||
widget = AddWidget(poseView, column, opener);
|
widget = AddWidget(poseView, column, opener);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
@@ -815,7 +819,7 @@ BPose::DrawIcon(BPoint where, BView* view, icon_size kind, bool direct,
|
|||||||
|
|
||||||
IconCache::sIconCache->Draw(ResolvedModel(), view, where,
|
IconCache::sIconCache->Draw(ResolvedModel(), view, where,
|
||||||
fIsSelected && !drawUnselected ? kSelectedIcon : kNormalIcon, kind,
|
fIsSelected && !drawUnselected ? kSelectedIcon : kNormalIcon, kind,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
if (fPercent != -1)
|
if (fPercent != -1)
|
||||||
DrawBar(where, view, kind);
|
DrawBar(where, view, kind);
|
||||||
@@ -823,14 +827,17 @@ BPose::DrawIcon(BPoint where, BView* view, icon_size kind, bool direct,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BPose::DrawBar(BPoint where,BView* view,icon_size kind)
|
BPose::DrawBar(BPoint where, BView* view, icon_size kind)
|
||||||
{
|
{
|
||||||
view->PushState();
|
view->PushState();
|
||||||
|
|
||||||
int32 size, barWidth, barHeight, yOffset;
|
int32 size;
|
||||||
|
int32 barWidth;
|
||||||
|
int32 barHeight;
|
||||||
|
int32 yOffset;
|
||||||
if (kind >= B_LARGE_ICON) {
|
if (kind >= B_LARGE_ICON) {
|
||||||
size = kind - 1;
|
size = kind - 1;
|
||||||
barWidth = (int32)((float)7 / (float)32 * (float)kind);
|
barWidth = (int32)(7.0f / 32.0f * (float)kind);
|
||||||
yOffset = 2;
|
yOffset = 2;
|
||||||
barHeight = size - 4 - 2 * yOffset;
|
barHeight = size - 4 - 2 * yOffset;
|
||||||
} else {
|
} else {
|
||||||
@@ -851,8 +858,8 @@ BPose::DrawBar(BPoint where,BView* view,icon_size kind)
|
|||||||
|
|
||||||
// the gray frame
|
// the gray frame
|
||||||
view->SetHighColor(76, 76, 76, 192);
|
view->SetHighColor(76, 76, 76, 192);
|
||||||
BRect rect( where.x + size - barWidth,where.y + yOffset,
|
BRect rect(where.x + size - barWidth,where.y + yOffset,
|
||||||
where.x + size - 1,where.y + size - 1 - yOffset);
|
where.x + size - 1,where.y + size - 1 - yOffset);
|
||||||
view->StrokeRect(rect);
|
view->StrokeRect(rect);
|
||||||
|
|
||||||
// calculate bar height
|
// calculate bar height
|
||||||
@@ -887,7 +894,6 @@ BPose::DrawBar(BPoint where,BView* view,icon_size kind)
|
|||||||
void
|
void
|
||||||
BPose::DrawToggleSwitch(BRect, BPoseView*)
|
BPose::DrawToggleSwitch(BRect, BPoseView*)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -910,8 +916,9 @@ BPose::SetLocation(BPoint point, const BPoseView* poseView)
|
|||||||
scale = poseView->IconSize() / 32.0;
|
scale = poseView->IconSize() / 32.0;
|
||||||
|
|
||||||
fLocation = BPoint(floorf(point.x / scale), floorf(point.y / scale));
|
fLocation = BPoint(floorf(point.x / scale), floorf(point.y / scale));
|
||||||
if (isinff(fLocation.x) || isinff(fLocation.y))
|
if (isinff(fLocation.x) || isinff(fLocation.y))
|
||||||
debugger("BPose::SetLocation() - infinite location");
|
debugger("BPose::SetLocation() - infinite location");
|
||||||
|
|
||||||
fHasLocation = true;
|
fHasLocation = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -930,7 +937,7 @@ BPose::CalcRect(BPoint loc, const BPoseView* poseView, bool minimalRect) const
|
|||||||
|
|
||||||
if (minimalRect) {
|
if (minimalRect) {
|
||||||
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
|
||||||
if (widget) {
|
if (widget != NULL) {
|
||||||
rect.right = widget->CalcRect(loc, poseView->FirstColumn(),
|
rect.right = widget->CalcRect(loc, poseView->FirstColumn(),
|
||||||
poseView).right;
|
poseView).right;
|
||||||
}
|
}
|
||||||
@@ -978,7 +985,6 @@ BPose::CalcRect(const BPoseView* poseView) const
|
|||||||
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|
||||||
void
|
void
|
||||||
BPose::PrintToStream()
|
BPose::PrintToStream()
|
||||||
{
|
{
|
||||||
@@ -987,11 +993,14 @@ BPose::PrintToStream()
|
|||||||
case kMoveSelectionTo:
|
case kMoveSelectionTo:
|
||||||
PRINT(("clipboardMode: Cut\n"));
|
PRINT(("clipboardMode: Cut\n"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCopySelectionTo:
|
case kCopySelectionTo:
|
||||||
PRINT(("clipboardMode: Copy\n"));
|
PRINT(("clipboardMode: Copy\n"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
PRINT(("clipboardMode: 0 - not in clipboard\n"));
|
PRINT(("clipboardMode: 0 - not in clipboard\n"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
PRINT(("%sselected\n", IsSelected() ? "" : "not "));
|
PRINT(("%sselected\n", IsSelected() ? "" : "not "));
|
||||||
PRINT(("location %s x:%f y:%f\n", HasLocation() ? "" : "unknown ",
|
PRINT(("location %s x:%f y:%f\n", HasLocation() ? "" : "unknown ",
|
||||||
@@ -999,5 +1008,4 @@ BPose::PrintToStream()
|
|||||||
HasLocation() ? fLocation.y : 0));
|
HasLocation() ? fLocation.y : 0));
|
||||||
PRINT(("%s autoplaced \n", WasAutoPlaced() ? "was" : "not"));
|
PRINT(("%s autoplaced \n", WasAutoPlaced() ? "was" : "not"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+84
-84
@@ -54,106 +54,105 @@ enum {
|
|||||||
|
|
||||||
|
|
||||||
class BPose {
|
class BPose {
|
||||||
public:
|
public:
|
||||||
BPose(Model* adopt, BPoseView*, uint32 clipboardMode,
|
BPose(Model* adopt, BPoseView*, uint32 clipboardMode,
|
||||||
bool selected = false);
|
bool selected = false);
|
||||||
virtual ~BPose();
|
virtual ~BPose();
|
||||||
|
|
||||||
BTextWidget* AddWidget(BPoseView*, BColumn*);
|
BTextWidget* AddWidget(BPoseView*, BColumn*);
|
||||||
BTextWidget* AddWidget(BPoseView*, BColumn*,
|
BTextWidget* AddWidget(BPoseView*, BColumn*,
|
||||||
ModelNodeLazyOpener &opener);
|
ModelNodeLazyOpener &opener);
|
||||||
void RemoveWidget(BPoseView*, BColumn*);
|
void RemoveWidget(BPoseView*, BColumn*);
|
||||||
void SetLocation(BPoint, const BPoseView*);
|
void SetLocation(BPoint, const BPoseView*);
|
||||||
void MoveTo(BPoint, BPoseView*, bool inval = true);
|
void MoveTo(BPoint, BPoseView*, bool invalidate = true);
|
||||||
|
|
||||||
void Draw(BRect poseRect, const BRect& updateRect, BPoseView*,
|
void Draw(BRect poseRect, const BRect& updateRect, BPoseView*,
|
||||||
bool fullDraw = true);
|
bool fullDraw = true);
|
||||||
void Draw(BRect poseRect, const BRect& updateRect, BPoseView*,
|
void Draw(BRect poseRect, const BRect& updateRect, BPoseView*,
|
||||||
BView* drawView, bool fullDraw, BPoint offset, bool selected);
|
BView* drawView, bool fullDraw, BPoint offset, bool selected);
|
||||||
void DeselectWithoutErasingBackground(BRect rect,
|
void DeselectWithoutErasingBackground(BRect rect,
|
||||||
BPoseView* poseView);
|
BPoseView* poseView);
|
||||||
// special purpose draw call for deselecting over a textured
|
// special purpose draw call for deselecting over a textured
|
||||||
// background
|
// background
|
||||||
|
|
||||||
void DrawBar(BPoint where, BView* view, icon_size kind);
|
void DrawBar(BPoint where, BView* view, icon_size kind);
|
||||||
|
|
||||||
void DrawIcon(BPoint, BView*, icon_size, bool direct,
|
void DrawIcon(BPoint, BView*, icon_size, bool direct,
|
||||||
bool drawUnselected = false);
|
bool drawUnselected = false);
|
||||||
void DrawToggleSwitch(BRect, BPoseView*);
|
void DrawToggleSwitch(BRect, BPoseView*);
|
||||||
void MouseUp(BPoint poseLoc, BPoseView*, BPoint where, int32 index);
|
void MouseUp(BPoint poseLoc, BPoseView*, BPoint where, int32 index);
|
||||||
Model* TargetModel() const;
|
Model* TargetModel() const;
|
||||||
Model* ResolvedModel() const;
|
Model* ResolvedModel() const;
|
||||||
void Select(bool selected);
|
void Select(bool selected);
|
||||||
bool IsSelected() const;
|
bool IsSelected() const;
|
||||||
// Rename to IsHighlighted
|
// Rename to IsHighlighted
|
||||||
bigtime_t SelectionTime() const;
|
bigtime_t SelectionTime() const;
|
||||||
|
|
||||||
BTextWidget* ActiveWidget() const;
|
BTextWidget* ActiveWidget() const;
|
||||||
BTextWidget* WidgetFor(uint32 hashAttr, int32* index = 0) const;
|
BTextWidget* WidgetFor(uint32 hashAttr, int32* index = 0) const;
|
||||||
BTextWidget* WidgetFor(BColumn* column, BPoseView* poseView,
|
BTextWidget* WidgetFor(BColumn* column, BPoseView* poseView,
|
||||||
ModelNodeLazyOpener &opener, int32* index = NULL);
|
ModelNodeLazyOpener &opener, int32* index = NULL);
|
||||||
// adds the widget if needed
|
// adds the widget if needed
|
||||||
|
|
||||||
bool PointInPose(BPoint poseLoc, const BPoseView*, BPoint where,
|
bool PointInPose(BPoint poseLoc, const BPoseView*, BPoint where,
|
||||||
BTextWidget** = NULL) const;
|
BTextWidget** = NULL) const;
|
||||||
bool PointInPose(const BPoseView*, BPoint where) const;
|
bool PointInPose(const BPoseView*, BPoint where) const;
|
||||||
BRect CalcRect(BPoint loc, const BPoseView*,
|
BRect CalcRect(BPoint loc, const BPoseView*,
|
||||||
bool minimal_rect = false) const;
|
bool minimal_rect = false) const;
|
||||||
BRect CalcRect(const BPoseView*) const;
|
BRect CalcRect(const BPoseView*) const;
|
||||||
void UpdateAllWidgets(int32 poseIndex, BPoint poseLoc, BPoseView*);
|
void UpdateAllWidgets(int32 poseIndex, BPoint poseLoc, BPoseView*);
|
||||||
void UpdateWidgetAndModel(Model* resolvedModel, const char* attrName,
|
void UpdateWidgetAndModel(Model* resolvedModel, const char* attrName,
|
||||||
uint32 attrType, int32 poseIndex, BPoint poseLoc,
|
uint32 attrType, int32 poseIndex, BPoint poseLoc,
|
||||||
BPoseView* view, bool visible);
|
BPoseView* view, bool visible);
|
||||||
bool UpdateVolumeSpaceBar(BVolume* volume);
|
bool UpdateVolumeSpaceBar(BVolume* volume);
|
||||||
void UpdateIcon(BPoint poseLoc, BPoseView*);
|
void UpdateIcon(BPoint poseLoc, BPoseView*);
|
||||||
|
|
||||||
//void UpdateFixedSymlink(BPoint poseLoc, BPoseView*);
|
//void UpdateFixedSymlink(BPoint poseLoc, BPoseView*);
|
||||||
void UpdateBrokenSymLink(BPoint poseLoc, BPoseView*);
|
void UpdateBrokenSymLink(BPoint poseLoc, BPoseView*);
|
||||||
void UpdateWasBrokenSymlink(BPoint poseLoc, BPoseView* poseView);
|
void UpdateWasBrokenSymlink(BPoint poseLoc, BPoseView* poseView);
|
||||||
|
|
||||||
void Commit(bool saveChanges, BPoint loc, BPoseView*, int32 index);
|
void Commit(bool saveChanges, BPoint loc, BPoseView*, int32 index);
|
||||||
void EditFirstWidget(BPoint poseLoc, BPoseView*);
|
void EditFirstWidget(BPoint poseLoc, BPoseView*);
|
||||||
void EditNextWidget(BPoseView*);
|
void EditNextWidget(BPoseView*);
|
||||||
void EditPreviousWidget(BPoseView*);
|
void EditPreviousWidget(BPoseView*);
|
||||||
|
|
||||||
BPoint Location(const BPoseView* poseView) const;
|
BPoint Location(const BPoseView* poseView) const;
|
||||||
bool DelayedEdit() const;
|
bool DelayedEdit() const;
|
||||||
void SetDelayedEdit(bool delay);
|
void SetDelayedEdit(bool delay);
|
||||||
bool ListModeInited() const;
|
bool ListModeInited() const;
|
||||||
bool HasLocation() const;
|
bool HasLocation() const;
|
||||||
bool NeedsSaveLocation() const;
|
bool NeedsSaveLocation() const;
|
||||||
void SetSaveLocation();
|
void SetSaveLocation();
|
||||||
bool WasAutoPlaced() const;
|
bool WasAutoPlaced() const;
|
||||||
void SetAutoPlaced(bool);
|
void SetAutoPlaced(bool);
|
||||||
|
|
||||||
uint32 ClipboardMode() const;
|
|
||||||
void SetClipboardMode(uint32 clipboardMode);
|
|
||||||
|
|
||||||
|
uint32 ClipboardMode() const;
|
||||||
|
void SetClipboardMode(uint32 clipboardMode);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
void PrintToStream();
|
void PrintToStream();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool _PeriodicUpdateCallback(BPose* pose, void* cookie);
|
static bool _PeriodicUpdateCallback(BPose* pose, void* cookie);
|
||||||
void EditPreviousNextWidgetCommon(BPoseView* poseView, bool next);
|
void EditPreviousNextWidgetCommon(BPoseView* poseView, bool next);
|
||||||
void CreateWidgets(BPoseView*);
|
void CreateWidgets(BPoseView*);
|
||||||
bool TestLargeIconPixel(BPoint) const;
|
bool TestLargeIconPixel(BPoint) const;
|
||||||
|
|
||||||
Model* fModel;
|
Model* fModel;
|
||||||
BObjectList<BTextWidget> fWidgetList;
|
BObjectList<BTextWidget> fWidgetList;
|
||||||
BPoint fLocation;
|
BPoint fLocation;
|
||||||
|
|
||||||
uint32 fClipboardMode;
|
uint32 fClipboardMode;
|
||||||
int32 fPercent;
|
int32 fPercent;
|
||||||
bigtime_t fSelectionTime;
|
bigtime_t fSelectionTime;
|
||||||
|
|
||||||
bool fIsSelected : 1;
|
bool fIsSelected : 1;
|
||||||
bool fHasLocation : 1;
|
bool fHasLocation : 1;
|
||||||
bool fNeedsSaveLocation : 1;
|
bool fNeedsSaveLocation : 1;
|
||||||
bool fListModeInited : 1;
|
bool fListModeInited : 1;
|
||||||
bool fWasAutoPlaced : 1;
|
bool fWasAutoPlaced : 1;
|
||||||
bool fBrokenSymLink : 1;
|
bool fBrokenSymLink : 1;
|
||||||
bool fBackgroundClean : 1;
|
bool fBackgroundClean : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -263,4 +262,5 @@ BPose::SetClipboardMode(uint32 clipboardMode)
|
|||||||
|
|
||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
|
|
||||||
|
|
||||||
#endif // _POSE_H
|
#endif // _POSE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user