Skip to content

Commit 43db75e

Browse files
committed
Refinements
1 parent 5911fd7 commit 43db75e

File tree

8 files changed

+91
-86
lines changed

8 files changed

+91
-86
lines changed

docs/modules/ROOT/pages/common.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
:mit_license: https://opensource.org/licenses/MIT[MIT License]
1616

1717
:layout: xref:layout.adoc[Layout]
18-
:stretch-elements: xref:layout/stretch_elements.adoc[Stretch Elements]
19-
:layers: xref:layout/layers.adoc[Layers]
20-
:layers_semantics: xref:layout/layers.adoc#_semantics[Layer Semantics]
18+
:limits: xref:layout/limits.adoc[limits]
19+
:view_limits: xref:layout/limits.adoc#_view_limits[view_limits]
20+
21+
:Stretch-Elements: xref:layout/stretch_elements.adoc[Stretch Elements]
22+
:Layers: xref:layout/layers.adoc[Layers]
23+
:Layers_Semantics: xref:layout/layers.adoc#_semantics[Layer Semantics]
2124
:decks: xref:layout/decks.adoc[Decks]

docs/modules/ROOT/pages/layout/decks.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ include::../common.adoc[]
44

55
== Overview
66

7-
The Deck is very similar to {layers}. Elements are placed in the z-axis. But
7+
The Deck is very similar to {Layers}. Elements are placed in the z-axis. But
88
unlike layers, only the selected element is active (top-most by default).
99

1010
image::/layout/deck.svg[alt="deck", width=353px, role=center]
1111

1212
=== Semantics
1313

14-
. Everything listed in the {layers_semantics}, except 2 and 3.
14+
. Everything listed in the {Layers_Semantics}, except 2 and 3.
1515
. Only the active selected element element is drawn.
1616
. Only the active selected element is given the chance to process UI control.
1717

docs/modules/ROOT/pages/layout/floating.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ floating({left, top, right, bottom}, subject)
2929
=== Semantics
3030

3131
. The element will be placed exactly to the specified position in the main
32-
view, constrained to the subject's natural _limits_.
33-
. The floating element does not violate the natural _limits_ of the subject.
32+
view, constrained to the subject's natural {limits}.
33+
. The floating element does not violate the natural {limits} of the subject.
3434
. Returns instance of `Proxy`.
3535

