#include "GuiInstanceLoader_WorkflowCodegen.h"
namespace
{
namespace
{
using
namespace
workflow
;
using
namespace
collections
;
using
namespace
reflection
::
description
;
class
WorkflowGenerateBindingVisitor
:
public
,
public
::
{
public
:
GuiResourcePrecompileContext
&
;
types
::
&
;
<
>
;
::
&
;
WorkflowGenerateBindingVisitor
(
GuiResourcePrecompileContext
&
,
types
::
&
,
<
>
,
::
&
)
:precompileContext(
)
, resolvingResult(
)
, errors(
)
, statements(
)
{
}
<
>
(
*
,
::
,
<
::
>
,
)
{
if
(
auto
=
()->
(
))
{
auto
=
.
0
].
()];
if
(
propertyResolving
.
==
::
)
{
=
0
].
<
>()
text
;
auto
=
.
()->
(
.
(),
true
);
if
(
instancePropertyInfo
|| !
binder
->
())
{
if
(
auto
=
binder
->
(
,
,
->
,
instancePropertyInfo
,
propertyResolving
.
,
propertyResolving
.
,
propertyResolving
.
,
expressionCode
,
0
]
,
))
{
return
statement
;
}
}
else
{
.
(
({
.
},
,
L"Precompile: Binder \""
+
.
() +
L"\" requires property \""
+
.
() +
L"\" to physically appear in type \""
+
.
.
() +
L"\"."
));
}
}
}
else
{
.
(
({
.
},
,
L"[INTERNAL-ERROR] Precompile: The appropriate IGuiInstanceBinder of binding \"-"
+
.
() +
L"\" cannot be found."
));
}
return
nullptr
;
}
<
>
(
*
,
::
,
<
::
>
,
)
{
auto
=
.
();
auto
=
td
->
(
.
(),
true
);
if
(!
eventInfo
)
{
.
(
({
.
},
,
L"[INTERNAL-ERROR] Precompile: Event \""
+
.
() +
L"\" cannot be found in type \""
+
.
.
() +
L"\"."
));
}
else
{
if
(
==
::
)
{
return
(
,
,
->
,
eventInfo
,
);
}
else
{
auto
=
()->
(
);
if
(
binder
)
{
return
binder
->
(
,
,
->
,
eventInfo
,
,
,
);
}
else
{
.
(
({
.
},
,
L"[INTERNAL-ERROR] The appropriate IGuiInstanceEventBinder of binding \"-"
+
.
() +
L"\" cannot be found."
));
}
}
}
return
nullptr
;
}
void
(
*
)
override
{
}
void
(
*
)
override
{
::
;
if
(
->
!=
::
)
{
reprTypeInfo
.
->
];
}
if
(
reprTypeInfo
.
&& (
reprTypeInfo
.
()->
()
::
) !=
::
)
{
WORKFLOW_ENVIRONMENT_VARIABLE_ADD
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
envVar
);
index
++) {
auto
=
->
.
()
index
];
.
.
(
envVar
,
value
); }
FOREACH_INDEXER(Ptr<GuiAttSetterRepr::SetterValue>, setter, index, repr->setters.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
::
>>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
::
>
;
__foreach_iterator__
.
(
setter
);
index
++)
{
auto
=
->
.
()
index
];
if
(
setter
!=
::
&&
setter
!=
::
)
{
if
(
auto
=
(
,
reprTypeInfo
,
setter
,
propertyName
))
{
Workflow_RecordScriptPosition
(
,
setter
0
]
,
statement
);
.
(
statement
);
}
}
else
{
FOREACH(Ptr<GuiValueRepr>, value, setter->values)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
setter
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
value
);)
{
value
(
this
);
}
}
}
FOREACH_INDEXER(Ptr<GuiAttSetterRepr::EventValue>, handler, index, repr->eventHandlers.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
::
>>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
::
>
;
__foreach_iterator__
.
(
handler
);
index
++)
{
if
(
reprTypeInfo
.
)
{
=
->
.
()
index
];
if
(
auto
=
(
,
reprTypeInfo
,
handler
,
propertyName
))
{
Workflow_RecordScriptPosition
(
,
handler
,
statement
);
.
(
statement
);
}
}
}
WORKFLOW_ENVIRONMENT_VARIABLE_REMOVE
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
->
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
envVar
);
index
++) {
auto
=
->
.
()
index
];
.
.
(
envVar
,
value
.
()); }
}
}
void
(
*
)
override
{
((
*)
);
}
};
void
Workflow_GenerateBindings
(
GuiResourcePrecompileContext
&
,
types
::
&
,
<
>
,
::
&
)
{
WorkflowGenerateBindingVisitor
(
,
,
,
);
.
(&
visitor
);
FOREACH(Ptr<GuiInstanceLocalized>, localized, resolvingResult.context->localizeds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
localized
);)
{
auto
=
L"bind("
+
localized
.
() +
L"::Get(presentation::controls::GuiApplication::GetApplication().Locale))"
;
if
(
auto
=
(
, {
.
},
code
,
localized
,
))
{
auto
=
.
.
()->
(
localized
.
(),
true
);
if
(
auto
=
Workflow_InstallBindProperty
(
,
,
.
,
instancePropertyInfo
,
bindExpr
))
{
Workflow_RecordScriptPosition
(
,
localized
,
statement
);
.
(
statement
);
}
}
}
}
}
}