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