#include "GuiToolstripCommand.h"
#include "../GuiApplication.h"
#include "../../GraphicsHost/GuiGraphicsHost_ShortcutKey.h"
#include "../../Resources/GuiParserManager.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
compositions
;
using
namespace
regex
;
using
namespace
parsing
;
void
::
(
compositions
::
*
,
compositions
::
&
)
{
.
(
,
);
}
void
::
(
compositions
::
*
,
compositions
::
&
)
{
();
}
void
::
()
{
;
.
(
arguments
);
}
void
::
(
compositions
::
*
,
<
>
)
{
if
(
!=
)
{
if
(
)
{
->
.
(
shortcutKeyItemExecutedHandler
);
if
(
)
{
auto
=
dynamic_cast
<
*>(
->
());
if
(
manager
)
{
manager
->
(
,
,
,
);
}
}
}
=
nullptr
;
shortcutKeyItemExecutedHandler
nullptr
;
?
:
nullptr
;
if
(
)
{
=
;
shortcutKeyItemExecutedHandler
->
.
(
this
, &
::
OnShortcutKeyItemExecuted
);
}
();
}
}
void
::
(
const
&
)
{
<
<
>>
;
if
(
auto
=
()->
<
>(
L"SHORTCUT"
))
{
if
(
<
>
=
parser
->ParseInternal(
,
errors
))
{
if
(
)
{
if
(!
->
())
{
->
(
new
);
}
if
(
auto
=
dynamic_cast
<
*>(
->
()))
{
*
=
manager
->
(
builder
,
builder
,
builder
,
builder
);
if
(!
item
)
{
item
=
manager
->
(
builder
,
builder
,
builder
,
builder
);
if
(
item
)
{
(
item
,
builder
);
}
}
}
}
else
{
builder
;
}
}
}
}
void
::
()
{
*
=
nullptr
;
if
(
auto
=
dynamic_cast
<
*>(
))
{
host
=
control
->
();
}
else
if
(
auto
=
dynamic_cast
<
*>(
))
{
host
=
composition
->
();
}
if
(
!=
host
)
{
if
(
)
{
(
nullptr
,
nullptr
);
=
nullptr
;
}
=
host
;
if
(
&& !
)
{
(
);
}
}
}
::
()
{
}
::
()
{
}
void
::
(
*
)
{
*
=
nullptr
;
if
(
!=
)
{
if
(
)
{
if
(
auto
=
dynamic_cast
<
*>(
))
{
control
->
.
(
renderTargetChangedHandler
);
}
else
if
(
auto
=
dynamic_cast
<
*>(
))
{
composition
->
()->
.
(
renderTargetChangedHandler
);
}
renderTargetChangedHandler
nullptr
;
}
=
;
if
(
)
{
if
(
auto
=
dynamic_cast
<
*>(
))
{
renderTargetChangedHandler
control
->
.
(
[=](
*
,
GuiControlSignalEventArgs
&
)
{
(
sender
,
arguments
);
});
}
else
if
(
auto
=
dynamic_cast
<
*>(
))
{
renderTargetChangedHandler
composition
->
()->
.
(
this
, &
::
);
}
}
();
}
}
void
::
(
*
)
{
(
nullptr
);
}
<
>
::
()
{
return
;
}
void
::
(
<
>
)
{
if
(
)
{
;
();
}
}
<
>
::
()
{
return
;
}
void
::
(
<
>
)
{
if
(
)
{
;
();
}
}
const
&
::
()
{
return
;
}
void
::
(
const
&
)
{
if
(
!=
)
{
;
();
}
}
compositions
::
*
::
()
{
return
;
}
void
::
(
compositions
::
*
)
{
(
,
0
);
}
::
()
{
return
?
:
L""
;
}
void
::
(
const
&
)
{
(
);
}
bool
::
()
{
return
;
}
void
::
(
bool
)
{
if
(
!=
)
{
=
;
();
}
}
bool
::
()
{
return
;
}
void
::
(
bool
)
{
if
(
!=
)
{
=
;
();
}
}
class
:
public
,
public
<
::
>
{
typedef
::
;
public
:
;
()
:regexShortcut(
L"((<ctrl>Ctrl)/+|(<shift>Shift)/+|(<alt>Alt)/+)*(<key>/.+)"
)
{
}
<
>
(
const
&
,
collections
::
<
<
>>&
)
override
{
<
>
=
.
(
);
if
(
match
&&
match
().
() !=
.
())
{
.
(
new
(
L"Failed to parse a shortcut \""
+
+
L"\"."
));
return
0
;
}
<
>
=
new
;
builder
;
builder
=
match
().
(
L"ctrl"
);
builder
=
match
().
(
L"shift"
);
builder
=
match
().
(
L"alt"
);
=
match
()[
L"key"
][
0
].
();
builder
=
()->
()->
(
name
);
return
builder
::
?
nullptr
:
builder
;
}
};
class
:
public
,
public
{
public
:
GUI_PLUGIN_NAME(GacUI_Compiler_ShortcutParser)
vl
::
()
override
{
return
L"GacUI_Compiler_ShortcutParser"
; }
void
(
vl
::
collections
::
<
>&
)
override
{
GUI_PLUGIN_DEPEND(GacUI_Parser);
}
void
()
override
{
*
=
();
manager
->
(
L"SHORTCUT"
,
new
GuiToolstripCommandShortcutParser
);
}
void
()
override
{
}
};
GUI_REGISTER_PLUGIN(GuiToolstripCommandPlugin)
class
{
public
:
() {
vl
::
presentation
::
controls
::
()->
(
new
GuiToolstripCommandPlugin
); } }
;
}
}
}