1 //------------------------------------------------------------------------------ 2 // Copyright (c) 2001-2005, Haiku 3 // 4 // Permission is hereby granted, free of charge, to any person obtaining a 5 // copy of this software and associated documentation files (the "Software"), 6 // to deal in the Software without restriction, including without limitation 7 // the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 // and/or sell copies of the Software, and to permit persons to whom the 9 // Software is furnished to do so, subject to the following conditions: 10 // 11 // The above copyright notice and this permission notice shall be included in 12 // all copies or substantial portions of the Software. 13 // 14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 // DEALINGS IN THE SOFTWARE. 21 // 22 // File Name: View.h 23 // Author: Erik Jaesler (erik@cgsoftware.com) 24 // Description: BView is the base class for all views (clipped regions 25 // within a window). 26 //------------------------------------------------------------------------------ 27 28 #ifndef _VIEW_H 29 #define _VIEW_H 30 31 32 #include <BeBuild.h> 33 #include <Font.h> 34 #include <Handler.h> 35 #include <InterfaceDefs.h> 36 #include <Rect.h> 37 38 39 // view definitions ------------------------------------------------------------ 40 41 enum { 42 B_PRIMARY_MOUSE_BUTTON = 0x01, 43 B_SECONDARY_MOUSE_BUTTON = 0x02, 44 B_TERTIARY_MOUSE_BUTTON = 0x04 45 }; 46 47 enum { 48 B_ENTERED_VIEW = 0, 49 B_INSIDE_VIEW, 50 B_EXITED_VIEW, 51 B_OUTSIDE_VIEW 52 }; 53 54 enum { 55 B_POINTER_EVENTS = 0x00000001, 56 B_KEYBOARD_EVENTS = 0x00000002 57 }; 58 59 enum { 60 B_LOCK_WINDOW_FOCUS = 0x00000001, 61 B_SUSPEND_VIEW_FOCUS = 0x00000002, 62 B_NO_POINTER_HISTORY = 0x00000004 63 }; 64 65 enum { 66 B_TRACK_WHOLE_RECT, 67 B_TRACK_RECT_CORNER 68 }; 69 70 enum { 71 B_FONT_FAMILY_AND_STYLE = 0x00000001, 72 B_FONT_SIZE = 0x00000002, 73 B_FONT_SHEAR = 0x00000004, 74 B_FONT_ROTATION = 0x00000008, 75 B_FONT_SPACING = 0x00000010, 76 B_FONT_ENCODING = 0x00000020, 77 B_FONT_FACE = 0x00000040, 78 B_FONT_FLAGS = 0x00000080, 79 B_FONT_ALL = 0x000000FF 80 }; 81 82 const uint32 B_FULL_UPDATE_ON_RESIZE = 0x80000000UL; /* 31 */ 83 const uint32 _B_RESERVED1_ = 0x40000000UL; /* 30 */ 84 const uint32 B_WILL_DRAW = 0x20000000UL; /* 29 */ 85 const uint32 B_PULSE_NEEDED = 0x10000000UL; /* 28 */ 86 const uint32 B_NAVIGABLE_JUMP = 0x08000000UL; /* 27 */ 87 const uint32 B_FRAME_EVENTS = 0x04000000UL; /* 26 */ 88 const uint32 B_NAVIGABLE = 0x02000000UL; /* 25 */ 89 const uint32 B_SUBPIXEL_PRECISE = 0x01000000UL; /* 24 */ 90 const uint32 B_DRAW_ON_CHILDREN = 0x00800000UL; /* 23 */ 91 const uint32 B_INPUT_METHOD_AWARE = 0x00400000UL; /* 23 */ 92 const uint32 _B_RESERVED7_ = 0x00200000UL; /* 22 */ 93 /* 94 #define _RESIZE_MASK_ ~(B_FULL_UPDATE_ON_RESIZE|_B_RESERVED1_|B_WILL_DRAW|\ 95 B_PULSE_NEEDED|B_NAVIGABLE_JUMP|B_FRAME_EVENTS|B_NAVIGABLE|\ 96 B_SUBPIXEL_PRECISE|B_DRAW_ON_CHILDREN|B_INPUT_METHOD_AWARE|_B_RESERVED7_) 97 */ 98 #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_) 99 100 const uint32 _VIEW_TOP_ = 1UL; 101 const uint32 _VIEW_LEFT_ = 2UL; 102 const uint32 _VIEW_BOTTOM_ = 3UL; 103 const uint32 _VIEW_RIGHT_ = 4UL; 104 const uint32 _VIEW_CENTER_ = 5UL; 105 106 inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3, uint32 r4) 107 { return ((r1 << 12) | (r2 << 8) | (r3 << 4) | r4); } 108 109 #define B_FOLLOW_NONE 0 110 #define B_FOLLOW_ALL_SIDES _rule_(_VIEW_TOP_, _VIEW_LEFT_, _VIEW_BOTTOM_, _VIEW_RIGHT_) 111 #define B_FOLLOW_ALL B_FOLLOW_ALL_SIDES 112 113 #define B_FOLLOW_LEFT _rule_(0, _VIEW_LEFT_, 0, _VIEW_LEFT_) 114 #define B_FOLLOW_RIGHT _rule_(0, _VIEW_RIGHT_, 0, _VIEW_RIGHT_) 115 #define B_FOLLOW_LEFT_RIGHT _rule_(0, _VIEW_LEFT_, 0, _VIEW_RIGHT_) 116 #define B_FOLLOW_H_CENTER _rule_(0, _VIEW_CENTER_, 0, _VIEW_CENTER_) 117 118 #define B_FOLLOW_TOP _rule_(_VIEW_TOP_, 0, _VIEW_TOP_, 0) 119 #define B_FOLLOW_BOTTOM _rule_(_VIEW_BOTTOM_, 0, _VIEW_BOTTOM_, 0) 120 #define B_FOLLOW_TOP_BOTTOM _rule_(_VIEW_TOP_, 0, _VIEW_BOTTOM_, 0) 121 #define B_FOLLOW_V_CENTER _rule_(_VIEW_CENTER_, 0, _VIEW_CENTER_, 0) 122 123 class BBitmap; 124 class BCursor; 125 class BMessage; 126 class BPicture; 127 class BPolygon; 128 class BRegion; 129 class BScrollBar; 130 class BScrollView; 131 class BShape; 132 class BShelf; 133 class BString; 134 class BWindow; 135 struct _array_data_; 136 struct _array_hdr_; 137 struct overlay_restrictions; 138 139 namespace BPrivate { 140 class ViewState; 141 }; 142 143 144 class BView : public BHandler { 145 public: 146 BView(BRect frame, const char* name, 147 uint32 resizeMask, uint32 flags); 148 virtual ~BView(); 149 150 BView(BMessage* data); 151 static BArchivable* Instantiate(BMessage* data); 152 virtual status_t Archive(BMessage* data, bool deep = true) const; 153 154 virtual void AttachedToWindow(); 155 virtual void AllAttached(); 156 virtual void DetachedFromWindow(); 157 virtual void AllDetached(); 158 159 virtual void MessageReceived(BMessage* msg); 160 161 void AddChild(BView* child, BView* before = NULL); 162 bool RemoveChild(BView* child); 163 int32 CountChildren() const; 164 BView* ChildAt(int32 index) const; 165 BView* NextSibling() const; 166 BView* PreviousSibling() const; 167 bool RemoveSelf(); 168 169 BWindow *Window() const; 170 171 virtual void Draw(BRect updateRect); 172 virtual void MouseDown(BPoint where); 173 virtual void MouseUp(BPoint where); 174 virtual void MouseMoved(BPoint where, 175 uint32 code, 176 const BMessage* a_message); 177 virtual void WindowActivated(bool state); 178 virtual void KeyDown(const char* bytes, int32 numBytes); 179 virtual void KeyUp(const char* bytes, int32 numBytes); 180 virtual void Pulse(); 181 virtual void FrameMoved(BPoint new_position); 182 virtual void FrameResized(float new_width, float new_height); 183 184 virtual void TargetedByScrollView(BScrollView* scroll_view); 185 void BeginRectTracking(BRect startRect, 186 uint32 style = B_TRACK_WHOLE_RECT); 187 void EndRectTracking(); 188 189 void GetMouse(BPoint* location, 190 uint32* buttons, 191 bool checkMessageQueue = true); 192 193 void DragMessage(BMessage* aMessage, 194 BRect dragRect, 195 BHandler* reply_to = NULL); 196 void DragMessage(BMessage* aMessage, 197 BBitmap* anImage, 198 BPoint offset, 199 BHandler* reply_to = NULL); 200 void DragMessage(BMessage* aMessage, 201 BBitmap* anImage, 202 drawing_mode dragMode, 203 BPoint offset, 204 BHandler* reply_to = NULL); 205 206 BView* FindView(const char* name) const; 207 BView* Parent() const; 208 BRect Bounds() const; 209 BRect Frame() const; 210 void ConvertToScreen(BPoint* pt) const; 211 BPoint ConvertToScreen(BPoint pt) const; 212 void ConvertFromScreen(BPoint* pt) const; 213 BPoint ConvertFromScreen(BPoint pt) const; 214 void ConvertToScreen(BRect* r) const; 215 BRect ConvertToScreen(BRect r) const; 216 void ConvertFromScreen(BRect* r) const; 217 BRect ConvertFromScreen(BRect r) const; 218 void ConvertToParent(BPoint* pt) const; 219 BPoint ConvertToParent(BPoint pt) const; 220 void ConvertFromParent(BPoint* pt) const; 221 BPoint ConvertFromParent(BPoint pt) const; 222 void ConvertToParent(BRect* r) const; 223 BRect ConvertToParent(BRect r) const; 224 void ConvertFromParent(BRect* r) const; 225 BRect ConvertFromParent(BRect r) const; 226 BPoint LeftTop() const; 227 228 void GetClippingRegion(BRegion* region) const; 229 virtual void ConstrainClippingRegion(BRegion* region); 230 void ClipToPicture(BPicture* picture, 231 BPoint where = B_ORIGIN, 232 bool sync = true); 233 void ClipToInversePicture(BPicture* picture, 234 BPoint where = B_ORIGIN, 235 bool sync = true); 236 237 virtual void SetDrawingMode(drawing_mode mode); 238 drawing_mode DrawingMode() const; 239 240 void SetBlendingMode(source_alpha srcAlpha, 241 alpha_function alphaFunc); 242 void GetBlendingMode(source_alpha* srcAlpha, 243 alpha_function* alphaFunc) const; 244 245 virtual void SetPenSize(float size); 246 float PenSize() const; 247 248 void SetViewCursor(const BCursor* cursor, bool sync=true); 249 250 virtual void SetViewColor(rgb_color c); 251 void SetViewColor(uchar r, uchar g, uchar b, uchar a = 255); 252 rgb_color ViewColor() const; 253 254 void SetViewBitmap(const BBitmap* bitmap, 255 BRect srcRect, BRect dstRect, 256 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 257 uint32 options = B_TILE_BITMAP); 258 void SetViewBitmap(const BBitmap* bitmap, 259 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 260 uint32 options = B_TILE_BITMAP); 261 void ClearViewBitmap(); 262 263 status_t SetViewOverlay(const BBitmap* overlay, 264 BRect srcRect, BRect dstRect, 265 rgb_color* colorKey, 266 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 267 uint32 options = 0); 268 status_t SetViewOverlay(const BBitmap* overlay, rgb_color* colorKey, 269 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 270 uint32 options = 0); 271 void ClearViewOverlay(); 272 273 virtual void SetHighColor(rgb_color a_color); 274 void SetHighColor(uchar r, uchar g, uchar b, uchar a = 255); 275 rgb_color HighColor() const; 276 277 virtual void SetLowColor(rgb_color a_color); 278 void SetLowColor(uchar r, uchar g, uchar b, uchar a = 255); 279 rgb_color LowColor() const; 280 281 void SetLineMode(cap_mode lineCap, 282 join_mode lineJoin, 283 float miterLimit = B_DEFAULT_MITER_LIMIT); 284 join_mode LineJoinMode() const; 285 cap_mode LineCapMode() const; 286 float LineMiterLimit() const; 287 288 void SetOrigin(BPoint pt); 289 void SetOrigin(float x, float y); 290 BPoint Origin() const; 291 292 void PushState(); 293 void PopState(); 294 295 void MovePenTo(BPoint pt); 296 void MovePenTo(float x, float y); 297 void MovePenBy(float x, float y); 298 BPoint PenLocation() const; 299 void StrokeLine(BPoint toPt, 300 pattern p = B_SOLID_HIGH); 301 void StrokeLine(BPoint pt0, 302 BPoint pt1, 303 pattern p = B_SOLID_HIGH); 304 void BeginLineArray(int32 count); 305 void AddLine(BPoint pt0, BPoint pt1, rgb_color col); 306 void EndLineArray(); 307 308 void StrokePolygon(const BPolygon* aPolygon, 309 bool closed = true, 310 pattern p = B_SOLID_HIGH); 311 void StrokePolygon(const BPoint* ptArray, 312 int32 numPts, 313 bool closed = true, 314 pattern p = B_SOLID_HIGH); 315 void StrokePolygon(const BPoint* ptArray, 316 int32 numPts, 317 BRect bounds, 318 bool closed = true, 319 pattern p = B_SOLID_HIGH); 320 void FillPolygon(const BPolygon* aPolygon, 321 pattern p = B_SOLID_HIGH); 322 void FillPolygon(const BPoint* ptArray, 323 int32 numPts, 324 pattern p = B_SOLID_HIGH); 325 void FillPolygon(const BPoint* ptArray, 326 int32 numPts, 327 BRect bounds, 328 pattern p = B_SOLID_HIGH); 329 330 void StrokeTriangle(BPoint pt1, 331 BPoint pt2, 332 BPoint pt3, 333 BRect bounds, 334 pattern p = B_SOLID_HIGH); 335 void StrokeTriangle(BPoint pt1, 336 BPoint pt2, 337 BPoint pt3, 338 pattern p = B_SOLID_HIGH); 339 void FillTriangle(BPoint pt1, 340 BPoint pt2, 341 BPoint pt3, 342 pattern p = B_SOLID_HIGH); 343 void FillTriangle(BPoint pt1, 344 BPoint pt2, 345 BPoint pt3, 346 BRect bounds, 347 pattern p = B_SOLID_HIGH); 348 349 void StrokeRect(BRect r, pattern p = B_SOLID_HIGH); 350 void FillRect(BRect r, pattern p = B_SOLID_HIGH); 351 void FillRegion(BRegion* a_region, pattern p= B_SOLID_HIGH); 352 void InvertRect(BRect r); 353 354 void StrokeRoundRect(BRect r, 355 float xRadius, 356 float yRadius, 357 pattern p = B_SOLID_HIGH); 358 void FillRoundRect(BRect r, 359 float xRadius, 360 float yRadius, 361 pattern p = B_SOLID_HIGH); 362 363 void StrokeEllipse(BPoint center, 364 float xRadius, 365 float yRadius, 366 pattern p = B_SOLID_HIGH); 367 void StrokeEllipse(BRect r, pattern p = B_SOLID_HIGH); 368 void FillEllipse(BPoint center, 369 float xRadius, 370 float yRadius, 371 pattern p = B_SOLID_HIGH); 372 void FillEllipse(BRect r, pattern p = B_SOLID_HIGH); 373 374 void StrokeArc(BPoint center, 375 float xRadius, 376 float yRadius, 377 float start_angle, 378 float arc_angle, 379 pattern p = B_SOLID_HIGH); 380 void StrokeArc(BRect r, 381 float start_angle, 382 float arc_angle, 383 pattern p = B_SOLID_HIGH); 384 void FillArc(BPoint center, 385 float xRadius, 386 float yRadius, 387 float start_angle, 388 float arc_angle, 389 pattern p = B_SOLID_HIGH); 390 void FillArc(BRect r, 391 float start_angle, 392 float arc_angle, 393 pattern p = B_SOLID_HIGH); 394 395 void StrokeBezier(BPoint* controlPoints, 396 pattern p = B_SOLID_HIGH); 397 void FillBezier(BPoint* controlPoints, 398 pattern p = B_SOLID_HIGH); 399 400 void StrokeShape(BShape* shape, 401 pattern p = B_SOLID_HIGH); 402 void FillShape(BShape* shape, 403 pattern p = B_SOLID_HIGH); 404 405 void CopyBits(BRect src, BRect dst); 406 void DrawBitmapAsync(const BBitmap* aBitmap, 407 BRect srcRect, 408 BRect dstRect); 409 void DrawBitmapAsync(const BBitmap* aBitmap); 410 void DrawBitmapAsync(const BBitmap* aBitmap, BPoint where); 411 void DrawBitmapAsync(const BBitmap* aBitmap, BRect dstRect); 412 void DrawBitmap(const BBitmap* aBitmap, 413 BRect srcRect, 414 BRect dstRect); 415 void DrawBitmap(const BBitmap* aBitmap); 416 void DrawBitmap(const BBitmap* aBitmap, BPoint where); 417 void DrawBitmap(const BBitmap* aBitmap, BRect dstRect); 418 419 void DrawChar(char aChar); 420 void DrawChar(char aChar, BPoint location); 421 void DrawString(const char* aString, 422 escapement_delta* delta = NULL); 423 void DrawString(const char* aString, BPoint location, 424 escapement_delta* delta = NULL); 425 void DrawString(const char* aString, int32 length, 426 escapement_delta* delta = NULL); 427 void DrawString(const char* aString, 428 int32 length, 429 BPoint location, 430 escapement_delta* delta = 0L); 431 432 virtual void SetFont(const BFont* font, uint32 mask = B_FONT_ALL); 433 434 #if !_PR3_COMPATIBLE_ 435 void GetFont(BFont* font) const; 436 #else 437 void GetFont(BFont* font); 438 #endif 439 void TruncateString(BString* in_out, 440 uint32 mode, 441 float width) const; 442 float StringWidth(const char* string) const; 443 float StringWidth(const char* string, int32 length) const; 444 void GetStringWidths(char* stringArray[], 445 int32 lengthArray[], 446 int32 numStrings, 447 float widthArray[]) const; 448 void SetFontSize(float size); 449 void ForceFontAliasing(bool enable); 450 void GetFontHeight(font_height* height) const; 451 452 void Invalidate(BRect invalRect); 453 void Invalidate(const BRegion* invalRegion); 454 void Invalidate(); 455 456 void SetDiskMode(char* filename, long offset); 457 458 void BeginPicture(BPicture* a_picture); 459 void AppendToPicture(BPicture* a_picture); 460 BPicture* EndPicture(); 461 462 void DrawPicture(const BPicture* a_picture); 463 void DrawPicture(const BPicture* a_picture, BPoint where); 464 void DrawPicture(const char* filename, long offset, BPoint where); 465 void DrawPictureAsync(const BPicture* a_picture); 466 void DrawPictureAsync(const BPicture* a_picture, BPoint where); 467 void DrawPictureAsync(const char* filename, long offset, 468 BPoint where); 469 470 status_t SetEventMask(uint32 mask, uint32 options=0); 471 uint32 EventMask(); 472 status_t SetMouseEventMask(uint32 mask, uint32 options=0); 473 474 virtual void SetFlags(uint32 flags); 475 uint32 Flags() const; 476 virtual void SetResizingMode(uint32 mode); 477 uint32 ResizingMode() const; 478 void MoveBy(float dh, float dv); 479 void MoveTo(BPoint where); 480 void MoveTo(float x, float y); 481 void ResizeBy(float dh, float dv); 482 void ResizeTo(float width, float height); 483 void ScrollBy(float dh, float dv); 484 void ScrollTo(float x, float y); 485 virtual void ScrollTo(BPoint where); 486 virtual void MakeFocus(bool focusState = true); 487 bool IsFocus() const; 488 489 virtual void Show(); 490 virtual void Hide(); 491 bool IsHidden() const; 492 bool IsHidden(const BView* looking_from) const; 493 494 void Flush() const; 495 void Sync() const; 496 497 virtual void GetPreferredSize(float* width, float* height); 498 virtual void ResizeToPreferred(); 499 500 BScrollBar* ScrollBar(orientation posture) const; 501 502 virtual BHandler* ResolveSpecifier(BMessage* msg, 503 int32 index, 504 BMessage* specifier, 505 int32 form, 506 const char* property); 507 virtual status_t GetSupportedSuites(BMessage* data); 508 509 bool IsPrinting() const; 510 void SetScale(float scale) const; 511 512 // Private or reserved --------------------------------------------------------- 513 virtual status_t Perform(perform_code d, void* arg); 514 515 virtual void DrawAfterChildren(BRect r); 516 517 // added by OBOS - DO NOT use this when programming BeOS R5!!! 518 float Scale() const; 519 520 private: 521 522 friend class BScrollBar; 523 friend class BWindow; 524 friend class BBitmap; 525 friend class BPrintJob; 526 friend class BShelf; 527 friend class BTabView; 528 529 virtual void _ReservedView2(); 530 virtual void _ReservedView3(); 531 virtual void _ReservedView4(); 532 virtual void _ReservedView5(); 533 virtual void _ReservedView6(); 534 virtual void _ReservedView7(); 535 virtual void _ReservedView8(); 536 537 #if !_PR3_COMPATIBLE_ 538 virtual void _ReservedView9(); 539 virtual void _ReservedView10(); 540 virtual void _ReservedView11(); 541 virtual void _ReservedView12(); 542 virtual void _ReservedView13(); 543 virtual void _ReservedView14(); 544 virtual void _ReservedView15(); 545 virtual void _ReservedView16(); 546 #endif 547 548 BView(const BView&); 549 BView& operator=(const BView&); 550 551 void InitData(BRect f, const char* name, uint32 rs, uint32 fl); 552 status_t ArchiveChildren(BMessage* data, bool deep) const; 553 status_t UnarchiveChildren(BMessage* data, BWindow* w = NULL); 554 status_t setViewImage(const BBitmap* bitmap,BRect srcRect, BRect dstRect, 555 uint32 followFlags, uint32 options); 556 void BeginPicture_pr(BPicture* a_picture, BRect r); 557 void SetPattern(pattern pat); 558 void DoBezier(int32 gr, BPoint* controlPoints, pattern p); 559 void DoShape(int32 gr, BShape* shape, pattern p); 560 void DoPictureClip(BPicture* picture, BPoint where, bool invert, 561 bool sync); 562 563 bool do_owner_check() const; 564 void _SetOwner(BWindow* newOwner); 565 void check_lock() const; 566 void check_lock_no_pick() const; 567 void movesize(uint32 code, int32 h, int32 v); 568 void handle_tick(); 569 char *test_area(int32 length); 570 void removeCommArray(); 571 _array_hdr_ *new_comm_array(int32 cnt); 572 void SetScroller(BScrollBar* sb); 573 void UnsetScroller(BScrollBar* sb); 574 void RealScrollTo(BPoint); 575 void fetch_font(); 576 uchar font_encoding() const; 577 BShelf* shelf() const; 578 void set_shelf(BShelf* shelf); 579 580 void _Activate(bool state); 581 void _Pulse(); 582 583 void _UpdateStateForRemove(); 584 void _UpdatePattern(::pattern pattern); 585 586 void deleteView( BView* aView); 587 bool do_owner_check_no_pick() const; 588 bool attachView( BView *aView ); 589 bool _AddChildToList(BView* child, BView* before = NULL); 590 bool _RemoveChildFromList(BView* child); 591 void callAttachHooks( BView *aView ); 592 void callDetachHooks( BView *aView ); 593 594 // Debugging methods 595 void PrintToStream(); 596 void PrintTree(); 597 598 int32 server_token; 599 uint32 fFlags; 600 BPoint fParentOffset; 601 BWindow* fOwner; 602 BView* fParent; 603 BView* fNextSibling; 604 BView* fPreviousSibling; 605 BView* fFirstChild; 606 607 int16 fShowLevel; 608 bool top_level_view; // used 609 bool fNoISInteraction; 610 BPicture* cpicture; // used 611 _array_data_* comm; // used 612 613 BScrollBar* fVerScroller; // used 614 BScrollBar* fHorScroller; // used 615 bool f_is_printing; 616 bool _unused_bool0; // was: attached; 617 bool _unused_bool1; 618 bool _unused_bool2; 619 BPrivate::ViewState* fPermanentState; // not used 620 BPrivate::ViewState* fState; 621 BRect fBounds; 622 BShelf* fShelf; 623 void* pr_state; // not used 624 uint32 fEventMask; 625 uint32 fEventOptions; 626 uint32 _reserved[4]; 627 #if !_PR3_COMPATIBLE_ 628 uint32 _more_reserved[3]; 629 #endif 630 }; 631 632 633 // inline definitions ---------------------------------------------------------- 634 635 inline void 636 BView::ScrollTo(float x, float y) 637 { 638 ScrollTo(BPoint(x, y)); 639 } 640 641 inline void 642 BView::SetViewColor(uchar r, uchar g, uchar b, uchar a) 643 { 644 rgb_color color; 645 color.red = r; color.green = g; 646 color.blue = b; color.alpha = a; 647 SetViewColor(color); 648 } 649 650 inline void 651 BView::SetHighColor(uchar r, uchar g, uchar b, uchar a) 652 { 653 rgb_color color; 654 color.red = r; color.green = g; 655 color.blue = b; color.alpha = a; 656 SetHighColor(color); 657 } 658 659 inline void 660 BView::SetLowColor(uchar r, uchar g, uchar b, uchar a) 661 { 662 rgb_color color; 663 color.red = r; color.green = g; 664 color.blue = b; color.alpha = a; 665 SetLowColor(color); 666 } 667 668 #endif // _VIEW_H 669