[Haiku-commits] r31197 - in haiku/trunk: headers/os/interface src/kits/interface

stippi at mail.berlios.de stippi at mail.berlios.de
Tue Jun 23 12:56:33 CEST 2009


Author: stippi
Date: 2009-06-23 12:56:22 +0200 (Tue, 23 Jun 2009)
New Revision: 31197
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31197&view=rev

Modified:
   haiku/trunk/headers/os/interface/LayoutBuilder.h
   haiku/trunk/headers/os/interface/SplitLayoutBuilder.h
   haiku/trunk/headers/os/interface/SplitView.h
   haiku/trunk/headers/os/interface/TwoDimensionalLayout.h
   haiku/trunk/src/kits/interface/SplitLayout.cpp
   haiku/trunk/src/kits/interface/SplitLayout.h
   haiku/trunk/src/kits/interface/SplitLayoutBuilder.cpp
   haiku/trunk/src/kits/interface/SplitView.cpp
   haiku/trunk/src/kits/interface/TwoDimensionalLayout.cpp
Log:
* Made BTwoDimensionalLayout and BSplitLayout::GetInsets() const.
* Give access to BSplitLayout::SetInsets() and GetInsets() from BSplitView.
* Give access to BSplitView::SetInsets() from BSplitLayoutBuilder and
  LayoutBuilder.
* Some automatic white-space cleanup.


Modified: haiku/trunk/headers/os/interface/LayoutBuilder.h
===================================================================
--- haiku/trunk/headers/os/interface/LayoutBuilder.h	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/headers/os/interface/LayoutBuilder.h	2009-06-23 10:56:22 UTC (rev 31197)
@@ -175,6 +175,9 @@
 	inline	ThisBuilder&		SetCollapsible(int32 first, int32 last,
 									bool collapsible);
 
+	inline	ThisBuilder&		SetInsets(float left, float top, float right,
+									float bottom);
+
 	inline						operator BSplitView*();
 
 private:
@@ -703,6 +706,16 @@
 
 
 template<typename ParentBuilder>
+typename Split<ParentBuilder>::ThisBuilder&
+Split<ParentBuilder>::SetInsets(float left, float top, float right,
+	float bottom)
+{
+	fView->SetInsets(left, top, right, bottom);
+	return *this;
+}
+
+
+template<typename ParentBuilder>
 Split<ParentBuilder>::operator BSplitView*()
 {
 	return fView;

Modified: haiku/trunk/headers/os/interface/SplitLayoutBuilder.h
===================================================================
--- haiku/trunk/headers/os/interface/SplitLayoutBuilder.h	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/headers/os/interface/SplitLayoutBuilder.h	2009-06-23 10:56:22 UTC (rev 31197)
@@ -24,6 +24,9 @@
 
 			BSplitLayoutBuilder& SetCollapsible(bool collapsible);
 
+			BSplitLayoutBuilder& SetInsets(float left, float top, float right,
+									float bottom);
+
 								operator BSplitView*();
 
 private:

Modified: haiku/trunk/headers/os/interface/SplitView.h
===================================================================
--- haiku/trunk/headers/os/interface/SplitView.h	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/headers/os/interface/SplitView.h	2009-06-23 10:56:22 UTC (rev 31197)
@@ -17,6 +17,11 @@
 									float spacing = 0.0f);
 	virtual						~BSplitView();
 
+			void				SetInsets(float left, float top, float right,
+									float bottom);
+			void				GetInsets(float* left, float* top, float* right,
+									float* bottom) const;
+
 			float				Spacing() const;
 			void				SetSpacing(float spacing);
 

