#include "GuiGraphicsHost.h"
#include "../Controls/GuiWindowControls.h"
#include "../Controls/Templates/GuiThemeStyleFactory.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
controls
;
using
namespace
elements
;
using
namespace
theme
;
::
()
{
}
::
()
{
}
void
::
(
<
IGuiGraphicsTimerCallback
>
)
{
.
(
);
}
void
::
()
{
for
(
=
.
() -
1
;
i
>=
0
;
i
--)
{
auto
=
i
];
if
(!
callback
())
{
.
(
i
);
}
}
}
void
::
(
*
)
{
.
=
;
.
=
?
GetGuiGraphicsResourceManager
()->
(
) :
nullptr
;
->
(&
);
}
void
::
DisconnectCompositionInternal
(
*
)
{
for
(
=
0
;
i
<
->
().
();
i
++)
{
DisconnectCompositionInternal
(
->
().
(
i
));
}
if
(
==
)
{
if
(
.
)
{
.
->
();
}
=
0
;
}
if
(
==
)
{
=
0
;
}
.
(
);
}
void
::
(
const
&
)
{
if
(
.
&& (
.
||
.
||
.
))
{
if
(!
.
->
() && !
.
)
{
.
->
();
auto
=
.
->
(
(
.
,
.
));
=
->
(
point
,
true
);
}
}
}
void
::
(
const
&
)
{
if
(
.
&& !(
.
||
.
||
.
))
{
.
->
();
=
0
;
}
}
void
::
(
const
&
,
*
,
::*
)
{
<
*>
;
while
(
)
{
if
(
->
())
{
compositions
.
(
);
}
=
->
();
}
(
);
(
&)
arguments
;
for
(
=
compositions
.
()-
1
;
i
>=
0
;
i
--)
{
compositions
i
]->
()->
.
(
arguments
);
if
(
arguments
.
)
{
return
;
}
}
for
(
=
0
;
i
<
compositions
.
();
i
++)
{
(
compositions
i
]->
()->*
).
(
arguments
);
if
(
arguments
.
)
{
return
;
}
}
}
void
::
(
const
&
,
*
,
::*
)
{
<
*>
;
{
auto
=
;
while
(
current
)
{
if
(
current
->
())
{
compositions
.
(
current
);
}
current
=
current
->
();
}
}
(
);
(
&)
arguments
;
for
(
=
compositions
.
() -
1
;
i
>=
0
;
i
--)
{
compositions
i
]->
()->
.
(
arguments
);
if
(
arguments
.
)
{
return
;
}
}
for
(
=
0
;
i
<
compositions
.
();
i
++)
{
(
compositions
i
]->
()->*
).
(
arguments
);
if
(
arguments
.
)
{
return
;
}
}
}
void
::
(
&
,
*
,
::*
)
{
.
=
;
.
=
0
;
=
.
;
=
.
;
while
(
)
{
if
(
->
())
{
if
(!
.
)
{
.
=
;
}
*
=
->
();
(
eventReceiver
->*
).
(
);
if
(
.
)
{
break
;
}
}
*
=
->
();
if
(
parent
)
{
=
parent
->
();
=
parent
->
();
=
->
();
x
+=
childBounds
.
+(
clientArea
.
-
parentBounds
.
);
y
+=
childBounds
.
+(
clientArea
.
-
parentBounds
.
);
.
=
x
;
.
=
y
;
}
=
parent
;
}
}
void
::
(
const
&
,
::*
)
{
*
=
0
;
if
(
)
{
composition
=
;
}
else
{
auto
=
.
->
(
(
.
,
.
));
composition
=
->
(
point
,
true
);
}
if
(
composition
)
{
=
composition
->
();
=
.
->
(
(
.
,
.
));
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
.
;
arguments
.
=
point
.
-
bounds
.
;
arguments
.
=
point
.
-
bounds
.
;
(
arguments
,
composition
,
);
}
}
void
::
()
{
->
(
nullptr
);
GetGuiGraphicsResourceManager
()->
(
.
);
(
.
);
}
::
::
(
)
{
=
.
->
();
=
.
->
();
(
.
bounds
.
clientBounds
.
,
.
bounds
.
clientBounds
.
);
auto
=
.
->
(
clientLocation
);
*
=
->
(
point
,
true
);
while
(
hitComposition
)
{
::
=
hitComposition
->
GetAssociatedHitTestResult
();
if
(
result
==
::
)
{
hitComposition
=
hitComposition
->
();
}
else
{
return
result
;
}
}
return
::
;
}
void
::
(
&
,
bool
,
bool
)
{
=
.
->
();
->
().
();
=
.
->
(
)
(
oldBounds
.
()
.
->
());
if
(
.
()
minWindowSize
.
)
{
if
(
)
{
if
(
.
()
minWindowSize
.
)
{
.
.
minWindowSize
.
;
}
}
else
if
(
oldBounds
.
.
)
{
.
oldBounds
.
minWindowSize
.
;
}
else
if
(
oldBounds
.
.
)
{
.
oldBounds
.
minWindowSize
.
;
}
}
if
(
.
()
minWindowSize
.
)
{
if
(
)
{
if
(
.
()
minWindowSize
.
)
{
.
.
minWindowSize
.
;
}
}
else
if
(
oldBounds
.
.
)
{
.
oldBounds
.
minWindowSize
.
;
}
else
if
(
oldBounds
.
.
)
{
.
oldBounds
.
minWindowSize
.
;
}
}
}
void
::
()
{
=
.
->
();
if
(
size
)
{
size
;
->
().
();
=
true
;
}
}
void
::
()
{
();
=
true
;
}
void
::
()
{
if
(!
)
{
=
true
;
}
}
void
::
(
const
&
)
{
->
();
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
(
, &
::
);
(
);
}
void
::
(
const
&
)
{
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
->
();
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
(
, &
::
);
(
);
}
void
::
(
const
&
)
{
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
->
();
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
(
, &
::
);
(
);
}
void
::
(
const
&
)
{
(
);
(
, &
::
);
}
void
::
(
const
&
)
{
(
, &
::
);
}
void
::
(
const
&
)
{
(
, &
::
);
}
void
::
(
const
&
)
{
;
{
auto
=
.
->
(
(
.
,
.
));
*
=
->
(
point
,
true
);
while
(
composition
)
{
newCompositions
.
(
0
,
composition
);
composition
=
composition
->
();
}
}
=
.
();
for
(
=
0
;
i
<
.
();
i
++)
{
if
(
i
==
newCompositions
.
())
{
firstDifferentIndex
=
newCompositions
.
();
break
;
}
if
(
i
] !=
newCompositions
i
])
{
firstDifferentIndex
=
i
;
break
;
}
}
for
(
=
.
() -
1
;
i
>=
firstDifferentIndex
;
i
--)
{
*
=
i
];
if
(
composition
->
())
{
composition
->
()->
.
(
(
composition
));
}
}
(
,
newCompositions
);
for
(
=
firstDifferentIndex
;
i
<
.
();
i
++)
{
*
=
i
];
if
(
composition
->
())
{
composition
->
()->
.
(
(
composition
));
}
}
*
=
0
;
if
(
newCompositions
.
() >
0
)
{
cursor
=
newCompositions
newCompositions
.
() -
1
]->
();
}
if
(
cursor
)
{
.
->
(
cursor
);
}
else
{
.
->
(
()->
()->
());
}
(
, &
::
);
}
void
::
()
{
}
void
::
()
{
for
(
=
.
()-
1
;
i
>=
0
;
i
--)
{
*
=
i
];
if
(
composition
->
())
{
composition
->
()->
.
(
(
composition
));
}
}
.
();
}
void
::
(
const
&
)
{
if
(
->
(
)) {
return
; }
if
(
->
(
,
)) {
return
; }
if
(
&&
->
(
)) {
return
; }
if
(
&&
->
())
{
(
,
, &
::
);
}
}
void
::
(
const
&
)
{
if
(
->
(
)) {
return
; }
if
(
&&
->
())
{
(
,
, &
::
);
}
}
void
::
(
const
&
)
{
if
(
->
(
)) {
return
; }
if
(
&&
->
())
{
(
,
, &
::
);
}
}
void
::
(
const
&
)
{
if
(
->
(
)) {
return
; }
if
(!
.
&& !
.
&&
.
==
::
&&
.
)
{
if
(
.
)
{
.
->
();
}
}
if
(
&&
->
())
{
(
,
, &
::
);
}
}
void
::
(
const
&
)
{
if
(
->
(
)) {
return
; }
if
(
->
(
)) {
return
; }
if
(
&&
->
())
{
(
,
, &
::
);
}
}
void
::
()
{
.
();
=
::
();
if
(
now
.
-
>=
)
{
=
now
.
;
if
(
&&
->
())
{
->
()->
.
(
(
));
}
}
(
false
);
}
::
(
controls
::
*
,
*
)
:controlHost(
)
{
=
new
(
);
=
new
(
);
.
=
this
;
=
new
;
->
(
::
LimitToElementAndChildren
);
->
(
);
(
nullptr
);
}
::
()
{
->
(
->
()
0
]);
(
);
delete
;
delete
;
if
(
)
{
delete
;
=
nullptr
;
}
delete
;
}
*
::
()
{
return
.
;
}
void
::
(
*
)
{
if
(
.
!=
)
{
if
(
.
)
{
()->
()->
(
this
);
.
->
(
this
);
}
if
(
)
{
->
(
this
);
()->
()->
(
this
);
->
();
->
().
();
->
(
->
(
));
=
true
;
}
(
);
}
}
*
::
()
{
return
;
}
void
::
(
bool
)
{
if
(!
&& !
)
{
return
;
}
=
false
;
if
(
.
&&
.
->
())
{
=
true
;
.
->
();
->
(
());
auto
=
.
->
();
.
->
();
=
false
;
switch
(
result
)
{
case
::
:
{
GetGuiGraphicsResourceManager
()->
(
.
);
=
true
;
}
break
;
case
::
:
{
();
=
true
;
}
break
;
default
:
{
=
true
;
auto
=
->
();
auto
=
->
();
auto
=
bounds
.
() >
preferred
.
() ?
bounds
.
() :
preferred
.
();
auto
=
bounds
.
() >
preferred
.
() ?
bounds
.
() :
preferred
.
();
->
UpdateClientSizeAfterRendering
(
preferred
.
(),
(
width
,
height
));
=
false
;
}
}
}
if
(!
)
{
{
;
(
procs
,
);
.
();
for
(
=
0
;
i
<
procs
.
();
i
++)
{
procs
i
]
);
}
}
{
;
(
procs
,
);
.
();
for
(
=
0
;
i
<
procs
.
();
i
++)
{
procs
.
()
i
]
);
}
}
}
}
void
::
()
{
=
true
;
}
void
::
(
const
<
void
()>&
,
)
{
if
(
.
==
nullptr
)
{
.
(
);
}
else
{
.
(
,
);
}
}
void
::
()
{
->
();
}
*
::
()
{
return
;
}
void
::
(
*
)
{
=
;
}
bool
::
(
*
)
{
if
(!
||
->
()!=
this
)
{
return
false
;
}
if
(
&&
->
())
{
;
arguments
.
=
;
arguments
.
=
;
->
()->
.
(
arguments
);
}
=
;
(
(
0
,
0
));
if
(
&&
->
())
{
;
arguments
.
=
;
arguments
.
=
;
->
()->
.
(
arguments
);
}
return
true
;
}
*
::
()
{
return
;
}
::
()
{
return
;
}
void
::
(
,
*
)
{
if
(
)
{
=
->
();
.
+=
bounds
.
;
.
+=
bounds
.
;
}
;
if
(
.
)
{
.
->
(
.
->
(
));
}
}
*
::
()
{
return
&
;
}
void
::
(
*
)
{
DisconnectCompositionInternal
(
);
}
}
}
}