[Haiku-commits] r21355 - in haiku/trunk: headers/os/interface src/kits/interface
bonefish at BerliOS
bonefish at mail.berlios.de
Sat Jun 9 01:24:49 CEST 2007
Author: bonefish
Date: 2007-06-09 01:24:38 +0200 (Sat, 09 Jun 2007)
New Revision: 21355
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=21355&view=rev
Modified:
haiku/trunk/headers/os/interface/View.h
haiku/trunk/src/kits/interface/View.cpp
Log:
* Set the _RESIZE_MASK_ macro to 0xffff. It was the bitwise inverse of the
disjunction of all view flags before, and the new layout related flags were
missing. I suppose there was not striking reason for previous method.
* Made InvalidateLayout() virtual. When implementing layout management
directly in a derived class instead of a separate BLayout, one needs to
override it to know when to discard cashed layout infos.
* Added a ResizeTo(BSize) method.
* Avoided ugly multi-line strings in PrintToStream().
Modified: haiku/trunk/headers/os/interface/View.h
===================================================================
--- haiku/trunk/headers/os/interface/View.h 2007-06-08 23:16:20 UTC (rev 21354)
+++ haiku/trunk/headers/os/interface/View.h 2007-06-08 23:24:38 UTC (rev 21355)
@@ -80,9 +80,7 @@
const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 21 */
const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 20 */
-#define _RESIZE_MASK_ ~(B_FULL_UPDATE_ON_RESIZE | _B_RESERVED1_ | B_WILL_DRAW \
- | B_PULSE_NEEDED | B_NAVIGABLE_JUMP | B_FRAME_EVENTS | B_NAVIGABLE \
- | B_SUBPIXEL_PRECISE | B_DRAW_ON_CHILDREN | B_INPUT_METHOD_AWARE | _B_RESERVED7_)
+#define _RESIZE_MASK_ (0xffff)
const uint32 _VIEW_TOP_ = 1UL;
const uint32 _VIEW_LEFT_ = 2UL;
@@ -473,6 +471,7 @@
void MoveTo(float x, float y);
void ResizeBy(float dh, float dv);
void ResizeTo(float width, float height);
+ void ResizeTo(BSize size);
void ScrollBy(float dh, float dv);
void ScrollTo(float x, float y);
virtual void ScrollTo(BPoint where);
@@ -533,7 +532,7 @@
virtual void SetLayout(BLayout* layout);
BLayout* GetLayout() const;
- void InvalidateLayout(bool descendants = false);
+ virtual void InvalidateLayout(bool descendants = false);
void EnableLayoutInvalidation();
void DisableLayoutInvalidation();
bool IsLayoutValid() const;
@@ -560,7 +559,6 @@
friend class BTabView;
friend class BWindow;
- virtual void _ReservedView10();
virtual void _ReservedView11();
virtual void _ReservedView12();
virtual void _ReservedView13();
Modified: haiku/trunk/src/kits/interface/View.cpp
===================================================================
--- haiku/trunk/src/kits/interface/View.cpp 2007-06-08 23:16:20 UTC (rev 21354)
+++ haiku/trunk/src/kits/interface/View.cpp 2007-06-08 23:24:38 UTC (rev 21355)
@@ -3642,6 +3642,13 @@
}
+void
+BView::ResizeTo(BSize size)
+{
+ ResizeBy(size.width - fBounds.Width(), size.height - fBounds.Height());
+}
+
+
// #pragma mark -
// Inherited Methods (from BHandler)
@@ -4843,7 +4850,7 @@
extern "C" void _ReservedView7__5BView() {}
extern "C" void _ReservedView8__5BView() {}
extern "C" void _ReservedView9__5BView() {}
-void BView::_ReservedView10(){}
+extern "C" void _ReservedView10__5BView() {}
void BView::_ReservedView11(){}
void BView::_ReservedView12(){}
void BView::_ReservedView13(){}
@@ -4871,25 +4878,25 @@
BView::PrintToStream()
{
printf("BView::PrintToStream()\n");
- printf("\tName: %s\
-\tParent: %s\
-\tFirstChild: %s\
-\tNextSibling: %s\
-\tPrevSibling: %s\
-\tOwner(Window): %s\
-\tToken: %ld\
-\tFlags: %ld\
-\tView origin: (%f,%f)\
-\tView Bounds rectangle: (%f,%f,%f,%f)\
-\tShow level: %d\
-\tTopView?: %s\
-\tBPicture: %s\
-\tVertical Scrollbar %s\
-\tHorizontal Scrollbar %s\
-\tIs Printing?: %s\
-\tShelf?: %s\
-\tEventMask: %ld\
-\tEventOptions: %ld\n",
+ printf("\tName: %s\n"
+ "\tParent: %s\n"
+ "\tFirstChild: %s\n"
+ "\tNextSibling: %s\n"
+ "\tPrevSibling: %s\n"
+ "\tOwner(Window): %s\n"
+ "\tToken: %ld\n"
+ "\tFlags: %ld\n"
+ "\tView origin: (%f,%f)\n"
+ "\tView Bounds rectangle: (%f,%f,%f,%f)\n"
+ "\tShow level: %d\n"
+ "\tTopView?: %s\n"
+ "\tBPicture: %s\n"
+ "\tVertical Scrollbar %s\n"
+ "\tHorizontal Scrollbar %s\n"
+ "\tIs Printing?: %s\n"
+ "\tShelf?: %s\n"
+ "\tEventMask: %ld\n"
+ "\tEventOptions: %ld\n",
Name(),
fParent ? fParent->Name() : "NULL",
fFirstChild ? fFirstChild->Name() : "NULL",
@@ -4910,23 +4917,23 @@
fEventMask,
fEventOptions);
- printf("\tState status:\
-\t\tLocalCoordianteSystem: (%f,%f)\
-\t\tPenLocation: (%f,%f)\
-\t\tPenSize: %f\
-\t\tHighColor: [%d,%d,%d,%d]\
-\t\tLowColor: [%d,%d,%d,%d]\
-\t\tViewColor: [%d,%d,%d,%d]\
-\t\tPattern: %llx\
-\t\tDrawingMode: %d\
-\t\tLineJoinMode: %d\
-\t\tLineCapMode: %d\
-\t\tMiterLimit: %f\
-\t\tAlphaSource: %d\
-\t\tAlphaFuntion: %d\
-\t\tScale: %f\
-\t\t(Print)FontAliasing: %s\
-\t\tFont Info:\n",
+ printf("\tState status:\n"
+ "\t\tLocalCoordianteSystem: (%f,%f)\n"
+ "\t\tPenLocation: (%f,%f)\n"
+ "\t\tPenSize: %f\n"
+ "\t\tHighColor: [%d,%d,%d,%d]\n"
+ "\t\tLowColor: [%d,%d,%d,%d]\n"
+ "\t\tViewColor: [%d,%d,%d,%d]\n"
+ "\t\tPattern: %llx\n"
+ "\t\tDrawingMode: %d\n"
+ "\t\tLineJoinMode: %d\n"
+ "\t\tLineCapMode: %d\n"
+ "\t\tMiterLimit: %f\n"
+ "\t\tAlphaSource: %d\n"
+ "\t\tAlphaFuntion: %d\n"
+ "\t\tScale: %f\n"
+ "\t\t(Print)FontAliasing: %s\n"
+ "\t\tFont Info:\n",
fState->origin.x, fState->origin.y,
fState->pen_location.x, fState->pen_location.y,
fState->pen_size,
More information about the Haiku-commits
mailing list