Commit Graph

22 Commits

Author SHA1 Message Date
Alex Wilson d56e7bd64d 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
2011-12-01 20:45:50 -07:00
Alex Wilson 53617d366d 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.
2011-11-05 14:25:06 -06:00
Alex Wilson 121a15ea8f By convention, Perform() methods are public, make this true for BLayout. 2011-11-05 01:58:56 -06:00
Alex Wilson e044d51aa8 Forbid copying and assignment in layout classes.
Specifically in:
 * BAbstractLayout
 * BAbstractLayoutItem
 * BGridLayout
 * BGridView
 * BGroupLayout
 * BGroupView
 * BLayout
 * BSplitView
 * BTwoDimensionalLayout
2011-11-04 22:23:22 -06:00
Alex Wilson 8151838e38 Add FBC padding to all (I think..) of the visible Layout related classes. 2011-11-02 00:29:33 -06:00
Alex Wilson a851b3ad54 Add Perform() methods to all the layout-related classes that needed them. 2011-10-31 14:57:30 -06:00
Alex Wilson 0843fb4572 Revirtualize BLayout::Relayout(), since it is in fact inherited from BLayoutItem and virtual anyway.
Also add a comment to make this obvious.
2011-10-28 14:17:05 -06:00
Alex Wilson e7b0dc78f7 Now that child classes aren't overriding the various InvalidateLayout() methods, we can take advantage of some guarantees to simplify/clean/optimize the layout invalidation propagation mechanisms! 2011-10-28 14:16:54 -06:00
Alex Wilson c74faed432 Add BLayoutItem::LayoutInvalidated() hook. Leave BLayoutItem::InvalidateLayout() (and therefore BLayout::InvalidateLayout()) virtual. This is needed to let BLayout override it for invalidation propagations. 2011-10-28 14:16:52 -06:00
Alex Wilson b38ea98f52 Devirtualize BLayout::InvalidateLayout(), add a protected hook BLayout::DoLayout(). This will allow for much better control over the propagation of layout invalidations, and therefore cleaner, more optimal code. 2011-10-28 14:16:39 -06:00
Alex Wilson b8725ee37e De-virtualize BLayout::Relayout(). I think this was virtual only by accident. 2011-10-28 14:16:28 -06:00
Alex Wilson 4e0131f51b Rename BLayout::DerivedLayoutItems() to DoLayout(), which is consistent with BView::DoLayout(). Also adjusted child classes and documentation. 2011-10-28 14:16:25 -06:00
Alex Wilson fa01d08496 User BView's layout item tracking functionality to simplify and optimize some methods in BLayout and BView.
Delete BLayout::RemoveViewRecursive() as it is no longer needed.
Add a few TODO's.
2011-10-28 14:16:16 -06:00
Ingo Weinhold a9e89a7325 Also made LayoutContext() const.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 21:53:25 +00:00
Ingo Weinhold df7309870f Made AncestorsVisible() const.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-19 21:26:54 +00:00
Alex Wilson 1d6c7b6cb6 Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
  may have slipped by.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 18:43:41 +00:00
Alex Wilson 6829d4174b Update BLayout::ItemAdded() and BLayout::ItemRemoved() to take an int32 index parameter, and ItemAdded() to return a bool indicating success or failure. Update BLayout::AddItem() to take the result of ItemAdded() into account. Also update BLayout::AllUnarchived() to take this into account. In either situation, if ItemAdded() returns false, the item does not get added to the layout. Removed various TODOs about code that could be removed once this change was made. In BSplitLayout, an item's LayoutData was lazy-initialized, but would always be created during ItemAdded(). Now we create the LayoutData explicitly, so that we can catch failed memory allocations. Closes #5524.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37817 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-30 02:28:17 +00:00
Ingo Weinhold b137ab3eb3 Patch by Alex Wilson (minor changes by myself) related to the new archiving
features:
* Some cosmetic adjustments of the API, like using references instead of
  pointers, argument order, method names, etc.
* Added convenience template methods for archiving and unarchiving to BArchiver
  and BUnarchiver.
* BUnarchiver (respectively the private BUnarchiveManager) explicitly deals with
  object ownership, now. This is necessary since an error while unarchiving
  could leave an already unarchived object without owning object, which would
  result in it being leaked. The BUnarchiver::{Get,Find}Object() methods do now
  have an optional parameter to specify whether object ownership shall be
  transferred.
* Fixed incorrect header guard in headers/private/binary_compatibility/Global.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-16 16:49:42 +00:00
Axel Dörfler 268317bd9d * Style cleanups.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37434 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-08 16:04:41 +00:00
Adrien Destugues 27d84b482c Patch by Alex Wilson as part of GSoC 2010 : Archiving of Layouted BViews hierarchy.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-08 15:40:49 +00:00
Stephan Aßmus 89208c77f1 Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
  headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
  (abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 11:12:41 +00:00
Ingo Weinhold 9ecf9d1c1d Merge from layout management branch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-26 16:21:15 +00:00