2005-11-21 19:58:36 +03:00
|
|
|
/*
|
2020-02-05 15:37:57 +03:00
|
|
|
* Copyright 2001-2020 Haiku, Inc. All rights reserved.
|
2005-11-21 19:58:36 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-08-31 21:18:20 +04:00
|
|
|
#ifndef _VIEW_H
|
|
|
|
#define _VIEW_H
|
|
|
|
|
|
|
|
|
2014-02-05 01:46:55 +04:00
|
|
|
#include <AffineTransform.h>
|
2006-08-26 20:21:15 +04:00
|
|
|
#include <Alignment.h>
|
2003-08-31 21:18:20 +04:00
|
|
|
#include <Font.h>
|
|
|
|
#include <Handler.h>
|
|
|
|
#include <InterfaceDefs.h>
|
|
|
|
#include <Rect.h>
|
2008-10-15 01:27:42 +04:00
|
|
|
#include <Gradient.h>
|
2003-08-31 21:18:20 +04:00
|
|
|
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// mouse button
|
2020-02-05 15:37:57 +03:00
|
|
|
#define B_MOUSE_BUTTON(n) (1 << ((n) - 1))
|
|
|
|
|
|
|
|
// Legacy BeOS R5 mouse button definitions
|
2003-08-31 21:18:20 +04:00
|
|
|
enum {
|
2020-02-05 15:37:57 +03:00
|
|
|
B_PRIMARY_MOUSE_BUTTON = B_MOUSE_BUTTON(1),
|
|
|
|
B_SECONDARY_MOUSE_BUTTON = B_MOUSE_BUTTON(2),
|
|
|
|
B_TERTIARY_MOUSE_BUTTON = B_MOUSE_BUTTON(3)
|
2003-08-31 21:18:20 +04:00
|
|
|
};
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// mouse transit
|
2003-08-31 21:18:20 +04:00
|
|
|
enum {
|
2009-08-27 15:12:41 +04:00
|
|
|
B_ENTERED_VIEW = 0,
|
2003-08-31 21:18:20 +04:00
|
|
|
B_INSIDE_VIEW,
|
|
|
|
B_EXITED_VIEW,
|
|
|
|
B_OUTSIDE_VIEW
|
|
|
|
};
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// event mask
|
2003-08-31 21:18:20 +04:00
|
|
|
enum {
|
2009-08-27 15:12:41 +04:00
|
|
|
B_POINTER_EVENTS = 0x00000001,
|
|
|
|
B_KEYBOARD_EVENTS = 0x00000002
|
2003-08-31 21:18:20 +04:00
|
|
|
};
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// event mask options
|
2003-08-31 21:18:20 +04:00
|
|
|
enum {
|
2009-08-27 15:12:41 +04:00
|
|
|
B_LOCK_WINDOW_FOCUS = 0x00000001,
|
|
|
|
B_SUSPEND_VIEW_FOCUS = 0x00000002,
|
|
|
|
B_NO_POINTER_HISTORY = 0x00000004,
|
2020-02-05 15:37:57 +03:00
|
|
|
// NOTE: This is the default behavior in Haiku, unlike in BeOS
|
2009-08-27 15:12:41 +04:00
|
|
|
B_FULL_POINTER_HISTORY = 0x00000008
|
2020-02-05 15:37:57 +03:00
|
|
|
// NOTE: New in Haiku (unless this flag is
|
|
|
|
// specified, both BWindow and BView::GetMouse()
|
|
|
|
// will filter out older mouse moved messages)
|
2003-08-31 21:18:20 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
B_TRACK_WHOLE_RECT,
|
|
|
|
B_TRACK_RECT_CORNER
|
|
|
|
};
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// set font mask
|
2003-08-31 21:18:20 +04:00
|
|
|
enum {
|
2009-08-27 15:12:41 +04:00
|
|
|
B_FONT_FAMILY_AND_STYLE = 0x00000001,
|
|
|
|
B_FONT_SIZE = 0x00000002,
|
|
|
|
B_FONT_SHEAR = 0x00000004,
|
|
|
|
B_FONT_ROTATION = 0x00000008,
|
2015-04-14 23:36:19 +03:00
|
|
|
B_FONT_SPACING = 0x00000010,
|
2009-08-27 15:12:41 +04:00
|
|
|
B_FONT_ENCODING = 0x00000020,
|
|
|
|
B_FONT_FACE = 0x00000040,
|
|
|
|
B_FONT_FLAGS = 0x00000080,
|
|
|
|
B_FONT_FALSE_BOLD_WIDTH = 0x00000100,
|
|
|
|
B_FONT_ALL = 0x000001FF
|
2003-08-31 21:18:20 +04:00
|
|
|
};
|
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
// view flags
|
2015-04-14 23:36:19 +03:00
|
|
|
const uint32 B_FULL_UPDATE_ON_RESIZE = 0x80000000UL; /* 31 */
|
|
|
|
const uint32 _B_RESERVED1_ = 0x40000000UL; /* 30 */
|
|
|
|
const uint32 B_WILL_DRAW = 0x20000000UL; /* 29 */
|
|
|
|
const uint32 B_PULSE_NEEDED = 0x10000000UL; /* 28 */
|
|
|
|
const uint32 B_NAVIGABLE_JUMP = 0x08000000UL; /* 27 */
|
2003-08-31 21:18:20 +04:00
|
|
|
const uint32 B_FRAME_EVENTS = 0x04000000UL; /* 26 */
|
2015-04-14 23:36:19 +03:00
|
|
|
const uint32 B_NAVIGABLE = 0x02000000UL; /* 25 */
|
|
|
|
const uint32 B_SUBPIXEL_PRECISE = 0x01000000UL; /* 24 */
|
|
|
|
const uint32 B_DRAW_ON_CHILDREN = 0x00800000UL; /* 23 */
|
2020-02-05 15:37:57 +03:00
|
|
|
const uint32 B_INPUT_METHOD_AWARE = 0x00400000UL; /* 22 */
|
|
|
|
const uint32 B_SCROLL_VIEW_AWARE = 0x00200000UL; /* 21 */
|
|
|
|
const uint32 B_SUPPORTS_LAYOUT = 0x00100000UL; /* 20 */
|
|
|
|
const uint32 B_INVALIDATE_AFTER_LAYOUT = 0x00080000UL; /* 19 */
|
|
|
|
const uint32 B_TRANSPARENT_BACKGROUND = 0x00040000UL; /* 18 */
|
2005-11-21 19:58:36 +03:00
|
|
|
|
2007-06-09 03:24:38 +04:00
|
|
|
#define _RESIZE_MASK_ (0xffff)
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2015-04-14 23:36:19 +03:00
|
|
|
const uint32 _VIEW_TOP_ = 1UL;
|
|
|
|
const uint32 _VIEW_LEFT_ = 2UL;
|
|
|
|
const uint32 _VIEW_BOTTOM_ = 3UL;
|
|
|
|
const uint32 _VIEW_RIGHT_ = 4UL;
|
|
|
|
const uint32 _VIEW_CENTER_ = 5UL;
|
2003-08-31 21:18:20 +04:00
|
|
|
|
|
|
|
inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3, uint32 r4)
|
|
|
|
{ return ((r1 << 12) | (r2 << 8) | (r3 << 4) | r4); }
|
|
|
|
|
|
|
|
#define B_FOLLOW_NONE 0
|
2009-08-27 15:12:41 +04:00
|
|
|
#define B_FOLLOW_ALL_SIDES _rule_(_VIEW_TOP_, _VIEW_LEFT_, _VIEW_BOTTOM_, \
|
|
|
|
_VIEW_RIGHT_)
|
2015-04-14 23:36:19 +03:00
|
|
|
#define B_FOLLOW_ALL B_FOLLOW_ALL_SIDES
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
#define B_FOLLOW_LEFT _rule_(0, _VIEW_LEFT_, 0, _VIEW_LEFT_)
|
|
|
|
#define B_FOLLOW_RIGHT _rule_(0, _VIEW_RIGHT_, 0, _VIEW_RIGHT_)
|
|
|
|
#define B_FOLLOW_LEFT_RIGHT _rule_(0, _VIEW_LEFT_, 0, _VIEW_RIGHT_)
|
|
|
|
#define B_FOLLOW_H_CENTER _rule_(0, _VIEW_CENTER_, 0, _VIEW_CENTER_)
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2005-11-21 19:58:36 +03:00
|
|
|
#define B_FOLLOW_TOP _rule_(_VIEW_TOP_, 0, _VIEW_TOP_, 0)
|
|
|
|
#define B_FOLLOW_BOTTOM _rule_(_VIEW_BOTTOM_, 0, _VIEW_BOTTOM_, 0)
|
|
|
|
#define B_FOLLOW_TOP_BOTTOM _rule_(_VIEW_TOP_, 0, _VIEW_BOTTOM_, 0)
|
|
|
|
#define B_FOLLOW_V_CENTER _rule_(_VIEW_CENTER_, 0, _VIEW_CENTER_, 0)
|
2003-08-31 21:18:20 +04:00
|
|
|
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
#define B_FOLLOW_LEFT_TOP B_FOLLOW_TOP | B_FOLLOW_LEFT
|
2015-02-14 00:34:34 +03:00
|
|
|
|
2003-08-31 21:18:20 +04:00
|
|
|
class BBitmap;
|
|
|
|
class BCursor;
|
2006-08-26 20:21:15 +04:00
|
|
|
class BLayout;
|
|
|
|
class BLayoutContext;
|
|
|
|
class BLayoutItem;
|
2003-08-31 21:18:20 +04:00
|
|
|
class BMessage;
|
|
|
|
class BPicture;
|
|
|
|
class BPolygon;
|
|
|
|
class BRegion;
|
|
|
|
class BScrollBar;
|
|
|
|
class BScrollView;
|
|
|
|
class BShape;
|
|
|
|
class BShelf;
|
|
|
|
class BString;
|
2009-08-03 18:47:41 +04:00
|
|
|
class BToolTip;
|
2003-08-31 21:18:20 +04:00
|
|
|
class BWindow;
|
|
|
|
struct _array_data_;
|
|
|
|
struct _array_hdr_;
|
|
|
|
struct overlay_restrictions;
|
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
class ViewState;
|
|
|
|
};
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
|
|
|
|
class BView : public BHandler {
|
2003-08-31 21:18:20 +04:00
|
|
|
public:
|
2009-08-27 15:12:41 +04:00
|
|
|
BView(const char* name, uint32 flags,
|
|
|
|
BLayout* layout = NULL);
|
|
|
|
BView(BRect frame, const char* name,
|
2014-05-28 20:11:57 +04:00
|
|
|
uint32 resizingMode, uint32 flags);
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual ~BView();
|
|
|
|
|
|
|
|
BView(BMessage* archive);
|
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
virtual status_t Archive(BMessage* archive,
|
|
|
|
bool deep = true) const;
|
2010-07-16 21:06:55 +04:00
|
|
|
virtual status_t AllUnarchived(const BMessage* archive);
|
|
|
|
virtual status_t AllArchived(BMessage* archive) const;
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void AllAttached();
|
|
|
|
virtual void DetachedFromWindow();
|
|
|
|
virtual void AllDetached();
|
|
|
|
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
|
|
|
|
void AddChild(BView* child, BView* before = NULL);
|
|
|
|
bool AddChild(BLayoutItem* child);
|
|
|
|
bool RemoveChild(BView* child);
|
|
|
|
int32 CountChildren() const;
|
|
|
|
BView* ChildAt(int32 index) const;
|
|
|
|
BView* NextSibling() const;
|
|
|
|
BView* PreviousSibling() const;
|
|
|
|
bool RemoveSelf();
|
|
|
|
|
|
|
|
BWindow* Window() const;
|
|
|
|
|
|
|
|
virtual void Draw(BRect updateRect);
|
|
|
|
virtual void MouseDown(BPoint where);
|
|
|
|
virtual void MouseUp(BPoint where);
|
|
|
|
virtual void MouseMoved(BPoint where, uint32 code,
|
|
|
|
const BMessage* dragMessage);
|
2014-06-12 03:00:46 +04:00
|
|
|
virtual void WindowActivated(bool active);
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
|
|
|
virtual void KeyUp(const char* bytes, int32 numBytes);
|
|
|
|
virtual void Pulse();
|
|
|
|
virtual void FrameMoved(BPoint newPosition);
|
|
|
|
virtual void FrameResized(float newWidth, float newHeight);
|
|
|
|
|
|
|
|
virtual void TargetedByScrollView(BScrollView* scrollView);
|
|
|
|
void BeginRectTracking(BRect startRect,
|
|
|
|
uint32 style = B_TRACK_WHOLE_RECT);
|
|
|
|
void EndRectTracking();
|
|
|
|
|
|
|
|
void GetMouse(BPoint* location, uint32* buttons,
|
|
|
|
bool checkMessageQueue = true);
|
|
|
|
|
|
|
|
void DragMessage(BMessage* message, BRect dragRect,
|
|
|
|
BHandler* replyTo = NULL);
|
|
|
|
void DragMessage(BMessage* message, BBitmap* bitmap,
|
|
|
|
BPoint offset, BHandler* replyTo = NULL);
|
|
|
|
void DragMessage(BMessage* message, BBitmap* bitmap,
|
|
|
|
drawing_mode dragMode, BPoint offset,
|
|
|
|
BHandler* replyTo = NULL);
|
|
|
|
|
|
|
|
BView* FindView(const char* name) const;
|
|
|
|
BView* Parent() const;
|
|
|
|
BRect Bounds() const;
|
|
|
|
BRect Frame() const;
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void ConvertToScreen(BPoint* point) const;
|
|
|
|
BPoint ConvertToScreen(BPoint point) const;
|
|
|
|
void ConvertFromScreen(BPoint* point) const;
|
|
|
|
BPoint ConvertFromScreen(BPoint point) const;
|
|
|
|
void ConvertToScreen(BRect* rect) const;
|
|
|
|
BRect ConvertToScreen(BRect rect) const;
|
|
|
|
void ConvertFromScreen(BRect* rect) const;
|
|
|
|
BRect ConvertFromScreen(BRect rect) const;
|
|
|
|
void ConvertToParent(BPoint* point) const;
|
|
|
|
BPoint ConvertToParent(BPoint point) const;
|
|
|
|
void ConvertFromParent(BPoint* point) const;
|
|
|
|
BPoint ConvertFromParent(BPoint point) const;
|
|
|
|
void ConvertToParent(BRect* rect) const;
|
|
|
|
BRect ConvertToParent(BRect rect) const;
|
|
|
|
void ConvertFromParent(BRect* rect) const;
|
|
|
|
BRect ConvertFromParent(BRect rect) const;
|
2009-08-27 15:12:41 +04:00
|
|
|
BPoint LeftTop() const;
|
|
|
|
|
|
|
|
void GetClippingRegion(BRegion* region) const;
|
|
|
|
virtual void ConstrainClippingRegion(BRegion* region);
|
|
|
|
void ClipToPicture(BPicture* picture,
|
|
|
|
BPoint where = B_ORIGIN, bool sync = true);
|
|
|
|
void ClipToInversePicture(BPicture* picture,
|
|
|
|
BPoint where = B_ORIGIN, bool sync = true);
|
|
|
|
|
2015-11-09 21:57:13 +03:00
|
|
|
void ClipToRect(BRect rect);
|
|
|
|
void ClipToInverseRect(BRect rect);
|
|
|
|
void ClipToShape(BShape* shape);
|
|
|
|
void ClipToInverseShape(BShape* shape);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void SetDrawingMode(drawing_mode mode);
|
2015-04-14 23:36:19 +03:00
|
|
|
drawing_mode DrawingMode() const;
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
void SetBlendingMode(source_alpha srcAlpha,
|
|
|
|
alpha_function alphaFunc);
|
2015-04-14 23:36:19 +03:00
|
|
|
void GetBlendingMode(source_alpha* srcAlpha,
|
2009-08-27 15:12:41 +04:00
|
|
|
alpha_function* alphaFunc) const;
|
|
|
|
|
|
|
|
virtual void SetPenSize(float size);
|
|
|
|
float PenSize() const;
|
|
|
|
|
|
|
|
void SetViewCursor(const BCursor* cursor,
|
|
|
|
bool sync = true);
|
|
|
|
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
bool HasDefaultColors() const;
|
|
|
|
bool HasSystemColors() const;
|
|
|
|
void AdoptParentColors();
|
|
|
|
void AdoptSystemColors();
|
|
|
|
void AdoptViewColors(BView* view);
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual void SetViewColor(rgb_color color);
|
|
|
|
void SetViewColor(uchar red, uchar green, uchar blue,
|
|
|
|
uchar alpha = 255);
|
2009-08-27 15:12:41 +04:00
|
|
|
rgb_color ViewColor() const;
|
|
|
|
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void SetViewUIColor(color_which which,
|
|
|
|
float tint = B_NO_TINT);
|
|
|
|
color_which ViewUIColor(float* tint = NULL) const;
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void SetViewBitmap(const BBitmap* bitmap,
|
|
|
|
BRect srcRect, BRect dstRect,
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
uint32 followFlags = B_FOLLOW_LEFT_TOP,
|
2009-08-27 15:12:41 +04:00
|
|
|
uint32 options = B_TILE_BITMAP);
|
|
|
|
void SetViewBitmap(const BBitmap* bitmap,
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
uint32 followFlags = B_FOLLOW_LEFT_TOP,
|
2009-08-27 15:12:41 +04:00
|
|
|
uint32 options = B_TILE_BITMAP);
|
|
|
|
void ClearViewBitmap();
|
|
|
|
|
|
|
|
status_t SetViewOverlay(const BBitmap* overlay,
|
|
|
|
BRect srcRect, BRect dstRect,
|
|
|
|
rgb_color* colorKey,
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
uint32 followFlags = B_FOLLOW_LEFT_TOP,
|
2009-08-27 15:12:41 +04:00
|
|
|
uint32 options = 0);
|
|
|
|
status_t SetViewOverlay(const BBitmap* overlay,
|
|
|
|
rgb_color* colorKey,
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
uint32 followFlags = B_FOLLOW_LEFT_TOP,
|
2009-08-27 15:12:41 +04:00
|
|
|
uint32 options = 0);
|
|
|
|
void ClearViewOverlay();
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual void SetHighColor(rgb_color color);
|
|
|
|
void SetHighColor(uchar red, uchar green, uchar blue,
|
|
|
|
uchar alpha = 255);
|
2009-08-27 15:12:41 +04:00
|
|
|
rgb_color HighColor() const;
|
|
|
|
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void SetHighUIColor(color_which which,
|
|
|
|
float tint = B_NO_TINT);
|
|
|
|
color_which HighUIColor(float* tint = NULL) const;
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual void SetLowColor(rgb_color color);
|
|
|
|
void SetLowColor(uchar red, uchar green, uchar blue,
|
|
|
|
uchar alpha = 255);
|
2009-08-27 15:12:41 +04:00
|
|
|
rgb_color LowColor() const;
|
|
|
|
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void SetLowUIColor(color_which which,
|
|
|
|
float tint = B_NO_TINT);
|
|
|
|
color_which LowUIColor(float* tint = NULL) const;
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void SetLineMode(cap_mode lineCap,
|
|
|
|
join_mode lineJoin,
|
|
|
|
float miterLimit = B_DEFAULT_MITER_LIMIT);
|
|
|
|
join_mode LineJoinMode() const;
|
|
|
|
cap_mode LineCapMode() const;
|
|
|
|
float LineMiterLimit() const;
|
|
|
|
|
2014-03-11 20:23:32 +04:00
|
|
|
void SetFillRule(int32 rule);
|
|
|
|
int32 FillRule() const;
|
|
|
|
|
2014-06-12 03:00:46 +04:00
|
|
|
void SetOrigin(BPoint where);
|
2009-08-27 15:12:41 +04:00
|
|
|
void SetOrigin(float x, float y);
|
|
|
|
BPoint Origin() const;
|
|
|
|
|
2014-02-05 01:46:55 +04:00
|
|
|
// Works in addition to Origin and Scale.
|
|
|
|
// May be used in parallel or as a much
|
|
|
|
// more powerful alternative.
|
|
|
|
void SetTransform(BAffineTransform transform);
|
|
|
|
BAffineTransform Transform() const;
|
2015-11-11 00:52:56 +03:00
|
|
|
void TranslateBy(double x, double y);
|
|
|
|
void ScaleBy(double x, double y);
|
|
|
|
void RotateBy(double angleRadians);
|
2014-02-05 01:46:55 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void PushState();
|
|
|
|
void PopState();
|
|
|
|
|
|
|
|
void MovePenTo(BPoint pt);
|
|
|
|
void MovePenTo(float x, float y);
|
|
|
|
void MovePenBy(float x, float y);
|
|
|
|
BPoint PenLocation() const;
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void StrokeLine(BPoint toPoint,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokeLine(BPoint start, BPoint end,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void BeginLineArray(int32 count);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void AddLine(BPoint start, BPoint end,
|
|
|
|
rgb_color color);
|
2009-08-27 15:12:41 +04:00
|
|
|
void EndLineArray();
|
|
|
|
|
|
|
|
void StrokePolygon(const BPolygon* polygon,
|
|
|
|
bool closed = true,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokePolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints, bool closed = true,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokePolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints, BRect bounds,
|
2009-08-27 15:12:41 +04:00
|
|
|
bool closed = true,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillPolygon(const BPolygon* polygon,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillPolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillPolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints, BRect bounds,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillPolygon(const BPolygon* polygon,
|
|
|
|
const BGradient& gradient);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void FillPolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints, const BGradient& gradient);
|
|
|
|
void FillPolygon(const BPoint* pointArray,
|
|
|
|
int32 numPoints, BRect bounds,
|
2009-08-27 15:12:41 +04:00
|
|
|
const BGradient& gradient);
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void StrokeTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3, BRect bounds,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokeTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3, BRect bounds,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3, const BGradient& gradient);
|
|
|
|
void FillTriangle(BPoint point1, BPoint point2,
|
|
|
|
BPoint point3, BRect bounds,
|
2009-08-27 15:12:41 +04:00
|
|
|
const BGradient& gradient);
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void StrokeRect(BRect rect,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillRect(BRect rect,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillRect(BRect rect, const BGradient& gradient);
|
|
|
|
void FillRegion(BRegion* rectegion,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillRegion(BRegion* rectegion,
|
2015-04-14 23:36:19 +03:00
|
|
|
const BGradient& gradient);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void InvertRect(BRect rect);
|
|
|
|
|
|
|
|
void StrokeRoundRect(BRect rect, float xRadius,
|
|
|
|
float yRadius,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillRoundRect(BRect rect, float xRadius,
|
|
|
|
float yRadius,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillRoundRect(BRect rect, float xRadius,
|
2009-08-27 15:12:41 +04:00
|
|
|
float yRadius, const BGradient& gradient);
|
|
|
|
|
|
|
|
void StrokeEllipse(BPoint center, float xRadius,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
float yRadius,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokeEllipse(BRect rect,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillEllipse(BPoint center, float xRadius,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
float yRadius,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillEllipse(BRect rect,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillEllipse(BPoint center, float xRadius,
|
|
|
|
float yRadius, const BGradient& gradient);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void FillEllipse(BRect rect,
|
2009-08-27 15:12:41 +04:00
|
|
|
const BGradient& gradient);
|
|
|
|
|
|
|
|
void StrokeArc(BPoint center, float xRadius,
|
|
|
|
float yRadius, float startAngle,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
float arcAngle,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void StrokeArc(BRect rect, float startAngle,
|
|
|
|
float arcAngle,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillArc(BPoint center, float xRadius,
|
|
|
|
float yRadius, float startAngle,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
float arcAngle,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
|
|
|
void FillArc(BRect rect, float startAngle,
|
|
|
|
float arcAngle,
|
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillArc(BPoint center, float xRadius,
|
|
|
|
float yRadius, float startAngle,
|
|
|
|
float arcAngle, const BGradient& gradient);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
void FillArc(BRect rect, float startAngle,
|
2009-08-27 15:12:41 +04:00
|
|
|
float arcAngle, const BGradient& gradient);
|
|
|
|
|
|
|
|
void StrokeBezier(BPoint* controlPoints,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillBezier(BPoint* controlPoints,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillBezier(BPoint* controlPoints,
|
2015-04-14 23:36:19 +03:00
|
|
|
const BGradient& gradient);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
void StrokeShape(BShape* shape,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillShape(BShape* shape,
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
::pattern pattern = B_SOLID_HIGH);
|
2009-08-27 15:12:41 +04:00
|
|
|
void FillShape(BShape* shape,
|
|
|
|
const BGradient& gradient);
|
|
|
|
|
|
|
|
void CopyBits(BRect src, BRect dst);
|
|
|
|
|
|
|
|
void DrawBitmapAsync(const BBitmap* aBitmap,
|
|
|
|
BRect bitmapRect, BRect viewRect,
|
|
|
|
uint32 options);
|
|
|
|
void DrawBitmapAsync(const BBitmap* aBitmap,
|
|
|
|
BRect bitmapRect, BRect viewRect);
|
|
|
|
void DrawBitmapAsync(const BBitmap* aBitmap,
|
|
|
|
BRect viewRect);
|
|
|
|
void DrawBitmapAsync(const BBitmap* aBitmap,
|
|
|
|
BPoint where);
|
|
|
|
void DrawBitmapAsync(const BBitmap* aBitmap);
|
|
|
|
|
|
|
|
void DrawBitmap(const BBitmap* aBitmap,
|
|
|
|
BRect bitmapRect, BRect viewRect,
|
|
|
|
uint32 options);
|
|
|
|
void DrawBitmap(const BBitmap* aBitmap,
|
|
|
|
BRect bitmapRect, BRect viewRect);
|
|
|
|
void DrawBitmap(const BBitmap* aBitmap,
|
|
|
|
BRect viewRect);
|
|
|
|
void DrawBitmap(const BBitmap* aBitmap,
|
|
|
|
BPoint where);
|
|
|
|
void DrawBitmap(const BBitmap* aBitmap);
|
|
|
|
|
2019-11-17 17:04:21 +03:00
|
|
|
void DrawTiledBitmapAsync(const BBitmap* aBitmap,
|
|
|
|
BRect viewRect, BPoint phase = B_ORIGIN);
|
|
|
|
|
|
|
|
void DrawTiledBitmap(const BBitmap* aBitmap,
|
|
|
|
BRect viewRect, BPoint phase = B_ORIGIN);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void DrawChar(char aChar);
|
|
|
|
void DrawChar(char aChar, BPoint location);
|
2010-03-15 16:59:14 +03:00
|
|
|
void DrawString(const char* string,
|
2009-08-27 15:12:41 +04:00
|
|
|
escapement_delta* delta = NULL);
|
2010-03-15 16:59:14 +03:00
|
|
|
void DrawString(const char* string,
|
2009-08-27 15:12:41 +04:00
|
|
|
BPoint location,
|
|
|
|
escapement_delta* delta = NULL);
|
2010-03-15 16:59:14 +03:00
|
|
|
void DrawString(const char* string, int32 length,
|
2009-08-27 15:12:41 +04:00
|
|
|
escapement_delta* delta = NULL);
|
2010-03-15 16:59:14 +03:00
|
|
|
void DrawString(const char* string, int32 length,
|
2009-08-27 15:12:41 +04:00
|
|
|
BPoint location,
|
|
|
|
escapement_delta* delta = 0L);
|
2010-03-15 18:08:07 +03:00
|
|
|
void DrawString(const char* string,
|
|
|
|
const BPoint* locations,
|
|
|
|
int32 locationCount);
|
2010-03-15 16:59:14 +03:00
|
|
|
void DrawString(const char* string, int32 length,
|
2010-03-15 18:08:07 +03:00
|
|
|
const BPoint* locations,
|
|
|
|
int32 locationCount);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2015-04-14 23:36:19 +03:00
|
|
|
virtual void SetFont(const BFont* font,
|
2009-08-27 15:12:41 +04:00
|
|
|
uint32 mask = B_FONT_ALL);
|
|
|
|
|
2015-04-14 23:36:19 +03:00
|
|
|
void GetFont(BFont* font) const;
|
2009-08-27 15:12:41 +04:00
|
|
|
void TruncateString(BString* in_out, uint32 mode,
|
|
|
|
float width) const;
|
|
|
|
float StringWidth(const char* string) const;
|
|
|
|
float StringWidth(const char* string,
|
|
|
|
int32 length) const;
|
|
|
|
void GetStringWidths(char* stringArray[],
|
|
|
|
int32 lengthArray[], int32 numStrings,
|
|
|
|
float widthArray[]) const;
|
|
|
|
void SetFontSize(float size);
|
|
|
|
void ForceFontAliasing(bool enable);
|
|
|
|
void GetFontHeight(font_height* height) const;
|
|
|
|
|
|
|
|
void Invalidate(BRect invalRect);
|
|
|
|
void Invalidate(const BRegion* invalRegion);
|
|
|
|
void Invalidate();
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void DelayedInvalidate(bigtime_t delay);
|
|
|
|
void DelayedInvalidate(bigtime_t delay,
|
|
|
|
BRect invalRect);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2017-07-24 09:48:28 +03:00
|
|
|
void SetDiskMode(char* filename, long offset);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
void BeginPicture(BPicture* a_picture);
|
|
|
|
void AppendToPicture(BPicture* a_picture);
|
|
|
|
BPicture* EndPicture();
|
|
|
|
|
|
|
|
void DrawPicture(const BPicture* a_picture);
|
|
|
|
void DrawPicture(const BPicture* a_picture,
|
|
|
|
BPoint where);
|
2017-07-24 09:48:28 +03:00
|
|
|
void DrawPicture(const char* filename, long offset,
|
2009-08-27 15:12:41 +04:00
|
|
|
BPoint where);
|
|
|
|
void DrawPictureAsync(const BPicture* a_picture);
|
|
|
|
void DrawPictureAsync(const BPicture* a_picture,
|
|
|
|
BPoint where);
|
|
|
|
void DrawPictureAsync(const char* filename,
|
2017-07-24 09:48:28 +03:00
|
|
|
long offset, BPoint where);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
app_server: add new BView layers API
* Add new methods
BView::BeginLayer(uint8 opacity)
BView::EndLayer()
* All drawing between begin and end of a layer is redirected onto an
intermediate bitmap. When ending the layer, this bitmap is
composited onto the view with the opacity given when the layer was
started.
* Layers can be nested arbitrarily and will be blended onto each
other in order. There can also be any arbitrary interleaving of
layer begin/end and drawing operations.
* Internally, drawing commands are redirected into a BPicture between
BeginLayer and EndLayer (but client code need not know or care
about this). Client code can also start/end other BPictures while
inside a layer.
* Uses the PictureBoundingBoxPlayer to determine the size of the
layer bitmap before allocating and drawing into it, so it does not
allocate more memory than necessary and -- more importantly -- it
will not alpha-composite more pixels than necessary.
* Drawing mode is always set to B_OP_ALPHA, blend mode to
(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE) while inside layers. This is
necessary for (a) correct compositing output and (b) for
redirection of drawing into the intermediate bitmap, which uses the
renderer_region offset (in B_OP_COPY, the Painter does not use the
AGG renderer methods, it directly accesses the pixel data. This
would access out-of-bounds without the offset, so B_OP_COPY cannot
be allowed.)
To ensure these modes aren't changed, BView::SetDrawingMode()
and BView::SetBlendingMode() are ignored while inside a layer.
* The main motivation behind this new API is WebKit, which internally
expects such a layers functionality to be present. A performant and
reusable implementation of this functionality can only be done
server-side in app_server.
2015-07-25 16:44:23 +03:00
|
|
|
void BeginLayer(uint8 opacity);
|
|
|
|
void EndLayer();
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
status_t SetEventMask(uint32 mask, uint32 options = 0);
|
|
|
|
uint32 EventMask();
|
|
|
|
status_t SetMouseEventMask(uint32 mask,
|
|
|
|
uint32 options = 0);
|
|
|
|
|
|
|
|
virtual void SetFlags(uint32 flags);
|
|
|
|
uint32 Flags() const;
|
|
|
|
virtual void SetResizingMode(uint32 mode);
|
|
|
|
uint32 ResizingMode() const;
|
|
|
|
void MoveBy(float dh, float dv);
|
|
|
|
void MoveTo(BPoint where);
|
|
|
|
void MoveTo(float x, float y);
|
|
|
|
void ResizeBy(float dh, float dv);
|
|
|
|
void ResizeTo(float width, float height);
|
|
|
|
void ResizeTo(BSize size);
|
|
|
|
void ScrollBy(float dh, float dv);
|
|
|
|
void ScrollTo(float x, float y);
|
|
|
|
virtual void ScrollTo(BPoint where);
|
2014-06-12 03:00:46 +04:00
|
|
|
virtual void MakeFocus(bool focus = true);
|
2009-08-27 15:12:41 +04:00
|
|
|
bool IsFocus() const;
|
|
|
|
|
|
|
|
virtual void Show();
|
|
|
|
virtual void Hide();
|
|
|
|
bool IsHidden() const;
|
|
|
|
bool IsHidden(const BView* looking_from) const;
|
|
|
|
|
|
|
|
void Flush() const;
|
|
|
|
void Sync() const;
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual void GetPreferredSize(float* _width, float* _height);
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void ResizeToPreferred();
|
|
|
|
|
2014-06-12 03:00:46 +04:00
|
|
|
BScrollBar* ScrollBar(orientation direction) const;
|
2009-08-27 15:12:41 +04:00
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
2009-08-27 15:12:41 +04:00
|
|
|
BMessage* specifier, int32 form,
|
|
|
|
const char* property);
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual status_t GetSupportedSuites(BMessage* data);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
bool IsPrinting() const;
|
|
|
|
void SetScale(float scale) const;
|
|
|
|
float Scale() const;
|
|
|
|
// new for Haiku
|
|
|
|
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual status_t Perform(perform_code code, void* data);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2013-11-06 22:14:53 +04:00
|
|
|
virtual void DrawAfterChildren(BRect updateRect);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
// layout related
|
|
|
|
|
|
|
|
virtual BSize MinSize();
|
|
|
|
virtual BSize MaxSize();
|
|
|
|
virtual BSize PreferredSize();
|
|
|
|
virtual BAlignment LayoutAlignment();
|
|
|
|
|
|
|
|
void SetExplicitMinSize(BSize size);
|
|
|
|
void SetExplicitMaxSize(BSize size);
|
|
|
|
void SetExplicitPreferredSize(BSize size);
|
2012-11-04 13:45:51 +04:00
|
|
|
void SetExplicitSize(BSize size);
|
2009-08-27 15:12:41 +04:00
|
|
|
void SetExplicitAlignment(BAlignment alignment);
|
|
|
|
|
|
|
|
BSize ExplicitMinSize() const;
|
|
|
|
BSize ExplicitMaxSize() const;
|
|
|
|
BSize ExplicitPreferredSize() const;
|
|
|
|
BAlignment ExplicitAlignment() const;
|
|
|
|
|
|
|
|
virtual bool HasHeightForWidth();
|
|
|
|
virtual void GetHeightForWidth(float width, float* min,
|
|
|
|
float* max, float* preferred);
|
|
|
|
|
2011-10-21 05:18:22 +04:00
|
|
|
void InvalidateLayout(bool descendants = false);
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void SetLayout(BLayout* layout);
|
|
|
|
BLayout* GetLayout() const;
|
|
|
|
|
|
|
|
void EnableLayoutInvalidation();
|
|
|
|
void DisableLayoutInvalidation();
|
2012-05-10 02:32:30 +04:00
|
|
|
bool IsLayoutInvalidationDisabled();
|
2009-08-27 15:12:41 +04:00
|
|
|
bool IsLayoutValid() const;
|
|
|
|
void ResetLayoutInvalidation();
|
|
|
|
|
|
|
|
BLayoutContext* LayoutContext() const;
|
|
|
|
|
|
|
|
void Layout(bool force);
|
|
|
|
void Relayout();
|
2006-08-26 20:21:15 +04:00
|
|
|
|
2010-08-17 22:43:41 +04:00
|
|
|
class Private;
|
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
protected:
|
2011-10-21 05:18:22 +04:00
|
|
|
virtual void LayoutInvalidated(bool descendants = false);
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual void DoLayout();
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2009-08-03 18:47:41 +04:00
|
|
|
public:
|
2009-08-27 15:12:41 +04:00
|
|
|
// tool tip support
|
2009-08-03 18:47:41 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void SetToolTip(const char* text);
|
|
|
|
void SetToolTip(BToolTip* tip);
|
|
|
|
BToolTip* ToolTip() const;
|
2009-08-03 18:47:41 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void ShowToolTip(BToolTip* tip = NULL);
|
|
|
|
void HideToolTip();
|
2009-08-03 18:47:41 +04:00
|
|
|
|
|
|
|
protected:
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
virtual bool GetToolTipAt(BPoint point, BToolTip** _tip);
|
2009-08-03 18:47:41 +04:00
|
|
|
|
2011-11-05 11:03:07 +04:00
|
|
|
virtual void LayoutChanged();
|
|
|
|
|
2014-03-08 03:15:02 +04:00
|
|
|
status_t ScrollWithMouseWheelDelta(BScrollBar*, float);
|
2012-06-24 18:46:17 +04:00
|
|
|
|
2003-08-31 21:18:20 +04:00
|
|
|
private:
|
2009-08-27 15:12:41 +04:00
|
|
|
void _Layout(bool force, BLayoutContext* context);
|
2010-08-17 22:43:41 +04:00
|
|
|
void _LayoutLeft(BLayout* deleted);
|
|
|
|
void _InvalidateParentLayout();
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// FBC padding and forbidden methods
|
|
|
|
virtual void _ReservedView13();
|
|
|
|
virtual void _ReservedView14();
|
|
|
|
virtual void _ReservedView15();
|
|
|
|
virtual void _ReservedView16();
|
|
|
|
|
|
|
|
BView(const BView&);
|
|
|
|
BView& operator=(const BView&);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct LayoutData;
|
|
|
|
|
2010-08-17 22:43:41 +04:00
|
|
|
friend class Private;
|
2003-08-31 21:18:20 +04:00
|
|
|
friend class BBitmap;
|
2006-08-26 20:21:15 +04:00
|
|
|
friend class BLayout;
|
2003-08-31 21:18:20 +04:00
|
|
|
friend class BPrintJob;
|
2006-08-26 20:21:15 +04:00
|
|
|
friend class BScrollBar;
|
2003-08-31 21:18:20 +04:00
|
|
|
friend class BShelf;
|
|
|
|
friend class BTabView;
|
2006-08-26 20:21:15 +04:00
|
|
|
friend class BWindow;
|
2003-08-31 21:18:20 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void _InitData(BRect frame, const char* name,
|
2014-05-28 20:11:57 +04:00
|
|
|
uint32 resizingMode, uint32 flags);
|
2009-08-27 15:12:41 +04:00
|
|
|
status_t _SetViewBitmap(const BBitmap* bitmap,
|
|
|
|
BRect srcRect, BRect dstRect,
|
|
|
|
uint32 followFlags, uint32 options);
|
|
|
|
void _ClipToPicture(BPicture* picture, BPoint where,
|
|
|
|
bool invert, bool sync);
|
|
|
|
|
2015-11-09 21:57:13 +03:00
|
|
|
void _ClipToRect(BRect rect, bool inverse);
|
|
|
|
void _ClipToShape(BShape* shape, bool inverse);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
bool _CheckOwnerLockAndSwitchCurrent() const;
|
|
|
|
bool _CheckOwnerLock() const;
|
|
|
|
void _CheckLockAndSwitchCurrent() const;
|
|
|
|
void _CheckLock() const;
|
|
|
|
void _SwitchServerCurrentView() const;
|
|
|
|
|
|
|
|
void _SetOwner(BWindow* newOwner);
|
|
|
|
void _RemoveCommArray();
|
|
|
|
|
|
|
|
BShelf* _Shelf() const;
|
|
|
|
void _SetShelf(BShelf* shelf);
|
|
|
|
|
|
|
|
void _MoveTo(int32 x, int32 y);
|
|
|
|
void _ResizeBy(int32 deltaWidth, int32 deltaHeight);
|
|
|
|
void _ParentResizedBy(int32 deltaWidth,
|
|
|
|
int32 deltaHeight);
|
|
|
|
|
|
|
|
void _ConvertToScreen(BPoint* pt,
|
|
|
|
bool checkLock) const;
|
|
|
|
void _ConvertFromScreen(BPoint* pt,
|
|
|
|
bool checkLock) const;
|
|
|
|
|
|
|
|
void _ConvertToParent(BPoint* pt,
|
|
|
|
bool checkLock) const;
|
|
|
|
void _ConvertFromParent(BPoint* pt,
|
|
|
|
bool checkLock) const;
|
|
|
|
|
|
|
|
void _Activate(bool state);
|
|
|
|
void _Attach();
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void _ColorsUpdated(BMessage* message);
|
2009-08-27 15:12:41 +04:00
|
|
|
void _Detach();
|
|
|
|
void _Draw(BRect screenUpdateRect);
|
|
|
|
void _DrawAfterChildren(BRect screenUpdateRect);
|
Set*UIColor, etc.
The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.
BView gains:
HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()
BWindow gains a simple helper method:
IsOffscreenWindow()
BMessage gains:
AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()
Previous private ColorTools methods are made public and moved into GraphicsDefs:
mix_color, blend_color, disable_color
These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.
In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR
These changes are documented in their proper user documentation files.
In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.
On the app_server side, the following has changed:
Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.
Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.
In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.
Decorator changes are live now, which required some reworking.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2015-12-10 21:52:48 +03:00
|
|
|
void _FontsUpdated(BMessage*);
|
2009-08-27 15:12:41 +04:00
|
|
|
void _Pulse();
|
|
|
|
|
|
|
|
void _UpdateStateForRemove();
|
|
|
|
void _UpdatePattern(::pattern pattern);
|
|
|
|
|
|
|
|
void _FlushIfNotInTransaction();
|
|
|
|
|
|
|
|
bool _CreateSelf();
|
|
|
|
bool _AddChildToList(BView* child,
|
|
|
|
BView* before = NULL);
|
|
|
|
bool _RemoveChildFromList(BView* child);
|
|
|
|
|
|
|
|
bool _AddChild(BView *child, BView *before);
|
|
|
|
bool _RemoveSelf();
|
2015-02-14 00:34:34 +03:00
|
|
|
void _RemoveLayoutItemsFromLayout(bool deleteItems);
|
2009-08-27 15:12:41 +04:00
|
|
|
|
|
|
|
// Debugging methods
|
2015-04-14 23:36:19 +03:00
|
|
|
void _PrintToStream();
|
2009-08-27 15:12:41 +04:00
|
|
|
void _PrintTree();
|
|
|
|
|
|
|
|
int32 _unused_int1;
|
|
|
|
|
|
|
|
uint32 fFlags;
|
|
|
|
BPoint fParentOffset;
|
|
|
|
BWindow* fOwner;
|
|
|
|
BView* fParent;
|
|
|
|
BView* fNextSibling;
|
|
|
|
BView* fPreviousSibling;
|
|
|
|
BView* fFirstChild;
|
|
|
|
|
2015-04-14 23:36:19 +03:00
|
|
|
int16 fShowLevel;
|
2009-08-27 15:12:41 +04:00
|
|
|
bool fTopLevelView;
|
|
|
|
bool fNoISInteraction;
|
|
|
|
BPicture* fCurrentPicture;
|
|
|
|
_array_data_* fCommArray;
|
|
|
|
|
|
|
|
BScrollBar* fVerScroller;
|
|
|
|
BScrollBar* fHorScroller;
|
|
|
|
bool fIsPrinting;
|
|
|
|
bool fAttached;
|
|
|
|
bool _unused_bool1;
|
|
|
|
bool _unused_bool2;
|
2013-09-10 20:36:07 +04:00
|
|
|
::BPrivate::ViewState* fState;
|
2009-08-27 15:12:41 +04:00
|
|
|
BRect fBounds;
|
|
|
|
BShelf* fShelf;
|
|
|
|
uint32 fEventMask;
|
|
|
|
uint32 fEventOptions;
|
|
|
|
uint32 fMouseEventOptions;
|
|
|
|
|
|
|
|
LayoutData* fLayoutData;
|
|
|
|
BToolTip* fToolTip;
|
|
|
|
|
2012-04-29 00:09:14 +04:00
|
|
|
uint32 _reserved[6];
|
2003-08-31 21:18:20 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
// #pragma mark - inline definitions
|
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
|
|
|
|
inline void
|
|
|
|
BView::ScrollTo(float x, float y)
|
2003-08-31 21:18:20 +04:00
|
|
|
{
|
|
|
|
ScrollTo(BPoint(x, y));
|
|
|
|
}
|
2005-06-29 03:02:44 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
inline void
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
BView::SetViewColor(uchar red, uchar green, uchar blue, uchar alpha)
|
2003-08-31 21:18:20 +04:00
|
|
|
{
|
2005-06-29 03:02:44 +04:00
|
|
|
rgb_color color;
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
color.red = red;
|
|
|
|
color.green = green;
|
|
|
|
color.blue = blue;
|
|
|
|
color.alpha = alpha;
|
2005-06-29 03:02:44 +04:00
|
|
|
SetViewColor(color);
|
2003-08-31 21:18:20 +04:00
|
|
|
}
|
2005-06-29 03:02:44 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
inline void
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
BView::SetHighColor(uchar red, uchar green, uchar blue, uchar alpha)
|
2003-08-31 21:18:20 +04:00
|
|
|
{
|
2005-06-29 03:02:44 +04:00
|
|
|
rgb_color color;
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
color.red = red;
|
|
|
|
color.green = green;
|
|
|
|
color.blue = blue;
|
|
|
|
color.alpha = alpha;
|
2005-06-29 03:02:44 +04:00
|
|
|
SetHighColor(color);
|
2003-08-31 21:18:20 +04:00
|
|
|
}
|
2005-06-29 03:02:44 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2005-06-29 03:02:44 +04:00
|
|
|
inline void
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
BView::SetLowColor(uchar red, uchar green, uchar blue, uchar alpha)
|
2003-08-31 21:18:20 +04:00
|
|
|
{
|
2005-06-29 03:02:44 +04:00
|
|
|
rgb_color color;
|
BView: Style fixes only, no functional change intended
Motivated by inconsistancies found while documenting BView.
Update copyright year, alphabetize
Variable names normalized:
* pt => point
* r => rect
* p => pattern
* c => color
* msg => message
* a, b and pt0, pt1 => start, end
* r, g, b, a => red, green, blue, alpha
A couple of white spaces fixes.
A couple of !pointer => pointer == NULL fixes.
GetPreferredSize params => _width and _height to indicate out params.
2013-06-29 06:59:17 +04:00
|
|
|
color.red = red;
|
|
|
|
color.green = green;
|
|
|
|
color.blue = blue;
|
|
|
|
color.alpha = alpha;
|
2005-06-29 03:02:44 +04:00
|
|
|
SetLowColor(color);
|
2003-08-31 21:18:20 +04:00
|
|
|
}
|
|
|
|
|
2012-11-04 13:45:51 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
#endif // _VIEW_H
|