demo: GacUI_Windows\Direct2DClock

This commit is contained in:
Zihan Chen
2018-03-21 02:59:50 -07:00
parent 8136839520
commit 29309581aa
15 changed files with 948 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Direct2DClock", "Direct2DClock\Direct2DClock.vcxproj", "{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{A9A7E9AB-319E-4AA6-B2E7-D551B28A485B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GacUILite", "..\Lib\GacUILite\GacUILite.vcxproj", "{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Debug|x64.ActiveCfg = Debug|x64
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Debug|x64.Build.0 = Debug|x64
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Debug|x86.ActiveCfg = Debug|Win32
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Debug|x86.Build.0 = Debug|Win32
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Release|x64.ActiveCfg = Release|x64
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Release|x64.Build.0 = Release|x64
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Release|x86.ActiveCfg = Release|Win32
{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}.Release|x86.Build.0 = Release|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|x64.ActiveCfg = Debug|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|x86.ActiveCfg = Debug|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|x86.Build.0 = Debug|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|x64.ActiveCfg = Release|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|x86.ActiveCfg = Release|Win32
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{96C559CA-9718-4BEC-A053-28A0AB6A8CA2} = {A9A7E9AB-319E-4AA6-B2E7-D551B28A485B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B1695089-4980-4B45-8BFD-9E55CA064276}
EndGlobalSection
EndGlobal
@@ -0,0 +1,123 @@
#define GAC_HEADER_USE_NAMESPACE
#include "AnimationControl.h"
#include <GacUIWindows.h>
namespace demo
{
struct AnimationControlMembers
{
DateTime lastUpdateTime;
ComPtr<ID2D1SolidColorBrush> borderBrush;
ComPtr<ID2D1SolidColorBrush> hourBrush;
ComPtr<ID2D1SolidColorBrush> minuteBrush;
ComPtr<ID2D1SolidColorBrush> secondBrush;
};
void AnimationControl::GlobalTimer()
{
auto time = DateTime::LocalTime();
if (time.totalMilliseconds - members->lastUpdateTime.totalMilliseconds >= 100)
{
members->lastUpdateTime = time;
if (auto renderer = element->GetRenderer())
{
this->GetRelatedControlHost()->GetGraphicsHost()->RequestRender();
}
}
}
void AnimationControl::OnBeforeRenderTargetChanged(GuiGraphicsComposition* sender, D2DEventArgs& arguments)
{
members->borderBrush = nullptr;
members->hourBrush = nullptr;
members->minuteBrush = nullptr;
members->secondBrush = nullptr;
}
void AnimationControl::OnAfterRenderTargetChanged(GuiGraphicsComposition* sender, D2DEventArgs& arguments)
{
if (!arguments.rt) return;
{
ID2D1SolidColorBrush* brush = nullptr;
arguments.rt->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 1.0f), &brush);
members->borderBrush = brush;
}
{
ID2D1SolidColorBrush* brush = nullptr;
arguments.rt->CreateSolidColorBrush(D2D1::ColorF(0.0f, 1.0f, 1.0f), &brush);
members->hourBrush = brush;
}
{
ID2D1SolidColorBrush* brush = nullptr;
arguments.rt->CreateSolidColorBrush(D2D1::ColorF(0.0f, 1.0f, 0.0f), &brush);
members->minuteBrush = brush;
}
{
ID2D1SolidColorBrush* brush = nullptr;
arguments.rt->CreateSolidColorBrush(D2D1::ColorF(1.0f, 1.0f, 0.0f), &brush);
members->secondBrush = brush;
}
}
void AnimationControl::OnRendering(GuiGraphicsComposition* sender, D2DEventArgs& arguments)
{
auto rt = arguments.rt;
if (!rt) return;
vint cx = arguments.bounds.Left() + arguments.bounds.Width() / 2;
vint cy = arguments.bounds.Top() + arguments.bounds.Height() / 2;
rt->DrawEllipse(D2D1::Ellipse(D2D1::Point2F(cx, cy), 160, 160), members->borderBrush.Obj());
for (vint i = 0; i < 12; i++)
{
auto s = sin(i * 3.14 / 6);
auto c = cos(i * 3.14 / 6);
rt->DrawLine(D2D1::Point2F(cx + c * 150, cy + s * 150), D2D1::Point2F(cx + c * 160, cy + s * 160), members->borderBrush.Obj());
}
auto time = DateTime::LocalTime();
{
auto d = ((time.hour + time.minute / 60.f + time.second / 3600.f) / 6.f - 0.5) * 3.14;
auto s = sin(d);
auto c = cos(d);
rt->DrawLine(D2D1::Point2F(cx, cy), D2D1::Point2F(cx + c * 90, cy + s * 90), members->hourBrush.Obj());
}
{
auto d = ((time.minute + time.second / 60.f) / 30.f - 0.5) * 3.14;
auto s = sin(d);
auto c = cos(d);
rt->DrawLine(D2D1::Point2F(cx, cy), D2D1::Point2F(cx + c * 110, cy + s * 110), members->minuteBrush.Obj());
}
{
auto d = (time.second / 30.f - 0.5) * 3.14;
auto s = sin(d);
auto c = cos(d);
rt->DrawLine(D2D1::Point2F(cx, cy), D2D1::Point2F(cx + c * 130, cy + s * 130), members->secondBrush.Obj());
}
}
AnimationControl::AnimationControl()
:GuiControl(theme::ThemeName::CustomControl)
, members(MakePtr<AnimationControlMembers>())
{
element = D2DElement::Create();
element->BeforeRenderTargetChanged.AttachMethod(this, &AnimationControl::OnBeforeRenderTargetChanged);
element->AfterRenderTargetChanged.AttachMethod(this, &AnimationControl::OnAfterRenderTargetChanged);
element->Rendering.AttachMethod(this, &AnimationControl::OnRendering);
{
auto bounds = new GuiBoundsComposition();
bounds->SetAlignmentToParent(Margin(0, 0, 0, 0));
bounds->SetOwnedElement(element);
GetContainerComposition()->AddChild(bounds);
}
members->lastUpdateTime = DateTime::LocalTime();
GetCurrentController()->CallbackService()->InstallListener(this);
}
AnimationControl::~AnimationControl()
{
GetCurrentController()->CallbackService()->UninstallListener(this);
}
}
@@ -0,0 +1,41 @@
#pragma once
#include <GacUI.h>
namespace vl
{
namespace presentation
{
namespace elements
{
struct GuiDirect2DElementEventArgs;
class GuiDirect2DElement;
}
}
}
namespace demo
{
struct AnimationControlMembers;
class AnimationControl
: public vl::presentation::controls::GuiControl
, protected vl::presentation::INativeControllerListener
{
using D2DElement = vl::presentation::elements::GuiDirect2DElement;
using D2DEventArgs = vl::presentation::elements::GuiDirect2DElementEventArgs;
using GuiGraphicsComposition = vl::presentation::compositions::GuiGraphicsComposition;
protected:
vl::Ptr<AnimationControlMembers> members;
D2DElement* element;
void GlobalTimer()override;
void OnBeforeRenderTargetChanged(GuiGraphicsComposition* sender, D2DEventArgs& arguments);
void OnAfterRenderTargetChanged(GuiGraphicsComposition* sender, D2DEventArgs& arguments);
void OnRendering(GuiGraphicsComposition* sender, D2DEventArgs& arguments);
public:
AnimationControl();
~AnimationControl();
};
}
@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AnimationControl.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
<ClCompile Include="UI\Source\MainWindow.cpp" />
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AnimationControl.h" />
<ClInclude Include="UI\Source\Demo.h" />
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
<ClInclude Include="UI\Source\MainWindow.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\GacUILite\GacUILite.vcxproj">
<Project>{96c559ca-9718-4bec-a053-28a0ab6a8ca2}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{9EB0726A-AA9E-4372-81F0-68AD18E82CCB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Direct2DClock</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);VCZH_DEBUG_NO_REFLECTION</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions);VCZH_DEBUG_NO_REFLECTION</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);VCZH_DEBUG_NO_REFLECTION</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions);VCZH_DEBUG_NO_REFLECTION</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="UI">
<UniqueIdentifier>{c45e71ee-e33d-4003-8481-8914536da541}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UI\Source\MainWindow.cpp">
<Filter>UI</Filter>
</ClCompile>
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
<Filter>UI</Filter>
</ClCompile>
<ClCompile Include="AnimationControl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml">
<Filter>Resource Files</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\DemoPartialClasses.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\MainWindow.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\Demo.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="AnimationControl.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -0,0 +1,19 @@
#define GAC_HEADER_USE_NAMESPACE
#include "UI/Source/Demo.h"
using namespace vl::collections;
using namespace vl::stream;
using namespace vl::reflection::description;
using namespace demo;
void GuiMain()
{
{
FileStream fileStream(L"../UIRes/Direct2DClock.bin", FileStream::ReadOnly);
auto resource = GuiResource::LoadPrecompiledBinary(fileStream);
GetResourceManager()->SetResource(L"Resource", resource);
}
MainWindow window;
window.MoveToScreenCenter();
GetApplication()->Run(&window);
}
@@ -0,0 +1,33 @@
<Resource>
<Folder name="GacGenConfig">
<Folder name="Cpp">
<Text name="SourceFolder">Source</Text>
<Text name="Resource">..\..\UIRes\Direct2DClock.bin</Text>
<Text name="NormalInclude">../../AnimationControl.h</Text>
<Text name="ReflectionInclude">GacUIReflection.h</Text>
<Text name="Name">Demo</Text>
</Folder>
</Folder>
<Instance name="MainWindowResource">
<Instance ref.CodeBehind="true" ref.Class="demo::MainWindow">
<ref.Members>
<![CDATA[
@cpp:UserImpl
@cpp:Private
func InstallAnimationControl(): void {}
]]>
</ref.Members>
<ref.Ctor>
<![CDATA[
{
self.InstallAnimationControl();
}
]]>
</ref.Ctor>
<Window ref.Name="self" Text="Direct2DClock" ClientSize="x:800 y:600">
<Bounds ref.Name="animationBounds" PreferredMinSize="x:400 y:400" AlignmentToParent="left:5 top:5 right:-1 bottom:-1"/>
</Window>
</Instance>
</Instance>
</Resource>
@@ -0,0 +1,16 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMO
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMO
#include "DemoPartialClasses.h"
#include "MainWindow.h"
#endif
@@ -0,0 +1,101 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#include "Demo.h"
/* CodePack:BeginIgnore() */
#ifndef VCZH_DEBUG_NO_REFLECTION
/* CodePack:ConditionOff(VCZH_DEBUG_NO_REFLECTION, DemoReflection.h) */
#include "DemoReflection.h"
#endif
/* CodePack:EndIgnore() */
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
#define GLOBAL_SYMBOL ::vl_workflow_global::Demo::
#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance().
#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance()
#define USERIMPL(...)
/***********************************************************************
Global Variables
***********************************************************************/
BEGIN_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)
vl_workflow_global::Demo instance;
INITIALIZE_GLOBAL_STORAGE_CLASS
FINALIZE_GLOBAL_STORAGE_CLASS
END_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)
namespace vl_workflow_global
{
/***********************************************************************
Global Functions
***********************************************************************/
Demo& Demo::Instance()
{
return Getvl_workflow_global_Demo().instance;
}
}
/***********************************************************************
Class (::demo::MainWindowConstructor)
***********************************************************************/
namespace demo
{
void MainWindowConstructor::__vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_)
{
(this->self = __vwsn_this_);
{
::vl::__vwsn::This(this->self)->SetClientSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(800); __vwsn_temp__.y = static_cast<::vl::vint>(600); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(this->self)->SetText(::vl::WString(L"Direct2DClock", false));
}
(this->animationBounds = new ::vl::presentation::compositions::GuiBoundsComposition());
{
::vl::__vwsn::This(this->animationBounds)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(this->animationBounds)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(400); __vwsn_temp__.y = static_cast<::vl::vint>(400); return __vwsn_temp__; }());
}
{
::vl::__vwsn::This(::vl::__vwsn::This(this->self)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->animationBounds));
}
}
MainWindowConstructor::MainWindowConstructor()
: self(static_cast<::demo::MainWindow*>(nullptr))
, animationBounds(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
{
}
}
#undef GLOBAL_SYMBOL
#undef GLOBAL_NAME
#undef GLOBAL_OBJ
#undef USERIMPL
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
@@ -0,0 +1,67 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES
#include "../../AnimationControl.h"
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
namespace demo
{
class MainWindowConstructor;
class MainWindow;
class MainWindowConstructor : public ::vl::Object, public ::vl::reflection::Description<MainWindowConstructor>
{
#ifndef VCZH_DEBUG_NO_REFLECTION
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MainWindowConstructor>;
#endif
protected:
::demo::MainWindow* self;
::vl::presentation::compositions::GuiBoundsComposition* animationBounds;
void __vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_);
public:
MainWindowConstructor();
};
}
/***********************************************************************
Global Variables and Functions
***********************************************************************/
namespace vl_workflow_global
{
class Demo
{
public:
static Demo& Instance();
};
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
@@ -0,0 +1,87 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#include "DemoReflection.h"
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
/***********************************************************************
Reflection
***********************************************************************/
namespace vl
{
namespace reflection
{
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
IMPL_CPP_TYPE_INFO(demo::MainWindow)
IMPL_CPP_TYPE_INFO(demo::MainWindowConstructor)
#define _ ,
BEGIN_CLASS_MEMBER(::demo::MainWindow)
CLASS_MEMBER_CONSTRUCTOR(::demo::MainWindow*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(InstallAnimationControl, NO_PARAMETER)
END_CLASS_MEMBER(::demo::MainWindow)
BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::MainWindowConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(animationBounds)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::demo::MainWindowConstructor)
#undef _
class DemoTypeLoader : public Object, public ITypeLoader
{
public:
void Load(ITypeManager* manager)
{
ADD_TYPE_INFO(::demo::MainWindow)
ADD_TYPE_INFO(::demo::MainWindowConstructor)
}
void Unload(ITypeManager* manager)
{
}
};
#endif
bool LoadDemoTypes()
{
#ifndef VCZH_DEBUG_NO_REFLECTION
if (auto manager = GetGlobalTypeManager())
{
return manager->AddTypeLoader(MakePtr<DemoTypeLoader>());
}
#endif
return false;
}
}
}
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
@@ -0,0 +1,57 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOREFLECTION
#include "Demo.h"
#ifndef VCZH_DEBUG_NO_REFLECTION
#include "GacUIReflection.h"
#endif
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
/***********************************************************************
Reflection
***********************************************************************/
namespace vl
{
namespace reflection
{
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
DECL_TYPE_INFO(::demo::MainWindow)
DECL_TYPE_INFO(::demo::MainWindowConstructor)
#endif
extern bool LoadDemoTypes();
}
}
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
@@ -0,0 +1,80 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#include "Demo.h"
/* CodePack:BeginIgnore() */
#ifndef VCZH_DEBUG_NO_REFLECTION
/* CodePack:ConditionOff(VCZH_DEBUG_NO_REFLECTION, DemoReflection.h) */
#include "DemoReflection.h"
#endif
/* CodePack:EndIgnore() */
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
#define GLOBAL_SYMBOL ::vl_workflow_global::Demo::
#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance().
#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance()
#define USERIMPL(...)
/***********************************************************************
Class (::demo::MainWindow)
***********************************************************************/
namespace demo
{
USERIMPL(/* ::demo::MainWindow */)
void MainWindow::InstallAnimationControl()
{
auto animationControl = new AnimationControl;
animationControl->GetBoundsComposition()->SetAlignmentToParent(vl::presentation::Margin(0, 0, 0, 0));
animationBounds->AddChild(animationControl->GetBoundsComposition());
}
MainWindow::MainWindow()
: ::vl::presentation::controls::GuiWindow(::vl::presentation::theme::ThemeName::Window)
{
auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::MainWindow", false));
auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
::vl::__vwsn::This(this)->SetResourceResolver(__vwsn_resolver_);
::vl::__vwsn::This(this)->__vwsn_initialize_instance_(this);
this->__vwsn_instance_ctor_();
}
void MainWindow::__vwsn_instance_ctor_()
{
::vl::__vwsn::This(this->self)->InstallAnimationControl();
}
MainWindow::~MainWindow()
{
this->FinalizeInstanceRecursively(static_cast<::vl::presentation::controls::GuiControlHost*>(this));
}
}
#undef GLOBAL_SYMBOL
#undef GLOBAL_NAME
#undef GLOBAL_OBJ
#undef USERIMPL
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
@@ -0,0 +1,51 @@
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW
#define VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW
#include "DemoPartialClasses.h"
#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses-equality"
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#endif
namespace demo
{
class MainWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::MainWindowConstructor, public ::vl::reflection::Description<MainWindow>
{
friend class ::demo::MainWindowConstructor;
#ifndef VCZH_DEBUG_NO_REFLECTION
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MainWindow>;
#endif
private:
void InstallAnimationControl();
public:
MainWindow();
void __vwsn_instance_ctor_();
~MainWindow();
};
}
#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__clang__)
#pragma clang diagnostic pop
#endif
#endif
Binary file not shown.