├── .gitattributes
├── .gitignore
├── CanvasLayoutDemo
├── CanvasLayoutDemo.vcxproj
├── CanvasLayoutDemo.vcxproj.filters
└── Main.cpp
├── DirectUI.sln
├── DirectUI
├── Application.cpp
├── Application.h
├── Brushes.cpp
├── Brushes.h
├── Buttons.cpp
├── Buttons.h
├── Colors.cpp
├── Colors.h
├── Core.cpp
├── Core.h
├── CoreUI.cpp
├── CoreUI.h
├── DirectUI.h
├── DirectUI.vcxproj
├── DirectUI.vcxproj.filters
├── Layout.cpp
├── Layout.h
├── ReadMe.txt
├── Shapes.cpp
├── Shapes.h
├── Text.cpp
├── Text.h
├── Window.cpp
├── Window.h
├── debug.h
├── dx.h
├── handle.h
├── pch.cpp
└── pch.h
├── HelloWorld
├── HelloWorld.cpp
├── HelloWorld.h
├── HelloWorld.ico
├── HelloWorld.vcxproj
├── HelloWorld.vcxproj.filters
├── small.ico
├── stdafx.cpp
├── stdafx.h
└── targetver.h
├── HitTesting
├── HitTesting.vcxproj
├── HitTesting.vcxproj.filters
└── Main.cpp
├── LICENSE
├── README.md
├── SimpleDataBinding
├── Main.cpp
├── SimpleDataBinding.vcxproj
└── SimpleDataBinding.vcxproj.filters
└── TextDemo
├── Main.cpp
├── TextDemo.vcxproj
└── TextDemo.vcxproj.filters
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/CanvasLayoutDemo/CanvasLayoutDemo.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}
24 | Win32Proj
25 | CanvasLayoutDemo
26 | 10.0.17763.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v141
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v141
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v141
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v141
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 |
76 |
77 | true
78 |
79 |
80 | false
81 |
82 |
83 | false
84 |
85 |
86 |
87 |
88 |
89 | Level3
90 | Disabled
91 | _DEBUG;_WINDOWS;%(PreprocessorDefinitions)
92 |
93 |
94 | Windows
95 |
96 |
97 |
98 |
99 |
100 |
101 | Level3
102 | Disabled
103 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
104 |
105 |
106 | Windows
107 |
108 |
109 |
110 |
111 | Level3
112 |
113 |
114 | MaxSpeed
115 | true
116 | true
117 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
118 |
119 |
120 | Windows
121 | true
122 | true
123 |
124 |
125 |
126 |
127 | Level3
128 |
129 |
130 | MaxSpeed
131 | true
132 | true
133 | NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
134 |
135 |
136 | Windows
137 | true
138 | true
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 | {42fbcd14-632d-48e5-828a-19278be94184}
147 |
148 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/CanvasLayoutDemo/CanvasLayoutDemo.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CanvasLayoutDemo/Main.cpp:
--------------------------------------------------------------------------------
1 | #include "..\DirectUI\DirectUI.h"
2 |
3 | using namespace DirectUI;
4 |
5 | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int) {
6 | Application app;
7 | app.Initialize();
8 |
9 | Window mainWindow(L"CanvasLayout Demo");
10 | mainWindow.ClearColor(Colors::Brown());
11 |
12 | auto canvas = Create();
13 | auto e1 = Create();
14 | e1->Fill(Create(Colors::Red()))->Width(100)->Height(100);
15 | canvas->X(e1, 50);
16 | canvas->Y(e1, 50);
17 | canvas->AddChild(e1);
18 |
19 | auto r1 = Create();
20 | r1->Fill(Create(Colors::Cyan()))->Width(200)->Height(150);
21 | canvas->X(r1, 230);
22 | canvas->Y(r1, 350);
23 | canvas->AddChild(r1);
24 |
25 | mainWindow.Content(canvas);
26 |
27 | app.Run();
28 |
29 | return 0;
30 | }
31 |
--------------------------------------------------------------------------------
/DirectUI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26430.16
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectUI", "DirectUI\DirectUI.vcxproj", "{42FBCD14-632D-48E5-828A-19278BE94184}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{46056F72-CC88-4D5F-8F93-E74AC9998FC0}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\HelloWorld.vcxproj", "{B95D657E-CCF5-424A-9CFE-2DBBF2175D67}"
11 | EndProject
12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CanvasLayoutDemo", "CanvasLayoutDemo\CanvasLayoutDemo.vcxproj", "{8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}"
13 | EndProject
14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextDemo", "TextDemo\TextDemo.vcxproj", "{7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}"
15 | EndProject
16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HitTesting", "HitTesting\HitTesting.vcxproj", "{571FA848-C61F-4316-89DB-88C3B2CC3736}"
17 | EndProject
18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Basic", "Basic", "{54EC50A8-BB7F-4661-80D2-0D25EC118C3F}"
19 | EndProject
20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleDataBinding", "SimpleDataBinding\SimpleDataBinding.vcxproj", "{EC50FDAE-6101-4C4C-9DBE-B250530A6E66}"
21 | EndProject
22 | Global
23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
24 | Debug|x64 = Debug|x64
25 | Debug|x86 = Debug|x86
26 | Release|x64 = Release|x64
27 | Release|x86 = Release|x86
28 | EndGlobalSection
29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
30 | {42FBCD14-632D-48E5-828A-19278BE94184}.Debug|x64.ActiveCfg = Debug|x64
31 | {42FBCD14-632D-48E5-828A-19278BE94184}.Debug|x64.Build.0 = Debug|x64
32 | {42FBCD14-632D-48E5-828A-19278BE94184}.Debug|x86.ActiveCfg = Debug|Win32
33 | {42FBCD14-632D-48E5-828A-19278BE94184}.Debug|x86.Build.0 = Debug|Win32
34 | {42FBCD14-632D-48E5-828A-19278BE94184}.Release|x64.ActiveCfg = Release|x64
35 | {42FBCD14-632D-48E5-828A-19278BE94184}.Release|x64.Build.0 = Release|x64
36 | {42FBCD14-632D-48E5-828A-19278BE94184}.Release|x86.ActiveCfg = Release|Win32
37 | {42FBCD14-632D-48E5-828A-19278BE94184}.Release|x86.Build.0 = Release|Win32
38 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Debug|x64.ActiveCfg = Debug|x64
39 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Debug|x64.Build.0 = Debug|x64
40 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Debug|x86.ActiveCfg = Debug|Win32
41 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Debug|x86.Build.0 = Debug|Win32
42 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Release|x64.ActiveCfg = Release|x64
43 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Release|x64.Build.0 = Release|x64
44 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Release|x86.ActiveCfg = Release|Win32
45 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67}.Release|x86.Build.0 = Release|Win32
46 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Debug|x64.ActiveCfg = Debug|x64
47 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Debug|x64.Build.0 = Debug|x64
48 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Debug|x86.ActiveCfg = Debug|Win32
49 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Debug|x86.Build.0 = Debug|Win32
50 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Release|x64.ActiveCfg = Release|x64
51 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Release|x64.Build.0 = Release|x64
52 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Release|x86.ActiveCfg = Release|Win32
53 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C}.Release|x86.Build.0 = Release|Win32
54 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Debug|x64.ActiveCfg = Debug|x64
55 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Debug|x64.Build.0 = Debug|x64
56 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Debug|x86.ActiveCfg = Debug|Win32
57 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Debug|x86.Build.0 = Debug|Win32
58 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Release|x64.ActiveCfg = Release|x64
59 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Release|x64.Build.0 = Release|x64
60 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Release|x86.ActiveCfg = Release|Win32
61 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1}.Release|x86.Build.0 = Release|Win32
62 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Debug|x64.ActiveCfg = Debug|x64
63 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Debug|x64.Build.0 = Debug|x64
64 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Debug|x86.ActiveCfg = Debug|Win32
65 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Debug|x86.Build.0 = Debug|Win32
66 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Release|x64.ActiveCfg = Release|x64
67 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Release|x64.Build.0 = Release|x64
68 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Release|x86.ActiveCfg = Release|Win32
69 | {571FA848-C61F-4316-89DB-88C3B2CC3736}.Release|x86.Build.0 = Release|Win32
70 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Debug|x64.ActiveCfg = Debug|x64
71 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Debug|x64.Build.0 = Debug|x64
72 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Debug|x86.ActiveCfg = Debug|Win32
73 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Debug|x86.Build.0 = Debug|Win32
74 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Release|x64.ActiveCfg = Release|x64
75 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Release|x64.Build.0 = Release|x64
76 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Release|x86.ActiveCfg = Release|Win32
77 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66}.Release|x86.Build.0 = Release|Win32
78 | EndGlobalSection
79 | GlobalSection(SolutionProperties) = preSolution
80 | HideSolutionNode = FALSE
81 | EndGlobalSection
82 | GlobalSection(NestedProjects) = preSolution
83 | {B95D657E-CCF5-424A-9CFE-2DBBF2175D67} = {54EC50A8-BB7F-4661-80D2-0D25EC118C3F}
84 | {8876F5EC-7DAF-4B5C-9787-FE79D02EC43C} = {54EC50A8-BB7F-4661-80D2-0D25EC118C3F}
85 | {7B7CDA34-2E88-48D7-8E20-7CEC65C8DFE1} = {54EC50A8-BB7F-4661-80D2-0D25EC118C3F}
86 | {571FA848-C61F-4316-89DB-88C3B2CC3736} = {54EC50A8-BB7F-4661-80D2-0D25EC118C3F}
87 | {54EC50A8-BB7F-4661-80D2-0D25EC118C3F} = {46056F72-CC88-4D5F-8F93-E74AC9998FC0}
88 | {EC50FDAE-6101-4C4C-9DBE-B250530A6E66} = {54EC50A8-BB7F-4661-80D2-0D25EC118C3F}
89 | EndGlobalSection
90 | EndGlobal
91 |
--------------------------------------------------------------------------------
/DirectUI/Application.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "Application.h"
3 | #include "Window.h"
4 |
5 | using namespace DirectUI;
6 | using namespace std;
7 |
8 | Application* Application::_app;
9 |
10 | Application::Application() {
11 | if (_app)
12 | throw std::exception("only a single Application object must exist");
13 | _app = this;
14 |
15 | }
16 |
17 | bool Application::Initialize() {
18 | if (!RegisterWindowClass())
19 | return false;
20 |
21 | _d2dfactory = DX::Direct2D::CreateFactory();
22 | if (!_d2dfactory)
23 | return false;
24 |
25 | _dwriteFactory = DX::DirectWrite::CreateFactory();
26 |
27 | _d3dDevice = DX::Direct3D::CreateDevice();
28 |
29 | OnInit();
30 | return true;
31 | }
32 |
33 | bool Application::RegisterWindowClass() {
34 | WNDCLASS wc {};
35 | wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
36 | wc.hInstance = ::GetModuleHandle(nullptr);
37 | wc.lpszClassName = DirectUIWindowClassName;
38 | wc.style = CS_HREDRAW | CS_VREDRAW;
39 | wc.lpfnWndProc = TopLevelWindowProc;
40 | return ::RegisterClass(&wc) ? true : false;
41 | }
42 |
43 | void Application::CreateDeviceSwapChainBitmap(const DX::Dxgi::SwapChain& swapChain, const DX::Direct2D::DeviceContext& target) {
44 | using namespace DX::Direct2D;
45 | using namespace DX;
46 |
47 | auto props = BitmapProperties1(BitmapOptions::Target | BitmapOptions::CannotDraw,
48 | PixelFormat(Dxgi::Format::B8G8R8A8_UNORM, AlphaMode::Ignore));
49 |
50 | target.SetTarget(target.CreateBitmapFromDxgiSurface(swapChain, props));
51 | }
52 |
53 | void Application::RemoveWindow(HWND hWnd) {
54 | _windows.erase(hWnd);
55 | if (_windows.size() == 0)
56 | ::PostQuitMessage(0);
57 | }
58 |
59 | bool Application::CreateDeviceContextAndSwapChain(HWND hWnd, DX::Direct2D::DeviceContext& dc, DX::Dxgi::SwapChain1& swapChain) {
60 | using namespace DX;
61 |
62 | dc = _d2dfactory.CreateDevice(_d3dDevice).CreateDeviceContext();
63 | ASSERT(dc);
64 | auto dxgi = _d3dDevice.GetDxgiFactory();
65 |
66 | Dxgi::SwapChainDescription1 description;
67 | description.SwapEffect = Dxgi::SwapEffect::Discard;
68 |
69 | swapChain = dxgi.CreateSwapChainForHwnd(_d3dDevice, hWnd, description);
70 | ASSERT(swapChain);
71 | CreateDeviceSwapChainBitmap(swapChain, dc);
72 |
73 | _dpi = _d2dfactory.GetDesktopDpi();
74 | dc.SetDpi(_dpi, _dpi);
75 |
76 | return true;
77 | }
78 |
79 | LRESULT Application::TopLevelWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
80 | return Current()->WindowProc(hWnd, message, wParam, lParam);
81 | }
82 |
83 | LRESULT Application::WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
84 | auto it = _windows.find(hWnd);
85 | if (it == _windows.end())
86 | return ::DefWindowProc(hWnd, message, wParam, lParam);
87 |
88 | return it->second->WindowProc(message, wParam, lParam);
89 | }
90 |
91 | void Application::OnInit() {
92 | ::CoInitialize(nullptr);
93 | }
94 |
95 | void Application::OnExit() {
96 | ::CoUninitialize();
97 | }
98 |
99 | int Application::Run() {
100 | MSG msg;
101 | while (auto result = GetMessage(&msg, 0, 0, 0)) {
102 | if (-1 != result) {
103 | ::TranslateMessage(&msg);
104 | ::DispatchMessage(&msg);
105 | }
106 | }
107 |
108 | return 0;
109 | }
110 |
--------------------------------------------------------------------------------
/DirectUI/Application.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "Core.h"
4 |
5 | namespace DirectUI {
6 | class Window;
7 |
8 | static const wchar_t* DirectUIWindowClassName = L"DirectUIWindowClassName";
9 |
10 | class Application : public DependencyObject {
11 | friend class Window;
12 |
13 | public:
14 | Application();
15 |
16 | static Application* Current() {
17 | return _app;
18 | }
19 |
20 | bool Initialize();
21 | virtual int Run();
22 |
23 | DX::Direct2D::Factory1& D2DFactory() {
24 | return _d2dfactory;
25 | }
26 |
27 | DX::DirectWrite::Factory2& DWriteFactory() {
28 | return _dwriteFactory;
29 | }
30 |
31 | float GetDpi() const {
32 | return _dpi;
33 | }
34 |
35 | protected:
36 | virtual void OnInit();
37 | virtual void OnExit();
38 |
39 | virtual bool RegisterWindowClass();
40 |
41 | virtual LRESULT WindowProc(HWND, UINT, WPARAM, LPARAM);
42 |
43 | bool CreateDeviceContextAndSwapChain(HWND, DX::Direct2D::DeviceContext& dc, DX::Dxgi::SwapChain1& swapChain);
44 |
45 | private:
46 | static LRESULT CALLBACK TopLevelWindowProc(HWND, UINT, WPARAM, LPARAM);
47 | static void CreateDeviceSwapChainBitmap(const DX::Dxgi::SwapChain& swapChain, const DX::Direct2D::DeviceContext& target);
48 | static bool ResizeSwapChainBitmap(DX::Direct2D::DeviceContext& target);
49 | void RemoveWindow(HWND hWnd);
50 |
51 | void AddWindow(HWND hWnd, Window* window) {
52 | _windows[hWnd] = window;
53 | }
54 |
55 | private:
56 | std::map _windows;
57 | DX::Direct3D::Device1 _d3dDevice;
58 | DX::Direct2D::Factory1 _d2dfactory;
59 | DX::Dxgi::SwapChain1 _swapChain;
60 | DX::DirectWrite::Factory2 _dwriteFactory;
61 | float _dpi;
62 |
63 | static Application* _app;
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/DirectUI/Brushes.cpp:
--------------------------------------------------------------------------------
1 | #include "pch.h"
2 | #include "Brushes.h"
3 | #include "Colors.h"
4 | #include "CoreUI.h"
5 |
6 | using namespace DirectUI;
7 |
8 | DEFINE_DP_WITH_FLAGS(Brush, Opacity, float, 1.0f, PropertyMetadataFlags::AffectsParentRender);
9 |
10 | DEFINE_DP_WITH_FLAGS(SolidColorBrush, Color, DX::Color, Colors::White(), PropertyMetadataFlags::AffectsParentRender);
11 |
12 | SolidColorBrush::SolidColorBrush(const DX::Color& color) {
13 | SetValue(ColorProperty, color, false);
14 | }
15 |
16 | DX::Direct2D::Brush& SolidColorBrush::GetBrush(DX::Direct2D::DeviceContext& dc) {
17 | if (!_brush)
18 | _brush = dc.CreateSolidColorBrush(Color());
19 | return _brush;
20 | }
21 |
22 | Ref Brushes::AliceBlue() {
23 | static auto brush = Create(Colors::AliceBlue());
24 | return brush;
25 | }
26 |
27 | Ref Brushes::AntiqueWhite() {
28 | static auto brush = Create(Colors::AntiqueWhite());
29 | return brush;
30 | }
31 |
32 | Ref Brushes::Aqua() {
33 | static auto brush = Create(Colors::Aqua());
34 | return brush;
35 | }
36 |
37 | Ref Brushes::Aquamarine() {
38 | static auto brush = Create(Colors::Aquamarine());
39 | return brush;
40 | }
41 |
42 | Ref Brushes::Azure() {
43 | static auto brush = Create(Colors::Azure());
44 | return brush;
45 | }
46 |
47 | Ref Brushes::Beige() {
48 | static auto brush = Create(Colors::Beige());
49 | return brush;
50 | }
51 |
52 | Ref Brushes::Bisque() {
53 | static auto brush = Create(Colors::Bisque());
54 | return brush;
55 | }
56 |
57 | Ref Brushes::Black() {
58 | static auto brush = Create(Colors::Black());
59 | return brush;
60 | }
61 |
62 | Ref Brushes::BlanchedAlmond() {
63 | static auto brush = Create(Colors::BlanchedAlmond());
64 | return brush;
65 | }
66 |
67 | Ref Brushes::Blue() {
68 | static auto brush = Create(Colors::Blue());
69 | return brush;
70 | }
71 |
72 | Ref Brushes::BlueViolet() {
73 | static auto brush = Create(Colors::BlueViolet());
74 | return brush;
75 | }
76 |
77 | Ref Brushes::Brown() {
78 | static auto brush = Create(Colors::Brown());
79 | return brush;
80 | }
81 |
82 | Ref Brushes::BurlyWood() {
83 | static auto brush = Create(Colors::BurlyWood());
84 | return brush;
85 | }
86 |
87 | Ref Brushes::CadetBlue() {
88 | static auto brush = Create(Colors::CadetBlue());
89 | return brush;
90 | }
91 |
92 | Ref Brushes::Chartreuse() {
93 | static auto brush = Create(Colors::Chartreuse());
94 | return brush;
95 | }
96 |
97 | Ref Brushes::Chocolate() {
98 | static auto brush = Create(Colors::Chocolate());
99 | return brush;
100 | }
101 |
102 | Ref Brushes::Coral() {
103 | static auto brush = Create(Colors::Coral());
104 | return brush;
105 | }
106 |
107 | Ref Brushes::CornflowerBlue() {
108 | static auto brush = Create(Colors::CornflowerBlue());
109 | return brush;
110 | }
111 |
112 | Ref Brushes::Cornsilk() {
113 | static auto brush = Create(Colors::Cornsilk());
114 | return brush;
115 | }
116 |
117 | Ref Brushes::Crimson() {
118 | static auto brush = Create(Colors::Crimson());
119 | return brush;
120 | }
121 |
122 | Ref Brushes::Cyan() {
123 | static auto brush = Create(Colors::Cyan());
124 | return brush;
125 | }
126 |
127 | Ref Brushes::DarkBlue() {
128 | static auto brush = Create(Colors::DarkBlue());
129 | return brush;
130 | }
131 |
132 | Ref Brushes::DarkCyan() {
133 | static auto brush = Create(Colors::DarkCyan());
134 | return brush;
135 | }
136 |
137 | Ref Brushes::DarkGoldenrod() {
138 | static auto brush = Create(Colors::DarkGoldenrod());
139 | return brush;
140 | }
141 |
142 | Ref Brushes::DarkGray() {
143 | static auto brush = Create(Colors::DarkGray());
144 | return brush;
145 | }
146 |
147 | Ref Brushes::DarkGreen() {
148 | static auto brush = Create(Colors::DarkGreen());
149 | return brush;
150 | }
151 |
152 | Ref Brushes::DarkKhaki() {
153 | static auto brush = Create(Colors::DarkKhaki());
154 | return brush;
155 | }
156 |
157 | Ref Brushes::DarkMagenta() {
158 | static auto brush = Create(Colors::DarkMagenta());
159 | return brush;
160 | }
161 |
162 | Ref Brushes::DarkOliveGreen() {
163 | static auto brush = Create(Colors::DarkOliveGreen());
164 | return brush;
165 | }
166 |
167 | Ref Brushes::DarkOrange() {
168 | static auto brush = Create(Colors::DarkOrange());
169 | return brush;
170 | }
171 |
172 | Ref Brushes::DarkOrchid() {
173 | static auto brush = Create(Colors::DarkOrchid());
174 | return brush;
175 | }
176 |
177 | Ref Brushes::DarkRed() {
178 | static auto brush = Create(Colors::DarkRed());
179 | return brush;
180 | }
181 |
182 | Ref Brushes::DarkSalmon() {
183 | static auto brush = Create(Colors::DarkSalmon());
184 | return brush;
185 | }
186 |
187 | Ref Brushes::DarkSeaGreen() {
188 | static auto brush = Create(Colors::DarkSeaGreen());
189 | return brush;
190 | }
191 |
192 | Ref Brushes::DarkSlateBlue() {
193 | static auto brush = Create(Colors::DarkSlateBlue());
194 | return brush;
195 | }
196 |
197 | Ref Brushes::DarkSlateGray() {
198 | static auto brush = Create(Colors::DarkSlateGray());
199 | return brush;
200 | }
201 |
202 | Ref Brushes::DarkTurquoise() {
203 | static auto brush = Create(Colors::DarkTurquoise());
204 | return brush;
205 | }
206 |
207 | Ref Brushes::DarkViolet() {
208 | static auto brush = Create(Colors::DarkViolet());
209 | return brush;
210 | }
211 |
212 | Ref Brushes::DeepPink() {
213 | static auto brush = Create(Colors::DeepPink());
214 | return brush;
215 | }
216 |
217 | Ref Brushes::DeepSkyBlue() {
218 | static auto brush = Create(Colors::DeepSkyBlue());
219 | return brush;
220 | }
221 |
222 | Ref Brushes::DimGray() {
223 | static auto brush = Create(Colors::DimGray());
224 | return brush;
225 | }
226 |
227 | Ref Brushes::DodgerBlue() {
228 | static auto brush = Create(Colors::DodgerBlue());
229 | return brush;
230 | }
231 |
232 | Ref Brushes::Firebrick() {
233 | static auto brush = Create(Colors::Firebrick());
234 | return brush;
235 | }
236 |
237 | Ref Brushes::FloralWhite() {
238 | static auto brush = Create(Colors::FloralWhite());
239 | return brush;
240 | }
241 |
242 | Ref Brushes::ForestGreen() {
243 | static auto brush = Create(Colors::ForestGreen());
244 | return brush;
245 | }
246 |
247 | Ref Brushes::Fuchsia() {
248 | static auto brush = Create(Colors::Fuchsia());
249 | return brush;
250 | }
251 |
252 | Ref Brushes::Gainsboro() {
253 | static auto brush = Create(Colors::Gainsboro());
254 | return brush;
255 | }
256 |
257 | Ref Brushes::GhostWhite() {
258 | static auto brush = Create(Colors::GhostWhite());
259 | return brush;
260 | }
261 |
262 | Ref Brushes::Gold() {
263 | static auto brush = Create(Colors::Gold());
264 | return brush;
265 | }
266 |
267 | Ref Brushes::Goldenrod() {
268 | static auto brush = Create(Colors::Goldenrod());
269 | return brush;
270 | }
271 |
272 | Ref Brushes::Gray() {
273 | static auto brush = Create(Colors::Gray());
274 | return brush;
275 | }
276 |
277 | Ref Brushes::Green() {
278 | static auto brush = Create(Colors::Green());
279 | return brush;
280 | }
281 |
282 | Ref Brushes::GreenYellow() {
283 | static auto brush = Create(Colors::GreenYellow());
284 | return brush;
285 | }
286 |
287 | Ref Brushes::Honeydew() {
288 | static auto brush = Create(Colors::Honeydew());
289 | return brush;
290 | }
291 |
292 | Ref Brushes::HotPink() {
293 | static auto brush = Create(Colors::HotPink());
294 | return brush;
295 | }
296 |
297 | Ref Brushes::IndianRed() {
298 | static auto brush = Create(Colors::IndianRed());
299 | return brush;
300 | }
301 |
302 | Ref Brushes::Indigo() {
303 | static auto brush = Create(Colors::Indigo());
304 | return brush;
305 | }
306 |
307 | Ref Brushes::Ivory() {
308 | static auto brush = Create(Colors::Ivory());
309 | return brush;
310 | }
311 |
312 | Ref Brushes::Khaki() {
313 | static auto brush = Create(Colors::Khaki());
314 | return brush;
315 | }
316 |
317 | Ref Brushes::Lavender() {
318 | static auto brush = Create(Colors::Lavender());
319 | return brush;
320 | }
321 |
322 | Ref Brushes::LavenderBlush() {
323 | static auto brush = Create(Colors::LavenderBlush());
324 | return brush;
325 | }
326 |
327 | Ref Brushes::LawnGreen() {
328 | static auto brush = Create(Colors::LawnGreen());
329 | return brush;
330 | }
331 |
332 | Ref Brushes::LemonChiffon() {
333 | static auto brush = Create(Colors::LemonChiffon());
334 | return brush;
335 | }
336 |
337 | Ref Brushes::LightBlue() {
338 | static auto brush = Create(Colors::LightBlue());
339 | return brush;
340 | }
341 |
342 | Ref Brushes::LightCoral() {
343 | static auto brush = Create(Colors::LightCoral());
344 | return brush;
345 | }
346 |
347 | Ref Brushes::LightCyan() {
348 | static auto brush = Create(Colors::LightCyan());
349 | return brush;
350 | }
351 |
352 | Ref Brushes::LightGoldenrodYellow() {
353 | static auto brush = Create(Colors::LightGoldenrodYellow());
354 | return brush;
355 | }
356 |
357 | Ref Brushes::LightGray() {
358 | static auto brush = Create(Colors::LightGray());
359 | return brush;
360 | }
361 |
362 | Ref Brushes::LightGreen() {
363 | static auto brush = Create(Colors::LightGreen());
364 | return brush;
365 | }
366 |
367 | Ref Brushes::LightPink() {
368 | static auto brush = Create(Colors::LightPink());
369 | return brush;
370 | }
371 |
372 | Ref Brushes::LightSalmon() {
373 | static auto brush = Create(Colors::LightSalmon());
374 | return brush;
375 | }
376 |
377 | Ref Brushes::LightSeaGreen() {
378 | static auto brush = Create(Colors::LightSeaGreen());
379 | return brush;
380 | }
381 |
382 | Ref Brushes::LightSkyBlue() {
383 | static auto brush = Create(Colors::LightSkyBlue());
384 | return brush;
385 | }
386 |
387 | Ref Brushes::LightSlateGray() {
388 | static auto brush = Create(Colors::LightSlateGray());
389 | return brush;
390 | }
391 |
392 | Ref Brushes::LightSteelBlue() {
393 | static auto brush = Create(Colors::LightSteelBlue());
394 | return brush;
395 | }
396 |
397 | Ref Brushes::LightYellow() {
398 | static auto brush = Create(Colors::LightYellow());
399 | return brush;
400 | }
401 |
402 | Ref Brushes::Lime() {
403 | static auto brush = Create(Colors::Lime());
404 | return brush;
405 | }
406 |
407 | Ref Brushes::LimeGreen() {
408 | static auto brush = Create(Colors::LimeGreen());
409 | return brush;
410 | }
411 |
412 | Ref Brushes::Linen() {
413 | static auto brush = Create(Colors::Linen());
414 | return brush;
415 | }
416 |
417 | Ref Brushes::Magenta() {
418 | static auto brush = Create(Colors::Magenta());
419 | return brush;
420 | }
421 |
422 | Ref Brushes::Maroon() {
423 | static auto brush = Create(Colors::Maroon());
424 | return brush;
425 | }
426 |
427 | Ref Brushes::MediumAquamarine() {
428 | static auto brush = Create(Colors::MediumAquamarine());
429 | return brush;
430 | }
431 |
432 | Ref Brushes::MediumBlue() {
433 | static auto brush = Create(Colors::MediumBlue());
434 | return brush;
435 | }
436 |
437 | Ref Brushes::MediumOrchid() {
438 | static auto brush = Create(Colors::MediumOrchid());
439 | return brush;
440 | }
441 |
442 | Ref Brushes::MediumPurple() {
443 | static auto brush = Create(Colors::MediumPurple());
444 | return brush;
445 | }
446 |
447 | Ref Brushes::MediumSeaGreen() {
448 | static auto brush = Create(Colors::MediumSeaGreen());
449 | return brush;
450 | }
451 |
452 | Ref Brushes::MediumSlateBlue() {
453 | static auto brush = Create(Colors::MediumSlateBlue());
454 | return brush;
455 | }
456 |
457 | Ref Brushes::MediumSpringGreen() {
458 | static auto brush = Create(Colors::MediumSpringGreen());
459 | return brush;
460 | }
461 |
462 | Ref Brushes::MediumTurquoise() {
463 | static auto brush = Create(Colors::MediumTurquoise());
464 | return brush;
465 | }
466 |
467 | Ref Brushes::MediumVioletRed() {
468 | static auto brush = Create(Colors::MediumVioletRed());
469 | return brush;
470 | }
471 |
472 | Ref Brushes::MidnightBlue() {
473 | static auto brush = Create(Colors::MidnightBlue());
474 | return brush;
475 | }
476 |
477 | Ref Brushes::MintCream() {
478 | static auto brush = Create(Colors::MintCream());
479 | return brush;
480 | }
481 |
482 | Ref Brushes::MistyRose() {
483 | static auto brush = Create(Colors::MistyRose());
484 | return brush;
485 | }
486 |
487 | Ref Brushes::Moccasin() {
488 | static auto brush = Create(Colors::Moccasin());
489 | return brush;
490 | }
491 |
492 | Ref Brushes::NavajoWhite() {
493 | static auto brush = Create(Colors::NavajoWhite());
494 | return brush;
495 | }
496 |
497 | Ref Brushes::Navy() {
498 | static auto brush = Create(Colors::Navy());
499 | return brush;
500 | }
501 |
502 | Ref Brushes::OldLace() {
503 | static auto brush = Create(Colors::OldLace());
504 | return brush;
505 | }
506 |
507 | Ref Brushes::Olive() {
508 | static auto brush = Create(Colors::Olive());
509 | return brush;
510 | }
511 |
512 | Ref Brushes::OliveDrab() {
513 | static auto brush = Create(Colors::OliveDrab());
514 | return brush;
515 | }
516 |
517 | Ref Brushes::Orange() {
518 | static auto brush = Create(Colors::Orange());
519 | return brush;
520 | }
521 |
522 | Ref Brushes::OrangeRed() {
523 | static auto brush = Create(Colors::OrangeRed());
524 | return brush;
525 | }
526 |
527 | Ref Brushes::Orchid() {
528 | static auto brush = Create(Colors::Orchid());
529 | return brush;
530 | }
531 |
532 | Ref Brushes::PaleGoldenrod() {
533 | static auto brush = Create(Colors::PaleGoldenrod());
534 | return brush;
535 | }
536 |
537 | Ref Brushes::PaleGreen() {
538 | static auto brush = Create(Colors::PaleGreen());
539 | return brush;
540 | }
541 |
542 | Ref Brushes::PaleTurquoise() {
543 | static auto brush = Create(Colors::PaleTurquoise());
544 | return brush;
545 | }
546 |
547 | Ref Brushes::PaleVioletRed() {
548 | static auto brush = Create(Colors::PaleVioletRed());
549 | return brush;
550 | }
551 |
552 | Ref Brushes::PapayaWhip() {
553 | static auto brush = Create(Colors::PapayaWhip());
554 | return brush;
555 | }
556 |
557 | Ref Brushes::PeachPuff() {
558 | static auto brush = Create(Colors::PeachPuff());
559 | return brush;
560 | }
561 |
562 | Ref Brushes::Peru() {
563 | static auto brush = Create(Colors::Peru());
564 | return brush;
565 | }
566 |
567 | Ref Brushes::Pink() {
568 | static auto brush = Create(Colors::Pink());
569 | return brush;
570 | }
571 |
572 | Ref Brushes::Plum() {
573 | static auto brush = Create(Colors::Plum());
574 | return brush;
575 | }
576 |
577 | Ref Brushes::PowderBlue() {
578 | static auto brush = Create(Colors::PowderBlue());
579 | return brush;
580 | }
581 |
582 | Ref Brushes::Purple() {
583 | static auto brush = Create(Colors::Purple());
584 | return brush;
585 | }
586 |
587 | Ref Brushes::Red() {
588 | static auto brush = Create(Colors::Red());
589 | return brush;
590 | }
591 |
592 | Ref Brushes::RosyBrown() {
593 | static auto brush = Create(Colors::RosyBrown());
594 | return brush;
595 | }
596 |
597 | Ref Brushes::RoyalBlue() {
598 | static auto brush = Create(Colors::RoyalBlue());
599 | return brush;
600 | }
601 |
602 | Ref Brushes::SaddleBrown() {
603 | static auto brush = Create(Colors::SaddleBrown());
604 | return brush;
605 | }
606 |
607 | Ref Brushes::Salmon() {
608 | static auto brush = Create(Colors::Salmon());
609 | return brush;
610 | }
611 |
612 | Ref Brushes::SandyBrown() {
613 | static auto brush = Create(Colors::SandyBrown());
614 | return brush;
615 | }
616 |
617 | Ref Brushes::SeaGreen() {
618 | static auto brush = Create(Colors::SeaGreen());
619 | return brush;
620 | }
621 |
622 | Ref Brushes::SeaShell() {
623 | static auto brush = Create(Colors::SeaShell());
624 | return brush;
625 | }
626 |
627 | Ref Brushes::Sienna() {
628 | static auto brush = Create(Colors::Sienna());
629 | return brush;
630 | }
631 |
632 | Ref Brushes::Silver() {
633 | static auto brush = Create(Colors::Silver());
634 | return brush;
635 | }
636 |
637 | Ref Brushes::SkyBlue() {
638 | static auto brush = Create(Colors::SkyBlue());
639 | return brush;
640 | }
641 |
642 | Ref