#include "GuiGraphicsStackComposition.h"
namespace
{
namespace
{
namespace
{
void
::
()
{
if
(
.
() !=
.
())
{
.
(
.
());
}
(
0
,
0
);
;
for
(
=
0
;
i
<
.
();
i
++)
{
=
0
;
=
0
;
=
i
]->
();
i
]
(
offset
,
itemSize
);
#define ACCUMULATE(U, V) \
{ \
if (stackItemTotalSize.V < itemSize.V) \
{ \
stackItemTotalSize.V = itemSize.V; \
} \
if (i > 0) \
{ \
stackItemTotalSize.U += padding; \
} \
stackItemTotalSize.U += itemSize.U; \
} \
switch
(
)
{
case
::
:
case
::
:
ACCUMULATE(x, y)
{
if
(
.
<
itemSize
.
) {
.
=
itemSize
.
; }
if
(
i
>
0
) {
.
+=
; }
.
+=
itemSize
.
; }
break
;
case
::
:
case
::
:
ACCUMULATE(y, x)
{
if
(
.
<
itemSize
.
) {
.
=
itemSize
.
; }
if
(
i
>
0
) {
.
+=
; }
.
+=
itemSize
.
; }
break
;
}
#undef ACCUMULATE
offset
.
+=
itemSize
.
+
;
offset
.
+=
itemSize
.
+
;
}
();
}
void
::
()
{
#define ADJUSTMENT(U, V) \
if (itemBounds.U() <= 0) \
{ \
adjustment -= itemBounds.U(); \
} \
else \
{ \
vint overflow = itemBounds.V() - previousBounds.V(); \
if (overflow > 0) \
{ \
adjustment -= overflow; \
} \
} \
if
(
)
{
=
->
();
switch
(
)
{
case
:
case
:
ADJUSTMENT(Left, Right)
if
(
itemBounds
.
() <=
0
) {
-=
itemBounds
.
(); }
else
{
=
itemBounds
.
() -
.
();
if
(
overflow
>
0
) {
-=
overflow
; } }
break
;
case
:
case
:
ADJUSTMENT(Top, Bottom)
if
(
itemBounds
.
() <=
0
) {
-=
itemBounds
.
(); }
else
{
=
itemBounds
.
() -
.
();
if
(
overflow
>
0
) {
-=
overflow
; } }
break
;
}
}
InvokeOnCompositionStateChanged
();
#undef ADJUSTMENT
}
void
::
(
*
,
&
)
{
();
}
void
::
(
*
)
{
::
(
);
*
=
dynamic_cast
<
*>(
);
if
(
item
)
{
if
(!
.
(
item
))
{
.
(
item
);
}
();
}
}
void
::
(
*
)
{
::
(
);
*
=
dynamic_cast
<
*>(
);
if
(
item
)
{
.
(
item
);
if
(
item
==
)
{
=
0
;
}
();
}
}
::
()
{
.
(
this
, &
::
);
}
::
()
{
}
const
::
&
::
()
{
return
;
}
bool
::
(
,
*
)
{
=
.
(
,
);
if
(!
(
))
{
.
(
);
return
false
;
}
else
{
return
true
;
}
}
::
::
()
{
return
;
}
void
::
(
)
{
=
;
();
}
::
()
{
return
;
}
void
::
(
)
{
=
;
();
}
void
::
()
{
::
ForceCalculateSizeImmediately
();
();
}
::
GetMinPreferredClientSize
()
{
=
::
GetMinPreferredClientSize
();
if
(
() ==
::
LimitToElementAndChildren
)
{
if
(!
||
==
||
==
)
{
if
(
minSize
.
<
.
)
{
minSize
.
=
.
;
}
}
if
(!
||
==
||
==
)
{
if
(
minSize
.
<
.
)
{
minSize
.
=
.
;
}
}
}
=
0
;
=
0
;
if
(
.
>
0
)
x
+=
.
;
if
(
.
>
0
)
x
+=
.
;
if
(
.
>
0
)
y
+=
.
;
if
(
.
>
0
)
y
+=
.
;
return
minSize
(
x
,
y
);
}
::
()
{
for
(
=
0
;
i
<
.
();
i
++)
{
if
(
i
].
()
i
]->
())
{
();
break
;
}
}
=
::
();
bounds
;
(
);
return
bounds
;
}
::()
{
return
;
}
void
::(
)
{
;
();
}
bool
::
()
{
=
();
switch
(
)
{
case
:
case
:
{
=
.
+ (
.
>
0
?
.
:
0
)
+ (
.
>
0
?
.
:
0
)
;
return
width
>
clientArea
.
();
}
break
;
case
:
case
:
{
=
.
+ (
.
>
0
?
.
:
0
)
+ (
.
>
0
?
.
:
0
)
;
return
height
>
clientArea
.
();
}
break
;
}
return
false
;
}
bool
::
(
)
{
if
(
0
<=
&&
<
.
())
{
=
];
}
else
{
=
0
;
}
();
return
!=
0
;
}
void
::
(
*
,
*
)
{
::
(
,
);
=
==
0
?
0
:
dynamic_cast
<
*>(
);
}
::
()
{
return
(
).
();
}
::
()
:stackParent(
0
)
{
(
::
LimitToElementAndChildren
);
}
::
()
{
}
bool
::
()
{
return
false
;
}
::
()
{
=
;
if
(
)
{
=
->
.
(
this
);
if
(
index
!= -
1
)
{
result
->
index
];
}
=
->
;
=
->
;
if
(
margin
.
<=
0
)
margin
.
=
0
;
if
(
margin
.
<=
0
)
margin
.
=
0
;
if
(
margin
.
<=
0
)
margin
.
=
0
;
if
(
margin
.
<=
0
)
margin
.
=
0
;
auto
=
result
.
();
auto
=
result
.
();
auto
=
result
.
();
auto
=
result
.
();
switch
(
->
)
{
case
::
:
x
+=
margin
.
+
->
;
y
=
margin
.
;
h
=
parentBounds
.
() -
margin
.
-
margin
.
;
break
;
case
::
:
x
=
parentBounds
.
() -
margin
.
-
x
-
w
+
->
;
y
=
margin
.
;
h
=
parentBounds
.
() -
margin
.
-
margin
.
;
break
;
case
::
:
x
=
margin
.
;
y
+=
margin
.
+
->
;
w
=
parentBounds
.
() -
margin
.
-
margin
.
;
break
;
case
::
:
x
=
margin
.
;
y
=
parentBounds
.
() -
margin
.
-
y
-
h
+
->
;
w
=
parentBounds
.
() -
margin
.
-
margin
.
;
break
;
}
result
(
x
-
.
,
y
-
.
,
x
+
w
+
.
,
y
+
h
+
.
);
}
(
result
);
return
result
;
}
void
::
(
)
{
;
InvokeOnCompositionStateChanged
();
}
::()
{
return
;
}
void
::(
)
{
;
InvokeOnCompositionStateChanged
();
}
}
}
}