Override a bunch of methods in layout related classes for FBC stability.

* Especially made sure to override archiving methods, since these are called rarely, so the cost is very minimal
* Otherwise, the closer a class is to a base class, the more likely I was to give it all the overrides.
This commit is contained in:
Alex Wilson
2011-11-05 14:25:06 -06:00
parent 121a15ea8f
commit 53617d366d
17 changed files with 213 additions and 0 deletions
+13
View File
@@ -37,12 +37,25 @@ public:
virtual void SetVisible(bool visible);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual status_t ItemArchived(BMessage* into, BLayoutItem* item,
int32 index) const;
virtual status_t ItemUnarchived(const BMessage* from,
BLayoutItem* item, int32 index);
virtual status_t Perform(perform_code d, void* arg);
protected:
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
virtual void LayoutInvalidated(bool children);
virtual void OwnerChanged(BView* was);
// BLayoutItem hook methods
virtual void AttachedToLayout();
virtual void DetachedFromLayout(BLayout* layout);
virtual void AncestorVisibilityChanged(bool shown);
private:
+10
View File
@@ -32,9 +32,19 @@ public:
virtual BAlignment BaseAlignment();
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllUnarchived(const BMessage* archive);
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t Perform(perform_code d, void* arg);
protected:
virtual void LayoutInvalidated(bool children);
virtual void AttachedToLayout();
virtual void DetachedFromLayout(BLayout* layout);
virtual void AncestorVisibilityChanged(bool shown);
private:
virtual void _ReservedAbstractLayoutItem1();
virtual void _ReservedAbstractLayoutItem2();
+1
View File
@@ -29,6 +29,7 @@ public:
float* max, float* preferred);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
static BArchivable* Instantiate(BMessage* from);
+2
View File
@@ -59,6 +59,8 @@ public:
int32 rowCount = 1);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
static BArchivable* Instantiate(BMessage* from);
virtual status_t ItemArchived(BMessage* into,
+1
View File
@@ -36,6 +36,7 @@ public:
float weight);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
static BArchivable* Instantiate(BMessage* from);
+1
View File
@@ -63,6 +63,7 @@ public:
// Archiving methods
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual status_t ItemArchived(BMessage* into, BLayoutItem* item,
+2
View File
@@ -45,6 +45,8 @@ private:
BSize fPreferredSize;
BAlignment fAlignment;
bool fVisible;
uint32 _reserved[2];
};
#endif // _SPACE_LAYOUT_ITEM_H
+4
View File
@@ -58,16 +58,20 @@ public:
float weight);
virtual void Draw(BRect updateRect);
virtual void DrawAfterChildren(BRect updateRect);
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where);
virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* message);
virtual void MessageReceived(BMessage* message);
virtual void SetLayout(BLayout* layout);
// overridden to avoid use
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
static BArchivable* Instantiate(BMessage* from);
@@ -42,6 +42,11 @@ public:
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual status_t ItemArchived(BMessage* into, BLayoutItem* item,
int32 index) const;
virtual status_t ItemUnarchived(const BMessage* from,
BLayoutItem* item, int32 index);
virtual status_t Perform(perform_code d, void* arg);
protected:
+58
View File
@@ -419,6 +419,13 @@ BAbstractLayout::Archive(BMessage* into, bool deep) const
}
status_t
BAbstractLayout::AllArchived(BMessage* archive) const
{
return BLayout::AllArchived(archive);
}
status_t
BAbstractLayout::AllUnarchived(const BMessage* from)
{
@@ -430,6 +437,43 @@ BAbstractLayout::AllUnarchived(const BMessage* from)
}
status_t
BAbstractLayout::ItemArchived(BMessage* into, BLayoutItem* item,
int32 index) const
{
return BLayout::ItemArchived(into, item, index);
}
status_t
BAbstractLayout::ItemUnarchived(const BMessage* from, BLayoutItem* item,
int32 index)
{
return BLayout::ItemUnarchived(from, item, index);
}
bool
BAbstractLayout::ItemAdded(BLayoutItem* item, int32 atIndex)
{
return BLayout::ItemAdded(item, atIndex);
}
void
BAbstractLayout::ItemRemoved(BLayoutItem* item, int32 fromIndex)
{
BLayout::ItemRemoved(item, fromIndex);
}
void
BAbstractLayout::LayoutInvalidated(bool children)
{
BLayout::LayoutInvalidated(children);
}
void
BAbstractLayout::OwnerChanged(BView* was)
{
@@ -443,6 +487,20 @@ BAbstractLayout::OwnerChanged(BView* was)
}
void
BAbstractLayout::AttachedToLayout()
{
BLayout::AttachedToLayout();
}
void
BAbstractLayout::DetachedFromLayout(BLayout* layout)
{
BLayout::DetachedFromLayout(layout);
}
void
BAbstractLayout::AncestorVisibilityChanged(bool shown)
{
+42
View File
@@ -154,6 +154,48 @@ BAbstractLayoutItem::Archive(BMessage* into, bool deep) const
}
status_t
BAbstractLayoutItem::AllUnarchived(const BMessage* archive)
{
return BLayoutItem::AllUnarchived(archive);
}
status_t
BAbstractLayoutItem::AllArchived(BMessage* archive) const
{
return BLayoutItem::AllArchived(archive);
}
void
BAbstractLayoutItem::LayoutInvalidated(bool children)
{
BLayoutItem::LayoutInvalidated(children);
}
void
BAbstractLayoutItem::AttachedToLayout()
{
BLayoutItem::AttachedToLayout();
}
void
BAbstractLayoutItem::DetachedFromLayout(BLayout* layout)
{
BLayoutItem::DetachedFromLayout(layout);
}
void
BAbstractLayoutItem::AncestorVisibilityChanged(bool shown)
{
BLayoutItem::AncestorVisibilityChanged(shown);
}
status_t
BAbstractLayoutItem::Perform(perform_code d, void* arg)
{
+7
View File
@@ -212,6 +212,13 @@ BCardLayout::Archive(BMessage* into, bool deep) const
}
status_t
BCardLayout::AllArchived(BMessage* archive) const
{
return BAbstractLayout::AllArchived(archive);
}
status_t
BCardLayout::AllUnarchived(const BMessage* from)
{
+14
View File
@@ -496,6 +496,20 @@ BGridLayout::Archive(BMessage* into, bool deep) const
}
status_t
BGridLayout::AllArchived(BMessage* into) const
{
return BTwoDimensionalLayout::AllArchived(into);
}
status_t
BGridLayout::AllUnarchived(const BMessage* from)
{
return BTwoDimensionalLayout::AllUnarchived(from);
}
BArchivable*
BGridLayout::Instantiate(BMessage* from)
{
+7
View File
@@ -198,6 +198,13 @@ BGroupLayout::Archive(BMessage* into, bool deep) const
}
status_t
BGroupLayout::AllArchived(BMessage* into) const
{
return BTwoDimensionalLayout::AllArchived(into);
}
status_t
BGroupLayout::AllUnarchived(const BMessage* from)
{
+7
View File
@@ -452,6 +452,13 @@ BLayout::Archive(BMessage* into, bool deep) const
}
status_t
BLayout::AllArchived(BMessage* archive) const
{
return BArchivable::AllArchived(archive);
}
status_t
BLayout::AllUnarchived(const BMessage* from)
{
+21
View File
@@ -222,6 +222,13 @@ BSplitView::Draw(BRect updateRect)
}
void
BSplitView::DrawAfterChildren(BRect r)
{
return BView::DrawAfterChildren(r);
}
void
BSplitView::MouseDown(BPoint where)
{
@@ -269,6 +276,13 @@ BSplitView::MouseMoved(BPoint where, uint32 transit, const BMessage* message)
}
void
BSplitView::MessageReceived(BMessage* message)
{
return BView::MessageReceived(message);
}
void
BSplitView::SetLayout(BLayout* layout)
{
@@ -283,6 +297,13 @@ BSplitView::Archive(BMessage* into, bool deep) const
}
status_t
BSplitView::AllArchived(BMessage* archive) const
{
return BView::AllArchived(archive);
}
status_t
BSplitView::AllUnarchived(const BMessage* from)
{
@@ -456,6 +456,24 @@ BTwoDimensionalLayout::AllUnarchived(const BMessage* from)
}
status_t
BTwoDimensionalLayout::ItemArchived(BMessage* into, BLayoutItem* item,
int32 index) const
{
return BAbstractLayout::ItemArchived(into, item, index);
}
status_t
BTwoDimensionalLayout::ItemUnarchived(const BMessage* from, BLayoutItem* item,
int32 index)
{
return BAbstractLayout::ItemUnarchived(from, item, index);
}
void
BTwoDimensionalLayout::LayoutInvalidated(bool children)
{