Modified: haiku/trunk/headers/os/interface/TwoDimensionalLayout.h
===================================================================
--- haiku/trunk/headers/os/interface/TwoDimensionalLayout.h	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/headers/os/interface/TwoDimensionalLayout.h	2009-06-23 10:56:22 UTC (rev 31197)
@@ -18,7 +18,7 @@
 			void				SetInsets(float left, float top, float right,
 									float bottom);
 			void				GetInsets(float* left, float* top, float* right,
-									float* bottom);
+									float* bottom) const;
 
 			void				AlignLayoutWith(BTwoDimensionalLayout* other,
 									enum orientation orientation);
@@ -58,7 +58,7 @@
 	virtual	void				PrepareItems(enum orientation orientation);
 	virtual	bool				HasMultiColumnItems();
 	virtual	bool				HasMultiRowItems();
-	
+
 	virtual	int32				InternalCountColumns() = 0;
 	virtual	int32				InternalCountRows() = 0;
 	virtual	void				GetColumnRowConstraints(

Modified: haiku/trunk/src/kits/interface/SplitLayout.cpp
===================================================================
--- haiku/trunk/src/kits/interface/SplitLayout.cpp	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/src/kits/interface/SplitLayout.cpp	2009-06-23 10:56:22 UTC (rev 31197)
@@ -192,7 +192,8 @@
 
 // GetInsets
 void
-BSplitLayout::GetInsets(float* left, float* top, float* right, float* bottom)
+BSplitLayout::GetInsets(float* left, float* top, float* right,
+	float* bottom) const
 {
 	if (left)
 		*left = fLeftInset;

Modified: haiku/trunk/src/kits/interface/SplitLayout.h
===================================================================
--- haiku/trunk/src/kits/interface/SplitLayout.h	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/src/kits/interface/SplitLayout.h	2009-06-23 10:56:22 UTC (rev 31197)
@@ -30,7 +30,7 @@
 			void				SetInsets(float left, float top, float right,
 									float bottom);
 			void				GetInsets(float* left, float* top, float* right,
-									float* bottom);
+									float* bottom) const;
 
 			float				Spacing() const;
 			void				SetSpacing(float spacing);

Modified: haiku/trunk/src/kits/interface/SplitLayoutBuilder.cpp
===================================================================
--- haiku/trunk/src/kits/interface/SplitLayoutBuilder.cpp	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/src/kits/interface/SplitLayoutBuilder.cpp	2009-06-23 10:56:22 UTC (rev 31197)
@@ -81,6 +81,15 @@
 	return *this;
 }
 
