xref: /haiku/docs/user/interface/View.dox (revision 1757f197bd98997256fea2918bfa4603bf81b748)
1/*
2 * Copyright 2011-2015, 2019 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		John Scipione, jscipione@gmail.com
7 *		Joseph Groover, looncraz@looncraz.net
8 *
9 * Corresponds to:
10 *		headers/os/interface/View.h	 hrev52835
11 *		src/kits/interface/View.cpp	 hrev53446
12 */
13
14
15/*!
16	\file View.h
17	\ingroup interface
18	\ingroup libbe
19	\brief BView class definition and support data structures.
20
21	\since BeOS R5
22*/
23
24
25// mouse buttons
26
27
28/*!
29	\var B_PRIMARY_MOUSE_BUTTON
30	\brief Primary mouse button mask parameter.
31
32	\since BeOS R3
33*/
34
35
36/*!
37	\var B_SECONDARY_MOUSE_BUTTON
38	\brief Secondary mouse button mask parameter.
39
40	\since BeOS R3
41*/
42
43
44/*!
45	\var B_TERTIARY_MOUSE_BUTTON
46	\brief Tertiary mouse button mask parameter.
47
48	\since BeOS R3
49*/
50
51
52// mouse transit
53
54
55/*!
56	\var B_ENTERED_VIEW
57	\brief Mouse transit entered view.
58
59	\since BeOS R3
60*/
61
62
63/*!
64	\var B_INSIDE_VIEW
65	\brief Mouse transit inside view.
66
67	\since BeOS R3
68*/
69
70
71/*!
72	\var B_EXITED_VIEW
73	\brief Mouse transit exited view.
74
75	\since BeOS R3
76*/
77
78
79/*!
80	\var B_OUTSIDE_VIEW
81	\brief Mouse transit outside view.
82
83	\since BeOS R5
84*/
85
86
87// event mask
88
89
90/*!
91	\var B_POINTER_EVENTS
92	\brief Mouse pointer events mask parameter.
93
94	\since BeOS R5
95*/
96
97
98/*!
99	\var B_KEYBOARD_EVENTS
100	\brief Keyboard events mask parameter.
101
102	\since BeOS R5
103*/
104
105
106// event mask options
107
108
109/*!
110	\var B_LOCK_WINDOW_FOCUS
111	\brief Prevents the attached window from losing its focused state while
112	       the mouse is held down.
113
114	\since BeOS R5
115*/
116
117
118/*!
119	\var B_SUSPEND_VIEW_FOCUS
120	\brief Events normally sent to the focus view are suppressed.
121
122	\since BeOS R5
123*/
124
125
126/*!
127	\var B_NO_POINTER_HISTORY
128	\brief Send only the most recent MouseMoved() event to the view.
129
130	\note New in Haiku: unless this flag is specified, both BWindow and
131	      BView::GetMouse() will filter out older mouse moved messages.
132
133	\since BeOS R5
134*/
135
136
137/*!
138	\var B_FULL_POINTER_HISTORY
139	\brief Send all MouseMoved() events to the view.
140
141	\since Haiku R1
142*/
143
144
145// event tracking
146
147
148/*!
149	\var B_TRACK_WHOLE_RECT
150	\brief The whole rectangle moves with the cursor.
151
152	\since BeOS R3
153*/
154
155
156/*!
157	\var B_TRACK_RECT_CORNER
158	\brief The left top corner is fixed while the right and bottom edges
159	       move with the cursor.
160
161	\since BeOS R3
162*/
163
164
165// set font mask
166
167
168/*!
169	\var B_FONT_FAMILY_AND_STYLE
170	\brief Font family and style mask parameter.
171
172	\since BeOS R3
173*/
174
175
176/*!
177	\var B_FONT_SIZE
178	\brief Font size mask parameter.
179
180	\since BeOS R3
181*/
182
183
184/*!
185	\var B_FONT_SHEAR
186	\brief Font shear mask parameter.
187
188	\since BeOS R3
189*/
190
191
192/*!
193	\var B_FONT_ROTATION
194	\brief Font rotation mask parameter.
195
196	\since BeOS R3
197*/
198
199
200/*!
201	\var B_FONT_SPACING
202	\brief Font spacing mask parameter.
203
204	\since BeOS R3
205*/
206
207
208/*!
209	\var B_FONT_ENCODING
210	\brief Font encoding mask parameter.
211
212	\since BeOS R3
213*/
214
215
216/*!
217	\var B_FONT_FACE
218	\brief Font face mask parameter.
219
220	\since BeOS R3
221*/
222
223
224/*!
225	\var B_FONT_FLAGS
226	\brief Font flags mask parameter.
227
228	\since BeOS R3
229*/
230
231
232/*!
233	\var B_FONT_FALSE_BOLD_WIDTH
234	\brief Font false bold width mask parameter.
235
236	\since Haiku R1
237*/
238
239
240/*!
241	\var B_FONT_ALL
242	\brief Font all properties mask parameter.
243
244	\since BeOS R3
245*/
246
247
248// view flags
249
250
251/*!
252	\var B_FULL_UPDATE_ON_RESIZE
253	\brief Redraw the entire view on resize.
254
255	\since BeOS R3
256*/
257
258
259/*!
260	\var _B_RESERVED1_
261	\brief Reserved for future use.
262
263	\since Haiku R1
264*/
265
266
267/*!
268	\var B_WILL_DRAW
269	\brief Indicates that the view will do its own drawing.
270
271	\since BeOS R3
272*/
273
274
275/*!
276	\var B_PULSE_NEEDED
277	\brief Indicates that the view accepts Pulse() messages.
278
279	\since BeOS R3
280*/
281
282
283/*!
284	\var B_NAVIGABLE_JUMP
285	\brief Indicates this is the default keyboard navigation view.
286
287	\since BeOS R3
288*/
289
290/*!
291	\var B_FRAME_EVENTS
292	\brief View responds to frame move and resize events.
293
294	\since BeOS R3
295*/
296
297
298/*!
299	\var B_NAVIGABLE
300	\brief The view is able to receive focus for keyboard navigation.
301	Typically focus is indicated by drawing a blue rectangle around the view.
302
303	\since BeOS R3
304*/
305
306
307/*!
308	\var B_SUBPIXEL_PRECISE
309	\brief The view draws with sub-pixel precision.
310
311	If this flag is not specified, drawing coordinates will be rounded
312	to the nearest integer.
313
314	\since BeOS R5
315*/
316
317
318/*!
319	\var B_DRAW_ON_CHILDREN
320	\brief Indicates that the view responds to the DrawAfterChildren() hook
321		method.
322
323	\since BeOS R5
324*/
325
326
327/*!
328	\var B_INPUT_METHOD_AWARE
329	\brief Indicates the view understands input method add-ons, as used
330		for complex text input in CJK and other languages.
331
332	\since BeOS R5
333*/
334
335
336/*!
337	\var B_SCROLL_VIEW_AWARE
338	\brief Indicates the view will properly manage scrollbars that
339		have been targeted to it, i.e. update their ranges and proportions.
340
341	\since Haiku R1
342*/
343
344
345/*!
346	\var B_SUPPORTS_LAYOUT
347	\brief The view supports the layout APIs, i.e. it doesn't require an
348	       frame rectangle to be specified.
349
350	\since Haiku R1
351*/
352
353
354/*!
355	\var B_INVALIDATE_AFTER_LAYOUT
356	\brief Indicates that the view should be redraw after being added to
357	       a layout.
358
359	\since Haiku R1
360*/
361
362
363// resize mask variables, internal variables but are in a public header.
364
365
366/*!
367	\var _RESIZE_MASK_
368	\brief Resize mask. Do not use.
369
370	\since Haiku R1
371*/
372
373
374/*!
375	\var _VIEW_TOP_
376	\brief View top mask variable. Do not use.
377
378	\since Haiku R1
379*/
380
381
382/*!
383	\var _VIEW_LEFT_
384	\brief View left mask variable. Do not use.
385
386	\since Haiku R1
387*/
388
389
390/*!
391	\var _VIEW_BOTTOM_
392	\brief View bottom mask variable. Do not use.
393
394	\since Haiku R1
395*/
396
397
398/*!
399	\var _VIEW_RIGHT_
400	\brief View right mask variable. Do not use.
401
402	\since Haiku R1
403*/
404
405
406/*!
407	\var _VIEW_CENTER_
408	\brief View center mask variable. Do not use.
409
410	\since Haiku R1
411*/
412
413
414/*!
415	\fn inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3, uint32 r4)
416	\brief Internal function, do not use.
417
418	\since Haiku R1
419*/
420
421
422// resize mask
423
424
425/*!
426	\var B_FOLLOW_NONE
427	\brief Follow none resize mask parameter. Equivalent to
428	       \c B_FOLLOW_LEFT | \c B_FOLLOW_TOP. The view maintains its position
429	       in its parent's coordinate system but not in the screen coordinate
430	       system.
431
432	\since BeOS R3
433*/
434
435
436/*!
437	\var B_FOLLOW_ALL_SIDES
438	\brief Follow all sides resize mask parameter. Equivalent to
439	\c B_FOLLOW_LEFT_RIGHT | \c B_FOLLOW_TOP_BOTTOM. The view will be resized
440	with its parent view both horizontally and vertically.
441
442	\since BeOS R3
443*/
444
445
446/*!
447	\var B_FOLLOW_ALL
448	\brief Equivalent to \c B_FOLLOW_ALL_SIDES.
449
450	\since BeOS R3
451*/
452
453
454// horizontal resize mask
455
456
457/*!
458	\var B_FOLLOW_LEFT
459	\brief The margin between the left side of the view and the left side
460	       of its parent remains constant.
461
462	\since BeOS R3
463*/
464
465
466/*!
467	\var B_FOLLOW_RIGHT
468	\brief The margin between the right side of the view and the right side
469	of its parent remains constant.
470
471	\since BeOS R3
472*/
473
474
475/*!
476	\var B_FOLLOW_LEFT_RIGHT
477	\brief The margin between the left and right sides of the view and the left
478	       and right sides of its parent both remain constant.
479
480	\since BeOS R3
481*/
482
483
484/*!
485	\var B_FOLLOW_H_CENTER
486	\brief The view maintains a constant relationship to the horizontal center
487	       of its parent view.
488
489	\since BeOS R3
490*/
491
492
493// vertical resize mask
494
495
496/*!
497	\var B_FOLLOW_TOP
498	\brief The margin between the top of the view and the top of its parent
499	       remains constant.
500
501	\since BeOS R3
502*/
503
504
505/*!
506	\var B_FOLLOW_BOTTOM
507	\brief The margin between the bottom of the view and the bottom of its
508	       parent remains constant.
509
510	\since BeOS R3
511*/
512
513
514/*!
515	\var B_FOLLOW_TOP_BOTTOM
516	\brief The margin between the top and bottom sides of the view and the
517	       top and bottom sides of its parent both remain constant.
518
519	\since BeOS R3
520*/
521
522
523/*!
524	\var B_FOLLOW_V_CENTER
525	\brief The view maintains a constant relationship to the vertical center
526	       of its parent view.
527
528	\since BeOS R3
529*/
530
531
532/*!
533	\var B_FOLLOW_LEFT_TOP
534	\brief The margins between the left and top sides of the view and the left
535	       and top sides of its parent remain constant.
536
537	\since Haiku R1
538*/
539
540
541/*!
542	\class BView
543	\ingroup interface
544	\ingroup libbe
545	\brief View base class.
546
547	A BView is a rectangular area within a window that responds to mouse clicks
548	and key presses, and acts as a surface for you to draw on.
549
550	Most Interface Kit classes, with the notable exception of BWindow inherit from
551	BView. Some of the time you might use a BView object as is, but most of the
552	time you subclass BView to do something unique.
553
554	To create a subclass of BView you generally override one or more of BView's
555	hook methods to respond to user events such as MouseDown() or FrameMoved().
556	By default a BView does nothing in its hook methods unless otherwise stated,
557	it's up to you to define what happens. To override the look of a BView you
558	should override the Draw() or DrawAfterChildren() methods. See the section on
559	Hook Methods below for more details.
560
561	When a BView object is first created it has no parent or child views. How you
562	add a view to the view hierarchy depends on if you want to use a standard
563	view with a defined frame rectangle or to use the Layout APIs to position and
564	size your view instead.
565
566	If you create a standard view you need to add it to a window or another view
567	using the AddChild() method, if you create a layout view you need to add your
568	view to a layout using BLayout::AddView() or by adding it to a layout builder.
569
570	Views are not very interesting until they, or one of their parents, are
571	attached to a window as many of BView's methods depend on a connection to the
572	App Server to do their work. In order to prevent multiple views from altering
573	the window simultaneously though locking is required. To perform an action
574	while the window is locked you issue the following code:
575
576\code
577if (Window()->LockLooper()) {
578	...
579	Window()->UnlockLooper()
580}
581\endcode
582
583	Whenever App Server calls a hook method it automatically locks the BWindow for
584	you.
585
586	Only one view attached to a window is able to receive keyboard events at a
587	time. The view that is able to receive keyboard events such as KeyDown() is
588	called the "focus view". MakeFocus() gives or removes focus from a view.
589	Call IsFocus() to determine whether or not the view is the window's current
590	focus view.
591
592	When a view has focus an indicator should be drawn to inform the user. Typically
593	the view is surrounded by a blue rectangle to indicate that it is the window's
594	focus view. The color can be queried using the keyboard_navigation_color()
595	function in InterfaceDefs.h
596
597	Each view has its own coordinate system with the origin point (0.0, 0.0)
598	located at the top left corner. You can convert a BPoint or BRect to or from
599	the view's coordinate system to the coordinate system of its parent, or
600	of the screen's coordinate system. See the section on Coordinate Conversion
601	Methods for more details.
602
603	The Application Server clips a BView to the region where it's permitted to
604	draw which is never larger than the view's bound rectangle. A view can never
605	draw outside its bounds nor can it draw outside of the bounds rectangle of any
606	parent view.
607
608	You may limit the clipping region further by passing a BRegion object to
609	ConstrainClippingRegion(). You can obtain the current clipping region by
610	calling GetClippingRegion().
611
612	Each view has a ViewColor() that fills the frame rectangle before the
613	view does any drawing of its own. The default view color is white, you may
614	change the view color by calling SetViewColor() or, as of Haiku R1,
615	SetViewUIColor(). A commonly used view color is \c B_PANEL_BACKGROUND_COLOR
616	which is a user-defined color used as the view color of most applications.
617	If you set the view color to \c B_TRANSPARENT_COLOR then the Application Server
618	won't erase the clipping region of the view before updating, this should only
619	be used if the view erases itself by drawing on every pixel in the clipping
620	region.
621
622	If you want to set the view color of a view to be the same as its parent you
623	need to set it within the AttachedToWindow() method of the view like so:
624
625\code
626SetViewColor(Parent()->ViewColor());
627\endcode
628
629	\since BeOS R3
630*/
631
632
633
634/*!
635	\fn BView::BView(const char* name, uint32 flags, BLayout* layout)
636	\brief Layout constructor.
637
638	To be used as part of a BLayout. You may use the Layout Methods found below
639	to set the size and alignment constraints of the view.
640
641	\c B_SUPPORTS_LAYOUT is automatically set to the view. The view flags can be
642	set after the view has been constructed by calling the SetFlags() methods.
643
644	\param name The name of the view, can be \c NULL.
645	\param flags The view flags, a mask of one or more of the following:
646	       - \c B_FULL_UPDATE_ON_RESIZE Redraw the entire view on resize.
647	       - \c B_WILL_DRAW Indicates that the view will do its own drawing.
648	       - \c B_PULSE_NEEDED The view accepts Pulse() messages.
649	       - \c B_NAVIGABLE_JUMP Default for keyboard navigation.
650	       - \c B_FRAME_EVENTS Responds to move and resize events.
651	       - \c B_NAVIGABLE Able to receive keyboard navigation focus.
652	       - \c B_SUBPIXEL_PRECISE Draws with sub-pixel precision.
653	       - \c B_DRAW_ON_CHILDREN Responds to DrawAfterChildren().
654	       - \c B_INPUT_METHOD_AWARE Allows access input method add-ons.
655	       - \c B_SUPPORTS_LAYOUT Supports the layout APIs, i.e. it doesn't
656	            use a frame rectangle.
657	       - \c B_INVALIDATE_AFTER_LAYOUT Is redraw after added to a layout.
658	\param layout A \a layout to set the view to.
659
660	\since Haiku R1
661*/
662
663
664/*!
665	\fn BView::BView(BRect frame, const char* name, uint32 resizingMode,
666		uint32 flags)
667	\brief Standard constructor.
668
669	A newly constructed BView object has no parent, you must assign it one by
670	passing it into the AddChild() method of another view or window. Once the
671	view or a parent view has been attached to a window the view becomes part of
672	that window's view hierarchy.
673
674	When the BView object is added as a child the \a frame values are interpreted
675	in the parent's coordinate system. The frame rectangle should be specified in
676	integral values to align on pixel boundaries, decimal values will be rounded.
677
678	The resizing mode flags and view flags can be set after the view has been
679	constructed by calling the SetResizingMode() and SetFlags() methods.
680
681	\param frame The \a frame rectangle of the view.
682	\param name The name of the view, can be \c NULL.
683	\param resizingMode Defines the view's behavior when its parent is resized.
684	       \n\n It combines one of the following horizontal resizing constants:
685	       \li \c B_FOLLOW_TOP The margin between the top of the view and the top
686	           of its parent remains constant.
687	       \li \c B_FOLLOW_BOTTOM The margin between the bottom of the view and
688	           the bottom of its parent remains constant.
689	       \li \c B_FOLLOW_TOP_BOTTOM The margin between the top and bottom sides
690	           of the view and the top and bottom sides of the parent both remain
691	           constant.
692	       \li \c B_FOLLOW_V_CENTER Maintains a constant relationship to the
693	           vertical center of the parent view.
694
695	       with one of the following vertical resizing constants:
696	       \li \c B_FOLLOW_LEFT The margin between the left side of the view and
697	           the left side of its parent remains constant.
698	       \li \c B_FOLLOW_RIGHT The margin between the right side of the view and
699	            the right side of the parent remains constant.
700	       \li \c B_FOLLOW_LEFT_RIGHT The margin between the left and right sides
701	           of the view and the left and right sides of its parent both remain
702	           constant.
703	       \li \c B_FOLLOW_H_CENTER The view maintains a constant relationship to
704	            the horizontal center of the parent view.
705
706	       or use one of the following combined horizontal/vertical constants:
707	       \li \c B_FOLLOW_NONE Equivalent to \c B_FOLLOW_LEFT | \c B_FOLLOW_TOP.
708	       \li \c B_FOLLOW_ALL_SIDES Equivalent to
709	            \c B_FOLLOW_LEFT_RIGHT | \c B_FOLLOW_TOP_BOTTOM.
710	\param flags The view flags, a mask of one or more of the following:
711	       - \c B_FULL_UPDATE_ON_RESIZE Redraw the entire view on resize.
712	       - \c B_WILL_DRAW Indicates that the view will do its own drawing.
713	       - \c B_PULSE_NEEDED The view accepts Pulse() messages.
714	       - \c B_NAVIGABLE_JUMP Default for keyboard navigation.
715	       - \c B_FRAME_EVENTS Responds to move and resize events.
716	       - \c B_NAVIGABLE Able to receive keyboard navigation focus.
717	       - \c B_SUBPIXEL_PRECISE Draws with sub-pixel precision.
718	       - \c B_DRAW_ON_CHILDREN Responds to DrawAfterChildren().
719	       - \c B_INPUT_METHOD_AWARE Allows access input method add-ons.
720	       - \c B_SUPPORTS_LAYOUT Supports the layout APIs, i.e. it doesn't
721	            use a frame rectangle.
722	       - \c B_INVALIDATE_AFTER_LAYOUT Is redraw after added to a layout.
723
724	\since BeOS R3
725*/
726
727
728/*!
729	\fn BView::BView(BMessage* archive)
730	\brief Archive constructor.
731
732	\param archive The message data to construct the view from.
733
734	\since BeOS R3
735*/
736
737
738/*!
739	\fn BView::~BView()
740	\brief Destructor method.
741
742	Deletes the view and all children freeing any memory used.
743
744	\since BeOS R3
745*/
746
747
748/*!
749	\name Archiving
750*/
751
752
753//! @{
754
755
756/*!
757	\fn BArchivable* BView::Instantiate(BMessage* data)
758	\brief Creates a new BView object from the \a data message.
759
760	\returns A newly created BView object or \c NULL if the message doesn't
761	         contain an archived BView.
762
763	\since BeOS R3
764*/
765
766
767/*!
768	\fn status_t BView::Archive(BMessage* data, bool deep) const
769	\brief Archives the object into the \a data message.
770
771	\param data A pointer to the BMessage object to archive the object into.
772	\param deep Whether or not to archive child views as well.
773
774	\return A status code, \c B_OK if everything went well or an error code
775	        otherwise.
776	\retval B_OK The object was archived successfully.
777	\retval B_NO_MEMORY Ran out of memory while archiving the object.
778
779	\since BeOS R3
780*/
781
782
783//! @}
784
785
786/*!
787	\name Hook Methods
788*/
789
790
791//! @{
792
793
794/*!
795	\fn status_t BView::AllUnarchived(const BMessage* from)
796	\brief Hook method called when all views have been unarchived.
797
798	\since BeOS R3
799*/
800
801
802/*!
803	\fn status_t BView::AllArchived(BMessage* into) const
804	\brief Hook method called when all views have been archived.
805
806	\since BeOS R3
807*/
808
809
810/*!
811	\fn void BView::AllAttached()
812	\brief Similar to AttachedToWindow() but this method is triggered after
813	       all child views have already been attached to a window.
814
815	\since BeOS R3
816*/
817
818
819/*!
820	\fn void BView::DetachedFromWindow()
821	\brief Hook method called when the object is detached from a window.
822
823	\since BeOS R3
824*/
825
826
827/*!
828	\fn void BView::AttachedToWindow()
829	\brief Hook method called when the object is attached to a window.
830
831	\since BeOS R3
832*/
833
834
835/*!
836	\fn void BView::AllDetached()
837	\brief Similar to AttachedToWindow() but this method is triggered after
838	       all child views have already been detached from a window.
839
840	\since BeOS R3
841*/
842
843
844/*!
845	\fn void BView::Draw(BRect updateRect)
846	\brief Draws the area of the view that intersects \a updateRect.
847
848	Derived classes should override this method to draw their view.
849
850	\remark This is an hook method called by the Interface Kit, you don't have to
851	        call it yourself. If you need to forcefully redraw the view consider
852	        calling Invalidate() instead.
853
854	\param updateRect The rectangular area to be drawn.
855
856	\since BeOS R3
857*/
858
859
860/*!
861	\fn void BView::DrawAfterChildren(BRect updateRect)
862	\brief Perform any drawing that needs to be done after child view have
863	       already been drawn.
864
865	\param updateRect The rectangular area to drawn in.
866
867	\since BeOS R5
868*/
869
870
871/*!
872	\fn void BView::FrameMoved(BPoint newPosition)
873	\brief Hook method called when the view is moved.
874
875	\param newPosition The point of the top left corner of the frame
876	       that the view has been moved to.
877
878	\since BeOS R3
879*/
880
881
882/*!
883	\fn void BView::FrameResized(float newWidth, float newHeight)
884	\brief Hook method called when the view is resized.
885
886	\param newWidth The new width of the view.
887	\param newHeight The new height of the view.
888
889	\since BeOS R3
890*/
891
892
893/*!
894	\fn void BView::KeyDown(const char* bytes, int32 numBytes)
895	\brief Hook method called when a keyboard key is pressed.
896
897	\param bytes The bytes of the key combination pressed.
898	\param numBytes The number of bytes in \a bytes.
899
900	\since BeOS R3
901*/
902
903
904/*!
905	\fn void BView::KeyUp(const char* bytes, int32 numBytes)
906	\brief Hook method called when a keyboard key is released.
907
908	\param bytes The bytes of the key combination pressed.
909	\param numBytes The number of bytes in \a bytes.
910
911	\since BeOS R3
912*/
913
914
915/*!
916	\fn virtual void BView::LayoutChanged()
917	\brief Hook function that is called when the layout if this view, or one of
918		its children, has changed.
919
920	\since Haiku R1
921*/
922
923
924/*!
925	\fn void BView::LayoutInvalidated(bool descendants)
926	\brief Hook method called when the layout is invalidated.
927
928	\param descendants Whether or not child views have also been invalidated.
929
930	\since Haiku R1
931*/
932
933
934/*!
935	\fn void BView::MessageReceived(BMessage* message)
936	\brief Handle \a message received by the associated looper.
937
938	\param message The \a message received by the associated looper.
939
940	\see BHandler::MessageReceived()
941
942	\since BeOS R3
943*/
944
945
946/*!
947	\fn void BView::MouseDown(BPoint where)
948	\brief Hook method called when a mouse button is pressed.
949
950	\param where The point on the screen where to mouse pointer is when
951	       the mouse button is pressed.
952
953	\since BeOS R3
954*/
955
956
957/*!
958	\fn void BView::MouseUp(BPoint where)
959	\brief Hook method called when a mouse button is released.
960
961	\param where The point on the screen where to mouse pointer is when
962	       the mouse button is released.
963
964	\since BeOS R3
965*/
966
967
968/*!
969	\fn void BView::MouseMoved(BPoint where, uint32 code,
970		const BMessage* dragMessage)
971	\brief Hook method called when the mouse is moved.
972
973	\param where The new location of the mouse in the view's coordinate system.
974	\param code One of the following:
975	- \c B_ENTERED_VIEW The cursor has just entered the view.
976	- \c B_INSIDE_VIEW The cursor is inside the view.
977	- \c B_EXITED_VIEW The cursor has left the view's bounds. This only gets sent
978	     if the scope of the mouse events that the view can receive has been
979	     expanded by SetEventMask() or SetMouseEventMask().
980	- \c B_OUTSIDE_VIEW The cursor is outside the view. This only gets sent if the
981	     scope of the mouse events that the view can receive has been expanded by
982	     SetEventMask() or SetMouseEventMask().
983	\param dragMessage If a drag-and-drop operation is taking place this is a
984	       pointer to a BMessage that holds the drag information, otherwise the
985	       pointer is \c NULL.
986
987	\sa SetEventMask(), SetMouseEventMask()
988	\sa DragMessage()
989
990	\since BeOS R3
991*/
992
993
994/*!
995	\fn void BView::Pulse()
996	\brief Hook method called when the view receives a \c B_PULSE
997	       message.
998
999	An action is performed each time the App Server calls the Pulse() method.
1000	The pulse rate is set by SetPulseRate(). You can implement Pulse() to do
1001	anything you want. The default version does nothing. The pulse granularity
1002	is no better than once per 100,000 microseconds.
1003
1004	\sa SetPulseRate()
1005
1006	\since BeOS R3
1007*/
1008
1009
1010/*!
1011	\fn void BView::TargetedByScrollView(BScrollView* scrollView)
1012	\brief Hook method called when the view becomes the target of
1013	       \a scrollView.
1014
1015	\param scrollView The BScrollView object that has targeted the view.
1016
1017	\since Haiku R1
1018*/
1019
1020
1021/*!
1022	\fn void BView::WindowActivated(bool active)
1023	\brief Hook method called when the attached window is activated or
1024	       deactivated.
1025
1026	\param active \c true when the window becomes activated, \c false when the
1027	       window becomes deactivated.
1028
1029	\since BeOS R3
1030*/
1031
1032
1033//! @}
1034
1035
1036/*!
1037	\fn BRect BView::Bounds() const
1038	\brief Returns the view's frame rectangle in the view's coordinate system.
1039
1040	\return The view's bounding rectangle in the view's coordinate system.
1041
1042	\since BeOS R3
1043*/
1044
1045
1046/*!
1047	\fn BRect BView::Frame() const
1048	\brief Returns the view's frame rectangle in the parent's coordinate system.
1049
1050	\returns The view's frame rectangle in the parent's coordinate system.
1051
1052	\since BeOS R3
1053*/
1054
1055
1056/*!
1057	\name Coordinate Conversions
1058*/
1059
1060
1061//! @{
1062
1063
1064/*!
1065	\fn void BView::ConvertToParent(BPoint* point) const
1066	\brief Convert \a point to the parent's coordinate system in place.
1067
1068	\param point A pointer to a BPoint object to convert.
1069
1070	\since BeOS R3
1071*/
1072
1073
1074/*!
1075	\fn BPoint BView::ConvertToParent(BPoint point) const
1076	\brief Returns \a point converted to the parent's coordinate system.
1077
1078	\param point A BPoint object to convert.
1079
1080	\return A new BPoint object in the parent's coordinate system.
1081
1082	\since BeOS R3
1083*/
1084
1085
1086/*!
1087	\fn void BView::ConvertFromParent(BPoint* point) const
1088	\brief Convert \a point from the parent's coordinate system to the
1089		   view's coordinate system in place.
1090
1091	\param point A pointer to a BPoint object to convert.
1092
1093	\since BeOS R3
1094*/
1095
1096
1097/*!
1098	\fn BPoint BView::ConvertFromParent(BPoint point) const
1099	\brief Returns \a point converted from the parent's coordinate system to
1100	       the view's coordinate system.
1101
1102	\param point A BPoint object to convert.
1103
1104	\return A new BPoint object in the view's coordinate system.
1105
1106	\since BeOS R3
1107*/
1108
1109
1110/*!
1111	\fn void BView::ConvertToParent(BRect* rect) const
1112	\brief Convert \a rect to the parent's coordinate system in place.
1113
1114	\param rect A pointer to a BRect object to convert.
1115
1116	\since BeOS R3
1117*/
1118
1119
1120/*!
1121	\fn BRect BView::ConvertToParent(BRect rect) const
1122	\brief Returns \a rect converted to the parent's coordinate system.
1123
1124	\param rect A BRect object to convert.
1125
1126	\return A new BRect object in the parent's coordinate system.
1127
1128	\since BeOS R3
1129*/
1130
1131
1132/*!
1133	\fn void BView::ConvertFromParent(BRect* rect) const
1134	\brief Convert \a rect from the parent's coordinate system to the
1135		   view's coordinate system in place.
1136
1137	\param rect A pointer to a BRect object to convert.
1138
1139	\since BeOS R3
1140*/
1141
1142
1143/*!
1144	\fn BRect BView::ConvertFromParent(BRect rect) const
1145	\brief Returns \a rect converted from the parent's coordinate system to the
1146		   view's coordinate system.
1147
1148	\param rect A BRect object to convert.
1149
1150	\return A new BRect object in the view's coordinate system.
1151
1152	\since BeOS R3
1153*/
1154
1155
1156/*!
1157	\fn void BView::ConvertToScreen(BPoint* point) const
1158	\brief Convert \a point to the screen's coordinate system in place.
1159
1160	\param point A pointer to a BPoint object to convert.
1161
1162	\since BeOS R3
1163*/
1164
1165
1166/*!
1167	\fn BPoint BView::ConvertToScreen(BPoint point) const
1168	\brief Returns \a point converted to the screen's coordinate system.
1169
1170	\param point A BPoint object to convert.
1171
1172	\return A new BPoint object in the screen's coordinate system.
1173
1174	\since BeOS R3
1175*/
1176
1177
1178/*!
1179	\fn void BView::ConvertFromScreen(BPoint* point) const
1180	\brief Convert \a point from the screen's coordinate system to the
1181		   view's coordinate system in place.
1182
1183	\param point A pointer to a BPoint object to convert.
1184
1185	\since BeOS R3
1186*/
1187
1188
1189/*!
1190	\fn BPoint BView::ConvertFromScreen(BPoint point) const
1191	\brief Returns \a point converted from the screen's coordinate system to
1192	       the view's coordinate system.
1193
1194	\param point A BPoint object to convert.
1195
1196	\return A new BPoint object in the view's coordinate system.
1197
1198	\since BeOS R3
1199*/
1200
1201
1202/*!
1203	\fn void BView::ConvertToScreen(BRect* rect) const
1204	\brief Convert \a rect to the screen's coordinate system in place.
1205
1206	\param rect A pointer to a BRect object to convert.
1207
1208	\since BeOS R3
1209*/
1210
1211
1212/*!
1213	\fn BRect BView::ConvertToScreen(BRect rect) const
1214	\brief Returns \a rect converted to the screen's coordinate system.
1215
1216	\param rect A BRect object to convert.
1217
1218	\return A new BRect object in the screen's coordinate system.
1219
1220	\since BeOS R3
1221*/
1222
1223
1224/*!
1225	\fn void BView::ConvertFromScreen(BRect* rect) const
1226	\brief Convert \a rect from the screen's coordinate system to the
1227		   view's coordinate system in place.
1228
1229	\param rect A pointer to a BRect object to convert.
1230
1231	\since BeOS R3
1232*/
1233
1234
1235/*!
1236	\fn BRect BView::ConvertFromScreen(BRect rect) const
1237	\brief Returns \a rect converted from the screen's coordinate system to the
1238		   view's coordinate system.
1239
1240	\param rect A BRect object to convert.
1241
1242	\return A new BRect object in the view's coordinate system.
1243
1244	\since BeOS R3
1245*/
1246
1247
1248/*!
1249	\fn uint32 BView::Flags() const
1250	\brief Return the view flags set in the constructor or by SetFlags().
1251
1252	\return The view flags as a uint32 mask.
1253
1254	\sa SetFlags()
1255
1256	\since BeOS R3
1257*/
1258
1259
1260/*!
1261	\fn void BView::SetFlags(uint32 flags)
1262	\brief Sets the view flags to the \a flags mask.
1263
1264	\param flags The view flags to set as a uint32 mask.
1265
1266	\sa Flags()
1267
1268	\since BeOS R3
1269*/
1270
1271
1272//! @}
1273
1274
1275/*!
1276	\fn void BView::Hide()
1277	\brief Hides the view without removing it from the view hierarchy.
1278
1279	Calls to Hide() and Show() are cumulative. A visible view becomes hidden
1280	once the number of Hide() calls exceeds the number of Show() calls.
1281
1282	\sa Show()
1283	\sa BWindow::Hide()
1284	\sa IsHidden()
1285
1286	\since BeOS R3
1287*/
1288
1289
1290/*!
1291	\fn void BView::Show()
1292	\brief Shows the view making it visible.
1293
1294	Calls to Hide() and Show() are cumulative. A hidden view becomes visible
1295	again once the number of Show() calls matches the number of Hide() calls.
1296
1297	\sa Hide()
1298	\sa BWindow::Show()
1299	\sa IsHidden()
1300
1301	\since BeOS R3
1302*/
1303
1304
1305/*!
1306	\fn bool BView::IsFocus() const
1307	\brief Returns whether or not the view is the window's current focus view.
1308
1309	The focus view changes as the user moves from one view to another either
1310	by pushing the tab key or by clicking a new view with the mouse. The change
1311	can be made programmatically via the MakeFocus() method.
1312
1313	\returns \c true if the view is the current focus view, \c false otherwise.
1314
1315	\sa MakeFocus()
1316	\sa BWindow::CurrentFocus()
1317
1318	\since BeOS R3
1319*/
1320
1321
1322/*!
1323	\fn bool BView::IsHidden(const BView* lookingFrom) const
1324	\brief Returns whether or not the view is hidden from the perspective of
1325	       \a lookingFrom.
1326
1327	A view is considered hidden if it, any of its parent views, or the window
1328	it's attached to has had the Hide() method called on it. This method
1329	allows you to determine the hidden status of a view from a different point
1330	on the view hierarchy.
1331
1332	\param lookingFrom The view used as a base when determining the hidden
1333	       status of the BView object.
1334
1335	\return \c true if the view was hidden via the Hide() method, \c false
1336	        otherwise.
1337
1338	\since Haiku R1
1339*/
1340
1341
1342/*!
1343	\fn bool BView::IsHidden() const
1344	\brief Returns whether or not the view is hidden.
1345
1346	A view can be hidden either by calling Hide() on the view, calling Hide()
1347	on a parent view or calling Hide() on the window that the view is attached
1348	to. When a BWindow or BView is hidden, all its descendants are also hidden.
1349
1350	This method only returns whether the view or an ancestor view has had the
1351	Hide() method called on it, it doesn't consider if the view is obscured
1352	by another view or is off-screen. A BView is not hidden by default.
1353
1354	\return \c true if the view was hidden via the Hide() method, \c false
1355	        otherwise.
1356
1357	\since BeOS R3
1358*/
1359
1360
1361/*!
1362	\fn bool BView::IsPrinting() const
1363	\brief Returns whether or not the view is drawing to a printer.
1364
1365	This method should only be called from the Draw() or DrawAfterChildren()
1366	methods. If called from any other method this method returns \c false.
1367
1368	The view may choose different fonts, images, or colors when drawing to a
1369	printer vs. when drawing to the screen.
1370
1371	\return Returns \c true if drawing to a printer, \c false otherwise.
1372
1373	\since BeOS R3
1374*/
1375
1376
1377/*!
1378	\fn BPoint BView::LeftTop() const
1379	\brief Returns the left top corner point.
1380
1381	\return The left top corner of the view as a BPoint object.
1382
1383	\since BeOS R3
1384*/
1385
1386
1387/*!
1388	\fn void BView::SetResizingMode(uint32 mode)
1389	\brief Sets the resizing mode of the view according to the \a mode mask.
1390
1391	The resizing mode is first set in the BView constructor.
1392
1393	\sa ResizingMode()
1394
1395	\since BeOS R3
1396*/
1397
1398
1399/*!
1400	\fn uint32 BView::ResizingMode() const
1401	\brief Returns the resizing mode flags mask set in the constructor or by
1402	       SetResizingMode().
1403
1404	\returns the current resizing mode flags as a uint32 mask.
1405
1406	\sa SetResizingMode()
1407
1408	\since BeOS R3
1409*/
1410
1411
1412/*!
1413	\fn void BView::SetViewCursor(const BCursor* cursor, bool sync)
1414	\brief Assigns \a cursor to the view.
1415
1416	This cursor will be displayed when the mouse is positioned inside the view.
1417
1418	\param cursor The BCursor object to assign to the view.
1419	\param sync If \c true App Server is synchronized immediately forcing the
1420	       change to occur. If \c false, the change will be put in the queue and
1421	       will take effect when the pending requests are processed.
1422
1423	\since BeOS R5
1424*/
1425
1426
1427/*!
1428	\fn void BView::Flush() const
1429	\brief Flushes the attached window's connection to App Server.
1430
1431	\note If the view isn't attached to a window, Flush() does nothing.
1432
1433	\since BeOS R3
1434*/
1435
1436
1437/*!
1438	\fn void BView::Sync() const
1439	\brief Synchronizes the attached window's connection to App Server.
1440
1441	\warning If the view isn't attached to a window, Sync() might crash the
1442	         application.
1443
1444	\since BeOS R3
1445*/
1446
1447
1448/*!
1449	\fn BWindow* BView::Window() const
1450	\brief Returns the window the view is attached to.
1451
1452	\return The window the view is attached to or \c NULL if the view isn't
1453	        attached to a window.
1454
1455	\since BeOS R3
1456*/
1457
1458
1459/*!
1460	\fn void BView::GetPreferredSize(float* _width, float* _height)
1461	\brief Fill out the preferred width and height of the view
1462		into the \a _width and \a _height parameters.
1463
1464	Derived classes should override this method to set the preferred
1465	size of object.
1466
1467	\remark Either the \a _width or \a _height parameter may be set to \c NULL
1468		    if you only want to get the other one.
1469
1470	\param[out] _width Pointer to a float to store the width of the view.
1471	\param[out] _height Pointer to a float to store the height of the view.
1472
1473	\since BeOS R3
1474*/
1475
1476
1477/*!
1478	\fn void BView::ResizeToPreferred()
1479	\brief Resizes the view to its preferred size keeping the position of the
1480	       left top corner constant.
1481
1482	\warning It is not recommended to use this method for views that are part
1483	         of a BLayout.
1484
1485	\since BeOS R3
1486*/
1487
1488
1489/*!
1490	\name Input Related
1491*/
1492
1493
1494//! @{
1495
1496
1497/*!
1498	\fn void BView::BeginRectTracking(BRect startRect, uint32 style)
1499	\brief Displays an outline rectangle on the view and initiates tracking.
1500
1501	This method is typically called from the MouseDown() while EndRectTracking()
1502	is typically called from the MouseUp method().
1503
1504	\param startRect The initial frame in the view's coordinate system.
1505	\param style This parameter is set to one of the following:
1506	- \c B_TRACK_WHOLE_RECT The position of the rect changes with the cursor
1507	     while its size remains the same.
1508	- \c B_TRACK_RECT_CORNER The left top corner is fixed while the right and
1509	     bottom edges move with the cursor.
1510
1511	\since BeOS R3
1512*/
1513
1514
1515/*!
1516	\fn void BView::EndRectTracking()
1517	\brief Ends tracking removing the outline rectangle from the view.
1518
1519	BeginRectTracking() is typically called from the MouseDown() while this
1520	method is typically called from the MouseUp() method.
1521
1522	\since BeOS R3
1523*/
1524
1525
1526/*!
1527	\fn void BView::DragMessage(BMessage* message, BRect dragRect,
1528		BHandler* replyTo)
1529	\brief Initiates a drag-and-drop session.
1530
1531	\warning This method only works if the BView objects are attached to a
1532	         window.
1533
1534	\param message Contains data to be dragged and dropped on the destination
1535	       view. The caller retains responsibility for this object.
1536	\param dragRect An outline rectangle used in place of a bitmap image set in
1537	       the view's coordinate system.
1538	\param replyTo The target set to handle the message sent in reply to the
1539	       dragged message. If \c NULL the reply is instead directed to the
1540	       BView object that initiated the drag-and-drop session.
1541
1542	\since BeOS R3
1543*/
1544
1545
1546/*!
1547	\fn void BView::DragMessage(BMessage* message, BBitmap* image,
1548		BPoint offset, BHandler* replyTo)
1549	\brief Initiates a drag-and-drop session of an \a image.
1550
1551	\warning This method only works if the BView objects are attached to a
1552	         window.
1553
1554	\param message Contains data to be dragged and dropped on the destination
1555	       view. The caller retains responsibility for this object.
1556	\param image Bitmap image dragged by the user. The memory used by the bitmap
1557	       is freed automatically when the message is dropped.
1558	\param offset The offset to the hotspot within the image in the bitmap's
1559	       coordinate system.
1560	\param replyTo The target set to handle the message sent in reply to the
1561	       dragged message. If \c NULL the reply is instead directed to the
1562	       BView object that initiated the drag-and-drop session.
1563
1564	\since BeOS R3
1565*/
1566
1567
1568/*!
1569	\fn void BView::DragMessage(BMessage* message, BBitmap* image,
1570		drawing_mode dragMode, BPoint offset, BHandler* replyTo)
1571	\brief Initiates a drag-and-drop session of an \a image with drawing_mode
1572	       set by \a dragMode.
1573
1574	\warning This method only works if the BView objects are attached to a
1575	         window.
1576
1577	\param message Contains data to be dragged and dropped on the destination
1578	       view. The caller retains responsibility for this object.
1579	\param image Bitmap image dragged by the user. The memory used by the bitmap
1580	       is freed automatically when the message is dropped.
1581	\param dragMode Sets the drawing_mode used to draw the dragged image. Set to
1582	       \c B_OP_ALPHA to drag-and-drop partially transparent images.
1583	\param offset The offset to the hotspot within the image in the bitmap's
1584	       coordinate system.
1585	\param replyTo The target set to handle the message sent in reply to the
1586	       dragged message. If \c NULL the reply is instead directed to the
1587	       BView object that initiated the drag-and-drop session.
1588
1589	\since BeOS R5
1590*/
1591
1592
1593/*!
1594	\fn void BView::GetMouse(BPoint* _location, uint32* _buttons,
1595		bool checkMessageQueue)
1596	\brief Fills out the cursor location and the current state of the mouse
1597	       buttons.
1598
1599	The cursor doesn't have to be located within the view for this method to work,
1600	however, the view must be attached to a window. Don't use this method to track
1601	the mouse in your derived view, implement MouseMoved() instead.
1602
1603	\param[out] _location Filled out with the cursor location in the view's
1604	            coordinate system.
1605	\param[out] _buttons Filled out with a mask of the following values:
1606	            - \c B_PRIMARY_MOUSE_BUTTON
1607	            - \c B_SECONDARY_MOUSE_BUTTON
1608	            - \c B_TERTIARY_MOUSE_BUTTON
1609	\param checkMessageQueue If \c true pull from any pending MouseMoved() or
1610	       MouseUp() events in the message queue top down before filling out
1611	       the current mouse cursor state.
1612
1613	\since BeOS R3
1614*/
1615
1616
1617/*!
1618	\fn void BView::MakeFocus(bool focus)
1619	\brief Makes the view the current focus view of the window or gives up
1620	       being the window's focus view.
1621
1622	The focus view handles selections and KeyDown events when the the attached
1623	window is active. There can be only one focus view at a time per window.
1624
1625	When called with \a focus set to \c true this method first calls
1626	MakeFocus() on the previously focused view with \a focus set to
1627	\c false.
1628
1629	The focus doesn't automatically change when MouseDown() is called so calling
1630	MakeFocus() is the only way to make a view the focus view of a window.
1631	Classes derived from BView that can display the current selection, or that
1632	can accept pasted data should call MakeFocus() in their MouseDown() method
1633	to update the focus view of the window on click.
1634
1635	If the view isn't attached to a window this method has no effect.
1636
1637	\param focus \a true to set focus, \a false to remove it.
1638
1639	\since BeOS R3
1640*/
1641
1642
1643/*!
1644	\fn BScrollBar* BView::ScrollBar(orientation posture) const
1645	\brief Returns the BScrollBar object that has the BView set as its target.
1646
1647	\param posture Either \c B_VERTICAL to get the vertical scroll bar or
1648	       \c B_HORIZONTAL to get the horizontal scroll bar.
1649
1650	\returns the Scrollbar object requested or \c NULL if none found.
1651
1652	\see BScrollBar::SetTarget()
1653
1654	\since BeOS R3
1655*/
1656
1657
1658/*!
1659	\fn void BView::ScrollBy(float deltaX, float deltaY)
1660	\brief Scroll the view by \a deltaX horizontally and \a deltaY vertically.
1661
1662	\param deltaX The amount to scroll horizontally.
1663	\param deltaY The amount to scroll vertically.
1664
1665	\since BeOS R3
1666*/
1667
1668
1669/*!
1670	\fn void BView::ScrollTo(float x, float y)
1671	\brief Scroll the view to the point specified by coordinates.
1672
1673	\param x The x-coordinate to scroll the view to.
1674	\param y The y-coordinate to scroll the view to.
1675
1676	\since BeOS R3
1677*/
1678
1679
1680/*!
1681	\fn virtual void BView::ScrollTo(BPoint where)
1682	\brief Scroll the view to the point specified by \a where.
1683
1684	\param where The location to scroll the view to.
1685
1686	\since BeOS R3
1687*/
1688
1689
1690/*!
1691	\fn void BView::ScrollWithMouseWheelDelta(BScrollBar* scrollBar,
1692		float delta)
1693	\brief Handle the scroll wheel changing over scrollbars.
1694
1695	- Extract the scrollbar change based on the mouse wheel \a delta into a
1696	  protected method of BView.
1697	- The method is called from the MessageReceived() method of BScrollBar.
1698
1699	With this change it is now a bit easier to scroll horizontally around the
1700	system by putting the mouse cursor over a horizontal scrollbar and using
1701	the wheel.
1702
1703	\since Haiku R1
1704*/
1705
1706
1707/*!
1708	\fn status_t BView::SetEventMask(uint32 mask, uint32 options)
1709	\brief Sets whether or not the view can accept mouse and keyboard
1710	       events when not in focus.
1711
1712	If \a mask includes \c B_POINTER_EVENTS then the view will receive mouse
1713	events even when the mouse isn't over the view and if it includes
1714	\c B_KEYBOARD_EVENTS the view will receive keyboard events even if it
1715	isn't in focus.
1716
1717	The \a options mask options are as follows:
1718	- \c B_NO_POINTER_HISTORY Tells App Server to only send the most recent
1719	     MouseMoved() event to the view sacrificing some granularity.
1720    - \c B_FULL_POINTER_HISTORY Tells App Server to send all MouseMoved()
1721	     events to the view.
1722
1723	\param mask The \a mask of \c B_POINTER_EVENTS and \c B_KEYBOARD_EVENTS
1724	       to set.
1725	\param options Sets other event-handling options.
1726
1727	\return \c B_OK if everything went fine or an error code, usually
1728	        \c B_ERROR if something went wrong.
1729
1730	\sa EventMask()
1731
1732	\since BeOS R5
1733*/
1734
1735
1736/*!
1737	\fn uint32 BView::EventMask()
1738	\brief Returns the current event mask.
1739
1740	\return The current event mask as a uint32.
1741
1742	\sa SetEventMask()
1743
1744	\since BeOS R5
1745*/
1746
1747
1748/*!
1749	\fn status_t BView::SetMouseEventMask(uint32 mask, uint32 options)
1750	\brief Sets whether or not the view can accept mouse and keyboard
1751	       events when not in focus from within MouseDown() until the
1752	       following MouseUp() event.
1753
1754	The \a options mask options are as follows:
1755	- \c B_NO_POINTER_HISTORY Tells App Server to send only the most recent
1756	     MouseMoved() event to the view sacrificing mouse movement granularity.
1757    - \c B_FULL_POINTER_HISTORY Tells App Server to send all MouseMoved()
1758	     events to the view.
1759	- \c B_SUSPEND_VIEW_FOCUS Events normally sent to the focus view are
1760	     suppressed. While the mouse is held down, the keyboard is ignored.
1761	     The view receiving the MouseDown() messages doesn't have to be the
1762	     focus view to suppress focused messages.
1763	- \c B_LOCK_WINDOW_FOCUS Prevents the attached window from losing its
1764	     focused state while the mouse is held down, even if the mouse leaves
1765	     the bounds of the window.
1766
1767	\param mask The \a mask of \c B_POINTER_EVENTS and \c B_KEYBOARD_EVENTS
1768	       to set.
1769	\param options Sets other event-handling options.
1770
1771	\return \c B_OK if everything went fine or an error code, usually
1772	        \c B_ERROR if something went wrong.
1773
1774	\since BeOS R5
1775*/
1776
1777
1778//! @}
1779
1780
1781/*!
1782	\name Graphics State
1783*/
1784
1785
1786//! @{
1787
1788
1789/*!
1790	\fn void BView::PushState()
1791	\brief Saves the drawing state to the stack.
1792
1793	The drawing state contains the following elements:
1794	- local and global origins
1795	- local and global scales
1796	- local and global clipping regions
1797	- the current drawing mode
1798	- pen size and location
1799	- the font context
1800	- foreground and background color
1801	- line cap and join modes
1802	- miter limit
1803	- stipple pattern
1804
1805	A new state context is created after PushState() is called with a local scale
1806	at 0, a local origin at (0, 0), and no clipping region.
1807
1808	\since BeOS R3
1809*/
1810
1811
1812/*!
1813	\fn void BView::PopState()
1814	\brief Restores the drawing state from the stack.
1815
1816	\since BeOS R3
1817*/
1818
1819
1820/*!
1821	\fn void BView::SetOrigin(BPoint where)
1822	\brief Sets the origin in the view's coordinate system.
1823
1824	\param where The point to set the origin to.
1825
1826	\sa Origin()
1827
1828	\since BeOS R3
1829*/
1830
1831
1832/*!
1833	\fn void BView::SetOrigin(float x, float y)
1834	\brief Sets the origin in the view's coordinate system.
1835
1836	\param x The x-coordinate to set the origin to.
1837	\param y The y-coordinate to set the origin to.
1838
1839	\sa Origin()
1840
1841	\since BeOS R3
1842*/
1843
1844
1845/*!
1846	\fn BPoint BView::Origin() const
1847	\brief Returns the origin point in the view's coordinate system.
1848
1849	\return The local origin point in the view's coordinate system.
1850
1851	\sa SetOrigin()
1852
1853	\since BeOS R3
1854*/
1855
1856
1857/*!
1858	\fn void BView::SetTransform(BAffineTransform transform)
1859	\brief Sets a BAffineTransform to transform the coordinate system
1860
1861	\sa See Transform() to get the current transformations, and TranslateBy(),
1862		ScaleBy() and RotateBy() for additional transformation options.
1863
1864	\since Haiku R1
1865*/
1866
1867
1868/*!
1869	\fn BAffineTransform BView::Transform() const
1870	\brief Returns the current BAffineTransform that is applied to the
1871		coordinate system
1872
1873	\sa SetTransform()
1874
1875	\since Haiku R1
1876*/
1877
1878
1879/*!
1880	\fn void BView::TranslateBy(double x, double y)
1881	\brief Translate the current view by coordinates.
1882
1883	The translation of \a x and \a y are applied to the current transformation,
1884	not instead of, so it is an additive action.
1885
1886	\sa See Transform() to get the current transformations, SetTransform(),
1887	ScaleBy() and RotateBy() for additional transformation options.
1888
1889	\since Haiku R1
1890*/
1891
1892
1893/*!
1894	\fn void BView::ScaleBy(double x, double y)
1895	\brief Scale the current view by factors \a x and \a y.
1896
1897	The scaling with factors \a x and \a y are applied to the current
1898	transformation, not instead of, so it is an additive action.
1899
1900	\sa See Transform() to get the current transformations, SetTransform(),
1901	TranslateBy() and RotateBy() for additional transformation options.
1902
1903	\since Haiku R1
1904*/
1905
1906
1907/*!
1908	\fn void BView::RotateBy(double angleRadians)
1909	\brief Rotate the current view by \a angleRadians.
1910
1911	The rotation is applied to the current transformation, not instead of, so
1912	it is an additive action.
1913
1914	\sa See Transform() to get the current transformations, SetTransform(),
1915	ScaleBy() and TranslateBy() for additional transformation options.
1916
1917	\since Haiku R1
1918*/
1919
1920
1921/*!
1922	\fn void BView::SetScale(float scale) const
1923	\brief Sets the scale of the coordinate system the view uses for drawing.
1924
1925	The default scale is 1.0. A \a scale value lower than 1.0 reduces the size of
1926	the drawing coordinate system, a \a scale value greater than 1.0 magnifies
1927	the coordinate system; for example, a \a scale value of 0.5 cuts the drawing
1928	drawing area in half moving the drawing closer to the origin while a \a scale
1929	value of 2.0 doubles the drawing area and moving it away from the origin.
1930
1931	Updating the \a scale of view won't update previously drawn elements.
1932
1933	SetScale() calls are not commutative unless you call them across different
1934	drawing states as the following:
1935
1936\code
1937	view->SetScale(2);
1938	view->SetScale(2);
1939	// view's scale is 2
1940
1941	view2->SetScale(2);
1942	view2->PushState();
1943	view2->SetScale(2);
1944	// view2's scale is 4
1945\endcode
1946
1947	\param scale The scale factor to set.
1948
1949	\since BeOS R3
1950*/
1951
1952
1953/*!
1954	\fn float BView::Scale() const
1955	\brief Return the current drawing scale.
1956
1957	\return The current drawing scale.
1958
1959	\since BeOS R3
1960*/
1961
1962
1963/*!
1964	\fn void BView::SetLineMode(cap_mode lineCap, join_mode lineJoin,
1965		float miterLimit)
1966	\brief Set line mode to use PostScript-style line cap and join modes.
1967
1968	\a lineCap determines the shape of the endpoints of stroked paths while
1969	\a lineJoin determines the shape of the corners where two lines meet.
1970
1971	The default miter limit is 10.0 which gives an angle of 11.478341°.
1972
1973	\param lineCap One of the following:
1974	- \c B_ROUND_CAP A semicircle with diameter of line width is drawn at the
1975	     endpoint.
1976	- \c B_BUTT_CAP A straight edge is drawn without extending beyond the endpoint.
1977	- \c B_SQUARE_CAP A straight edge is drawn extending past the endpoint by half
1978	     the line width.
1979	\param lineJoin One of the following:
1980	- \c B_ROUND_JOIN Same as \c B_ROUND_CAP but for a join.
1981	- \c B_MITER_JOIN The lines are extended until they meet. If angle that they
1982	     meet at is greater than the 2*arcsin(1/\a miterLimit) than a bevel join
1983		 is used instead.
1984	- \c B_BEVEL_JOIN The area between the caps is filled with a triangle.
1985	- \c B_BUTT_JOIN Same as \c B_BUTT_CAP but for a join.
1986	- \c B_SQUARE_JOIN Same as \c B_SQUARE_CAP but for a join.
1987	\param miterLimit Sets the cut off angle before a miter join becomes a bevel
1988	       join calculated by 2*arcsin(1/\a miterLimit).
1989
1990	\since BeOS R3
1991*/
1992
1993
1994/*!
1995	\fn join_mode BView::LineJoinMode() const
1996	\brief Returns the current line join mode.
1997
1998	\return The current line join mode set to the view.
1999
2000	\since BeOS R3
2001*/
2002
2003
2004/*!
2005	\fn cap_mode BView::LineCapMode() const
2006	\brief Returns the current line cap mode.
2007
2008	\return The current line cap mode set to the view.
2009
2010	\since BeOS R3
2011*/
2012
2013
2014/*!
2015	\fn float BView::LineMiterLimit() const
2016	\brief Returns the miter limit used for \c B_MITER_JOIN join mode.
2017
2018	\return The current miter limit set to the view.
2019
2020	\since BeOS R3
2021*/
2022
2023
2024/*!
2025	\fn void BView::SetFillRule(int32 rule)
2026	\brief Sets the fill rule for the view.
2027
2028	A fill rule is a rule that describes an algorithm that is used to find out
2029	what the inside of a shape is. The concept comes from the SVG format.
2030
2031	See <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule">
2032	the Mozilla documentation on the fill property of SVG</a> for more
2033	information.
2034
2035	\param rule There are two algorithms: the \c B_NONZERO and the
2036		\c B_EVEN_ODD algorithm.
2037
2038	\since Haiku R1
2039*/
2040
2041
2042/*!
2043	\fn int32 BView::FillRule() const
2044	\brief Return the current fill mode.
2045
2046	See BView::SetFillRule() for more information.
2047
2048	\returns Returns \c 0 if no fill rule is applied, \c B_EVEN_ODD when the
2049		even-odd algorithm is applied, and \c B_NONZERO if the nonzero
2050		algorithm is applied.
2051
2052	\since Haiku R1
2053*/
2054
2055
2056/*!
2057	\fn void BView::SetDrawingMode(drawing_mode mode)
2058	\brief Sets the drawing mode of the view.
2059
2060	The default drawing mode is \c B_OP_COPY.
2061
2062	\param mode Set to one of the following:
2063	- \c B_OP_COPY
2064	- \c B_OP_OVER
2065	- \c B_OP_ERASE
2066	- \c B_OP_INVERT
2067	- \c B_OP_SELECT
2068	- \c B_OP_ALPHA
2069	- \c B_OP_MIN
2070	- \c B_OP_MAX
2071	- \c B_OP_ADD
2072	- \c B_OP_SUBTRACT
2073	- \c B_OP_BLEND
2074
2075	\since BeOS R3
2076*/
2077
2078
2079/*!
2080	\fn drawing_mode BView::DrawingMode() const
2081	\brief Return the current drawing_mode.
2082
2083	\return The current drawing_mode.
2084
2085	\since BeOS R3
2086*/
2087
2088
2089/*!
2090	\fn void BView::SetBlendingMode(source_alpha srcAlpha,
2091		alpha_function alphaFunc)
2092	\brief Set the blending mode which controls how transparency is used.
2093
2094	\param srcAlpha Set to one of the following:
2095	- \c B_CONSTANT_ALPHA Use the high color's alpha channel.
2096	- \c B_PIXEL_ALPHA Use the alpha value of each pixel when drawing a bitmap.
2097	\param alphaFunc Set to one of the following:
2098	- \c B_ALPHA_OVERLAY Used for drawing a image with transparency over an opaque
2099	     background.
2100	- \c B_ALPHA_COMPOSITE Used to composite two or more transparent images
2101	     together offscreen to produce a new image drawn using
2102		 \c B_ALPHA_OVERLAY mode.
2103
2104	\since BeOS R5
2105*/
2106
2107
2108/*!
2109	\fn void BView::GetBlendingMode(source_alpha* srcAlpha,
2110		alpha_function* alphaFunc) const
2111	\brief Fill out \a srcAlpha and \a alphaFunc with the alpha mode and
2112	       alpha function of the view.
2113
2114	\param[out] srcAlpha The alpha mode to fill out.
2115	\param[out] alphaFunc The alpha function to fill out.
2116
2117	\since BeOS R5
2118*/
2119
2120
2121/*!
2122	\fn void BView::MovePenTo(BPoint point)
2123	\brief Move the pen to \a point in the view's coordinate system.
2124
2125	\param point the location to move the pen to.
2126
2127	\since BeOS R3
2128*/
2129
2130
2131/*!
2132	\fn void BView::MovePenTo(float x, float y)
2133	\brief Move the pen to the point specified by \a x and \a y in the view's
2134	       coordinate system.
2135
2136	\param x The horizontal coordinate to move the pen to.
2137	\param y The vertical coordinate to move the pen to.
2138
2139	\since BeOS R3
2140*/
2141
2142
2143/*!
2144	\fn void BView::MovePenBy(float x, float y)
2145	\brief Move the pen by \a x pixels horizontally and \a y pixels vertically.
2146
2147	\param x The number of pixels to move the pen horizontally.
2148	\param y The number of pixels to move the pen vertically.
2149
2150	\since BeOS R3
2151*/
2152
2153
2154/*!
2155	\fn BPoint BView::PenLocation() const
2156	\brief Return the current pen location as a BPoint object.
2157
2158	\return The current pen location in the view's coordinate system.
2159
2160	\sa MovePenTo(BPoint)
2161	\sa MovePenTo(float, float)
2162	\sa MovePenBy(float, float)
2163
2164	\since BeOS R3
2165*/
2166
2167
2168/*!
2169	\fn void BView::SetPenSize(float size)
2170	\brief Set the pen size to \a size.
2171
2172	\param size The pen size to set.
2173
2174	\since BeOS R3
2175*/
2176
2177
2178/*!
2179	\fn float BView::PenSize() const
2180	\brief Return the current pen size.
2181
2182	\return The current pen size as a float.
2183
2184	\sa SetPenSize()
2185
2186	\since BeOS R3
2187*/
2188
2189
2190/*!
2191	\fn bool BView::HasDefaultColors() const
2192	\brief Tests if the view has any colors set.
2193
2194	\return Boolean value, true if colors are not set.
2195
2196	\since Haiku R1
2197*/
2198
2199
2200/*!
2201	\fn bool BView::HasSystemColors() const
2202	\brief Tests if the view is using system "panel" colors.
2203		   B_PANEL_BACKGROUND_COLOR for ViewUIColor()
2204		   B_PANEL_BACKGROUND_COLOR for LowUIColor()
2205		   B_PANEL_TEXT_COLOR for HighUIColor()
2206
2207	\return Boolean value, true if colors are as described.
2208
2209	\since Haiku R1
2210*/
2211
2212
2213/*!
2214	\fn void BView::AdoptParentColors()
2215	\brief Attempts to use the colors of any parent view.
2216		   Will adopt view, low, and high colors.
2217		   Should be called in AttachedToWindow() or AllAttached().
2218
2219	\since Haiku R1
2220*/
2221
2222
2223/*!
2224	\fn void BView::AdoptSystemColors()
2225	\brief Instructs view to use standard system "panel" colors.
2226		   B_PANEL_BACKGROUND_COLOR for ViewUIColor()
2227		   B_PANEL_BACKGROUND_COLOR for LowUIColor()
2228		   B_PANEL_TEXT_COLOR for HighUIColor()
2229
2230	\since Haiku R1
2231*/
2232
2233
2234/*!
2235	\fn void BView::AdoptViewColors(BView* view)
2236	\brief Attempts to use the colors of a given view.
2237		   Will adopt view, low, and high colors.
2238
2239	\since Haiku R1
2240*/
2241
2242
2243/*!
2244	\fn void BView::SetHighColor(rgb_color color)
2245	\brief Set the high color of the view.
2246
2247	\param color The color to set.
2248
2249	\since BeOS R3
2250*/
2251
2252
2253/*!
2254	\fn void BView::SetHighColor(uchar red, uchar green, uchar blue,
2255		uchar alpha)
2256	\brief Set the high color of the view.
2257
2258	\param red The \a red component of the high color.
2259	\param green The \a green component of the high color.
2260	\param blue The \a blue component of the high color.
2261	\param alpha The \a alpha component of the high color.
2262
2263	\since BeOS R3
2264*/
2265
2266
2267/*!
2268	\fn void BView::SetHighUIColor(color_which which, float tint)
2269	\brief Set the high color of the view to a system constant.
2270	       The color will update live with user changes.
2271
2272	\param which The color_which constant to set.
2273	\param tint Optional tint value to use.
2274
2275	\since Haiku R1
2276*/
2277
2278
2279/*!
2280	\fn rgb_color BView::HighColor() const
2281	\brief Return the current high color.
2282
2283	\return The current high color as an rgb_color struct.
2284
2285	\sa SetHighColor(rgb_color)
2286	\sa SetHighColor(uchar, uchar, uchar, uchar)
2287
2288	\since BeOS R3
2289*/
2290
2291
2292/*!
2293	\fn color_which BView::HighUIColor(float* tint) const
2294	\brief Return the current high color constant being used.
2295
2296	\param tint Optional float pointer in which to store the tint
2297				value used to modify the system color constant.
2298	\return The current high color constant.
2299
2300	\sa SetHighUIColor(color_which, float)
2301
2302	\since Haiku R1
2303*/
2304
2305
2306/*!
2307	\fn void BView::SetLowColor(rgb_color color)
2308	\brief Set the low color of the view.
2309
2310	\param color The color to set.
2311
2312	\since BeOS R3
2313*/
2314
2315
2316/*!
2317	\fn void BView::SetLowColor(uchar red, uchar green, uchar blue, uchar alpha)
2318	\brief Set the low color of the view.
2319
2320	\param red The \a red component of the low color.
2321	\param green The \a green component of the low color.
2322	\param blue The \a blue component of the low color.
2323	\param alpha The \a alpha component of the low color.
2324
2325	\since BeOS R3
2326*/
2327
2328
2329/*!
2330	\fn void BView::SetLowUIColor(color_which which, float tint)
2331	\brief Set the low color of the view to a system constant.
2332	       The color will update live with user changes.
2333
2334	\param which The color_which constant to set.
2335	\param tint Optional tint value to use.
2336
2337	\since Haiku R1
2338*/
2339
2340
2341/*!
2342	\fn rgb_color BView::LowColor() const
2343	\brief Return the current low color.
2344
2345	\return The current low color as an rgb_color struct.
2346
2347	\sa SetLowColor(rgb_color)
2348	\sa SetLowColor(uchar, uchar, uchar, uchar)
2349
2350	\since BeOS R3
2351*/
2352
2353
2354/*!
2355	\fn color_which BView::LowUIColor(float* tint) const
2356	\brief Return the current low color constant being used.
2357
2358	\param tint Optional float pointer in which to store the tint
2359				value used to modify the system color constant.
2360	\return The current low color constant.
2361
2362	\sa SetLowUIColor(color_which, float)
2363
2364	\since Haiku R1
2365*/
2366
2367
2368/*!
2369	\fn void BView::SetViewColor(rgb_color color)
2370	\brief Set the view color of the view.
2371
2372	\param color The color to set.
2373
2374	\since BeOS R3
2375*/
2376
2377
2378/*!
2379	\fn void BView::SetViewColor(uchar red, uchar green, uchar blue,
2380		uchar alpha)
2381	\brief Set the view color of the view.
2382
2383	\param red The \a red component of the view color.
2384	\param green The \a green component of the view color.
2385	\param blue The \a blue component of the view color.
2386	\param alpha The \a alpha component of the view color.
2387
2388	\since BeOS R3
2389*/
2390
2391
2392/*!
2393	\fn void BView::SetViewUIColor(color_which which, float tint)
2394	\brief Set the view color of the view to a system constant.
2395	       The color will update live with user changes.
2396
2397	\param which The color_which constant to set.
2398	\param tint Optional tint value to use.
2399
2400	\since Haiku R1
2401*/
2402
2403
2404/*!
2405	\fn rgb_color BView::ViewColor() const
2406	\brief Return the current view color.
2407
2408	\return The current view color as an rgb_color struct.
2409
2410	\sa SetViewColor(rgb_color)
2411	\sa SetViewColor(uchar, uchar, uchar, uchar)
2412
2413	\since BeOS R3
2414*/
2415
2416
2417/*!
2418	\fn color_which BView::ViewUIColor(float* tint) const
2419	\brief Return the current view color constant being used.
2420
2421	\param tint Optional float pointer in which to store the tint
2422				value used to modify the system color constant.
2423	\return The current view color constant.
2424
2425	\sa SetViewUIColor(color_which, float)
2426
2427	\since Haiku R1
2428*/
2429
2430
2431/*!
2432	\fn void BView::ForceFontAliasing(bool enable)
2433	\brief Turn anti-aliasing on and off when printing.
2434
2435	Typically want to turn font anti-aliasing off when printing by passing
2436	\c true to this method and then turn it on again by passing in \c false.
2437
2438	This method does not affect characters drawn to the screen.
2439
2440	\param enable If \c true turn off anti-aliasing, if \c false turn on
2441	       anti-aliasing.
2442
2443	\since BeOS R5
2444*/
2445
2446
2447/*!
2448	\fn void BView::SetFont(const BFont* font, uint32 mask)
2449	\brief Set the font of the view.
2450
2451	By passing \c B_FONT_ALL to the \a mask parameter as is the default all
2452	font properties from \a font are set on the view.
2453
2454	\param font A pointer to a const BFont object to set on the view.
2455	\param mask A mask to determine what font properties to set, either pass
2456	       in \c B_FONT_ALL to set all font properties or create a mask
2457	       containing one or more of the following values to set:
2458	  - \c B_FONT_FAMILY_AND_STYLE
2459	  - \c B_FONT_SPACING
2460	  - \c B_FONT_SIZE
2461	  - \c B_FONT_ENCODING
2462	  - \c B_FONT_SHEAR
2463	  - \c B_FONT_FACE
2464	  - \c B_FONT_ROTATION
2465	  - \c B_FONT_FLAGS
2466
2467	\see BFont for more details.
2468
2469	\since BeOS R3
2470*/
2471
2472
2473/*!
2474	\fn void BView::GetFont(BFont* font) const
2475	\brief Fill out \a font with the font set to the view.
2476
2477	\param[out] font The BFont object to fill out.
2478
2479	\since BeOS R3
2480*/
2481
2482
2483/*!
2484	\fn void BView::GetFontHeight(font_height* height) const
2485	\brief Fill out the font_height struct with the view font.
2486
2487	\param[out] height The font_height struct to fill out.
2488
2489	\since BeOS R3
2490*/
2491
2492
2493/*!
2494	\fn void BView::SetFontSize(float size)
2495	\brief Set the size of the view's font to \a size.
2496
2497	\param size The font size to set to the view in points.
2498
2499	\since BeOS R3
2500*/
2501
2502
2503/*!
2504	\fn float BView::StringWidth(const char* string) const
2505	\brief Return the width of \a string set in the font of the view.
2506
2507	\param string The \a string to get the width of.
2508
2509	\return The width of the string in the view's font as a float.
2510
2511	\since BeOS R3
2512*/
2513
2514
2515/*!
2516	\fn float BView::StringWidth(const char* string, int32 length) const
2517	\brief Return the width of \a string set in the font of the view up to
2518	       \a length characters.
2519
2520	\param string The \a string to get the width of.
2521	\param length The maximum number of characters in \a string to consider.
2522
2523	\return The width of the string in the view's font as a float.
2524
2525	\since BeOS R3
2526*/
2527
2528
2529/*!
2530	\fn void BView::GetStringWidths(char* stringArray[], int32 lengthArray[],
2531		int32 numStrings, float widthArray[]) const
2532	\brief Fill out widths of the strings in \a stringArray set in the font
2533	       of the view into \a widthArray.
2534
2535	\param stringArray The array of strings to get the lengths of.
2536	\param lengthArray The number of characters of the strings in \a stringArray
2537	       to consider.
2538	\param numStrings The number of strings in \a stringArray.
2539	\param widthArray The array to store the widths of the strings in
2540	       \a stringArray.
2541
2542	\since BeOS R3
2543*/
2544
2545
2546/*!
2547	\fn void BView::TruncateString(BString* string, uint32 mode, float width) const
2548	\brief Truncate \a string with truncation mode \a mode so that it is no wider
2549	       than \a width set in the view's font.
2550
2551	When the string is truncated the missing characters are replaced by a
2552	horizontal ellipses.
2553
2554	\param string The string to truncate in place.
2555	\param mode The truncation mode to use, one of the following:
2556	- \c B_TRUNCATE_BEGINNING Truncate from the beginning of the string.
2557	- \c B_TRUNCATE_MIDDLE Truncate from the middle of the string.
2558	- \c B_TRUNCATE_END Truncate from the end of the string.
2559	- \c B_TRUNCATE_SMART Truncate from anywhere based on the string content.
2560	     Not currently implemented.
2561	\param width The maximum width to truncate the string to.
2562
2563	\since BeOS R5
2564*/
2565
2566
2567/*!
2568	\fn void BView::ClipToPicture(BPicture* picture, BPoint where, bool sync)
2569	\brief Intersects the current clipping region of the view with the pixels
2570	       of \a picture.
2571
2572	BPicture instances are resolution independent, \a picture is effectively
2573	drawn at the view's resolution and the bitmap produced is used to modify the
2574	clipping region.
2575
2576	The pixels that are at least partially opaque are the ones drawn by
2577	\a picture.
2578
2579	\param picture The BPicture object to intersect with.
2580	\param where Offset in the view's coordinate system.
2581	\param sync If \c false, this method will execute asynchronously.
2582
2583	\since BeOS R5
2584*/
2585
2586
2587/*!
2588	\fn void BView::ClipToInversePicture(BPicture* picture, BPoint where,
2589		bool sync)
2590	\brief Intersects the current clipping region of the view with the pixels
2591	       outside of \a picture.
2592
2593	\param picture The BPicture object to intersect with.
2594	\param where Offset in the view's coordinate system.
2595	\param sync If \c false, this method will execute asynchronously.
2596
2597	\see ClipToPicture()
2598
2599	\since BeOS R5
2600*/
2601
2602
2603/*!
2604	\fn void BView::ClipToRect(BRect rect)
2605	\brief Intersects the current clipping region of the view with the pixels
2606	       of \a rect.
2607
2608	\param rect The BRect that describes the rectangle to intersect with.
2609
2610	\since Haiku R1
2611*/
2612
2613
2614/*!
2615	\fn void BView::ClipToInverseRect(BRect rect)
2616	\brief Intersects the current clipping region of the view with the pixels
2617	       outside of \a rect.
2618
2619	\param rect The BRect that describes the rectangle to intersect with.
2620
2621	\see ClipToRect()
2622
2623	\since Haiku R1
2624*/
2625
2626
2627/*!
2628	\fn void BView::ClipToShape(BShape* shape)
2629	\brief Intersects the current clipping region of the view with the pixels
2630	       of \a shape.
2631
2632	\param shape The BShape that describes the area to intersect with.
2633
2634	\since Haiku R1
2635*/
2636
2637
2638/*!
2639	\fn void BView::ClipToInverseShape(BShape* shape)
2640	\brief Intersects the current clipping region of the view with the pixels
2641	       outside of \a shape.
2642
2643	\param shape The BShape that describes the area to intersect with.
2644
2645	\see ClipToShape()
2646
2647	\since Haiku R1
2648*/
2649
2650
2651/*!
2652	\fn void BView::GetClippingRegion(BRegion* region) const
2653	\brief Fill out \a region with the view's clipping region.
2654
2655	\param[out] region The BRegion object to fill out.
2656
2657	Get the current clipping region, which is an intersection of the view
2658	visible region on screen (which depends on the view bounds, any child view
2659	hiding parts of it, and overlapping windows) and the constrained clipping
2660	regions set by calls to ConstrainClippingRegion() in the current stack of
2661	drawing states.
2662
2663	\since BeOS R3
2664*/
2665
2666
2667/*!
2668	\fn void BView::ConstrainClippingRegion(BRegion* region)
2669	\brief Set the clipping region the \a region restricting the area that the
2670	       view can draw in.
2671
2672	The Application Server keeps track of the clipping region for each view
2673	attached to a window so that the view can't draw outside of it,
2674	consequently this method works only for views that are attached to a window.
2675
2676	The default clipping region contains the visible area of the view. By
2677	passing a region to this method the clipping area is further restricted.
2678	Passing in \c NULL resets the clipping region back to the default.
2679
2680	Calls to ConstrainClippingRegion() are not cumulative, each time this
2681	method is called it replaces the old clipping region. However, clipping
2682	regions from previous states are intersected to compute the effective
2683	clipping.
2684
2685	Region-based clipping is not affected by the view transform. If you need to
2686	constrain drawing to a transformed region, use ClipToPicture() and
2687	FillRegion() instead.
2688
2689	\param region The region to set the clipping region to or \c NULL
2690	       to reset to default.
2691
2692	\since BeOS R3
2693*/
2694
2695
2696//! @}
2697
2698
2699/*!
2700	\name Drawing Related
2701
2702	The view must be attached to the window for these methods to work unless
2703	otherwise stated. Notes on specific methods are provided below:
2704
2705	DrawBitmap()
2706	DrawTiledBitmap()
2707
2708	DrawBitmap() scales the image to fit if the image has different size than
2709	the destination rectangle.
2710
2711	DrawTiledBitmap() fills the destination rectangle with copies of the source
2712	image, without changing its size.
2713
2714	The asynchronous versions pass the image to Application Server and return
2715	immediately.
2716
2717	This can be more efficient in some cases for example to draw several bitmaps
2718	at once and then call Sync() to tell Application Server to wait for them all
2719	to finish drawing rather than waiting for each one to draw.
2720
2721	DrawPicture()
2722
2723	The asynchronous versions pass the picture to Application Server and return
2724	immediately.
2725
2726	This can be more efficient in some cases for example to draw several pictures
2727	at once and then call Sync() to tell Application Server to wait for them all
2728	to finish drawing rather than waiting for each one to draw.
2729
2730	DrawPicture() doesn't alter the graphics state of the view nor do changes to
2731	the graphics state of the view alter the BPicture object. What the picture
2732	will look like depends on the graphics parameters that were in effect when the
2733	picture was recorded.
2734
2735	DrawString()
2736
2737	The \a string is drawn in the view's current font and is modified by
2738	the other parameters of the font such as its direction (left-to-right or
2739	right-to-left), rotation, spacing, shear, etc. The \a string is always drawn
2740	left to right even if its text direction is set to right-to-left mode.
2741
2742	Drawing a string is fastest in \c B_OP_COPY mode and anti-aliasing can
2743	produce undesirable effects when a string is draw in other modes, especially
2744	if the string is drawn in the same location repeatedly.
2745
2746	DrawString() doesn't erase before drawing.
2747*/
2748
2749
2750//! @{
2751
2752
2753/*!
2754	\fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect bitmapRect,
2755		BRect viewRect, uint32 options)
2756	\brief Draws \a bitmap on the view within \a viewRect asynchronously.
2757		   \a bitmap portion is scaled to fit \a viewRect.
2758
2759	\param bitmap The bitmap to draw onto the view.
2760	\param bitmapRect The portion of the bitmap to draw in the bitmap's
2761	       coordinate system.
2762	\param viewRect The area in the view's coordinate system to draw the
2763	       bitmap in.
2764	\param options combination of \a bitmap_drawing_options flags
2765
2766	\since Haiku R1
2767*/
2768
2769
2770/*!
2771	\fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect bitmapRect,
2772		BRect viewRect)
2773	\brief Draws \a bitmap on the view within \a viewRect asynchronously.
2774		   \a bitmap portion is scaled to fit \a viewRect.
2775
2776	\param bitmap The bitmap to draw onto the view.
2777	\param bitmapRect The portion of the bitmap to draw in the bitmap's
2778	       coordinate system.
2779	\param viewRect The area in the view's coordinate system to draw the
2780	       bitmap in.
2781
2782	\since BeOS R3
2783*/
2784
2785
2786/*!
2787	\fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BRect viewRect)
2788	\brief Draws \a bitmap on the view within \a viewRect asynchronously.
2789		   \a bitmap is scaled to fit \a viewRect.
2790
2791	\param bitmap The bitmap to draw onto the view.
2792	\param viewRect The area in the view's coordinate system to draw the
2793	       bitmap in.
2794
2795	\since BeOS R3
2796*/
2797
2798
2799/*!
2800	\fn void BView::DrawBitmapAsync(const BBitmap* bitmap, BPoint where)
2801	\brief Draws \a bitmap on the view offset by \a where asynchronously.
2802
2803	\param bitmap The bitmap to draw onto the view.
2804	\param where The location to draw the bitmap in the view's coordinate system.
2805
2806	\since BeOS R3
2807*/
2808
2809
2810/*!
2811	\fn void BView::DrawBitmapAsync(const BBitmap* bitmap)
2812	\brief Draws \a bitmap on the view asynchronously.
2813
2814	\param bitmap The bitmap to draw onto the view.
2815
2816	\since BeOS R3
2817*/
2818
2819
2820/*!
2821	\fn void BView::DrawBitmap(const BBitmap* bitmap, BRect bitmapRect,
2822		BRect viewRect, uint32 options)
2823	\brief Draws \a bitmap on the view within \a viewRect. \a bitmap portion
2824		   is scaled to fit \a viewRect.
2825
2826	\param bitmap The bitmap to draw onto the view.
2827	\param bitmapRect The portion of the bitmap to draw in the bitmap's
2828	       coordinate system.
2829	\param viewRect The area in the view's coordinate system to draw the
2830	       bitmap in.
2831	\param options ??
2832
2833	\since Haiku R1
2834*/
2835
2836
2837/*!
2838	\fn void BView::DrawBitmap(const BBitmap* bitmap, BRect bitmapRect,
2839		BRect viewRect)
2840	\brief Draws \a bitmap on the view within \a viewRect. \a bitmap portion
2841		   is scaled to fit \a viewRect.
2842
2843	\param bitmap The bitmap to draw onto the view.
2844	\param bitmapRect The portion of the bitmap to draw in the bitmap's
2845	       coordinate system.
2846	\param viewRect The area in the view's coordinate system to draw the
2847	       bitmap in.
2848
2849	\since BeOS R3
2850*/
2851
2852
2853/*!
2854	\fn void BView::DrawBitmap(const BBitmap* bitmap, BRect viewRect)
2855	\brief Draws \a bitmap on the view within \a viewRect. \a bitmap is scaled
2856		   to fit \a viewRect.
2857
2858	\param bitmap The bitmap to draw onto the view.
2859	\param viewRect The area in the view's coordinate system to draw the
2860	       bitmap in.
2861
2862	\since BeOS R3
2863*/
2864
2865
2866/*!
2867	\fn void BView::DrawBitmap(const BBitmap* bitmap, BPoint where)
2868	\brief Draws \a bitmap on the view offset by \a where.
2869
2870	\param bitmap The bitmap to draw onto the view.
2871	\param where The location to draw the bitmap in the view's coordinate system.
2872
2873	\since BeOS R3
2874*/
2875
2876
2877/*!
2878	\fn void BView::DrawBitmap(const BBitmap* bitmap)
2879	\brief Draws \a bitmap on the view.
2880
2881	\param bitmap The bitmap to draw onto the view.
2882
2883	\since BeOS R3
2884*/
2885
2886
2887/*!
2888	\fn void BView::DrawTiledBitmapAsync(const BBitmap* bitmap, BRect viewRect,
2889		BPoint phase = B_ORIGIN)
2890	\brief Draws \a bitmap on the view within \a viewRect asynchronously.
2891		   If \a bitmap is smaller, it is cloned to fill remaining space
2892		   in \a viewRect.
2893
2894	\param bitmap The bitmap to draw onto the view.
2895	\param viewRect The area in the view's coordinate system to draw the
2896	       bitmap in.
2897	\param phase Source bitmap offset used as starting point for drawing.
2898
2899	\since Haiku R1
2900*/
2901
2902
2903/*!
2904	\fn void BView::DrawTiledBitmap(const BBitmap* bitmap, BRect viewRect,
2905		BPoint phase = B_ORIGIN)
2906	\brief Draws \a bitmap on the view within \a viewRect. If \a bitmap is
2907		   smaller, it is cloned to fill remaining space in \a viewRect.
2908
2909	\param bitmap The bitmap to draw onto the view.
2910	\param viewRect The area in the view's coordinate system to draw the
2911	       bitmap in.
2912	\param phase Source bitmap offset used as starting point for drawing.
2913
2914	\since Haiku R1
2915*/
2916
2917
2918/*!
2919	\fn void BView::DrawChar(char c)
2920	\brief Draws character \a c onto to the view at the current pen position.
2921
2922	The character is drawn in the view's current font.
2923
2924	\param c The character to draw.
2925
2926	\since BeOS R3
2927*/
2928
2929
2930/*!
2931	\fn void BView::DrawChar(char c, BPoint location)
2932	\brief Draws character \a c at the specified \a location in the view.
2933
2934	The character is drawn in the view's current font.
2935
2936	\param c The character to draw.
2937	\param location The location in the view to draw the character.
2938
2939	\since BeOS R3
2940*/
2941
2942
2943/*!
2944	\fn void BView::DrawString(const char* string, escapement_delta* delta)
2945	\brief Draw \a string onto the view at the current pen position.
2946
2947	\param string The string to draw.
2948	\param delta Adds additional width to each character according to the
2949	       following fields:
2950	- nonspace(float) The amount of width to add to characters with visible
2951	  glyphs.
2952	- space(float) The amount of width to add to characters with escapements
2953	  but don't have visible glyphs.
2954
2955	\since BeOS R3
2956*/
2957
2958
2959/*!
2960	\fn void BView::DrawString(const char* string, BPoint location,
2961		escapement_delta* delta)
2962	\brief Draw \a string onto the view at the specified \a location in the view.
2963
2964	\param string The string to draw.
2965	\param location The location in the view to draw the string.
2966	\param delta Adds additional width to each character according to the
2967	       following fields:
2968	- nonspace(float) The amount of width to add to characters with visible
2969	  glyphs.
2970	- space(float) The amount of width to add to characters with escapements
2971	  but don't have visible glyphs.
2972
2973	\since BeOS R3
2974*/
2975
2976
2977/*!
2978	\fn void BView::DrawString(const char* string, int32 length,
2979		escapement_delta* delta)
2980	\brief Draw \a string up to \a length characters onto the view at the current
2981	       pen position.
2982
2983	\param string The string to draw.
2984	\param length The maximum number of characters in \a string to draw.
2985	\param delta Adds additional width to each character according to the
2986	       following fields:
2987	- nonspace(float) The amount of width to add to characters with visible
2988	  glyphs.
2989	- space(float) The amount of width to add to characters with escapements
2990	  but don't have visible glyphs.
2991
2992	\since BeOS R3
2993*/
2994
2995
2996/*!
2997	\fn void BView::DrawString(const char* string, int32 length, BPoint location,
2998		escapement_delta* delta)
2999	\brief Draw \a string up to \a length characters onto the view at the
3000	       specified \a location in the view.
3001
3002	\param string The string to draw.
3003	\param length The maximum number of characters in \a string to draw.
3004	\param location The location in the view to draw the string.
3005	\param delta Adds additional width to each character according to the
3006	       following fields:
3007	- nonspace(float) The amount of width to add to characters with visible
3008	  glyphs.
3009	- space(float) The amount of width to add to characters with escapements
3010	  but don't have visible glyphs.
3011
3012	\since BeOS R3
3013*/
3014
3015
3016/*!
3017	\fn void BView::DrawString(const char* string, const BPoint* locations,
3018		int32 locationCount)
3019	\brief Draw \a string \a locationCount times at the specified \a locations.
3020
3021	\param string The string to draw.
3022	\param locations A pointer to an array of BPoint objects to draw the string.
3023	\param locationCount The number of elements in \a locations.
3024
3025	\since Haiku R1
3026*/
3027
3028
3029/*!
3030	\fn void BView::DrawString(const char* string, int32 length,
3031		const BPoint* locations, int32 locationCount)
3032	\brief Draw \a string up to \a length characters \a locationCount times at the
3033	       specified \a locations.
3034
3035	\param string The string to draw.
3036	\param length The maximum number of characters in \a string to draw.
3037	\param locations A pointer to an array of BPoint objects to draw the string.
3038	\param locationCount The number of elements in \a locations.
3039
3040	\since Haiku R1
3041*/
3042
3043
3044/*!
3045	\fn void BView::StrokeEllipse(BPoint center, float xRadius, float yRadius,
3046		::pattern pattern)
3047	\brief Stroke the outline of an ellipse starting at \a center with a
3048	       horizontal radius of \a xRadius and a vertical radius of \a yRadius.
3049
3050	\param center The center point.
3051	\param xRadius The horizontal radius.
3052	\param yRadius The vertical radius.
3053	\param pattern One of the following:
3054	- \c B_SOLID_HIGH
3055	- \c B_SOLID_LOW
3056	- \c B_MIXED_COLORS
3057
3058	\since BeOS R3
3059*/
3060
3061
3062/*!
3063	\fn void BView::StrokeEllipse(BRect rect, ::pattern pattern)
3064	\brief Stroke the outline of an ellipse inscribed within \a rect.
3065
3066	\param rect The area within which to inscribe the shape.
3067	\param pattern One of the following:
3068	- \c B_SOLID_HIGH
3069	- \c B_SOLID_LOW
3070	- \c B_MIXED_COLORS
3071
3072	\since BeOS R3
3073*/
3074
3075
3076/*!
3077	\fn void BView::FillEllipse(BPoint center, float xRadius, float yRadius,
3078		::pattern pattern)
3079	\brief Fill an ellipse starting at \a center with a horizontal radius
3080	       of \a xRadius and a vertical radius of \a yRadius.
3081
3082	\param center The center point.
3083	\param xRadius The horizontal radius.
3084	\param yRadius The vertical radius.
3085	\param pattern One of the following:
3086	- \c B_SOLID_HIGH
3087	- \c B_SOLID_LOW
3088	- \c B_MIXED_COLORS
3089
3090	\since BeOS R3
3091*/
3092
3093
3094/*!
3095	\fn void BView::FillEllipse(BRect rect, ::pattern pattern)
3096	\brief Fill an ellipse inscribed within \a rect.
3097
3098	\param rect The area within which to inscribe the shape.
3099	\param pattern One of the following:
3100	- \c B_SOLID_HIGH
3101	- \c B_SOLID_LOW
3102	- \c B_MIXED_COLORS
3103
3104	\since BeOS R3
3105*/
3106
3107
3108/*!
3109	\fn void BView::FillEllipse(BPoint center, float xRadius, float yRadius,
3110		const BGradient& gradient)
3111	\brief Fill an ellipse with the specified \a gradient pattern starting at
3112	       \a center with a horizontal radius of \a xRadius and a vertical radius
3113		   of \a yRadius.
3114
3115	\param center The center point.
3116	\param xRadius The horizontal radius.
3117	\param yRadius The vertical radius.
3118	\param gradient The gradient pattern to fill the ellipse with.
3119
3120	\since Haiku R1
3121*/
3122
3123
3124/*!
3125	\fn void BView::FillEllipse(BRect rect, const BGradient& gradient)
3126	\brief Fill an ellipse with the specified \a gradient pattern inscribed within
3127	       \a rect.
3128
3129	\param rect The area within which to inscribe the shape.
3130	\param gradient The gradient pattern to fill the ellipse with.
3131
3132	\since Haiku R1
3133*/
3134
3135
3136/*!
3137	\fn void BView::StrokeArc(BPoint center, float xRadius, float yRadius,
3138		float startAngle, float arcAngle, ::pattern pattern)
3139	\brief Stroke the outline of an arc starting at \a center with a
3140	       horizontal radius of \a xRadius and a vertical radius of \a yRadius
3141	       starting at \a startAngle and drawing \a arcAngle degrees.
3142
3143	\param center The center point.
3144	\param xRadius The horizontal radius.
3145	\param yRadius The vertical radius.
3146	\param startAngle The angle to begin drawing at.
3147	\param arcAngle The number of degrees of the arc to draw.
3148	\param pattern One of the following:
3149	- \c B_SOLID_HIGH
3150	- \c B_SOLID_LOW
3151	- \c B_MIXED_COLORS
3152
3153	\since BeOS R3
3154*/
3155
3156
3157/*!
3158	\fn void BView::StrokeArc(BRect rect, float startAngle, float arcAngle,
3159		::pattern pattern)
3160	\brief Stroke the outline of an arc inscribed within \a rect starting at
3161	       \a startAngle and drawing \a arcAngle degrees.
3162
3163	\param rect The area within which to inscribe the shape.
3164	\param startAngle The angle to begin drawing at.
3165	\param arcAngle The number of degrees of the arc to draw.
3166	\param pattern One of the following:
3167	- \c B_SOLID_HIGH
3168	- \c B_SOLID_LOW
3169	- \c B_MIXED_COLORS
3170
3171	\since BeOS R3
3172*/
3173
3174
3175/*!
3176	\fn void BView::FillArc(BPoint center, float xRadius, float yRadius,
3177		float startAngle, float arcAngle, ::pattern pattern)
3178	\brief Fill an arc starting at \a center with a horizontal radius of
3179	       \a xRadius and a vertical radius of \a yRadius starting at
3180	       \a startAngle and drawing \a arcAngle degrees.
3181
3182	\param center The center point.
3183	\param xRadius The horizontal radius.
3184	\param yRadius The vertical radius.
3185	\param startAngle The angle to begin drawing at.
3186	\param arcAngle The number of degrees of the arc to draw.
3187	\param pattern One of the following:
3188	- \c B_SOLID_HIGH
3189	- \c B_SOLID_LOW
3190	- \c B_MIXED_COLORS
3191
3192	\since BeOS R3
3193*/
3194
3195
3196/*!
3197	\fn void BView::FillArc(BPoint center, float xRadius, float yRadius,
3198		float startAngle, float arcAngle, const BGradient& gradient)
3199	\brief Fill an arc with the specified \a gradient pattern starting at
3200	       \a center with a horizontal radius of \a xRadius and a vertical
3201		   radius of \a yRadius starting at \a startAngle and drawing
3202		   \a arcAngle degrees.
3203
3204	\param center The center point.
3205	\param xRadius The horizontal radius.
3206	\param yRadius The vertical radius.
3207	\param startAngle The angle to begin drawing at.
3208	\param arcAngle The number of degrees of the arc to draw.
3209	\param gradient The gradient pattern to fill the arc with.
3210
3211	\since Haiku R1
3212*/
3213
3214
3215/*!
3216	\fn void BView::FillArc(BRect rect, float startAngle, float arcAngle,
3217		::pattern pattern)
3218	\brief Fill an arc inscribed within \a rect starting at startAngle and
3219	       drawing \a arcAngle degrees.
3220
3221	\param rect The area within which to inscribe the shape.
3222	\param startAngle The angle to begin drawing at.
3223	\param arcAngle The number of degrees of the arc to draw.
3224	\param pattern One of the following:
3225	- \c B_SOLID_HIGH
3226	- \c B_SOLID_LOW
3227	- \c B_MIXED_COLORS
3228
3229	\since BeOS R3
3230*/
3231
3232
3233/*!
3234	\fn void BView::FillArc(BRect rect, float startAngle, float arcAngle,
3235		const BGradient& gradient)
3236	\brief Fill an arc with the specified \a gradient pattern inscribed within
3237	       \a rect starting at startAngle and drawing \a arcAngle degrees.
3238
3239	\param rect The area within which to inscribe the shape.
3240	\param startAngle The angle to begin drawing at.
3241	\param arcAngle The number of degrees of the arc to draw.
3242	\param gradient The gradient pattern to fill the arc with.
3243
3244	\since Haiku R1
3245*/
3246
3247
3248/*!
3249	\fn void BView::StrokeBezier(BPoint* controlPoints, ::pattern pattern)
3250	\brief Stroke a bezier curve.
3251
3252	\param controlPoints The list of points that form the bezier curve.
3253	\param pattern One of the following:
3254	- \c B_SOLID_HIGH
3255	- \c B_SOLID_LOW
3256	- \c B_MIXED_COLORS
3257
3258	\since BeOS R3
3259*/
3260
3261
3262/*!
3263	\fn void BView::FillBezier(BPoint* controlPoints, ::pattern pattern)
3264	\brief Fill a bezier curve.
3265
3266	\param controlPoints The list of points that form the bezier curve.
3267	\param pattern One of the following:
3268	- \c B_SOLID_HIGH
3269	- \c B_SOLID_LOW
3270	- \c B_MIXED_COLORS
3271
3272	\since BeOS R3
3273*/
3274
3275
3276/*!
3277	\fn void BView::FillBezier(BPoint* controlPoints, const BGradient& gradient)
3278
3279	\brief Fill a bezier curve.
3280
3281	\param controlPoints The list of points that form the bezier curve.
3282	\param gradient The gradient pattern to fill the bezier curve with.
3283
3284	\since Haiku R1
3285*/
3286
3287
3288/*!
3289	\fn void BView::StrokePolygon(const BPolygon* polygon, bool closed,
3290		::pattern pattern)
3291	\brief Stroke a polygon shape.
3292
3293	\param polygon The polygon shape to stroke.
3294	\param closed Whether or not the last line of the polygon should intersect
3295	       with the initial point.
3296	\param pattern One of the following:
3297	- \c B_SOLID_HIGH
3298	- \c B_SOLID_LOW
3299	- \c B_MIXED_COLORS
3300
3301	\since BeOS R3
3302*/
3303
3304
3305/*!
3306	\fn void BView::StrokePolygon(const BPoint* pointArray, int32 numPoints,
3307		bool closed, ::pattern pattern)
3308	\brief Stroke a polygon shape made up of points specified by \a pointArray.
3309
3310	\param pointArray An array of points that specify the vertices of the
3311	       polygon.
3312	\param numPoints The number of points in \a pointArray.
3313	\param closed Whether or not the last line of the polygon should intersect
3314	       with the initial point.
3315	\param pattern One of the following:
3316	- \c B_SOLID_HIGH
3317	- \c B_SOLID_LOW
3318	- \c B_MIXED_COLORS
3319
3320	\since BeOS R3
3321*/
3322
3323
3324/*!
3325	\fn void BView::StrokePolygon(const BPoint* pointArray, int32 numPoints,
3326		BRect bounds, bool closed, ::pattern pattern)
3327	\brief Stroke a polygon shape made up of points specified by \a pointArray
3328	       inscribed by \a bounds.
3329
3330	\param pointArray An array of points that specify the vertices of the
3331	       polygon.
3332	\param numPoints The number of points in \a pointArray.
3333	\param bounds The smallest rectangle that encloses the points in
3334	       \a pointArray.
3335	\param closed Whether or not the last line of the polygon should intersect
3336	       with the initial point.
3337	\param pattern One of the following:
3338	- \c B_SOLID_HIGH
3339	- \c B_SOLID_LOW
3340	- \c B_MIXED_COLORS
3341
3342	\since BeOS R3
3343*/
3344
3345
3346/*!
3347	\fn void BView::FillPolygon(const BPolygon* polygon, ::pattern pattern)
3348	\brief Fill a polygon shape.
3349
3350	\param polygon The polygon shape to fill.
3351	\param pattern One of the following:
3352	- \c B_SOLID_HIGH
3353	- \c B_SOLID_LOW
3354	- \c B_MIXED_COLORS
3355
3356	\since BeOS R3
3357*/
3358
3359
3360/*!
3361	\fn void BView::FillPolygon(const BPolygon* polygon,
3362		const BGradient& gradient)
3363	\brief Fill a polygon shape with the specified \a gradient pattern.
3364
3365	\param polygon The polygon shape to fill.
3366	\param gradient The gradient pattern to fill the polygon with.
3367
3368	\since Haiku R1
3369*/
3370
3371
3372/*!
3373	\fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints,
3374		::pattern pattern)
3375	\brief Fill a polygon shape made up of points specified by \a pointArray.
3376
3377	\param pointArray An array of points that specify the vertices of the polygon.
3378	\param numPoints The number of points in \a pointArray.
3379	\param pattern One of the following:
3380	- \c B_SOLID_HIGH
3381	- \c B_SOLID_LOW
3382	- \c B_MIXED_COLORS
3383
3384	\since BeOS R3
3385*/
3386
3387
3388/*!
3389	\fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints,
3390		const BGradient& gradient)
3391	\brief Fill a polygon shape made up of points specified by \a pointArray
3392	       with the specified \a gradient pattern.
3393
3394	\param pointArray An array of points that specify the vertices of the
3395	       polygon.
3396	\param numPoints The number of points in \a pointArray.
3397	\param gradient The gradient pattern to fill the polygon with.
3398
3399	\since Haiku R1
3400*/
3401
3402
3403/*!
3404	\fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints,
3405		BRect bounds, ::pattern pattern)
3406	\brief Fill a polygon shape made up of points specified by \a pointArray
3407	       inscribed by \a bounds.
3408
3409	\param pointArray An array of points that specify the vertices of the
3410	       polygon.
3411	\param numPoints The number of points in \a pointArray.
3412	\param bounds The smallest rectangle that encloses the points in
3413	       \a pointArray.
3414	\param pattern One of the following:
3415	- \c B_SOLID_HIGH
3416	- \c B_SOLID_LOW
3417	- \c B_MIXED_COLORS
3418
3419	\since BeOS R3
3420*/
3421
3422
3423/*!
3424	\fn void BView::FillPolygon(const BPoint* pointArray, int32 numPoints,
3425		BRect bounds, const BGradient& gradient)
3426	\brief Fill a polygon shape made up of points specified by \a pointArray
3427	       inscribed by \a bounds with the specified \a gradient pattern.
3428
3429	\param pointArray An array of points that specify the vertices of the
3430	       polygon.
3431	\param numPoints The number of points in \a pointArray.
3432	\param bounds The smallest rectangle that encloses the points in
3433	       \a pointArray.
3434	\param gradient The gradient pattern to fill the polygon with.
3435
3436	\since Haiku R1
3437*/
3438
3439
3440/*!
3441	\fn void BView::StrokeRect(BRect rect, ::pattern pattern)
3442	\brief Stroke the rectangle specified by \a rect.
3443
3444	\param rect The rectangular area to stroke.
3445	\param pattern One of the following:
3446	- \c B_SOLID_HIGH
3447	- \c B_SOLID_LOW
3448	- \c B_MIXED_COLORS
3449
3450	\since BeOS R3
3451*/
3452
3453
3454/*!
3455	\fn void BView::FillRect(BRect rect, ::pattern pattern)
3456	\brief Fill the rectangle specified by \a rect.
3457
3458	\param rect The rectangular area to fill.
3459	\param pattern One of the following:
3460	- \c B_SOLID_HIGH
3461	- \c B_SOLID_LOW
3462	- \c B_MIXED_COLORS
3463
3464	\since BeOS R3
3465*/
3466
3467
3468/*!
3469	\fn void BView::FillRect(BRect rect, const BGradient& gradient)
3470	\brief Fill the rectangle specified by \a rect with the specified
3471	       \a gradient pattern.
3472
3473	\param rect The rectangular area to fill.
3474	\param gradient The gradient pattern to fill the rectangle with.
3475
3476	\since Haiku R1
3477*/
3478
3479
3480/*!
3481	\fn void BView::StrokeRoundRect(BRect rect, float xRadius, float yRadius,
3482		::pattern pattern)
3483	\brief Stroke the rounded rectangle with horizontal radius \a xRadius and
3484	       vertical radius \a yRadius.
3485
3486	\param rect The rectangular area to stroke the round rect within.
3487	\param xRadius The horizontal radius.
3488	\param yRadius The vertical radius.
3489	\param pattern One of the following:
3490	- \c B_SOLID_HIGH
3491	- \c B_SOLID_LOW
3492	- \c B_MIXED_COLORS
3493
3494	\since BeOS R3
3495*/
3496
3497
3498/*!
3499	\fn void BView::FillRoundRect(BRect rect, float xRadius, float yRadius,
3500		::pattern pattern)
3501	\brief Fill the rounded rectangle with horizontal radius \a xRadius and
3502	       vertical radius \a yRadius.
3503
3504	\param rect The rectangular area to fill the round rect within.
3505	\param xRadius The horizontal radius.
3506	\param yRadius The vertical radius.
3507	\param pattern One of the following:
3508	- \c B_SOLID_HIGH
3509	- \c B_SOLID_LOW
3510	- \c B_MIXED_COLORS
3511
3512	\since BeOS R3
3513*/
3514
3515
3516/*!
3517	\fn void BView::FillRoundRect(BRect rect, float xRadius, float yRadius,
3518		const BGradient& gradient)
3519	\brief Fill the rounded rectangle with horizontal radius \a xRadius and
3520	       vertical radius \a yRadius with the specified \a gradient pattern.
3521
3522	\param rect The rectangular area to fill the round rect within.
3523	\param xRadius The horizontal radius.
3524	\param yRadius The vertical radius.
3525	\param gradient The gradient pattern to fill the round rect with.
3526
3527	\since Haiku R1
3528*/
3529
3530
3531/*!
3532	\fn void BView::FillRegion(BRegion* region, ::pattern pattern)
3533	\brief Fill \a region.
3534
3535	\param region The \a region to fill.
3536	\param pattern One of the following:
3537	- \c B_SOLID_HIGH
3538	- \c B_SOLID_LOW
3539	- \c B_MIXED_COLORS
3540
3541	\since BeOS R3
3542*/
3543
3544
3545/*!
3546	\fn void BView::FillRegion(BRegion* region, const BGradient& gradient)
3547	\brief Fill \a region with the specified \a gradient pattern.
3548
3549	\param region The \a region to fill.
3550	\param gradient The gradient pattern to fill the \a region with.
3551
3552	\since Haiku R1
3553*/
3554
3555
3556/*!
3557	\fn void BView::StrokeTriangle(BPoint point1, BPoint point2, BPoint point3,
3558		BRect bounds, ::pattern pattern)
3559	\brief Stroke the triangle specified by points \a point1, \a point2, and
3560	       \a point3 and enclosed by \a bounds.
3561
3562	\param point1 The first point of the triangle.
3563	\param point2 The second point of the triangle.
3564	\param point3 The third point of the triangle.
3565	\param bounds The rectangular area that encloses the triangle.
3566	\param pattern One of the following:
3567	- \c B_SOLID_HIGH
3568	- \c B_SOLID_LOW
3569	- \c B_MIXED_COLORS
3570
3571	\since BeOS R3
3572*/
3573
3574
3575/*!
3576	\fn void BView::StrokeTriangle(BPoint point1, BPoint point2, BPoint point3,
3577		::pattern pattern)
3578	\brief Stroke the triangle specified by points \a point1, \a point2,
3579	       and \a point3.
3580
3581	\param point1 The first point of the triangle.
3582	\param point2 The second point of the triangle.
3583	\param point3 The third point of the triangle.
3584	\param pattern One of the following:
3585	- \c B_SOLID_HIGH
3586	- \c B_SOLID_LOW
3587	- \c B_MIXED_COLORS
3588
3589	\since BeOS R3
3590*/
3591
3592
3593/*!
3594	\fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3,
3595		::pattern pattern)
3596	\brief Fill the triangle specified by points \a point1, \a point2,
3597	       and \a point3.
3598
3599	\param point1 The first point of the triangle.
3600	\param point2 The second point of the triangle.
3601	\param point3 The third point of the triangle.
3602	\param pattern One of the following:
3603	- \c B_SOLID_HIGH
3604	- \c B_SOLID_LOW
3605	- \c B_MIXED_COLORS
3606
3607	\since BeOS R3
3608*/
3609
3610
3611/*!
3612	\fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3,
3613		const BGradient& gradient)
3614	\brief Fill the triangle specified by points \a point1, \a point2,
3615	       and \a point3 with the specified \a gradient pattern.
3616
3617	\param point1 The first point of the triangle.
3618	\param point2 The second point of the triangle.
3619	\param point3 The third point of the triangle.
3620	\param gradient The gradient pattern to fill the triangle with.
3621
3622	\since Haiku R1
3623*/
3624
3625
3626/*!
3627	\fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3,
3628		BRect bounds, ::pattern pattern)
3629	\brief Fill the triangle specified by points \a point1, \a point2,
3630	       and \a point3 and enclosed by \a bounds.
3631
3632	\param point1 The first point of the triangle.
3633	\param point2 The second point of the triangle.
3634	\param point3 The third point of the triangle.
3635	\param bounds The rectangular area that encloses the triangle.
3636	\param pattern One of the following:
3637	- \c B_SOLID_HIGH
3638	- \c B_SOLID_LOW
3639	- \c B_MIXED_COLORS
3640
3641	\since BeOS R3
3642*/
3643
3644
3645/*!
3646	\fn void BView::FillTriangle(BPoint point1, BPoint point2, BPoint point3,
3647		BRect bounds, const BGradient& gradient)
3648	\brief Fill the triangle specified by points \a point1, \a point2,
3649	       and \a point3 and enclosed by \a bounds with the specified
3650	       \a gradient pattern.
3651
3652	\param point1 The first point of the triangle.
3653	\param point2 The second point of the triangle.
3654	\param point3 The third point of the triangle.
3655	\param bounds The rectangular area that encloses the triangle.
3656	\param gradient The gradient pattern to fill the triangle with.
3657
3658	\since Haiku R1
3659*/
3660
3661
3662/*!
3663	\fn void BView::StrokeLine(BPoint toPoint, ::pattern pattern)
3664	\brief Stroke a line from the current pen location to the point \a toPoint.
3665
3666	\param toPoint The end point of the line.
3667	\param pattern One of the following:
3668	- \c B_SOLID_HIGH
3669	- \c B_SOLID_LOW
3670	- \c B_MIXED_COLORS
3671
3672	\since BeOS R3
3673*/
3674
3675
3676/*!
3677	\fn void BView::StrokeLine(BPoint start, BPoint end, ::pattern pattern)
3678	\brief Stroke a line from point \a start to point \a end.
3679
3680	\param start The start point of the line.
3681	\param end The end point of the line.
3682	\param pattern One of the following:
3683	- \c B_SOLID_HIGH
3684	- \c B_SOLID_LOW
3685	- \c B_MIXED_COLORS
3686
3687	\since BeOS R3
3688*/
3689
3690
3691/*!
3692	\fn void BView::StrokeShape(BShape* shape, ::pattern pattern)
3693	\brief Stroke \a shape.
3694
3695	\param shape The \a shape to stroke.
3696	\param pattern One of the following:
3697	- \c B_SOLID_HIGH
3698	- \c B_SOLID_LOW
3699	- \c B_MIXED_COLORS
3700
3701	\since BeOS R5
3702*/
3703
3704
3705/*!
3706	\fn void BView::FillShape(BShape* shape, ::pattern pattern)
3707	\brief Fill \a shape.
3708
3709	\param shape The \a shape to fill.
3710	\param pattern One of the following:
3711	- \c B_SOLID_HIGH
3712	- \c B_SOLID_LOW
3713	- \c B_MIXED_COLORS
3714
3715	\since BeOS R5
3716*/
3717
3718
3719/*!
3720	\fn void BView::FillShape(BShape* shape, const BGradient& gradient)
3721	\brief Fill \a shape with the specified \a gradient pattern.
3722
3723	\param shape The \a shape to fill.
3724	\param gradient The gradient pattern to fill the \a shape with.
3725
3726	\since Haiku R1
3727*/
3728
3729
3730/*!
3731	\fn void BView::BeginLineArray(int32 count)
3732	\brief Begin a line array of up to \a count lines.
3733
3734	This is a more efficient way of drawing a large number of lines than calling
3735	StrokeLine() repeatedly. First call BeginLineArray() to begin drawing lines,
3736	then call AddLine() for each line you wish to draw, and finally call
3737	EndLineArray() to finish the line array and draw the lines.
3738
3739	These methods don't move the current pen location or change the high or low
3740	colors of the view. \a count should be close to the number of lines you wish
3741	to draw and should be below 256 to draw efficiently.
3742
3743	\param count The maximum number of lines in the line array to draw.
3744
3745	\see StrokeLine()
3746
3747	\since BeOS R3
3748*/
3749
3750
3751/*!
3752	\fn void BView::AddLine(BPoint start, BPoint end, rgb_color color);
3753	\brief Add a line to the line array drawn from \a start to \a end.
3754
3755	\param start The \a start point of the line.
3756	\param end The \a end point of the line.
3757	\param color The \a color to draw the line.
3758
3759	\since BeOS R3
3760*/
3761
3762
3763/*!
3764	\fn void BView::EndLineArray()
3765	\brief End the line array drawing the lines.
3766
3767	\since BeOS R3
3768*/
3769
3770
3771/*!
3772	\fn void BView::SetDiskMode(char* filename, long offset)
3773	\brief Unimplemented.
3774
3775	\since Haiku R1
3776*/
3777
3778
3779/*!
3780	\fn void BView::BeginPicture(BPicture* picture)
3781	\brief Begins sending drawing instructions to \a picture.
3782
3783	The \a BPicture object is cleared and any successive drawing instructions sent
3784	to the view are redirected to \a picture until EndPicture() is called. To
3785	append drawing instructions to a BPicture object without clearing it first
3786	call AppendToPicture() instead.
3787
3788	The view doesn't display anything to the screen while it's recording to \a
3789	picture. Use the DrawPicture() method to render the \a picture.
3790
3791	Only drawing instructions performed directly on the view, not its child views
3792	are send to the BPicture object and BPicture captures only primitive graphics
3793	operations. The view must be attached to a window for the drawing instruction
3794	to be recorded. Drawing instructions are recorded even if the view is hidden or
3795	resides outside the clipping region or the window is off-screen.
3796
3797	\param picture The BPicture object to record drawing instructions to.
3798
3799	\since BeOS R3
3800*/
3801
3802
3803/*!
3804	\fn void BView::AppendToPicture(BPicture* picture)
3805	\brief Appends drawing instructions to \a picture without clearing it first.
3806
3807	\param picture The BPicture object to record drawing instructions to.
3808
3809	\since BeOS R3
3810*/
3811
3812
3813/*!
3814	\fn BPicture* BView::EndPicture()
3815	\brief Ends the drawing instruction recording session and returns the
3816	       BPicture object passed to BeginPicture() or AppendToPicture().
3817
3818	\return The BPicture object passed to BeginPicture() or AppendToPicture().
3819
3820	\since BeOS R3
3821*/
3822
3823
3824/*!
3825	\fn void BView::SetViewBitmap(const BBitmap* bitmap, BRect srcRect,
3826		BRect dstRect, uint32 followFlags, uint32 options)
3827	\brief Sets the background \a bitmap of the view.
3828
3829	All drawing to the view occurs over \a bitmap. Any visible regions not
3830	covered by \a bitmap are filled with the current background color.
3831
3832	Once \a bitmap has been passed in and this method returns the caller may
3833	safely delete the object.
3834
3835	\param bitmap The background bitmap to set to the view.
3836	\param srcRect Specifies the area of \a bitmap to use.
3837	\param dstRect Specifies the area of the view to set \a bitmap to.
3838	\param followFlags Specifies the as the view is resized. See the BView
3839	       constructor for more details.
3840	\param options Specifies additional view options. The only option currently
3841	       available is \c B_TILE_BITMAP which tiles the bitmap across the view.
3842
3843	\since BeOS R4
3844*/
3845
3846
3847/*!
3848	\fn void BView::SetViewBitmap(const BBitmap* bitmap, uint32 followFlags,
3849		uint32 options)
3850	\brief Sets the background \a bitmap of the view.
3851
3852	All drawing to the view occurs over \a bitmap. Any visible regions not
3853	covered by \a bitmap are filled with the current background color.
3854
3855	Once \a bitmap has been passed in and this method returns the caller may
3856	safely delete the object.
3857
3858	\param bitmap The background bitmap to set to the view.
3859	\param followFlags Specifies the as the view is resized. See the BView
3860	       constructor for more details.
3861	\param options Specifies additional view options. The only option currently
3862	       available is \c B_TILE_BITMAP which tiles the bitmap across the view.
3863
3864	\since BeOS R4
3865*/
3866
3867
3868/*!
3869	\fn void BView::ClearViewBitmap()
3870	\brief Clears the background bitmap of the view if it has one.
3871
3872	\since BeOS R4
3873*/
3874
3875
3876/*!
3877	\fn status_t BView::SetViewOverlay(const BBitmap* overlay, BRect srcRect,
3878		BRect dstRect, rgb_color* colorKey, uint32 followFlags, uint32 options)
3879	\brief Sets the \a overlay bitmap of the view.
3880
3881	\a colorKey specifies which color pixels in \a overlay are treated as transparent
3882	allowing the pixels of the view to show through.
3883
3884	Once \a overlay has been passed in and this method returns the caller may
3885	safely delete the object.
3886
3887	\param overlay The overlay bitmap to set to the view.
3888	\param srcRect Specifies the area of \a overlay to use.
3889	\param dstRect Specifies the area of the view to set \a overlay to.
3890	\param colorKey The color in \a overlay to treat as transparent.
3891	\param followFlags Specifies the as the view is resized. See the BView
3892	       constructor for more details.
3893	\param options Specifies additional view options. The only option currently
3894	       available is \c B_TILE_BITMAP which tiles the bitmap across the view.
3895
3896	\since BeOS R5
3897*/
3898
3899
3900/*!
3901	\fn status_t BView::SetViewOverlay(const BBitmap* overlay,
3902		rgb_color* colorKey, uint32 followFlags, uint32 options)
3903	\brief Sets the \a overlay bitmap of the view.
3904
3905	\a colorKey specifies which color pixels in \a overlay are treated as transparent
3906	allowing the pixels of the view to show through.
3907
3908	Once \a overlay has been passed in and this method returns the caller may
3909	safely delete the object.
3910
3911	\param overlay The overlay bitmap to set to the view.
3912	\param colorKey The color in \a overlay to treat as transparent.
3913	\param followFlags Specifies the as the view is resized. See the BView
3914	       constructor for more details.
3915	\param options Specifies additional view options. The only option currently
3916	       available is \c B_TILE_BITMAP which tiles the bitmap across the view.
3917
3918	\since BeOS R5
3919*/
3920
3921
3922/*!
3923	\fn void BView::ClearViewOverlay()
3924	\brief Clears the overlay bitmap of the view if it has one.
3925
3926	\since BeOS R5
3927*/
3928
3929
3930/*!
3931	\fn void BView::CopyBits(BRect src, BRect dst)
3932	\brief Copy the bits from the \a src rectangle to the \a dst rectangle in the
3933	       view's coordinate system.
3934
3935	If the rectangles are of different sizes than \a src is scaled to fit. \a src
3936	is clipped if a part of \a dst lies outside of the visible region of the view.
3937	Only the visible portions of \a src are copied.
3938
3939	The view must be attached to a window for this method to work.
3940
3941	\param src The source rectangle to copy bits from.
3942	\param dst The destination rectangle to copy bits to.
3943
3944	\since BeOS R3
3945*/
3946
3947
3948/*!
3949	\fn void BView::DrawPicture(const BPicture* picture)
3950	\brief Draws the \a picture at the view's current pen position.
3951
3952	\param picture The BPicture object to draw.
3953
3954	\since BeOS R3
3955*/
3956
3957
3958/*!
3959	\fn void BView::DrawPicture(const BPicture* picture, BPoint where)
3960	\brief Draws the \a picture at the location in the view specified by \a where.
3961
3962	\param picture The BPicture object to draw.
3963	\param where The point on the view to draw \a picture.
3964
3965	\since BeOS R3
3966*/
3967
3968
3969/*!
3970	\fn void BView::DrawPicture(const char* filename, long offset, BPoint where)
3971	\brief Draws the \a picture from the file specified by \a filename offset by
3972	       \a offset bytes at the location in the view specified by \a where.
3973
3974	\param filename The filename of the file containing the picture to draw.
3975	\param where The point on the view to draw the picture.
3976	\param offset The number of bytes to offset in the file to find the picture.
3977
3978	\since BeOS R4
3979*/
3980
3981
3982/*!
3983	\fn void BView::DrawPictureAsync(const BPicture* picture)
3984	\brief Draws the \a picture at the view's current pen position.
3985
3986	\param picture The BPicture object to draw.
3987
3988	\since BeOS R5
3989*/
3990
3991
3992/*!
3993	\fn void BView::DrawPictureAsync(const BPicture* picture, BPoint where)
3994	\brief Draws the \a picture at the location in the view specified by
3995	       \a where.
3996
3997	\param picture The BPicture object to draw.
3998	\param where The point on the view to draw \a picture.
3999
4000	\since BeOS R5
4001*/
4002
4003
4004/*!
4005	\fn void BView::DrawPictureAsync(const char* filename, long offset,
4006		BPoint where)
4007	\brief Draws the \a picture from the file specified by \a filename offset
4008	       by \a offset bytes at the location in the view specified by
4009	       \a where.
4010
4011	\param filename The filename of the file containing the picture to draw.
4012	\param where The point on the view to draw the picture.
4013	\param offset The number of bytes to offset in the file to find the
4014	       picture.
4015
4016	\since BeOS R5
4017*/
4018
4019
4020/*!
4021	\fn void BView::BeginLayer(uint8 opacity)
4022	\brief Begins a drawing layer.
4023
4024	This feature of BView allows you to create a separate layer, draw on it,
4025	and blend it in with the rest of the view with a given \a opacity.
4026	Internally, the method creates a new drawing buffer, that you can draw on
4027	using the methods of BView. After finishing your layer, you call EndLayer()
4028	to apply the \a opacity to the layer, and blend it in with the existing
4029	drawing.
4030
4031	You can nest layers, meaning you can call this method while drawing a
4032	layer, to create a sublayer. The layers are mixed and blended in order.
4033
4034	This work was done to support drawing for WebKit.
4035
4036	\sa EndLayer()
4037
4038	\since Haiku R1
4039*/
4040
4041
4042/*!
4043	\fn void BView::EndLayer()
4044	\brief Finish a layer and blend it in with the view.
4045
4046	This is the counterpart to BeginLayer(). You can nest multiple layer. If
4047	this method is called and the current layer is nested in another layer, the
4048	current layer is applied to the layer above. If this is the only layer, it
4049	will directly blend in to the main view.
4050
4051	\sa BeginLayer()
4052
4053	\since Haiku R`
4054*/
4055
4056
4057/*!
4058	\fn void BView::Invalidate(BRect invalRect)
4059	\brief Sends a message to App Server to redraw the portion of the view
4060	       specified by \a invalRect.
4061
4062	\param invalRect The rectangular area of the view to redraw.
4063
4064	\since BeOS R3
4065*/
4066
4067
4068/*!
4069	\fn void BView::Invalidate(const BRegion* region)
4070	\brief Sends a message to App Server to redraw the portion of the view
4071	       specified by \a region.
4072
4073	\param region The region of the view to redraw.
4074
4075	\since Haiku R1
4076*/
4077
4078
4079/*!
4080	\fn void BView::Invalidate()
4081	\brief Sends a message to App Server to redraw the view.
4082
4083	\since BeOS R3
4084*/
4085
4086
4087/*!
4088	\fn void BView::DelayedInvalidate(bigtime_t delay)
4089	\brief Sends a message to App Server to redraw the entire view after
4090	       a certain, minimum, delay. Repeated calls to this method may be
4091	       merged, but the view is guaranteed to be redrawn after the delay
4092	       given in the first call of this method.
4093
4094	\param delay The time, in microseconds, to wait until redrawing the view.
4095
4096	\since Haiku R1
4097*/
4098
4099
4100/*!
4101	\fn void BView::DelayedInvalidate(bigtime_t delay, BRect invalRect)
4102	\brief Sends a message to App Server to redraw the portion of the view
4103	       specified by \a invalRect after a certain, minimum, delay.
4104	       Repeated calls to this method may be merged, but the invalidated
4105	       rect is guaranteed to be redrawn after the minimum delay given
4106	       by the first call of this method.
4107
4108	\param delay The time, in microseconds, to wait until redrawing the view.
4109	\param invalRect The rectangular area of the view to redraw.
4110
4111	\since Haiku R1
4112*/
4113
4114
4115/*!
4116	\fn void BView::InvertRect(BRect rect)
4117	\brief Inverts the colors within \a rect.
4118
4119	This method is often used to draw a highlighted selection in a view.
4120
4121	\param rect The rectangular area in the view to invert the colors of.
4122
4123	\since BeOS R3
4124*/
4125
4126
4127//! @}
4128
4129
4130/*!
4131	\name View Hierarchy
4132*/
4133
4134
4135//! @{
4136
4137
4138/*!
4139	\fn void BView::AddChild(BView* child, BView* before)
4140	\brief Adds \a child to the view hierarchy immediately before \a before.
4141
4142	A view may only have one parent at a time so \a child must not have already
4143	been added to the view hierarchy. If \a before is \c NULL then \a child is added
4144	to the end of the tree. If the view is attached to a window \a child and all
4145	of its descendent views also become attached to the window invoking an
4146	AttachedToWindow() method on each view.
4147
4148	\param child The child view to add.
4149	\param before The sibling view to add \a child before.
4150
4151	\since BeOS R3
4152*/
4153
4154
4155/*!
4156	\fn bool BView::AddChild(BLayoutItem* child)
4157	\brief Add the \a child layout item to the view hierarchy.
4158
4159	\param child The child layout item to add.
4160	\return Whether or not \a child was added to the view layout hierarchy.
4161
4162	\since Haiku R1
4163*/
4164
4165
4166/*!
4167	\fn bool BView::RemoveChild(BView* child)
4168	\brief Removes \a child from the view hierarchy.
4169
4170	\param child The child view to remove.
4171	\return Whether or not \a child was removed from the view hierarchy.
4172
4173	\since BeOS R3
4174*/
4175
4176
4177/*!
4178	\fn int32 BView::CountChildren() const
4179	\brief Returns the number of child views that this view has.
4180
4181	\return The number of child views.
4182
4183	\since BeOS R3
4184*/
4185
4186
4187/*!
4188	\fn BView* BView::ChildAt(int32 index) const
4189	\brief Returns a pointer to the child view found at \a index.
4190
4191	\param index The index of the child view to return a pointer of.
4192
4193	\return A pointer to the child view at \a index or \c NULL if not found.
4194
4195	\since BeOS R3
4196*/
4197
4198
4199/*!
4200	\fn BView* BView::NextSibling() const
4201	\brief Returns a pointer to the next sibling view.
4202
4203	\return A pointer to the next sibling view or \a NULL if not found.
4204
4205	\since BeOS R3
4206*/
4207
4208
4209/*!
4210	\fn BView* BView::PreviousSibling() const
4211	\brief Returns a pointer to the previous sibling view.
4212
4213	\return A pointer to the previous sibling view or \a NULL if not found.
4214
4215	\since BeOS R3
4216*/
4217
4218
4219/*!
4220	\fn bool BView::RemoveSelf()
4221	\brief Removes the view and all child views from the view hierarchy.
4222
4223	\returns Whether or not the view was removed from the view hierarchy.
4224
4225	\since BeOS R3
4226*/
4227
4228
4229/*!
4230	\fn BView* BView::Parent() const
4231	\brief Returns a pointer to the view's parent.
4232
4233	\return A pointer to the parent view or \c NULL if not attached.
4234
4235	\since BeOS R3
4236*/
4237
4238
4239/*!
4240	\fn BView* BView::FindView(const char* name) const
4241	\brief Returns the view in the view hierarchy with the specified \a name.
4242
4243	\return The view in the view hierarchy with the specified \a name or \c NULL
4244	        if not found.
4245
4246	\since BeOS R3
4247*/
4248
4249
4250//! @}
4251
4252
4253/*!
4254	\name View Frame Alteration
4255
4256	As a view's frame rectangle must be aligned to pixel values all parameters are
4257	rounded to the nearest integer. If the view isn't attached these methods alter the
4258	frame rectangle without triggering FrameMoved(), FrameResized() or Invalidate().
4259*/
4260
4261
4262//! @{
4263
4264
4265/*!
4266	\fn void BView::MoveBy(float deltaX, float deltaY)
4267	\brief Moves the view \a deltaX pixels horizontally and \a deltaY pixels
4268	       vertically in the parent view's coordinate system.
4269
4270	\param deltaX The number of pixels to move the view horizontally.
4271	\param deltaY The number of pixels to move the view vertically.
4272
4273	\since BeOS R3
4274*/
4275
4276
4277/*!
4278	\fn void BView::MoveTo(BPoint where)
4279	\brief Move the view to the location specified by \a where in the parent
4280	       view's coordinate system.
4281
4282	\param where The location to move the view to.
4283
4284	\since BeOS R3
4285*/
4286
4287
4288/*!
4289	\fn void BView::MoveTo(float x, float y)
4290	\brief Move the view to the coordinates specified by \a x in the horizontal
4291	       dimension and \a y in the vertical dimension in the parent view's
4292	       coordinate system.
4293
4294	\param x The horizontal coordinate to move the view to.
4295	\param y The vertical coordinate to move the view to.
4296
4297	\since BeOS R3
4298*/
4299
4300
4301/*!
4302	\fn void BView::ResizeBy(float deltaWidth, float deltaHeight)
4303	\brief Resize the view by \a deltaWidth horizontally and \a deltaHeight
4304	       vertically without moving the top left corner of the view.
4305
4306	\param deltaWidth The number of pixels to resize the view by horizontally.
4307	\param deltaHeight The number of pixels to resize the view by vertically.
4308
4309	\since BeOS R3
4310*/
4311
4312
4313/*!
4314	\fn void BView::ResizeTo(float width, float height)
4315	\brief Resize the view to the specified \a width and \a height.
4316
4317	\param width The width to resize the view to.
4318	\param height The height to resize the view to.
4319
4320	\since BeOS R3
4321*/
4322
4323
4324/*!
4325	\fn void BView::ResizeTo(BSize size)
4326	\brief Resize the view to the dimension specified by \a size.
4327
4328	\param size The \a size to resize the view to.
4329
4330	\since Haiku R1
4331*/
4332
4333
4334//! @}
4335
4336
4337/*!
4338	\fn status_t BView::GetSupportedSuites(BMessage* data)
4339	\copydoc BHandler::GetSupportedSuites()
4340*/
4341
4342
4343/*!
4344	\fn BHandler* BView::ResolveSpecifier(BMessage* message, int32 index,
4345		BMessage* specifier, int32 what, const char* property)
4346	\copydoc BHandler::ResolveSpecifier()
4347*/
4348
4349
4350/*!
4351	\fn status_t BView::Perform(perform_code code, void* _data)
4352	\brief Perform some action. (Internal Method)
4353
4354	The following perform codes are recognized:
4355		- \c PERFORM_CODE_MIN_SIZE:
4356		- \c PERFORM_CODE_MAX_SIZE:
4357		- \c PERFORM_CODE_PREFERRED_SIZE:
4358		- \c PERFORM_CODE_LAYOUT_ALIGNMENT:
4359		- \c PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
4360		- \c PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
4361		- \c PERFORM_CODE_SET_LAYOUT:
4362		- \c PERFORM_CODE_INVALIDATE_LAYOUT:
4363		- \c PERFORM_CODE_DO_LAYOUT:
4364		- \c PERFORM_CODE_GET_TOOL_TIP_AT:
4365		- \c PERFORM_CODE_ALL_UNARCHIVED:
4366		- \c PERFORM_CODE_ALL_ARCHIVED:
4367
4368	\param code The perform code.
4369	\param _data A pointer to store some data.
4370
4371	\returns A status code.
4372
4373	\since Haiku R1
4374*/
4375
4376
4377/*!
4378	\name Layouting
4379
4380	\note These methods were not available in BeOS R5.
4381*/
4382
4383
4384//! @{
4385
4386
4387/*!
4388	\fn BSize BView::MinSize()
4389	\brief Return the minimum size of the view.
4390
4391	\remark This is only meaningful if the view is part of a BLayout.
4392
4393	\return The minimum size of the view as a BSize.
4394
4395	\sa BAbstractLayout::MinSize()
4396
4397	\since Haiku R1
4398*/
4399
4400
4401/*!
4402	\fn BSize BView::MaxSize()
4403	\brief Return the maximum size of the view.
4404
4405	\remark This is only meaningful if the view is part of a BLayout.
4406
4407	\return The maximum size of the view as a BSize.
4408
4409	\sa BAbstractLayout::MaxSize()
4410
4411	\since Haiku R1
4412*/
4413
4414
4415/*!
4416	\fn BSize BView::PreferredSize()
4417	\brief Return the preferred size of the view.
4418
4419	\remark This is only meaningful if the view is part of a BLayout.
4420
4421	\return The preferred size of the view as a BSize.
4422
4423	\sa BAbstractLayout::PreferredSize()
4424
4425	\since Haiku R1
4426*/
4427
4428
4429/*!
4430	\fn virtual BAlignment BView::LayoutAlignment()
4431	\brief Return the current BAlignemnt of the view.
4432
4433	\remark This is only meaningful if the view is part of a BLayout.
4434
4435	\since Haiku R1
4436*/
4437
4438
4439/*!
4440	\fn void BView::SetExplicitMinSize(BSize size)
4441	\brief Set this view's min size, to be used by MinSize().
4442
4443	\remark This is only meaningful if the view is part of a BLayout.
4444
4445	\sa BAbstractLayout::SetExplicitMinSize()
4446
4447	\since Haiku R1
4448*/
4449
4450
4451/*!
4452	\fn void BView::SetExplicitMaxSize(BSize size)
4453	\brief Set this view's max size, to be used by MaxSize().
4454
4455	\remark This is only meaningful if the view is part of a BLayout.
4456
4457	\sa BAbstractLayout::SetExplicitMaxSize()
4458
4459	\since Haiku R1
4460*/
4461
4462
4463/*!
4464	\fn void BView::SetExplicitPreferredSize(BSize size)
4465	\brief Set this view's preferred size, to be used by PreferredSize().
4466
4467	\remark This is only meaningful if the view is part of a BLayout.
4468
4469	\sa BAbstractLayout::SetExplicitPreferredSize()
4470
4471	\since Haiku R1
4472*/
4473
4474
4475/*!
4476	\fn void BView::SetExplicitSize(BSize size)
4477	\brief Set this view's size.
4478
4479	\remark This is only meaningful if the view is part of a BLayout.
4480
4481	This is a convenience function that calls both SetExplicitMinSize()
4482	and SetExplicitMaxSize() with the \a size parameter.
4483
4484	\since Haiku R1
4485*/
4486
4487
4488/*!
4489	\fn void BView::SetExplicitAlignment(BAlignment alignment)
4490	\brief Set this view's alignment, to be used by Alignment().
4491
4492	\remark This is only meaningful if the view is part of a BLayout.
4493
4494	\sa BAbstractLayout::SetExplicitAlignment()
4495
4496	\since Haiku R1
4497*/
4498
4499
4500/*!
4501	\fn BSize BView::ExplicitMinSize() const
4502	\brief Returns the explicit minimum size.
4503
4504	\remark This is only meaningful if the view is part of a BLayout.
4505
4506	This returns the value that was set by SetExplicitMinSize().
4507
4508	\since Haiku R1
4509*/
4510
4511
4512/*!
4513	\fn BSize BView::ExplicitMaxSize() const
4514	\brief Returns the explicit maximum size.
4515
4516	\remark This is only meaningful if the view is part of a BLayout.
4517
4518	This returns the value that was set by SetExplicitMaxSize().
4519
4520	\since Haiku R1
4521*/
4522
4523
4524/*!
4525	\fn BSize BView::ExplicitPreferredSize() const
4526	\brief Returns the explicit preferred size.
4527
4528	\remark This is only meaningful if the view is part of a BLayout.
4529
4530	This returns the value that was set by SetExplicitPreferredSize().
4531
4532	\since Haiku R1
4533*/
4534
4535
4536/*!
4537	\fn BSize BView::ExplicitAlignment() const
4538	\brief Returns the explicit alignment size.
4539
4540	\remark This is only meaningful if the view is part of a BLayout.
4541
4542	This returns the value that was set by SetExplicitAlignment().
4543
4544	\since Haiku R1
4545*/
4546
4547
4548/*!
4549	\fn bool BView::HasHeightForWidth()
4550	\brief Returns whether the layout of the view can calculate a height for a
4551		given width.
4552
4553	\remark This is only meaningful if the view is part of a BLayout.
4554
4555	Use GetHeightForWidth() to actually get the preferred size.
4556
4557	\returns \c true if the height values can be calculated, \c false if they
4558		cannot.
4559
4560	\since Haiku R1
4561*/
4562
4563
4564/*!
4565	\fn virtual void BView::GetHeightForWidth(float width, float* min,
4566		float* max, float* preferred)
4567	\brief Returns the min, max and preferred height for a given width.
4568
4569	\remark This is only meaningful if the view is part of a BLayout.
4570
4571	\param[in] width The width you want the height to be calculated for.
4572	\param[out] min The minimum height that the layout will request.
4573	\param[out] max The maximum height that the layout will request.
4574	\param[out] preferred The preferred height for this \a width.
4575
4576	\since Haiku R1
4577*/
4578
4579
4580/*!
4581	\fn void BView::SetLayout(BLayout* layout)
4582	\brief Sets the \a layout of the view.
4583
4584	\param layout The \a layout to set.
4585
4586	\since Haiku R1
4587*/
4588
4589
4590/*!
4591	\fn BLayout* BView::GetLayout() const
4592	\brief Get the layout of the view.
4593
4594	\remark This is only meaningful if the view is part of a BLayout.
4595
4596	\returns The layout of the view.
4597
4598	\since Haiku R1
4599*/
4600
4601
4602/*!
4603	\fn void BView::InvalidateLayout(bool descendants)
4604	\brief Invalidate layout.
4605
4606	\remark This is only meaningful if the view is part of a BLayout.
4607
4608	\param descendants Also invalidate its children views.
4609
4610	\since Haiku R1
4611*/
4612
4613
4614/*!
4615	\fn void BView::EnableLayoutInvalidation()
4616	\brief Enable layout invalidation.
4617
4618	\remark This is only meaningful if the view is part of a BLayout.
4619
4620	\since Haiku R1
4621*/
4622
4623
4624/*!
4625	\fn void BView::DisableLayoutInvalidation()
4626	\brief Disable layout invalidation.
4627
4628	\remark This is only meaningful if the view is part of a BLayout.
4629
4630	\since Haiku R1
4631*/
4632
4633
4634/*!
4635	\fn bool BView::IsLayoutInvalidationDisabled()
4636	\brief Returns whether or not layout invalidation is disabled.
4637
4638	\remark This is only meaningful if the view is part of a BLayout.
4639
4640	\return \c true of layout invalidation is disabled, \c false otherwise.
4641
4642	\since Haiku R1
4643*/
4644
4645
4646/*!
4647	\fn bool BView::IsLayoutValid() const
4648	\brief Returns whether or not the layout is valid.
4649
4650	\remark This is only meaningful if the view is part of a BLayout.
4651
4652	\returns Returns \c true if the layout is valid, \c false otherwise.
4653
4654	\since Haiku R1
4655*/
4656
4657
4658/*!
4659	\fn void BView::ResetLayoutInvalidation()
4660	\brief Service call for BView derived classes re-enabling
4661	       InvalidateLayout() notifications.
4662
4663	BLayout and BView will avoid calling InvalidateLayout on views that have
4664	already been invalidated, but if the view caches internal layout information
4665	which it updates in methods other than DoLayout(), it has to invoke this
4666	method, when it has done so, since otherwise the information might become
4667	obsolete without the layout noticing.
4668
4669	This is only meaningful if the view is part of a BLayout.
4670
4671	\since Haiku R1
4672*/
4673
4674
4675/*!
4676	\fn BLayoutContext* BView::LayoutContext() const
4677	\brief Returns the BLayoutContext for this View.
4678
4679	\remark This is only meaningful if the view is part of a BLayout.
4680
4681	\since Haiku R1
4682*/
4683
4684
4685/*!
4686	\fn void BView::Layout(bool force)
4687	\brief Layout the view.
4688
4689	\remark This is only meaningful if the view is part of a BLayout.
4690
4691	\param force If \c true layout even if valid.
4692
4693	\since Haiku R1
4694*/
4695
4696
4697/*!
4698	\fn void BView::Relayout()
4699	\brief Relayout the view.
4700
4701	\remark This is only meaningful if the view is part of a BLayout.
4702
4703	\since Haiku R1
4704*/
4705
4706
4707/*!
4708	\fn void BView::DoLayout()
4709	\brief Layout view within the layout context.
4710
4711	\remark This is only meaningful if the view is part of a BLayout.
4712
4713	\since Haiku R1
4714*/
4715
4716
4717//! @}
4718
4719
4720/*!
4721	\name Tool Tips
4722
4723	\note These methods were not available in BeOS R5.
4724*/
4725
4726
4727//! @{
4728
4729
4730/*!
4731	\fn void BView::SetToolTip(const char* text)
4732	\brief Set the tool tip of the view to \a text.
4733
4734	\param text The \a text to set the view to or \c NULL or blank to unset.
4735
4736	\since Haiku R1
4737*/
4738
4739
4740/*!
4741	\fn void BView::SetToolTip(BToolTip* tip)
4742	\brief Set the tool tip of the view to the \a tip object.
4743
4744	\param tip The tool tip object to set the view to or \c NULL to unset.
4745
4746	\since Haiku R1
4747*/
4748
4749
4750/*!
4751	\fn BToolTip* BView::ToolTip() const
4752	\brief Return the tool tip set to the view or \c NULL if not set.
4753
4754	\return The BToolTip object set to the view.
4755
4756	\since Haiku R1
4757*/
4758
4759
4760/*!
4761	\fn void BView::ShowToolTip(BToolTip* tip)
4762	\brief Show the tool tip at the current mouse position.
4763
4764	\param tip The BToolTip object to show.
4765
4766	\since Haiku R1
4767*/
4768
4769
4770/*!
4771	\fn void BView::HideToolTip()
4772	\brief Hide the view's tool tip.
4773
4774	\since Haiku R1
4775*/
4776
4777
4778/*!
4779	\fn bool BView::GetToolTipAt(BPoint point, BToolTip** _tip)
4780	\brief Point \a _tip with the view's tool tip.
4781
4782	\param point Currently unused.
4783	\param _tip A pointer to a pointer to a BToolTip object to set.
4784
4785	\since Haiku R1
4786*/
4787
4788
4789//! @}
4790