3636
'''

docs/modules/ROOT/pages/layout/grids.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ image::/layout/hgrid.svg[alt="hgrid", width=347px, role=center]
2020
Horizontal Grids are composites that lay out one or more child elements in a
2121
row following externally supplied horizontal fractional positions. Horizontal
2222
Grids have computed horizontal and vertical sizes following the natural
23-
`limits` of its children.
23+
{limits} of its children.
2424

2525
=== Semantics
2626

@@ -152,7 +152,7 @@ image::/layout/vgrid.svg[alt="vgrid", width=347px, role=center]
152152
Vertical Grids are composites that lay out one or more child elements in a
153153
column following externally supplied vertical fractional positions. Vertical
154154
Grids have computed horizontal and vertical sizes following the natural
155-
`limits` of its children.
155+
{limits} of its children.
156156

157157
=== Semantics
158158

docs/modules/ROOT/pages/layout/limits.adoc

+47-45
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@ include::../common.adoc[]
66

77
Each element provides information on how it wants to be sized by means of
88
`min` and `max` limits: a hint that determine its actual extent and how it
9-
will be placed in the view depending on available window space. The element's
10-
`limits` member function determines the minimum and maximum extents of an
11-
element:
9+
will be placed in the view depending on available window space.
1210

13-
[,c++]
14-
----
15-
view_limits limits(basic_context const& ctx) const;
16-
----
11+
== view_limits
1712

18-
+++<a name="view_limits">++++++</a>+++
19-
See link:context[Context] for information about `basic_context`. `view_limits`
20-
is a struct that gives us the `min` and `max` information:
13+
`view_limits` is a struct that gives us the `min` and `max` information:
14+
15+
=== Declaration
2116

2217
[,c++]
2318
----
@@ -28,39 +23,17 @@ struct view_limits
2823
};
2924
----
3025

31-
For the purpose of this document, we will use these terms and expressions:
26+
=== Notation
3227

33-
limits:: The limits of an element
28+
`full_extent`:: An implementation-defined huge number that signifies an unbounded extent.
3429

35-
limits.min:: The minimum limits of an element
30+
`point`:: A data structure representing a coordinate in a 2D space used to
31+
specify positions or dimensions within the graphical context.
3632

37-
limits.min.x:: The minimum horizontal limit of an element
33+
=== full_limits
3834

39-
limits.min.y:: The minimum vertical limit of an element
40-
41-
limits.max:: The maximum limits of an element
42-
43-
limits.max.x:: The maximum horizontal limit of an element
44-
45-
limits.max.y:: The maximum vertical limit of an element
46-
47-
horizontal limits:: (limits.min.x, limits.max.x)
48-
49-
vertical limits:: (limits.min.y, limits.max.y)
50-
51-
minimum limits:: (limits.min.x, limits.min.y)
52-
53-
maximum limits:: (limits.max.x, limits.max.y)
54-
55-
minimum horizontal limit:: limits.min.x
56-
57-
maximum horizontal limit:: limits.max.x
58-
59-
minimum vertical limit:: limits.min.y
60-
61-
maximum vertical limit:: limits.max.y
62-
63-
By default, an element has full limits: it is infinitely resizable:
35+
By default, an element has full limits, meaning there is no constraints on
36+
its size. It is infinitely resizable:
6437

6538
[,c++]
6639
----
@@ -73,17 +46,12 @@ constexpr view_limits full_limits = {
7346
An element with `full_limits` can be resized from an empty point (zero x and
7447
y size) up to the full extent of the screen, and beyond (if possible).
7548

76-
NOTE: `full_extent` is actually an implementation defined huge
77-
number near the _maximum limits_ of the coordinate's data type (also
78-
implementation defined).
79-
8049
* An element has a fixed horizontal size if this expression is true:
8150
`limits.min.x == limits.max.x`.
8251
* An element has a fixed vertical size if this expression is true:
8352
`limits.min.y == limits.max.y`.
8453

85-
[discrete]
86-
==== Examples
54+
=== Examples
8755

8856
[,c++]
8957
----
@@ -100,6 +68,40 @@ implementation defined).
10068
{{100, 100}, {100, 200}}; // Fixed width, semi-flexible height (100 to 200)
10169
----
10270

71+
=== Terms and Expressions
72+
73+
For the purpose of this document, we will use these terms and expressions:
74+
75+
limits:: The limits of an element
76+
77+
limits.min:: The minimum limits of an element
78+
79+
limits.min.x:: The minimum horizontal limit of an element
80+
81+
limits.min.y:: The minimum vertical limit of an element
82+
83+
limits.max:: The maximum limits of an element
84+
85+
limits.max.x:: The maximum horizontal limit of an element
86+
87+
limits.max.y:: The maximum vertical limit of an element
88+
89+
horizontal limits:: (limits.min.x, limits.max.x)
90+
91+
vertical limits:: (limits.min.y, limits.max.y)
92+
93+
minimum limits:: (limits.min.x, limits.min.y)
94+
95+
maximum limits:: (limits.max.x, limits.max.y)
96+
97+
minimum horizontal limit:: limits.min.x
98+
99+
maximum horizontal limit:: limits.max.x
100+
101+
minimum vertical limit:: limits.min.y
102+
103+
maximum vertical limit:: limits.max.y
104+
103105
'''
104106

105107
_Copyright (c) 2014-2024 Joel de Guzman. All rights reserved._

docs/modules/ROOT/pages/layout/margin_elements.adoc

+21-21
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ margin({left, top, right, bottom}, subject)
3030

3131
. Space is added to the left, top, right, and bottom of the subject with the
3232
given parameters.
33-
. The element's _limits_ is overridden to account for the additional space.
34-
. The `margin` does not violate the natural _limits_ of the subject.
33+
. The element's {limits} is overridden to account for the additional space.
34+
. The `margin` does not violate the natural {limits} of the subject.
3535
`margin` will respect the subject's min-max constraints and resizability.
3636
. Returns instance of `Proxy`.
3737

@@ -58,8 +58,8 @@ margin_left(left, subject)
5858
=== Semantics
5959

6060
. Space is added to the left of the subject with the given parameter.
61-
. The element's _limits_ is overridden to account for the additional space.
62-
. The `margin_left` does not violate the natural _limits_ of the subject.
61+
. The element's {limits} is overridden to account for the additional space.
62+
. The `margin_left` does not violate the natural {limits} of the subject.
6363
`margin_left` will respect the subject's min-max constraints and
6464
resizability.
6565
. Returns instance of `Proxy`.
@@ -87,8 +87,8 @@ margin_right(right, subject)
8787
=== Semantics
8888