+// SetInsets
+BSplitLayoutBuilder&
+BSplitLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
+{
+	fView->SetInsets(left, top, right, bottom);
+
+	return *this;
+}
+
 // cast operator BSplitView*
 BSplitLayoutBuilder::operator BSplitView*()
 {

Modified: haiku/trunk/src/kits/interface/SplitView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/SplitView.cpp	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/src/kits/interface/SplitView.cpp	2009-06-23 10:56:22 UTC (rev 31197)
@@ -55,6 +55,21 @@
 {
 }
 
+// SetInsets
+void
+BSplitView::SetInsets(float left, float top, float right, float bottom)
+{
+	fSplitLayout->SetInsets(left, top, right, bottom);
+}
+
+// GetInsets
+void
+BSplitView::GetInsets(float* left, float* top, float* right,
+	float* bottom) const
+{
+	fSplitLayout->GetInsets(left, top, right, bottom);
+}
+
 // Spacing
 float
 BSplitView::Spacing() const

Modified: haiku/trunk/src/kits/interface/TwoDimensionalLayout.cpp
===================================================================
--- haiku/trunk/src/kits/interface/TwoDimensionalLayout.cpp	2009-06-23 10:27:58 UTC (rev 31196)
+++ haiku/trunk/src/kits/interface/TwoDimensionalLayout.cpp	2009-06-23 10:56:22 UTC (rev 31197)
@@ -59,13 +59,13 @@
 	virtual	Layouter*			GetLayouter(bool minMax);
 
 			LayoutInfo*			GetLayoutInfo();
-	
+
 			void				AddLocalLayouter(LocalLayouter* localLayouter);
 			void				RemoveLocalLayouter(
 									LocalLayouter* localLayouter);
 
 			void				AbsorbCompoundLayouter(CompoundLayouter* other);
-	
+
 	virtual	void				InvalidateLayout();
 			bool				IsMinMaxValid();
 			void				ValidateMinMax();
@@ -105,7 +105,7 @@
 	virtual	void				InvalidateLayout();
 
 			void				InvalidateHeightForWidth();
-	
+
 			void				InternalGetHeightForWidth(
 									LocalLayouter* localLayouter,
 									BLayoutContext* context,
@@ -148,7 +148,7 @@
 			void				Layout(BSize size);
 
 			BRect				ItemFrame(Dimensions itemDimensions);
-	
+
 			void				ValidateMinMax();
 
 			void				DoHorizontalLayout(float width);
@@ -159,8 +159,8 @@
 
 			void				AlignWith(LocalLayouter* other,
 									enum orientation orientation);
-	
 
+
 	// interface for the compound layout context
 
 			void				PrepareItems(
@@ -183,14 +183,14 @@
 									Layouter* layouter,
 									BLayoutContext* context);
 			void				SetHeightForWidthConstraintsAdded(bool added);
-	
+
 			void				SetCompoundLayouter(
 									CompoundLayouter* compoundLayouter,
 									enum orientation orientation);
 
 			void				InternalInvalidateLayout(
 									CompoundLayouter* compoundLayouter);
-	
+
 	// implementation private
 private:
 			BTwoDimensionalLayout*	fLayout;
@@ -202,7 +202,7 @@
 			BLayoutContext*		fHorizontalLayoutContext;
 			float				fHorizontalLayoutWidth;
 			bool				fHeightForWidthConstraintsAdded;
-	
+
 			void				_SetHorizontalLayoutContext(
 									BLayoutContext* context, float width);
 
@@ -248,7 +248,7 @@
 // GetInsets
 void
 BTwoDimensionalLayout::GetInsets(float* left, float* top, float* right,
-	float* bottom)
+	float* bottom) const
 {
 	if (left)
 		*left = fLeftInset;
@@ -379,7 +379,7 @@
 //	preferredHeight);
 //}
 }
-			
+
 			item->AlignInFrame(frame);
 		}
 //else
@@ -499,7 +499,7 @@
 	return fLayoutInfo;
 }
 
-// AddLocalLayouter	
+// AddLocalLayouter
 void
 BTwoDimensionalLayout::CompoundLayouter::AddLocalLayouter(
 	LocalLayouter* localLayouter)
@@ -536,7 +536,7 @@
 		AddLocalLayouter(layouter);
 		layouter->SetCompoundLayouter(this, fOrientation);
 	}
-	
+
 	InvalidateLayout();
 }
 
@@ -605,7 +605,7 @@
 	LocalLayouter* localLayouter, BLayoutContext* context)
 {
 	ValidateMinMax();
-	
+
 	if (context != fLayoutContext || fLastLayoutSize != size) {
 		DoLayout(size, localLayouter, context);
 		fLayoutContext = context;
@@ -852,7 +852,7 @@
 		fHeightForWidthLayoutContext->AddListener(this);
 
 	InvalidateHeightForWidth();
-	
+
 	return true;
 }
 
@@ -868,7 +868,7 @@
 // #pragma mark - LocalLayouter
 
 
-// constructor								
+// constructor
 BTwoDimensionalLayout::LocalLayouter::LocalLayouter(
 		BTwoDimensionalLayout* layout)
 	: fLayout(layout),
@@ -1100,7 +1100,7 @@
 		return false;
 
 	LayoutInfo* hLayoutInfo = fHLayouter->GetLayoutInfo();
-	
+
 	// add the children's height for width constraints
 	int32 itemCount = fHeightForWidthItems.CountItems();
 	for (int32 i = 0; i < itemCount; i++) {




More information about the Haiku-commits mailing list