#include "WinGDIApplication.h"
#include "..\..\..\GraphicsElement\WindowsGDI\GuiGraphicsWindowsGDI.h"
#include <ShellScalingApi.h>
#include "..\ServicesImpl\WindowsCallbackService.h"
namespace
{
namespace
{
namespace
{
using
namespace
vl
::
collections
;
class
GdiWindowsNativeWindowListener
:
public
,
public
{
protected
:
<
>
;
*
;
bool
=
false
;
(
,
,
,
)
{
if
(
<
||
>
)
{
return
;
}
else
{
return
;
}
}
()
{
=
->
();
(
nativeWindowSize
.
.
,
nativeWindowSize
.
.
);
(
windowSize
.
*
5
/
4
,
windowSize
.
*
5
/
4
);
(
windowSize
.
*
3
/
2
,
windowSize
.
*
3
/
2
);
=
?
(
(),
()) :
(
0
,
0
);
=
(
windowSize
.
,
minBounds
.
,
maxBounds
.
,
currentSize
.
);
=
(
windowSize
.
,
minBounds
.
,
maxBounds
.
,
currentSize
.
);
return
(
newWidth
,
newHeight
);
}
void
(
)
{
if
(
.
256
)
.
256
;
if
(
.
256
)
.
256
;
if
(
)
{
if
(
() !=
.
.
||
() !=
.
.
)
{
0
;
=
true
;
}
}
if
(!
)
{
new
(
.
.
,
.
.
,
::
,
true
);
()->
(
true
);
}
}
public
:
GdiWindowsNativeWindowListener
(
*
)
:window(
)
{
}
void
()
{
(
());
}
void
()
{
if
(
)
{
=
false
;
auto
=
()->
();
dynamic_cast
<
*>(
callbackService
)->
();
}
*
=
(
);
(
form
->
());
controlDC
.
(
0
,
0
,
);
}
*
()
{
if
(!
)
();
return
();
}
};
class
GdiWindowsNativeControllerListener
:
public
,
public
INativeControllerListener
{
public
:
<
*,
<
GdiWindowsNativeWindowListener
>>
;
~
GdiWindowsNativeControllerListener
()
{
for
(
=
0
;
i
<
.
();
i
++)
{
auto
=
.
()
i
];
auto
=
.
()
i
];
window
->
(
listener
.
());
}
}
void
(
*
)
{
<
GdiWindowsNativeWindowListener
>
=
new
GdiWindowsNativeWindowListener
(
);
->
(
listener
.
());
.
(
,
listener
);
}
void
(
*
)
{
<
GdiWindowsNativeWindowListener
>
=
];
.
(
);
->
(
listener
.
());
}
};
GdiWindowsNativeControllerListener
*
=
0
;
*
(
*
)
{
=
gdiListener
->
.
().
(
);
return
index
==-
1
?
0
:
gdiListener
->
.
().
(
index
)
();
}
(
*
)
{
*
=
(
);
return dc?dc->GetHandle():NULL;
}
}
namespace
{
class
WinGDIApplicationGDIObjectProvider
:
public
IWindowsGDIObjectProvider
{
protected
:
*
;
public
:
WinGDIApplicationGDIObjectProvider
()
:mLangFontLink(
0
)
{
CoCreateInstance(CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, IID_IMLangFontLink2, (void**)&mLangFontLink);
(
CLSID_CMultiLanguage
,
0
,
,
IID_IMLangFontLink2
, (
void
**)&
);
}
~
WinGDIApplicationGDIObjectProvider
()
{
->
();
}
windows
::
*
(
*
)
override
{
return
vl
::
presentation
::
windows
::
(
);
}
*
(
*
)
override
{
return
dynamic_cast
<
*>(
vl
::
presentation
::
windows
::
(
)->
());
}
void
(
*
,
*
)
override
{
vl
::
presentation
::
windows
::
(
)->
(
);
}
*
()
override
{
return
vl
::
presentation
::
windows
::
();
}
*
(
*
)
override
{
return
vl
::
presentation
::
windows
::
(
);
}
*
()
override
{
return
;
}
};
}
}
}
using
namespace
vl
;
using
namespace
vl
::
presentation
;
using
namespace
vl
::
presentation
::
windows
;
using
namespace
vl
::
presentation
::
elements_windows_gdi
;
int
(
,
void
(*
)())
{
EnableCrossKernelCrashing
();
*
=
CreateWindowsNativeController
(
);
(
controller
);
{
GdiWindowsNativeControllerListener
;
controller
->
()->
(&
listener
);
gdiListener
=&
listener
;
();
gdiListener
=
0
;
controller
->
()->
(&
listener
);
}
DestroyWindowsNativeController
(
controller
);
return
0
;
}
int
()
{
(
false
);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
HINSTANCE hInstance=(HINSTANCE)GetModuleHandle(NULL);
WinGDIApplicationGDIObjectProvider
;
SetWindowsGDIObjectProvider
(&
objectProvider
);
return
(
hInstance
, &
);
}