8989
. Space is added to the right of the subject with the given parameter.
90-
. The element's _limits_ is overridden to account for the additional space.
91-
. The `margin_right` does not violate the natural _limits_ of the subject.
90+
. The element's {limits} is overridden to account for the additional space.
91+
. The `margin_right` does not violate the natural {limits} of the subject.
9292
`margin_right` will respect the subject's min-max constraints and
9393
resizability.
9494
. Returns instance of `Proxy`.
@@ -116,8 +116,8 @@ margin_top(top, subject)
116116
=== Semantics
117117

118118
. Space is added to the top of the subject with the given parameter.
119-
. The element's _limits_ is overridden to account for the additional space.
120-
. The `margin_top` does not violate the natural _limits_ of the subject.
119+
. The element's {limits} is overridden to account for the additional space.
120+
. The `margin_top` does not violate the natural {limits} of the subject.
121121
`margin_top` will respect the subject's min-max constraints and
122122
resizability.
123123
. Returns instance of `Proxy`.
@@ -146,8 +146,8 @@ margin_bottom(bottom, subject)
146146

147147
. Space is added to the to the bottom of the subject with the given
148148
parameter.
149-
. The element's _limits_ is overridden to account for the additional space.
150-
. The `margin_bottom` does not violate the natural _limits_ of the subject.
149+
. The element's {limits} is overridden to account for the additional space.
150+
. The `margin_bottom` does not violate the natural {limits} of the subject.
151151
`margin_bottom` will respect the subject's min-max constraints and
152152
resizability.
153153
. Returns instance of `Proxy`.
@@ -186,8 +186,8 @@ margin_left_right(left, right, subject)
186186

187187
. Space is added to the to the left and right sides of the subject with the
188188
given parameters.
189-
. The element's _limits_ is overridden to account for the additional space.
190-
. The `hmargin` (and variants) does not violate the natural _limits_ of the
189+
. The element's {limits} is overridden to account for the additional space.
190+
. The `hmargin` (and variants) does not violate the natural {limits} of the
191191
subject. `hmargin` (and variants) will respect the subject's min-max
192192
constraints and resizability.
193193
. Returns instance of `Proxy`.
@@ -228,8 +228,8 @@ margin_top_bottom(top, bottom, subject)
228228

229229
. Space is added to the to the top and bottom sides of the subject with the
230230
given parameters.
231-
. The element's _limits_ is overridden to account for the additional space.
232-
. The `vmargin` (and variants) does not violate the natural _limits_ of the
231+
. The element's {limits} is overridden to account for the additional space.
232+
. The `vmargin` (and variants) does not violate the natural {limits} of the
233233
subject. `vmargin` (and variants) will respect the subject's min-max
234234
constraints and resizability.
235235
. Returns instance of `Proxy`.
@@ -262,8 +262,8 @@ margin_left_top(left, top, subject)
262262

263263
. Space is added to the to the left and top sides of the subject with the
264264
given parameters.
265-
. The element's _limits_ is overridden to account for the additional space.
266-
. The `margin_left_top` (and variant) does not violate the natural _limits_
265+
. The element's {limits} is overridden to account for the additional space.
266+
. The `margin_left_top` (and variant) does not violate the natural {limits}
267267
of the subject. `margin_left_top` (and variant) will respect the subject's
268268
min-max constraints and resizability.
269269
. Returns instance of `Proxy`.
@@ -296,9 +296,9 @@ margin_left_bottom(left, bottom, subject)
296296

297297
. Space is added to the to the left and bottom sides of the subject with the
298298
given parameters.
299-
. The element's _limits_ is overridden to account for the additional space.
299+
. The element's {limits} is overridden to account for the additional space.
300300
. The `margin_left_bottom` (and variant) does not violate the natural
301-
_limits_ of the subject. `margin_left_bottom` (and variant) will respect
301+
{limits} of the subject. `margin_left_bottom` (and variant) will respect
302302
the subject's min-max constraints and resizability.
303303
. Returns instance of `Proxy`.
304304

@@ -330,8 +330,8 @@ margin_right_top(right, top, subject)
330330

331331
. Space is added to the to the right and top sides of the subject with the
332332
given parameters.
333-
. The element's _limits_ is overridden to account for the additional space.
334-
. The `margin_right_top` (and variant) does not violate the natural _limits_
333+
. The element's {limits} is overridden to account for the additional space.
334+
. The `margin_right_top` (and variant) does not violate the natural {limits}
335335
of the subject. `margin_right_top` (and variant) will respect the
336336
subject's min-max constraints and resizability.
337337
. Returns instance of `Proxy`.
@@ -364,7 +364,7 @@ margin_right_bottom(right, bottom, subject)
364364

