History log of /haiku/headers/private/interface/ViewPrivate.h
Revision Date Author Comments
# 241f109c 01-Nov-2022 Máximo Castañeda <antiswen@yahoo.es>

View: provide the transform between different coordinate spaces

There's currently no way for an application to convert between view and
drawing coordinates with a drawing states stack without keeping track of
all the transformations itself, which is not very convenient for helper
or library functions.

Handle other spaces too, for good measure.

Change-Id: Ic8404a1c111e273fff1eebf2f9f59f58246b796c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5775
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 7f9368ca 09-Dec-2015 looncraz <looncraz@looncraz.net>

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>


# b617d006 13-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

ViewPrivate.h: minor cleanup, no functional change.


# eb431663 11-Mar-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server & interface kit: support fill rules.

* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.


# a6db6bd4 04-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Added WIP support for affine transformations to BViews.

Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.


# bd97b9ad 07-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BObjectList<BLayoutItem> to BView::fLayoutData that keeps track of any BLayoutItems that refer to this view that are part of a layout. BLayoutItem does the registering/deregistering of the items, and BView::Private proxies fLayoutData for us. Currently, this is not used anywhere, but there are many places where it will be used soon.


# edb4c824 06-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a method to BView::Private that calls BView::_RemoveSelf().
Add a struct to kits/interface/Layout.cpp that uses BView::Private to
provide RAII mechanics for the removal of views (calling
BView::Private::RemoveSelf()).
Use the new struct to simplify BLayout::AddItem().


# 1d6c7b6c 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
may have slipped by.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12349c7d 05-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Begun to use structs for the BView<->app_server communication. This makes
the protocoll less prone to errors, reduces possible points of failure and
most importantly, reduces the number of function calls to the link API.
I only know the numbers for StrokeLine(), which I tested via the Benchmark
test app. With this change, drawing random colored and positioned lines
actually doubled in speed. On the BView side, the calls to
ServerLink::Attach() only halfed, while on the app_server side, the number
of calls to ServerLink::Read() is now 1/4th. It will also be worth
investigating why the link stuff is so slow at all. I also optimized
BView::DrawString() a lot in this change, but I don't have any numbers
yet. Some other commands which used multiple Attach()/Read() calls were
also optimized, at least the most important ones. Begin/EndLineArray() was
also pretty bad on the app_server side.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29937 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f56301c9 07-Jul-2008 Karsten Heimrich <host.haiku@gmx.de>

* maintain our own rect while printing, this makes it possible to print all pages e.g. syslog from StyledEdit



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9bbab88 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

* First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
view - note though, that you must not remove a view before closing or
hiding its window for now (and that you still need to set the
kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the
specified flags set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24090 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 938519a6 30-Oct-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

oops forgot to commit this



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19156 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 931aebe9 07-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Deleting replicants now works

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18066 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 621a8324 23-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed ViewAux.h header to ViewPrivate.h.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17210 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b617d006f9ada29cd5133557bc267915c888d010 13-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

ViewPrivate.h: minor cleanup, no functional change.


# eb431663264ef319e72b492801fb867b5d71910b 11-Mar-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server & interface kit: support fill rules.

* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.


# a6db6bd40fe3492fd3104dba560f0e3ff61d388d 04-Feb-2014 Stephan Aßmus <superstippi@gmx.de>

Added WIP support for affine transformations to BViews.

Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.


# bd97b9adba41005ca6dafaf0c32f63422ec351b6 07-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BObjectList<BLayoutItem> to BView::fLayoutData that keeps track of any BLayoutItems that refer to this view that are part of a layout. BLayoutItem does the registering/deregistering of the items, and BView::Private proxies fLayoutData for us. Currently, this is not used anywhere, but there are many places where it will be used soon.


# edb4c8244cfe8ed3801ef4854d45c03324c96510 06-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a method to BView::Private that calls BView::_RemoveSelf().
Add a struct to kits/interface/Layout.cpp that uses BView::Private to
provide RAII mechanics for the removal of views (calling
BView::Private::RemoveSelf()).
Use the new struct to simplify BLayout::AddItem().


# 1d6c7b6cb6f46c2672074ff137a18833d4dd3041 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
may have slipped by.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12349c7d3d445aa2bb4d737e5c7bcf135cca1d69 05-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Begun to use structs for the BView<->app_server communication. This makes
the protocoll less prone to errors, reduces possible points of failure and
most importantly, reduces the number of function calls to the link API.
I only know the numbers for StrokeLine(), which I tested via the Benchmark
test app. With this change, drawing random colored and positioned lines
actually doubled in speed. On the BView side, the calls to
ServerLink::Attach() only halfed, while on the app_server side, the number
of calls to ServerLink::Read() is now 1/4th. It will also be worth
investigating why the link stuff is so slow at all. I also optimized
BView::DrawString() a lot in this change, but I don't have any numbers
yet. Some other commands which used multiple Attach()/Read() calls were
also optimized, at least the most important ones. Begin/EndLineArray() was
also pretty bad on the app_server side.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29937 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f56301c9e824fb17a6022f06ec64d6807b64adc5 07-Jul-2008 Karsten Heimrich <host.haiku@gmx.de>

* maintain our own rect while printing, this makes it possible to print all pages e.g. syslog from StyledEdit



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9bbab8848383da363df67ea3e712c222d3708f0 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

* First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
view - note though, that you must not remove a view before closing or
hiding its window for now (and that you still need to set the
kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the
specified flags set.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24090 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 938519a6670f6a25e481ff68325b36bd279b0e3c 30-Oct-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

oops forgot to commit this



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19156 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 931aebe962b3fa36dfde39a276f5f5d87cbde282 07-Jul-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Deleting replicants now works

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18066 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 621a832488a17c2281190dd4c3d9f9d741ef1273 23-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Renamed ViewAux.h header to ViewPrivate.h.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17210 a95241bf-73f2-0310-859d-f6bbb57e9c96