History log of /haiku/headers/os/interface/LayoutBuilder.h
Revision Date Author Comments
# cb5156f0 13-Nov-2020 Murai Takashi <tmurai01@gmail.com>

LayoutBuilder.h: Fix use after free

Fix 'item' is used after delete.
Pointed out by Clang Static Analyzer.

Change-Id: I8eca3084c97b37015a2da1b96119a458d4eb9aa7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3392
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: John Scipione <jscipione@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>


# 52c07497 26-Dec-2015 Markus Himmel <markus@himmel-villmar.de>

BLayoutBuilder: Add support for BCardLayout

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 1bfa46f2 21-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BLayoutBuilder::Grid: added spacing setters.


# e724b26f 08-Jul-2013 John Scipione <jscipione@gmail.com>

Remove enum elaborated type specifier

...from orientation params. Elaborated type specifiers are not needed
for C++ code and removing them makes doxygen happy. Verified working
on both gcc2h and gcc4h builds.


# caddc641 15-Nov-2012 Joseph R. Prostko <joe.prostko@gmail.com>

Changes to allow Haiku source to build with GCC 4.7
* GCC 4.7 is more picky than GCC 4.6, so have to make changes accordingly
* Changes include addressing issues with scoping, redeclaration, etc.
Thanks Rene and Ingo for your input on these changes


# 17ad59af 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added BLayoutBuilder::{Group|Grid}::SetExplicitAlignment().


# 2267b7e7 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added Grid::AddGlue(), and SetExplicit*Size() methods.


# 8ef19442 17-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

Add new constructors to BLayoutBuilder::Grid and BLayoutBuilder::Group that accept a plain old BView, and give it a new layout. These are very similar to the constructors that are already in place taking a BWindow. This solves a problem I have come across a few times, where one wants to build a layout in something like a BBox. Althought there is currently a way to do it with the layout builders, this is prettier.


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


# 813147df 09-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

* Add new SetInsets() methods to BTwoDimensionalLayout, BSplitView
* Also add equivalent methods to the layout builders in LayoutBuilder.h
* BSplitView now calls BControlLook::ComposeSpacing(), instead of BSplitLayout
* part of #7447


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


# 6bb10e96 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a layout builder for menus.


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


# e4acf496 17-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

BLayoutBuilder::Grid::{AddMenuField,AddTextControl}(): Use separate column
count parameters for label and control view. Most likely when one doesn't want
to use the default value (1), the label and the view will cover a different
amount of columns.


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


# 82ab3167 02-Sep-2010 Alex Wilson <yourpalal2@gmail.com>

