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_FALSE_BOLD_WIDTH = 0x00000100, 65 B_FONT_ALL = 0x000001FF 66 }; 67 68 // view flags 69 const uint32 B_FULL_UPDATE_ON_RESIZE = 0x80000000UL; /* 31 */ 70 const uint32 _B_RESERVED1_ = 0x40000000UL; /* 30 */ 71 const uint32 B_WILL_DRAW = 0x20000000UL; /* 29 */ 72 const uint32 B_PULSE_NEEDED = 0x10000000UL; /* 28 */ 73 const uint32 B_NAVIGABLE_JUMP = 0x08000000UL; /* 27 */ 74 const uint32 B_FRAME_EVENTS = 0x04000000UL; /* 26 */ 75 const uint32 B_NAVIGABLE = 0x02000000UL; /* 25 */ 76 const uint32 B_SUBPIXEL_PRECISE = 0x01000000UL; /* 24 */ 77 const uint32 B_DRAW_ON_CHILDREN = 0x00800000UL; /* 23 */ 78 const uint32 B_INPUT_METHOD_AWARE = 0x00400000UL; /* 23 */ 79 const uint32 _B_RESERVED7_ = 0x00200000UL; /* 22 */ 80 const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 21 */ 81 const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 20 */ 82 83 #define _RESIZE_MASK_ (0xffff) 84 85 const uint32 _VIEW_TOP_ = 1UL; 86 const uint32 _VIEW_LEFT_ = 2UL; 87 const uint32 _VIEW_BOTTOM_ = 3UL; 88 const uint32 _VIEW_RIGHT_ = 4UL; 89 const uint32 _VIEW_CENTER_ = 5UL; 90 91 inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3, uint32 r4) 92 { return ((r1 << 12) | (r2 << 8) | (r3 << 4) | r4); } 93 94 #define B_FOLLOW_NONE 0 95 #define B_FOLLOW_ALL_SIDES _rule_(_VIEW_TOP_, _VIEW_LEFT_, _VIEW_BOTTOM_, _VIEW_RIGHT_) 96 #define B_FOLLOW_ALL B_FOLLOW_ALL_SIDES 97 98 #define B_FOLLOW_LEFT _rule_(0, _VIEW_LEFT_, 0, _VIEW_LEFT_) 99 #define B_FOLLOW_RIGHT _rule_(0, _VIEW_RIGHT_, 0, _VIEW_RIGHT_) 100 #define B_FOLLOW_LEFT_RIGHT _rule_(0, _VIEW_LEFT_, 0, _VIEW_RIGHT_) 101 #define B_FOLLOW_H_CENTER _rule_(0, _VIEW_CENTER_, 0, _VIEW_CENTER_) 102 103 #define B_FOLLOW_TOP _rule_(_VIEW_TOP_, 0, _VIEW_TOP_, 0) 104 #define B_FOLLOW_BOTTOM _rule_(_VIEW_BOTTOM_, 0, _VIEW_BOTTOM_, 0) 105 #define B_FOLLOW_TOP_BOTTOM _rule_(_VIEW_TOP_, 0, _VIEW_BOTTOM_, 0) 106 #define B_FOLLOW_V_CENTER _rule_(_VIEW_CENTER_, 0, _VIEW_CENTER_, 0) 107 108 class BBitmap; 109 class BCursor; 110 class BLayout; 111 class BLayoutContext; 112 class BLayoutItem; 113 class BMessage; 114 class BPicture; 115 class BPolygon; 116 class BRegion; 117 class BScrollBar; 118 class BScrollView; 119 class BShape; 120 class BShelf; 121 class BString; 122 class BWindow; 123 struct _array_data_; 124 struct _array_hdr_; 125 struct overlay_restrictions; 126 127 namespace BPrivate { 128 class ViewState; 129 }; 130 131 132 class BView : public BHandler { 133 public: 134 BView(const char* name, uint32 flags, 135 BLayout* layout = NULL); 136 BView(BRect frame, const char* name, 137 uint32 resizeMask, uint32 flags); 138 virtual ~BView(); 139 140 BView(BMessage* data); 141 static BArchivable* Instantiate(BMessage* data); 142 virtual status_t Archive(BMessage* data, bool deep = true) const; 143 144 virtual void AttachedToWindow(); 145 virtual void AllAttached(); 146 virtual void DetachedFromWindow(); 147 virtual void AllDetached(); 148 149 virtual void MessageReceived(BMessage* msg); 150 151 void AddChild(BView* child, BView* before = NULL); 152 bool AddChild(BLayoutItem* child); 153 bool RemoveChild(BView* child); 154 int32 CountChildren() const; 155 BView* ChildAt(int32 index) const; 156 BView* NextSibling() const; 157 BView* PreviousSibling() const; 158 bool RemoveSelf(); 159 160 BWindow* Window() const; 161 162 virtual void Draw(BRect updateRect); 163 virtual void MouseDown(BPoint where); 164 virtual void MouseUp(BPoint where); 165 virtual void MouseMoved(BPoint where, 166 uint32 code, 167 const BMessage* a_message); 168 virtual void WindowActivated(bool state); 169 virtual void KeyDown(const char* bytes, int32 numBytes); 170 virtual void KeyUp(const char* bytes, int32 numBytes); 171 virtual void Pulse(); 172 virtual void FrameMoved(BPoint new_position); 173 virtual void FrameResized(float new_width, float new_height); 174 175 virtual void TargetedByScrollView(BScrollView* scroll_view); 176 void BeginRectTracking(BRect startRect, 177 uint32 style = B_TRACK_WHOLE_RECT); 178 void EndRectTracking(); 179 180 void GetMouse(BPoint* location, 181 uint32* buttons, 182 bool checkMessageQueue = true); 183 184 void DragMessage(BMessage* aMessage, 185 BRect dragRect, 186 BHandler* reply_to = NULL); 187 void DragMessage(BMessage* aMessage, 188 BBitmap* anImage, 189 BPoint offset, 190 BHandler* reply_to = NULL); 191 void DragMessage(BMessage* aMessage, 192 BBitmap* anImage, 193 drawing_mode dragMode, 194 BPoint offset, 195 BHandler* reply_to = NULL); 196 197 BView* FindView(const char* name) const; 198 BView* Parent() const; 199 BRect Bounds() const; 200 BRect Frame() const; 201 void ConvertToScreen(BPoint* pt) const; 202 BPoint ConvertToScreen(BPoint pt) const; 203 void ConvertFromScreen(BPoint* pt) const; 204 BPoint ConvertFromScreen(BPoint pt) const; 205 void ConvertToScreen(BRect* r) const; 206 BRect ConvertToScreen(BRect r) const; 207 void ConvertFromScreen(BRect* r) const; 208 BRect ConvertFromScreen(BRect r) const; 209 void ConvertToParent(BPoint* pt) const; 210 BPoint ConvertToParent(BPoint pt) const; 211 void ConvertFromParent(BPoint* pt) const; 212 BPoint ConvertFromParent(BPoint pt) const; 213 void ConvertToParent(BRect* r) const; 214 BRect ConvertToParent(BRect r) const; 215 void ConvertFromParent(BRect* r) const; 216 BRect ConvertFromParent(BRect r) const; 217 BPoint LeftTop() const; 218 219 void GetClippingRegion(BRegion* region) const; 220 virtual void ConstrainClippingRegion(BRegion* region); 221 void ClipToPicture(BPicture* picture, 222 BPoint where = B_ORIGIN, 223 bool sync = true); 224 void ClipToInversePicture(BPicture* picture, 225 BPoint where = B_ORIGIN, 226 bool sync = true); 227 228 virtual void SetDrawingMode(drawing_mode mode); 229 drawing_mode DrawingMode() const; 230 231 void SetBlendingMode(source_alpha srcAlpha, 232 alpha_function alphaFunc); 233 void GetBlendingMode(source_alpha* srcAlpha, 234 alpha_function* alphaFunc) const; 235 236 virtual void SetPenSize(float size); 237 float PenSize() const; 238 239 void SetViewCursor(const BCursor* cursor, bool sync=true); 240 241 virtual void SetViewColor(rgb_color c); 242 void SetViewColor(uchar r, uchar g, uchar b, uchar a = 255); 243 rgb_color ViewColor() const; 244 245 void SetViewBitmap(const BBitmap* bitmap, 246 BRect srcRect, BRect dstRect, 247 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 248 uint32 options = B_TILE_BITMAP); 249 void SetViewBitmap(const BBitmap* bitmap, 250 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 251 uint32 options = B_TILE_BITMAP); 252 void ClearViewBitmap(); 253 254 status_t SetViewOverlay(const BBitmap* overlay, 255 BRect srcRect, BRect dstRect, 256 rgb_color* colorKey, 257 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 258 uint32 options = 0); 259 status_t SetViewOverlay(const BBitmap* overlay, rgb_color* colorKey, 260 uint32 followFlags = B_FOLLOW_TOP|B_FOLLOW_LEFT, 261 uint32 options = 0); 262 void ClearViewOverlay(); 263 264 virtual void SetHighColor(rgb_color a_color); 265 void SetHighColor(uchar r, uchar g, uchar b, uchar a = 255); 266 rgb_color HighColor() const; 267 268 virtual void SetLowColor(rgb_color a_color); 269 void SetLowColor(uchar r, uchar g, uchar b, uchar a = 255); 270 rgb_color LowColor() const; 271 272 void SetLineMode(cap_mode lineCap, 273 join_mode lineJoin, 274 float miterLimit = B_DEFAULT_MITER_LIMIT); 275 join_mode LineJoinMode() const; 276 cap_mode LineCapMode() const; 277 float LineMiterLimit() const; 278 279 void SetOrigin(BPoint pt); 280 void SetOrigin(float x, float y); 281 BPoint Origin() const; 282 283 void PushState(); 284 void PopState(); 285 286 void MovePenTo(BPoint pt); 287 void MovePenTo(float x, float y); 288 void MovePenBy(float x, float y); 289 BPoint PenLocation() const; 290 void StrokeLine(BPoint toPt, 291 pattern p = B_SOLID_HIGH); 292 void StrokeLine(BPoint pt0, 293 BPoint pt1, 294 pattern p = B_SOLID_HIGH); 295 void BeginLineArray(int32 count); 296 void AddLine(BPoint pt0, BPoint pt1, rgb_color col); 297 void EndLineArray(); 298 299 void StrokePolygon(const BPolygon* aPolygon, 300 bool closed = true, 301 pattern p = B_SOLID_HIGH); 302 void StrokePolygon(const BPoint* ptArray, 303 int32 numPts, 304 bool closed = true, 305 pattern p = B_SOLID_HIGH); 306 void StrokePolygon(const BPoint* ptArray, 307 int32 numPts, 308 BRect bounds, 309 bool closed = true, 310 pattern p = B_SOLID_HIGH); 311 void FillPolygon(const BPolygon* aPolygon, 312 pattern p = B_SOLID_HIGH); 313 void FillPolygon(const BPoint* ptArray, 314 int32 numPts, 315 pattern p = B_SOLID_HIGH); 316 void FillPolygon(const BPoint* ptArray, 317 int32 numPts, 318 BRect bounds, 319 pattern p = B_SOLID_HIGH); 320 321 void StrokeTriangle(BPoint pt1, 322 BPoint pt2, 323 BPoint pt3, 324 BRect bounds, 325 pattern p = B_SOLID_HIGH); 326 void StrokeTriangle(BPoint pt1, 327 BPoint pt2, 328 BPoint pt3, 329 pattern p = B_SOLID_HIGH); 330 void FillTriangle(BPoint pt1, 331 BPoint pt2, 332 BPoint pt3, 333 pattern p = B_SOLID_HIGH); 334 void FillTriangle(BPoint pt1, 335 BPoint pt2, 336 BPoint pt3, 337 BRect bounds, 338 pattern p = B_SOLID_HIGH); 339 340 void StrokeRect(BRect r, pattern p = B_SOLID_HIGH); 341 void FillRect(BRect r, pattern p = B_SOLID_HIGH); 342 void FillRegion(BRegion* a_region, pattern p= B_SOLID_HIGH); 343 void InvertRect(BRect r); 344 345 void StrokeRoundRect(BRect r, 346 float xRadius, 347 float yRadius, 348 pattern p = B_SOLID_HIGH); 349 void FillRoundRect(BRect r, 350 float xRadius, 351 float yRadius, 352 pattern p = B_SOLID_HIGH); 353 354 void StrokeEllipse(BPoint center, 355 float xRadius, 356 float yRadius, 357 pattern p = B_SOLID_HIGH); 358 void StrokeEllipse(BRect r, pattern p = B_SOLID_HIGH); 359 void FillEllipse(BPoint center, 360 float xRadius, 361 float yRadius, 362 pattern p = B_SOLID_HIGH); 363 void FillEllipse(BRect r, pattern p = B_SOLID_HIGH); 364 365 void StrokeArc(BPoint center, 366 float xRadius, 367 float yRadius, 368 float start_angle, 369 float arc_angle, 370 pattern p = B_SOLID_HIGH); 371 void StrokeArc(BRect r, 372 float start_angle, 373 float arc_angle, 374 pattern p = B_SOLID_HIGH); 375 void FillArc(BPoint center, 376 float xRadius, 377 float yRadius, 378 float start_angle, 379 float arc_angle, 380 pattern p = B_SOLID_HIGH); 381 void FillArc(BRect r, 382 float start_angle, 383 float arc_angle, 384 pattern p = B_SOLID_HIGH); 385 386 void StrokeBezier(BPoint* controlPoints, 387 pattern p = B_SOLID_HIGH); 388 void FillBezier(BPoint* controlPoints, 389 pattern p = B_SOLID_HIGH); 390 391 void StrokeShape(BShape* shape, 392 pattern p = B_SOLID_HIGH); 393 void FillShape(BShape* shape, 394 pattern p = B_SOLID_HIGH); 395 396 void CopyBits(BRect src, BRect dst); 397 void DrawBitmapAsync(const BBitmap* aBitmap, 398 BRect srcRect, 399 BRect dstRect); 400 void DrawBitmapAsync(const BBitmap* aBitmap); 401 void DrawBitmapAsync(const BBitmap* aBitmap, BPoint where); 402 void DrawBitmapAsync(const BBitmap* aBitmap, BRect dstRect); 403 void DrawBitmap(const BBitmap* aBitmap, 404 BRect srcRect, 405 BRect dstRect); 406 void DrawBitmap(const BBitmap* aBitmap); 407 void DrawBitmap(const BBitmap* aBitmap, BPoint where); 408 void DrawBitmap(const BBitmap* aBitmap, BRect dstRect); 409 410 void DrawChar(char aChar); 411 void DrawChar(char aChar, BPoint location); 412 void DrawString(const char* aString, 413 escapement_delta* delta = NULL); 414 void DrawString(const char* aString, BPoint location, 415 escapement_delta* delta = NULL); 416 void DrawString(const char* aString, int32 length, 417 escapement_delta* delta = NULL); 418 void DrawString(const char* aString, 419 int32 length, 420 BPoint location, 421 escapement_delta* delta = 0L); 422 423 virtual void SetFont(const BFont* font, uint32 mask = B_FONT_ALL); 424 425 #if !_PR3_COMPATIBLE_ 426 void GetFont(BFont* font) const; 427 #else 428 void GetFont(BFont* font); 429 #endif 430 void TruncateString(BString* in_out, 431 uint32 mode, 432 float width) const; 433 float StringWidth(const char* string) const; 434 float StringWidth(const char* string, int32 length) const; 435 void GetStringWidths(char* stringArray[], 436 int32 lengthArray[], 437 int32 numStrings, 438 float widthArray[]) const; 439 void SetFontSize(float size); 440 void ForceFontAliasing(bool enable); 441 void GetFontHeight(font_height* height) const; 442 443 void Invalidate(BRect invalRect); 444 void Invalidate(const BRegion* invalRegion); 445 void Invalidate(); 446 447 void SetDiskMode(char* filename, long offset); 448 449 void BeginPicture(BPicture* a_picture); 450 void AppendToPicture(BPicture* a_picture); 451 BPicture* EndPicture(); 452 453 void DrawPicture(const BPicture* a_picture); 454 void DrawPicture(const BPicture* a_picture, BPoint where); 455 void DrawPicture(const char* filename, long offset, BPoint where); 456 void DrawPictureAsync(const BPicture* a_picture); 457 void DrawPictureAsync(const BPicture* a_picture, BPoint where); 458 void DrawPictureAsync(const char* filename, long offset, 459 BPoint where); 460 461 status_t SetEventMask(uint32 mask, uint32 options=0); 462 uint32 EventMask(); 463 status_t SetMouseEventMask(uint32 mask, uint32 options=0); 464 465 virtual void SetFlags(uint32 flags); 466 uint32 Flags() const; 467 virtual void SetResizingMode(uint32 mode); 468 uint32 ResizingMode() const; 469 void MoveBy(float dh, float dv); 470 void MoveTo(BPoint where); 471 void MoveTo(float x, float y); 472 void ResizeBy(float dh, float dv); 473 void ResizeTo(float width, float height); 474 void ResizeTo(BSize size); 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 virtual void InvalidateLayout(bool descendants = false); 536 void EnableLayoutInvalidation(); 537 void DisableLayoutInvalidation(); 538 bool IsLayoutValid() const; 539 540 BLayoutContext* LayoutContext() const; 541 542 void Layout(bool force); 543 void Relayout(); 544 545 protected: 546 virtual void DoLayout(); 547 548 private: 549 void _Layout(bool force, BLayoutContext* context); 550 551 private: 552 struct LayoutData; 553 554 friend class BBitmap; 555 friend class BLayout; 556 friend class BPrintJob; 557 friend class BScrollBar; 558 friend class BShelf; 559 friend class BTabView; 560 friend class BWindow; 561 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