Make archiving hooks protected in layout classes.

Furthermore,
* remove a stray blank line in Layout.cpp
* make BLayoutItem::SetLayout() private, as it should have been
This commit is contained in:
Alex Wilson
2011-12-01 20:45:50 -07:00
parent f98f5ca48b
commit d56e7bd64d
12 changed files with 50 additions and 40 deletions
+5 -3
View File
@@ -37,6 +37,11 @@ public:
virtual void SetVisible(bool visible);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t Perform(perform_code d, void* arg);
protected:
// Archiving hook methods
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
@@ -45,9 +50,6 @@ public:
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);
+5 -2
View File
@@ -32,12 +32,15 @@ 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:
// various hook methods
virtual status_t AllUnarchived(const BMessage* archive);
virtual status_t AllArchived(BMessage* archive) const;
virtual void LayoutInvalidated(bool children);
virtual void AttachedToLayout();
+3 -2
View File
@@ -29,13 +29,14 @@ 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);
virtual status_t Perform(perform_code d, void* arg);
protected:
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void LayoutInvalidated(bool children = false);
virtual void DoLayout();
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
+5 -5
View File
@@ -59,18 +59,18 @@ 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 Perform(perform_code d, void* arg);
protected:
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:
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
+5 -5
View File
@@ -36,18 +36,18 @@ 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);
virtual status_t Perform(perform_code d, void* arg);
protected:
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:
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
+5 -6
View File
@@ -60,9 +60,12 @@ public:
BRect LayoutArea();
BLayoutContext* LayoutContext() const;
// Archiving methods
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t Perform(perform_code d, void* arg);
protected:
// Archiving hook methods
virtual status_t AllArchived(BMessage* archive) const;
virtual status_t AllUnarchived(const BMessage* from);
@@ -70,10 +73,6 @@ public:
int32 index) const;
virtual status_t ItemUnarchived(const BMessage* from,
BLayoutItem* item, int32 index);
virtual status_t Perform(perform_code d, void* arg);
protected:
// BLayout hook methods
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
+5 -3
View File
@@ -55,13 +55,13 @@ public:
void AlignInFrame(BRect frame);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual status_t Perform(perform_code d, void* arg);
protected:
void SetLayout(BLayout* layout);
// archiving methods
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
// hook methods
virtual void LayoutInvalidated(bool children);
@@ -72,6 +72,8 @@ protected:
virtual void AncestorVisibilityChanged(bool shown);
private:
void SetLayout(BLayout* layout);
virtual void _ReservedLayoutItem1();
virtual void _ReservedLayoutItem2();
virtual void _ReservedLayoutItem3();
+3 -2
View File
@@ -34,8 +34,6 @@ public:
static BArchivable* Instantiate(BMessage* archive);
virtual status_t Archive(BMessage* archive,
bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void Draw(BRect update);
virtual void AttachedToWindow();
@@ -89,6 +87,9 @@ public:
virtual status_t Perform(perform_code d, void* arg);
protected:
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void LayoutInvalidated(bool descendants);
virtual void DoLayout();
+3 -2
View File
@@ -71,13 +71,14 @@ public:
// 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);
virtual status_t Perform(perform_code d, void* arg);
protected:
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void DrawSplitter(BRect frame,
const BRect& updateRect,
enum orientation orientation,
+3 -2
View File
@@ -36,8 +36,6 @@ public:
static BArchivable* Instantiate(BMessage* archive);
virtual status_t Archive(BMessage* archive,
bool deep = true) const;
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void SetText(const char* text);
const char* Text() const;
@@ -92,6 +90,9 @@ public:
BLayoutItem* CreateTextViewLayoutItem();
protected:
virtual status_t AllArchived(BMessage* into) const;
virtual status_t AllUnarchived(const BMessage* from);
virtual void LayoutInvalidated(bool descendants);
virtual void DoLayout();
+8 -7
View File
@@ -39,13 +39,6 @@ public:
virtual void SetFrame(BRect frame);
virtual status_t Archive(BMessage* into, bool deep = true) const;
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);
@@ -63,7 +56,15 @@ protected:
int32 height;
};
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 void LayoutInvalidated(bool children = false);
virtual void DoLayout();
BSize AddInsets(BSize size);
-1
View File
@@ -381,7 +381,6 @@ BLayout::Relayout(bool immediate)
}
void
BLayout::_LayoutWithinContext(bool force, BLayoutContext* context)
{