Add default spacing for Layouts (#5614)
* introduce B_USE_DEFAULT_SPACING, which works somewhat like B_SIZE_UNSET and B_ALIGN_HORIZONTAL_UNSET
* introduce static float BControlLook::ComposeItemSpacing(float spacing), which checks uses be_control_look->DefaultItemSpacing().
* modify layouts to use BControlLook::ComposeItemSpacing() in SetInsets and SetSpacing methods.
* default insets are still 0, 0, 0, 0, but can be set to default spacing by passing B_USE_DEFAULT_SPACING
* I've found two regressions, patches incoming, please report others on #5614.


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


# 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


# a77ec88a 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed Group(BWindow*, ...) and Grid(BWindow*, ...) constructors to no longer
leak a view.
* Also set the view's background color to B_PANEL_BACKGROUND_COLOR to make this
better usable in applications.
* Removed the admittedly useless Group(BView*, ...) constructor I introduced
earlier.


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


# 7628cd87 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Added new BView variant of the BLayoutBuilder::Group() constructor.


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


# 89208c77 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
(abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


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


# d61def1d 14-Aug-2009 Jonas Sundström <jonas@kirilla.com>

A spelling error, I presume.

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


# 617ebd88 30-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added convenience methods to add BTextControls and BMenuFields to a grid
layout.


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


# 4aeb7a3c 23-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Made BTwoDimensionalLayout and BSplitLayout::GetInsets() const.
* Give access to BSplitLayout::SetInsets() and GetInsets() from BSplitView.
* Give access to BSplitView::SetInsets() from BSplitLayoutBuilder and
LayoutBuilder.
* Some automatic white-space cleanup.


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


# 2a3974d3 19-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added constructor versions of the Group and Grid layout builders that take a
BWindow* parameter. They set the newly created layout on the window, which saves
the API user to do that.


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


# 1a726098 17-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

New approach to layout building:
* The new builders are templatized and completely inline.
* They are easily nestable, which only worked for groups with the old approach.
* Added builder for split views.


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


# 1bfa46f230304cd7898b657fefcf512f1686ecbe 21-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BLayoutBuilder::Grid: added spacing setters.


# e724b26f23ad0df100a47f8d913bcdb3d54267df 08-Jul-2013 John Scipione <jscipione@gmail.com>

Remove enum elaborated type specifier

...from orientation params. Elaborated type specifiers are not needed
for C++ code and removing them makes doxygen happy. Verified working
on both gcc2h and gcc4h builds.


# caddc641c1682911446623c09d95170423aaa0de 15-Nov-2012 Joseph R. Prostko <joe.prostko@gmail.com>

Changes to allow Haiku source to build with GCC 4.7
* GCC 4.7 is more picky than GCC 4.6, so have to make changes accordingly
* Changes include addressing issues with scoping, redeclaration, etc.
Thanks Rene and Ingo for your input on these changes


# 17ad59afd3b25f230efd7231a3315e344ef73ae0 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added BLayoutBuilder::{Group|Grid}::SetExplicitAlignment().


# 2267b7e7fbfd5c977d50ec35613eb1a0b9ecf521 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added Grid::AddGlue(), and SetExplicit*Size() methods.


# 8ef1944247c77e7d68ba1ce73aa0f2206ba6f08e 17-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

Add new constructors to BLayoutBuilder::Grid and BLayoutBuilder::Group that accept a plain old BView, and give it a new layout. These are very similar to the constructors that are already in place taking a BWindow. This solves a problem I have come across a few times, where one wants to build a layout in something like a BBox. Althought there is currently a way to do it with the layout builders, this is prettier.


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


# 813147df835cb6637d8d2bbf737f96b5056898e6 09-Jun-2011 Alex Wilson <yourpalal2@gmail.com>

* Add new SetInsets() methods to BTwoDimensionalLayout, BSplitView
* Also add equivalent methods to the layout builders in LayoutBuilder.h
* BSplitView now calls BControlLook::ComposeSpacing(), instead of BSplitLayout
* part of #7447


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


# 6bb10e965d9c53048917a44e521e0939c74f0863 19-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a layout builder for menus.


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


# e4acf496c6668909fe8bb33e25f603649f52d1b5 17-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

BLayoutBuilder::Grid::{AddMenuField,AddTextControl}(): Use separate column
count parameters for label and control view. Most likely when one doesn't want
to use the default value (1), the label and the view will cover a different
amount of columns.


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


# 82ab3167232c5c8ee53e684eddc83dc7cb60f1cc 02-Sep-2010 Alex Wilson <yourpalal2@gmail.com>

Add default spacing for Layouts (#5614)
* introduce B_USE_DEFAULT_SPACING, which works somewhat like B_SIZE_UNSET and B_ALIGN_HORIZONTAL_UNSET
* introduce static float BControlLook::ComposeItemSpacing(float spacing), which checks uses be_control_look->DefaultItemSpacing().
* modify layouts to use BControlLook::ComposeItemSpacing() in SetInsets and SetSpacing methods.
* default insets are still 0, 0, 0, 0, but can be set to default spacing by passing B_USE_DEFAULT_SPACING
* I've found two regressions, patches incoming, please report others on #5614.


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


# 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


# a77ec88a9d444be0804db6f573b135fdbf324384 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed Group(BWindow*, ...) and Grid(BWindow*, ...) constructors to no longer
leak a view.
* Also set the view's background color to B_PANEL_BACKGROUND_COLOR to make this
better usable in applications.
* Removed the admittedly useless Group(BView*, ...) constructor I introduced
earlier.


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


# 7628cd87bf938bb2fc485255c25b32bb1fb5c6f4 07-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Added new BView variant of the BLayoutBuilder::Group() constructor.


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


# 89208c77f10235d43fda0c7b3fd6751db02cc12c 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
(abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


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


# d61def1d469080270674624b7ede6eef69fce70b 14-Aug-2009 Jonas Sundström <jonas@kirilla.com>

A spelling error, I presume.

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


# 617ebd889736d9388d0d49567b819874c6266c95 30-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Added convenience methods to add BTextControls and BMenuFields to a grid
layout.


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


# 4aeb7a3cc2d01a2d21127d7dd8cf5594e6c1e141 23-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* Made BTwoDimensionalLayout and BSplitLayout::GetInsets() const.
* Give access to BSplitLayout::SetInsets() and GetInsets() from BSplitView.
* Give access to BSplitView::SetInsets() from BSplitLayoutBuilder and
LayoutBuilder.
* Some automatic white-space cleanup.


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


# 2a3974d313c2a18163643a1dab76e156b5fe423b 19-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added constructor versions of the Group and Grid layout builders that take a
BWindow* parameter. They set the newly created layout on the window, which saves
the API user to do that.


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


# 1a726098ecee6525b34f70b457413e7904ba77a7 17-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

New approach to layout building:
* The new builders are templatized and completely inline.
* They are easily nestable, which only worked for groups with the old approach.
* Added builder for split views.


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