#include "GuiControlShared.h"
#include "../GuiWindowControls.h"
#include "../../GraphicsHost/GuiGraphicsHost.h"
namespace
{
namespace
{
namespace
{
using
namespace
reflection
::
description
;
using
namespace
compositions
;
::
()
{
}
::
()
{
}
void
::
(
*
)
{
}
void
::
(
*
)
{
}
class
:
public
,
public
IGuiGraphicsTimerCallback
{
public
:
*
;
*
;
bool
=
true
;
(
*
,
*
)
:rootObject(
)
, controlHost(
)
{
}
bool
()
override
{
if
(
)
{
for
(
=
->
.
() -
1
;
i
>=
0
;
i
--)
{
auto
=
->
i
];
animation
();
if
(
animation
())
{
->
.
(
i
);
}
}
if
(
->
.
() ==
0
)
{
->
(
nullptr
);
return
false
;
}
}
return
;
}
};
void
::
(
controls
::
*
)
{
if
(!
)
{
new
(
this
,
);
->
()->
(
);
}
}
bool
::
(
controls
::
*
)
{
if
(
&&
!=
)
{
=
false
;
nullptr
;
return
true
;
}
return
false
;
}
void
::
OnControlHostForInstanceChanged
()
{
auto
=
GetControlHostForInstance
();
if
(
(
controlHost
))
{
FOREACH(Ptr<IGuiAnimation>, animation, runningAnimations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
animation
);)
{
animation
();
}
}
if
(
controlHost
)
{
(
controlHost
);
FOREACH(Ptr<IGuiAnimation>, animation, runningAnimations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
animation
);)
{
animation
();
}
();
}
}
void
::
()
{
FOREACH(Ptr<IGuiAnimation>, animation, pendingAnimations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
animation
);)
{
animation
();
}
(
,
,
true
);
.
();
}
::
()
{
}
::
()
{
(
nullptr
);
}
void
::
()
{
if
(!
)
{
=
true
;
FOREACH(Ptr<IValueSubscription>, subscription, subscriptions)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
subscription
);)
{
subscription
();
}
FOREACH(GuiComponent*, component, components)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
component
);)
{
component
->
(
this
);
}
.
();
for
(
=
0
;
i
<
.
();
i
++)
{
delete
i
];
}
.
();
}
}
bool
::
()
{
return
;
}
void
::
FinalizeInstanceRecursively
(
templates
::
*
)
{
if
(!
)
{
(
);
}
}
void
::
FinalizeInstanceRecursively
(
*
)
{
if
(!
)
{
(
);
}
}
void
::
FinalizeInstanceRecursively
(
*
)
{
if
(!
)
{
(
);
}
}
void
::
(
*
)
{
}
void
::
(
<
>
)
{
;
}
<
>
::
(
const
&
,
const
&
,
bool
)
{
<
>
;
if
(
)
{
object
(
,
);
}
if
(
&& !
object
)
{
throw
(
L"Resource \""
+
+
L"://"
+
+
L"\" does not exist."
);
}
return
object
;
}
<
description
::
>
::
(
<
description
::
>
)
{
CHECK_ERROR(finalized == false, L"GuiInstanceRootObject::AddSubscription(Ptr<IValueSubscription>)#Cannot add subscription after finalizing.");
do
{
if
(!(
==
false
))
throw
(
L"GuiInstanceRootObject::AddSubscription(Ptr<IValueSubscription>)#Cannot add subscription after finalizing."
);}
while
(
0
);
if
(
.
(
.
()))
{
return
nullptr
;
}
else
{
.
(
);
();
();
return
;
}
}
void
::
()
{
FOREACH(Ptr<IValueSubscription>, subscription, subscriptions)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
subscription
);)
{
subscription
();
}
}
bool
::
(
*
)
{
CHECK_ERROR(finalized == false, L"GuiInstanceRootObject::AddComponent(GuiComponent*)#Cannot add component after finalizing.");
do
{
if
(!(
==
false
))
throw
(
L"GuiInstanceRootObject::AddComponent(GuiComponent*)#Cannot add component after finalizing."
);}
while
(
0
);
if
(
.
(
))
{
return
false
;
}
else
{
.
(
);
->
(
this
);
return
true
;
}
}
bool
::
(
*
)
{
return
(
new
<
>(
));
}
bool
::
(
<
>
)
{
CHECK_ERROR(finalized == false, L"GuiInstanceRootObject::AddAnimation(Ptr<IGuiAnimation>)#Cannot add animation after finalizing.");
do
{
if
(!(
==
false
))
throw
(
L"GuiInstanceRootObject::AddAnimation(Ptr<IGuiAnimation>)#Cannot add animation after finalizing."
);}
while
(
0
);
if
(
.
(
.
()) ||
.
(
.
()))
{
return
false
;
}
else
{
.
(
);
if
(
auto
=
GetControlHostForInstance
())
{
(
controlHost
);
();
}
return
true
;
}
}
bool
::
(
<
>
)
{
if
(!
)
return
false
;
if
(
.
(
.
()))
{
.
(
.
());
return
true
;
}
if
(
.
(
.
()))
{
.
(
.
());
return
true
;
}
return
false
;
}
}
}
}