365365
. Space is added to the to the right and bottom sides of the subject with the
366366
given parameters.
367-
. The element's _limits_ is overridden to account for the additional space.
367+
. The element's {limits} is overridden to account for the additional space.
368368
. The `margin_right_bottom` (and variant) does not violate the natural
369369
limits of the subject. `margin_right_bottom` (and variant) will respect
370370
the subject's min-max constraints and resizability.

docs/modules/ROOT/pages/layout/size_elements.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include::../common.adoc[]
55

66
== Overview
77

8-
Size elements override the _limits_ of an enclosed element. There is a
8+
Size elements override the {limits} of an enclosed element. There is a
99
comprehensive list of size related elements in the Elements Library that can
1010
be used for various purposes. This section catalogues all the available size
1111
elements.
@@ -14,11 +14,11 @@ elements.
1414

1515
image::/layout/limit.svg[alt="limit", width=360px, role=center]
1616

17-
Overrides the _limits_ of an element.
17+
Overrides the {limits} of an element.
1818

1919
=== Notation
2020

21-
`limits` :: Instance of <<view_limits,`view_limits`>>
21+
`limits` :: Instance of {view_limits}
2222
`subject` :: Instance of `Element`
2323

2424
=== Expression
@@ -30,8 +30,8 @@ limit(limits, subject)
3030

3131
=== Semantics
3232

33-
. The _limits_ of `subject` will be set to the specified `limits`
34-
constrained by the natural _limits_ of the `subject` (the natural _limits_
33+
. The {limits} of `subject` will be set to the specified {limits}
34+
constrained by the natural {limits} of the `subject` (the natural {limits}
3535
of the element will not be violated).
3636
. Returns instance of `Proxy`.
3737

@@ -56,7 +56,7 @@ fixed_size({width, height}, subject)
5656
=== Semantics
5757

5858
. `subject` will be laid out with a fixed `width` and `height`, constrained
59-
by the natural _limits_ of the `subject` (the natural _limits_ of the
59+
by the natural {limits} of the `subject` (the natural {limits} of the
6060
element will not be violated).
6161
. Returns instance of `Proxy`.
6262

docs/modules/ROOT/pages/layout/tiles.adoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Tiles are the most useful layout elements. Tiles are used everywhere for
88
composing hierarchical elements in rows and columns, typical to all GUIs.
99
Tiles allow elements to fluidly adjust depending on available space. Tiles
1010
compute the layout of its elements using the children elements' size
11-
`limits`.
11+
{limits}.
1212

1313
== Horizontal Tiles
1414

@@ -22,7 +22,7 @@ available space.
2222
. The elements are laid out in a single row, left to right, immediately next
2323
to each other with no intervening space.
2424
. The elements are positioned horizontally using the children's natural
25-
_limits_.
25+
{limits}.
2626
. Horizontal space is allocated using this algorithm:
2727
.. Space is allocated for each child element following the child's natural
2828
_minimum horizontal limit_.
@@ -34,7 +34,7 @@ to it according to the element's `stretch()` member function. A stretch
3434
value of `1.0` is default. A stretchiness value of 2.0 means that the
3535
element is able to stretch twice as much compared to its siblings.
3636
Horizontally fixed-sized elements will not be stretched (element d in
37-
the diagram). (Also see {stretch-elements}).
37+
the diagram). (Also see {Stretch-Elements}).
3838
. The tile's _minimum vertical limit_ is computed as the maximum of the
3939
children elements' __minimum vertical limit__s.
4040
. The grid's _maximum vertical limit_ is computed as the minimum of the
@@ -130,7 +130,7 @@ available space.
130130
. The elements are laid out in a single column, top to bottom, immediately
131131
next to each other with no intervening space.
132132
. The elements are positioned vertically using the children's natural
133-
_limits_.
133+
{limits}.
134134
. Vertical space is allocated using this algorithm:
135135
.. Space is allocated for each child element following the child's natural
136136
_minimum vertical limit_.
@@ -142,7 +142,7 @@ to it according to the element's `stretch()` member function. A stretch
142142
value of `1.0` is default. A stretchiness value of 2.0 means that the
143143
element is able to stretch twice as much compared to its siblings.
144144
Vertically fixed-sized elements will not be stretched (element b in the
145-
diagram). (Also see {stretch-elements}).
145+
diagram). (Also see {Stretch-Elements}).
146146
. The tile's _minimum horizontal limit_ is computed as the maximum of the
147147
children elements' __minimum horizontal limit__s.
148148
. The grid's _maximum horizontal limit_ is computed as the minumum of the

0 commit comments

Comments
 (0)